A method of fine tuning a latex electronic poster template

By establishing a news content database and layout template library, and using the LaTeX typesetting system to fine-tune the layout, the problem of excessive white space in LaTeX e-newsletter templates was solved, and the aesthetics of the e-newsletter was improved.

CN113095057BActive Publication Date: 2025-10-17HANGZHOU DIANZI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110349060.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-31
Publication Date
2025-10-17
Estimated Expiration
2041-03-31

AI Technical Summary

Technical Problem

The existing LaTeX electronic newspaper template has too much white space, which affects the appearance.

Method used

By establishing a news content database list and layout template library, the LaTeX typesetting system is used to automatically match templates, and the layout is fine-tuned according to the layout and distribution type of the news block, including adjusting the image size, inserting newspaper brochures, or increasing the number of words to minimize white space.

Benefits of technology

The white space between blocks in LaTeX newsletter template is minimized, which improves the aesthetics of the page.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0003001873050000061
    Figure BDA0003001873050000061
  • Figure BDA0003001873050000062
    Figure BDA0003001873050000062
  • Figure BDA0003001873050000063
    Figure BDA0003001873050000063
Patent Text Reader

Abstract

The application discloses a method for fine adjustment of a latex electronic newspaper template, and overcomes the problem of too much blank space after automatic layout of an electronic newspaper layout system, which influences the appearance, and comprises the following steps: S1, establishing a database list of news content and classifying the same; S2, establishing a news page template library; S3, selecting news original material content and matching a suitable electronic newspaper template through an automatic layout system; and S4, fine adjustment of a page according to a news block page and distribution type. According to the electronic newspaper template matched based on the automatic layout system of the electronic newspaper, the news content is filled into a corresponding news column block of the template, and the fine adjustment method is used, so that the purpose of minimizing the blank space of the block is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer word processing, and particularly relates to a method for fine-tuning a LaTeX electronic newspaper template. BACKGROUND

[0002] LaTeX is a typesetting system based on TeX, which is the most popular and widely used TeX macro set in the world today. By using this format, even users without knowledge of typesetting and programming can fully utilize the powerful functions provided by TeX to generate a large number of printed matter with book quality within a few days or even hours. Therefore, it is very suitable for generating high-printing-quality scientific and mathematical documents. This system is also suitable for generating all other kinds of documents from simple letters to complete books.

[0003] With the continuous development of science and technology, electronic newspapers have become a trend. However, the current automatic typesetting generation method of the LaTeX system is only about academic papers, journals, etc., and there are few electronic newspapers, and the generated electronic newspaper templates may have too much white space, resulting in unattractive pages. For example, the China Patent Office disclosed an invention named "A method for generating LaTeX template automatic typesetting of graduation thesis" on February 19, 2019, with publication number CN109359286A. The invention discloses a method for generating LaTeX template automatic typesetting of graduation thesis, including the following steps: 1) importing macro package; 2) defining macro command; 3) defining header and footer; 4) writing graduation thesis cover; 5) writing graduation thesis content, including Chinese abstract, English abstract, main text, appendix, reference, and thanks, generating thesis table of contents; 6) compiling. The invention has important significance for the popularization of LaTeX paper editing in university graduation thesis, but it is only applicable to paper editing. SUMMARY

[0004] The purpose of the present application is to overcome the problem of too much white space in the LaTeX electronic newspaper template in the prior art, which affects the aesthetics, and to provide a method for fine-tuning a LaTeX electronic newspaper template. The LaTeX typesetting system generates an electronic newspaper template, fills the news content into the template, and achieves the purpose of minimizing the block white space through fine-tuning.

[0005] In order to achieve the above-mentioned purpose, the present application adopts the following technical solution: a method for fine-tuning a LaTeX electronic newspaper template, characterized in that it comprises the following steps:

[0006] S1: establishing a database list of news content and classifying it;

[0007] S2: establishing a news page template library;

[0008] S3: Selecting news raw material content and matching suitable electronic newspaper template through automatic layout system;

[0009] S4: Fine-tuning the layout according to the news block layout and distribution type.

[0010] The automatic layout system is the prior art, which puts the news raw material into the corresponding position in the data list, establishes a layout template library, and the automatic matching system matches the corresponding template according to the area occupied by the news material content. After the matching is completed, the layout is fine-tuned according to the news block layout and distribution type. The automatic layout system is preferably a LaTeX layout system, and the electronic newspaper template is a pdf file and a TeX file generated by the LaTeX layout system, which includes the overall layout of the electronic newspaper designed by using TeX commands, such as rules for column, paragraph, header and footer forms, etc. It also includes news content formats, such as font, font size, picture size and position, etc. There are seven types of news block layout forms: picture and title separately occupy a line, and text does not split columns; title separately occupies a line, and text and picture surround and do not split columns; picture and title separately occupy a line, and text splits columns; title separately occupies a line, and text and picture surround and split columns; title separately occupies a column, and picture and title are parallel, and text does not split columns; title separately occupies a column, and picture and title are parallel, and text splits columns; title is a column title, picture and title are parallel, and text is below the picture and surrounds the column title and does not split columns. Splitting columns refers to dividing the layout of a newspaper into several columns. Due to the diversity of news block layout, there are different fine-tuning methods for different layouts.

[0011] As preferred, in step S1, the database list specifically includes:

[0012] S1.1: Collecting news raw material, including title, text, reporter's name, picture and design rules of these contents;

[0013] S1.2: Collecting the maximum and minimum values of the area of the news length after standardizing the news content, including text area, picture area and title area;

[0014] S1.3: Classifying the information collected in S1.2 and S1.3, and arranging them in order in the corresponding categories.

[0015] The design rules include font, font size, line height, position, etc. The news length area includes three parts: text area, picture area and title area. Classifying the news information will make it more intuitive and clear when calling the content.

[0016] As preferred, in step S1.3, the classified manner is that each news raw material is marked and classified according to news importance, and the categories include headline news, second news and third news. Headline news refers to the most important manuscript on a version, which is usually placed in the most prominent version position and highlighted by various arrangement means. The importance of second and third news decreases in turn, and the news material is marked and classified according to the importance, which is beneficial to the subsequent layout.

[0017] As preferred, in step S2, the specific steps of establishing the template library include:

[0018] S2.1: multiple TeX files of different versions are used as candidate templates;

[0019] S2.2: each TeX template file is pre-defined with parameter information of news blocks, and the parameter information includes quantity, shape, size and position;

[0020] S2.3: the TeX templates are saved in the template library.

[0021] TeX is a layout system, and the best electronic newspaper template can be generated by changing each parameter in the TeX file.

[0022] As preferred, in step S4, the method of layout fine-tuning according to the news block layout and distribution type further includes:

[0023] S4.1: it is judged whether the news content fills the current page, if the current page is filled, it is judged whether layout fine-tuning is needed through user suggestion, if fine-tuning is needed, self-defined manual fine-tuning can be performed through the background fine-tuning TeX template function, if not, the fine-tuned layout is directly output; if the current page is not filled, step S4.2 is performed;

[0024] S4.2: it is judged whether the news block has pictures, if not, step S4.5 is performed, if yes, step S4.3 is performed;

[0025] S4.3: it is judged whether it is one picture, if not, it is judged whether the picture set is in a single row or a single column, if not, the white space is allocated according to the proportion of the picture occupying the entire news block picture area and step S4.4 is performed, and then the fine-tuned layout is output, if it is in a single row or a single column, step S4.5 is performed; if it is one picture, step S4.4 is performed;

[0026] S4.4: judging whether the picture is arranged in a single row or a single column, if not, adjusting the picture size according to the white space, then judging whether the adjusted picture size exceeds a threshold, if yes, proceeding to step S4.5, if not, outputting the fine-tuned layout; if the picture is arranged in a single row or a single column, proceeding to step S4.5;

[0027] S4.5: judging whether the white space area meets the minimum picture insertion, if yes, inserting the picture, then outputting the fine-tuned layout; if not, supplementing the news word count, then outputting the fine-tuned layout.

[0028] To fine-tune the layout, first we need to judge whether the news content fills the current page news content. When the current page news block is fully arranged, there may be too much white space at the bottom of the page. In order to make the news layout more beautiful, we can judge whether to fine-tune the layout according to the user's suggestion. If no fine-tuning is needed, it is directly output as a pdf format, if fine-tuning is needed, we need to judge how to fine-tune according to the layout form (such as whether there is a picture, the number of pictures, the position of the picture, etc.).

[0029] When the news content cannot be arranged in the current page, white space will appear. We need to adjust the white space, which is the difference between the area of the news block and the area of the news length. According to the size of the white space, we choose the appropriate way to reduce the white space. If the news block contains picture content and the picture needs to be adjusted, the picture adjustment also needs to be divided into single picture adjustment and multiple picture adjustment. Because sometimes only adjusting the size of one picture may affect the overall beauty of the news layout, so in this case we need to choose multiple pictures to adjust the size.

[0030] Judging whether the picture is larger than the white space area, if yes, sending the news content to the editor to supplement the news material, and reducing the white space by increasing the word count; if not, selecting a suitable picture according to the white space area to insert.

[0031] As an optimization, in step S4.3, for the picture set that is not arranged in a single row or a single column, the specific steps of distributing the white space according to the proportion of the picture occupying the entire news block picture area are as follows:

[0032] The expansion space allocated to each picture is:

[0033] Pe i = [Pi / (P1+...Pn)]*S2,

[0034] Where n represents the number of pictures in the block, P1, P2, …, Pn represent the area of each picture, and S2 represents the white space area of the news block.

[0035] The blank area is the increased area after the picture is adjusted. The adjustment here is to appropriately enlarge the picture according to the length-width ratio of the picture.

[0036] As preferred, the method of minimizing the blank area by adjusting the picture size in step S4.4 is further:

[0037] A: In the article with no column and only one picture, the picture is adjusted because

[0038] pw'≤bw and PS'≤∈2,

[0039] pw' / ph'=pw / ph,

[0040] pw'*ph'-pw*ph=ew*eh,

[0041] The height of the adjusted picture can be obtained as:

[0042]

[0043] The width of the adjusted picture is:

[0044]

[0045] wherein, pw represents the picture width, pw' represents the width of the adjusted picture, ph represents the picture height, ph' represents the height of the adjusted picture, PS' represents the area of the adjusted picture, ew represents the blank width, and ∈2 represents the threshold of the picture size;

[0046] B: In the article with column and only one picture, the picture is adjusted because:

[0047] pw'≤bw and PS'≤∈2,

[0048] pw' / ph'=pw / ph,

[0049]

[0050] pw'=pc'*cw+(pc'-1)*cd,

[0051] pw'*ph'-pw*ph=ew*eh,

[0052] The height of the adjusted picture can be obtained as:

[0053]

[0054] The width of the adjusted picture is:

[0055]

[0056] The number of columns occupied by the picture after adjustment is:

[0057]

[0058] where pc represents the column number occupied by the picture before adjustment, pc' represents the column number occupied by the picture after adjustment, cw represents the column width, and cd represents the column interval;

[0059] C: if the allocated extension space is insufficient for adjustment according to the column width in the article with columns and the picture is not arranged in a single row or column, then randomly select a picture to give up adjustment until the allocated extension space of each picture except the picture giving up adjustment is sufficient for adjustment according to the column width, and then adjust the picture according to the method in B.

[0060] The environment of a single picture mainly includes the following cases: column arrangement, non-column arrangement, and column arrangement with text surrounding. If the picture is in the article with column arrangement, the column number occupied by the picture needs to be adjusted; if the picture is in the article without column arrangement, the size of the picture can be directly changed to adjust the size of the news article.

[0061] As a preferred embodiment, the method for judging whether the adjusted picture size exceeds the threshold value in step S4.4 is further:

[0062] The maximum range of picture adjustment is that the width pw' of the adjusted picture is equal to the width bw of the news block. If the adjusted picture size PS' exceeds the set threshold value of picture size ∈2, step S4.5 is performed, and if not, the layout is output.

[0063] In order to minimize the white space and the aesthetic degree of the entire news article after picture adjustment, the threshold value ∈2 of the picture size in different environments needs to be set to prevent over-adjustment. Here, the maximum range of picture adjustment is that the width pw' of the adjusted picture is equal to the width bw of the news block, because if the width pw' of the adjusted picture is greater than the width bw of the news block, it will exceed the news layout.

[0064] As a preferred embodiment, the specific steps of inserting the picture of the report flower in step S4.5 are:

[0065] The width of the adjusted picture of the report flower is:

[0066] npw' = bw,

[0067] The height of the adjusted picture of the report flower is:

[0068] nph' = (nph / npw)*npw',

[0069] eh-nph' ≤ ∈1,

[0070] where npw represents the width of the original picture, nph represents the height of the original picture, eh represents the height of the blank, bw represents the width of the news block, npw' represents the width of the adjusted picture, nph' represents the height of the adjusted picture, and represents the threshold of the difference between the height of the blank and the height of the picture.

[0071] The picture is a reserved picture in the picture library, including a promotional slogan picture, an advertisement picture, etc. Since the blank part is usually at the tail of the news block and the blank width pw is the width bw of the news block, the picture needs to be adjusted according to the length-width ratio of the original picture when the picture is inserted, until the width pw of the picture is the same as the blank width ew, so the picture is preferably a vector picture. The width npw' of the adjusted picture has been determined, and the height nph' of the adjusted picture needs to be calculated next, so that it cannot exceed the height eh of the blank and cannot differ greatly from the height eh of the blank.

[0072] As a preferred embodiment, in step S4.5, the specific step of reducing the blank by increasing the number of words is:

[0073] The blank is reduced by increasing the number of words, where the range of the increased number of words is:

[0074] [minwc, maxwc],

[0075] The maximum number of words in a line in a non-columned article is:

[0076]

[0077] The maximum number of words in a line in a columned article is:

[0078]

[0079] The blank width is:

[0080] ew = bw,

[0081] The blank height is:

[0082] eh = S2 / bw,

[0083] The news area is:

[0084] S1 = WS + PS + TS,

[0085] The maximum number of lines that can be inserted is:

[0086]

[0087] The maximum number of words that can be inserted is:

[0088] maxwc = maxhc * hwc1,

[0089] The minimum number of words that can be inserted is:

[0090] minwc=(maxhc-1)*hwc2+1,

[0091] where maxwc represents the maximum number of words that can be inserted in the article without columnar, minwc represents the minimum number of words that can be inserted in the article with columnar, hwc represents the number of words in a line, mf represents the font size, cc represents the number of columns, cd represents the column spacing, ew represents the white space width, eh represents the white space height, bw represents the news block width, S1 represents the news area, S2 represents the white space area, WS represents the word area, PS represents the picture area, TS represents the title area, maxhc represents the maximum number of lines that can be inserted, and mh represents the line height of the font.

[0092] For the layout that needs to reduce the white space by increasing the number of words, first, the range of the number of words that can be increased is determined, and the range of the number of words is determined by the maximum number of words in a line in the columnar and non-columnar articles. Secondly, the white space width and the white space height, and the news area, the maximum number of lines that can be inserted are determined.

[0093] Therefore, the present application has the following beneficial effects: according to the e-paper template matched based on the electronic layout system, the news content is filled into the corresponding news column block of the template, and the purpose of minimizing the block white space is achieved by the fine-tuning method. BRIEF DESCRIPTION OF DRAWINGS

[0094] Figure 1 The specific operation flowchart of the present application is shown in the figure;

[0095] Figure 2 The flowchart of the layout fine-tuning of the present application is shown in the figure. DETAILED DESCRIPTION

[0096] The present application will be further described in detail below in combination with the drawings and specific embodiments:

[0097] As shown in the embodiment, a method for fine-tuning the latex e-paper template can be seen, and the operation flowchart is as follows: Figure 1

[0098] Step 1: Establish a database list of news content, and each piece of news raw material needs to be marked and classified according to the headline, the second headline, the third headline, etc. The database list of news content includes two parts of content, one part is the title, the text, the reporter's name, the picture information of the news, and the design rules of these information content, including the font, the font size, the line height, and the position rules. The other part is the maximum and minimum values of the news area obtained after the standardization of the news content, including the text area, the picture area, and the title area.

[0099] ​Second step: Establishing news page template database, which includes multiple different page templates, TeX files with predefined parameter information, including the number, shape, size and location of news blocks.

[0100] Third step: Selecting news raw material content and matching suitable electronic newspaper template through automatic layout system. The automatic layout system is prior art, which puts news raw material into corresponding position in data list, establishes page template database, and the automatic matching system matches corresponding template according to the area occupied by news material content.

[0101] Fourth step: Fine-tuning page according to news block page and distribution type. After matching, the following two distribution types may appear: unable to fill the current page type, and exactly filling the current page type. The page form includes seven types: picture and title separately occupying a line, and text not being divided into columns; title separately occupying a line, and text and picture surrounding and not being divided into columns; picture and title separately occupying a line, and text being divided into columns; title separately occupying a line, and text and picture surrounding and being divided into columns; title separately occupying a column, picture and title being parallel, and text not being divided into columns; title separately occupying a column, picture and title being parallel, and text being divided into columns; title being column title, picture and title being parallel, and text being below picture and surrounding column title and not being divided into columns.

[0102] As shown in the embodiment of Figure Two , the process of fine-tuning page is as follows:

[0103] First step: Fine-tuning page, which first needs to judge whether news content fills the current page news content. When exactly filling the current page, although all news blocks of the page are filled, there may be too much white space at the bottom of the page. In order to make the news page more beautiful, we can judge whether to fine-tune the page through user's suggestion. If no fine-tuning is needed, it is directly output as pdf format, if fine-tuning is needed, it can be manually fine-tuned through the background fine-tuning TeX template function; if not, the fine-tuned page is directly output. When news content cannot fill the current page, white space will appear, which needs to be adjusted, and the second step is performed. The size of white space is the difference between the area of news block and the area of news length. According to the size of white space, appropriate way is selected to reduce the white space.

[0104] Second step: After determining that fine-tuning is needed, it is judged whether the news block contains picture. If not, the fifth step is performed; if the news block contains picture content and the picture needs to be adjusted, the third step is performed.

[0105] Third step: picture adjustment also needs to be divided into single picture adjustment and multiple picture adjustment, because sometimes only adjusting the size of a picture may affect the overall appearance of the news page, so in this case multiple pictures need to be selected for size adjustment. Therefore, first determine whether it is a single picture, if not, determine whether the picture set is in a separate row or a separate column, if not in a separate row or a separate column, allocate white space according to the proportion of the picture occupying the entire news block picture area, and then proceed to the fourth step. The extension space allocated for each picture is:

[0106] Pe i = [Pi / (P1+...Pn)]*S2,

[0107] Where n represents the number of pictures in the block, P1, P2, …, Pn represent the area of each picture, and S2 represents the white space area of the news block,

[0108] If it is in a separate row or a separate column, proceed to the fifth step; if it is a single picture, proceed to the fourth step.

[0109] Fourth step: determine whether the picture is in a separate row or a separate column, if the picture is not in a separate column or a separate row, adjust the picture size according to the white space, and then determine whether the adjusted picture size exceeds the threshold. When adjusting the picture size according to the white space, there are different adjustment methods for different page styles. For a single picture, the page style mainly includes the following cases: column, no column, and column with text surrounding. If the picture is in a columned article, the number of columns occupied by the picture needs to be adjusted; if the picture is in a non-columned article, the picture size can be directly changed to adjust the news length. The specific adjustment method is:

[0110] A: In an article with only one picture that is not columned, since

[0111] pw'≤bw and PS'≤∈2,

[0112] pw' / ph' = pw / ph,

[0113] pw' * ph' - pw * ph = ew * eh,

[0114] The height of the adjusted picture is:

[0115]

[0116] The width of the adjusted picture is:

[0117]

[0118] wherein, pw represents the picture width, pw' represents the width of the adjusted picture, ph represents the picture height, ph' represents the height of the adjusted picture, PS' represents the area of the adjusted picture, ew represents the margin width, ∈2 represents the threshold of the picture size;

[0119] B: adjusting the picture in the article with columns and only one picture, because:

[0120] pw'≤bw and PS'≤∈2,

[0121] pw' / ph' = pw / ph,

[0122]

[0123] pw' = pc' * cw + (pc' - 1) * cd,

[0124] pw' * ph' - pw * ph = ew * eh,

[0125] The height of the adjusted picture can be obtained as:

[0126]

[0127] The width of the adjusted picture is:

[0128]

[0129] The number of columns occupied by the picture after adjustment is:

[0130]

[0131] wherein, pc represents the number of columns occupied by the picture before adjustment, pc' represents the number of columns occupied by the picture after adjustment, cw represents the column width, and cd represents the column spacing;

[0132] C: if in the article with columns and the picture is not alone in a row or a column, the allocated expansion space is not enough for adjustment according to the column width, then randomly select the picture to give up adjustment until the allocated expansion space of each picture except the picture giving up adjustment is enough for adjustment according to the column width, and then use the method in B to adjust the picture.

[0133] The maximum range of picture adjustment is that the width pw' of the adjusted picture is equal to the width bw of the news block, if the size PS' of the adjusted picture exceeds the set threshold ∈2 of the picture size, the fifth step is performed, if not, the layout is output. If the picture is alone in a column or a row, the fifth step is performed.

[0134] Fifth step: judging whether the white space area meets the minimum picture insertion requirement. If yes, select a suitable picture to insert into the white space area, and then output the fine-tuned layout. The picture is a pre-reserved picture in the picture library, including promotional slogan pictures, advertisement pictures, etc. Since the white space is usually at the tail of the news block and the white space width pw is the width of the news block bw, the picture needs to be adjusted according to the original picture's length-width ratio until the picture's width pw is the same as the white space width ew, so the picture is preferably a vector picture.

[0135] The width of the adjusted picture is:

[0136] npw' = bw,

[0137] The width of the adjusted picture npw' has been determined, and the height of the adjusted picture nph' needs to be calculated next:

[0138] nph' = (nph / npw)*npw',

[0139] eh - nph' ≤ ε1,

[0140] where npw represents the width of the original picture, nph represents the height of the original picture, eh represents the white space height, bw represents the width of the news block, npw' represents the width of the adjusted picture, nph' represents the height of the adjusted picture, and ε1 represents the threshold of the difference between the white space height and the picture height. nph' cannot exceed the white space height eh and cannot differ greatly from the white space height eh.

[0141] If not, send the news content to the editor to supplement the news material by increasing the number of words to reduce the white space, and then output the fine-tuned layout.

[0142] For layouts that need to reduce white space by increasing the number of words, we first need to determine the range of the number of words to be increased, which is determined by the maximum number of words per line in columned and uncolumned articles. Second, we need to determine the white space width and height, as well as the news length area and the maximum number of lines that can be inserted.

[0143] The specific calculation process is:

[0144] Reduce white space by increasing the number of words, where the range of the number of words to be increased is:

[0145] [minwc, maxwc],

[0146] The maximum number of words per line in uncolumned articles is:

[0147]

[0148] The maximum number of words per line in columned articles is:

[0149]

[0150] The margin width is:

[0151] ew = bw,

[0152] The margin height is:

[0153] eh = S2 / bw,

[0154] The news column area is:

[0155] S1 = WS + PS + TS,

[0156] The maximum number of lines that can be inserted is:

[0157]

[0158] The maximum number of words that can be inserted is:

[0159] maxwc = maxhc * hwc1,

[0160] The minimum number of words that can be inserted is:

[0161] minwc = (maxhc - 1) * hwc2 + 1,

[0162] where maxwc represents the maximum number of words that can be inserted in a non-columned article, minwc represents the minimum number of words that can be inserted in a columned article, hwc represents the number of words per line, mf represents the font size, cc represents the number of columns, cd represents the column spacing, ew represents the margin width, eh represents the margin height, bw represents the news block width, S1 represents the news column area, S2 represents the margin area, WS represents the word area, PS represents the picture area, TS represents the title area, maxhc represents the maximum number of lines that can be inserted, and mh represents the line height of the text.

[0163] The above-described embodiments are only a preferred scheme of the present application, and do not limit the present application in any form. Other variations and modifications can be made without departing from the technical scheme recited in the claims.

Claims

1. A method for fine-tuning a latex electronic newspaper template, characterized in that: The following steps are involved: S1: Establish a database list of news content and classify it; S2: Establish a news page template library; S3: Select the original news material content and match it with the appropriate e-newsletter template through the automatic typesetting system; S4: Fine-tune the layout based on the news section layout and distribution type: S4.1: If the news content fills the current page, determine whether to fine-tune the layout based on user suggestions. If necessary, perform manual fine-tuning using the background fine-tuning Tex template function. If not, directly output the layout. If the current page is not filled, proceed to S4.2; S4.2: If the image does not exist in the news section, proceed to S4.5; if it does, proceed to S4.3; S4.3: If it is not a single image, determine whether the image set is in a single row or column. If not, allocate white space based on the proportion of the image to the entire news block image area and proceed to S4.

4. If it is, proceed to S4.

5. If it is a single image, proceed to S4.

4. S4.4: If the images are not arranged in separate rows or columns, resize the images based on the remaining blank space. If the resized images exceed the threshold, proceed to S4.

5. Otherwise, output the fine-tuned layout. If the images are arranged in separate columns or rows, proceed to S4.

5. S4.5: If the blank area meets the minimum requirements for inserting a newsletter picture, insert the newsletter picture and output the fine-tuned layout; otherwise, add the number of news words and then output the fine-tuned layout.

2. A method for fine-tuning a latex electronic newspaper template according to claim 1, characterized in that: In step S1, the specific steps of establishing a database list include: S1.1: Collect original news materials, including titles, text, reporter names, pictures, and design rules for these contents; S1.2: Collect the maximum and minimum areas of news articles obtained after standardization of news content, including the area of ​​text, image, and title. S1.3: Categorize the information collected in S1.1 and S1.2 and arrange them in the corresponding categories in order.

3. A method for fine-tuning a latex electronic newspaper template according to claim 2, characterized in that, In the step S1.3, the classification method is as follows: each piece of news original material is marked and classified according to the importance of the news, and the categories include headline news, second news, and third news.

4. A method for fine-tuning a latex electronic newspaper template according to claim 1, characterized in that: In step S2, the specific steps of establishing the template library include: S2.1: Use TeX files of various layouts as candidate templates; S2.2: Predefine the parameter information of the news block in each TeX template file, including the number, shape, size and position; S2.3: Save these TeX templates in a template library.

5. A method for fine-tuning a latex electronic newspaper template according to claim 1, characterized in that: In step S4.3, for a set of pictures that are not in a single row or column, the specific steps of allocating white space according to the proportion of the pictures occupying the entire news block picture area are as follows: The expansion space allocated to each image is: Or i =[Pi / (P1+...Pn)]*S2, Where n represents the number of pictures in the block, P1, P2, ..., Pn represent the area of ​​each picture, and S2 represents the blank area of ​​the news block.

6. A method for fine-tuning a latex electronic newspaper template according to claim 1, characterized in that: In step S4.4, the method for adjusting the image size according to the blank space is further as follows: A: Adjust the image in an article that is not divided into columns and has only one image. pw'≤bw and PS'≤∈2, pw' / ph'=pw / ph, pw'*ph'-pw*ph=ew*eh, The height of the adjusted image can be obtained as: The width of the adjusted image is: Where pw represents the image width, pw' represents the width of the adjusted image, ph represents the image height, ph' represents the height of the adjusted image, PS' represents the area of ​​the adjusted image, ew represents the blank width, and ∈2 represents the threshold of the image size; B: Adjusting images in a column-based article with only one image, because: pw'≤bw and PS'≤∈2, pw' / ph'=pw / ph, pc=[pw / cw], pw'=pc'*cw+(pc'-1)*cd, pw'*ph'-pw*ph=ew*eh, The height of the adjusted image can be obtained as: The width of the adjusted image is: The number of columns occupied by the adjusted image is: Where pc represents the number of columns occupied by the image before adjustment, pc' represents the number of columns occupied by the image after adjustment, cw represents the column width, and cd represents the column spacing; C: If the allocated expansion space is insufficient to adjust to the column width in an article with columns and images that are not arranged in separate rows or columns, randomly select images and abandon adjustments until the allocated expansion space for each image except the image that has been abandoned is sufficient to adjust to the column width. Then, use the method in B to adjust the images.

7. A method for fine-tuning a latex electronic newspaper template according to claim 1, characterized in that: In step S4.4, the method for determining whether the adjusted image size exceeds the threshold is further as follows: The maximum range of image adjustment is that the width pw' of the adjusted image is equal to the width bw of the news block. If the adjusted image size PS' exceeds the set image size threshold ∈2, proceed to step S4.

5. If not, output the fine-tuned layout.

8. The method for fine-tuning a latex electronic newspaper template according to claim 1, wherein: In step S4.5, the specific steps of inserting the flower picture are as follows: By inserting a flower image to reduce the white space, the width of the flower image after adjustment is: npw'=bw, The height of the flower picture after adjustment is: nph'=(nph / npw)*npw', eh-nph'≤∈1, Where npw represents the width of the original flower image, nph represents the height of the original flower image, eh represents the blank height, bw represents the news block width, npw' represents the width of the adjusted flower image, nph' represents the height of the adjusted flower image, and ∈1 represents the threshold value of the difference between the blank height and the flower image height.

9. The method for fine-tuning a latex electronic newspaper template according to claim 1, wherein: In step S4.5, the specific steps of supplementing the word count of the news are: Reduce white space by increasing the number of words, where the range of increasing the number of words is: [minwc, maxwc], The maximum number of characters in a line of a non-column article is: hwc1=[bw / mf] Maximum number of characters per line in a column article: hwc2=[[bw-(cc-1)*cd] / mf] The width of the margin is: ew=bw, The margin height is: eh=S2 / bw, The news section area is: S1=WS+PS+TS, The maximum number of rows that can be inserted is: maxhc=[eh / mh], The maximum number of characters that can be inserted is: maxwc=maxhc*hwc1, The minimum number of characters that can be inserted is: minwc=(maxhc-1)*hwc2+1, Among them, maxwc represents the maximum number of words that can be inserted in an article without columns, minwc represents the minimum number of words that can be inserted in an article with columns, hwc represents the number of words in a line, mf represents the text size, cc represents the number of columns, cd represents the column spacing, ew represents the margin width, eh represents the margin height, bw represents the news block width, S1 represents the news page area, S2 represents the margin area, WS represents the word area, PS represents the figure area, TS represents the title area, maxhc represents the maximum number of lines that can be inserted, and mh represents the text line height.

Citation Information

Patent Citations

  • A generation method of automatic typesetting for LaTeX template for graduation thesis

    CN109359286A

  • Electronic data typesetting method and device

    CN102789448A

  • Printing typesetting system and method based on newspaper layout AI automatic typesetting design

    CN112001154A