Comment field method of adjustment and device
Technical field
The present invention relates to typesetting technique more particularly to a kind of comment field method of adjustment and devices.
Background technology
Annotation is generally arranged at below text, is that the relevant informations such as the word to article, content, background, author are situated between
The word to continue has the forms such as footnote, endnote, is a very important part during copy editor and typesetting.
The content of annotation and text is individually positioned in the comment field and text area of the page.Different publications are to comment field
Width has different requirements, and under normal circumstances, the well-to-do width by adjacent text area of comment field is influenced.In typesetting process
In, according to the difference of text area typesetting situation, the size and location of comment field will also make corresponding adjustment.In the prior art,
Often comparing the width of comment field and text area by manually observing, and be adjusted manually, adjustment result is often present with deviation,
And time-consuming and laborious, inefficiency.
The content of the invention
The present invention provides a kind of comment field method of adjustment and device, to solve to manually adjust comment field in the prior art not
Enough accurately, the technical issues of inefficiency.
The present invention provides a kind of comment field method of adjustment, including:
The content of text area and the content of comment field are imported, and typesetting is carried out to the text area and the comment field;
Calculate the width of the adjacent text area of the comment field;
According to the width of the adjacent text area, the width of the comment field is adjusted.
Further, according to the width of the adjacent text area, the width of the comment field is adjusted, including:
If the width of the comment field and the width of the adjacent text area are inconsistent, by the width tune of the comment field
The whole width for the adjacent text area.
Further, after the content and the content of comment field for importing text area, further include:
Calculate the width and record of comment field;
It is the width of the adjacent text area by the width adjustment of the comment field, including:
Following steps are repeated, until judging to draw the width of adjacent text area and any of recorded comment field
It is of same size:Judge whether the width of adjacent text area is identical with any width of recorded comment field;It is if described adjacent
The width of text area and any width of recorded comment field differ, then are institute by the width adjustment of the comment field
State the width of adjacent text area;Typesetting is carried out to the text area and the comment field, calculates and records the width of the comment field
Degree.
Further, the method further includes:
It is reciprocal in text area if the width of the adjacent text area is of same size with any of recorded comment field
Page break is inserted into after the end mark of second paragraph;
By the width that the width adjustment of the comment field is the penultimate paragraph;
Typesetting is carried out to the comment field and the text area.
Further, before the content and the content of comment field for importing text area, further include:
Subfield configuration information input by user is received, the subfield configuration information includes word adjacent above comment field point
The comment field is arranged on to the lower section on which column during column;
Correspondingly, when carrying out typesetting to the text area and the comment field, if text adjacent above the comment field
Word is divided into multicolumn, then the comment field is arranged on to the lower section of corresponding column text area according to the subfield configuration information.
The present invention also provides a kind of comment field adjusting apparatus, including:
Import modul, for importing the content of the content of text area and comment field, and to the text area and the annotation
Area carries out typesetting;
Computing module, for calculating the width of the adjacent text area of the comment field;
Module is adjusted, for the width according to the adjacent text area, adjusts the width of the comment field.
Further, the adjustment module, is specifically used for:
If the width of the comment field and the width of the adjacent text area are inconsistent, by the width tune of the comment field
The whole width for the adjacent text area.
Further, the import modul is additionally operable to:
After the content and the content of comment field for importing text area, the width and record of comment field are calculated;
Correspondingly, the adjustment module is specifically used for:
If the width of the comment field and the width of the adjacent text area are inconsistent, following steps are repeated, until
Judgement show that the width of adjacent text area is of same size with any of recorded comment field:Judge the width of adjacent text area
It is whether identical with any width of recorded comment field;If the width of the adjacent text area and recorded comment field
Any width differ, then by the width adjustment of the comment field be the adjacent text area width;To the text
Area and the comment field carry out typesetting, calculate and record the width of the comment field.
Further, the adjustment module is additionally operable to:
It is reciprocal in text area if the width of the adjacent text area is of same size with any of recorded comment field
Page break is inserted into after the end mark of second paragraph;
By the width that the width adjustment of the comment field is the penultimate paragraph;
Typesetting is carried out to the comment field and the text area.
Further, the import modul is additionally operable to:
Before the content and the content of comment field for importing text area, subfield configuration information input by user is received, it is described
Subfield configuration information includes the comment field is arranged on to the lower section on which column during word subfield adjacent above comment field;
Correspondingly, when carrying out typesetting to the text area and the comment field, if text adjacent above the comment field
Word is divided into multicolumn, then the comment field is arranged on to the lower section of corresponding column text area according to the subfield configuration information.
Comment field method of adjustment provided by the invention and device, by importing the content of text area and the content of comment field,
Typesetting is carried out to the text area and the comment field, calculates the width of the text area of the adjacent comment field, and according to described
The width of adjacent text area adjusts the width of the comment field, can quickly and accurately by comment field adjust to text area phase
Matching, without manually being adjusted, effectively increases regulated efficiency, has saved publication cost.
Description of the drawings
Fig. 1 is the flow chart for the comment field method of adjustment that the embodiment of the present invention one provides;
Fig. 2 is the position view of comment field and text area in the comment field method of adjustment that the embodiment of the present invention one provides
One;
Fig. 3 is the position view of comment field and text area in the comment field method of adjustment that the embodiment of the present invention one provides
Two;
Fig. 4 is the position view of comment field and text area in the comment field method of adjustment that the embodiment of the present invention one provides
Three;
Fig. 5 is the position view of comment field and text area in the comment field method of adjustment that the embodiment of the present invention one provides
Four;
Fig. 6 is the flow chart of comment field method of adjustment provided by Embodiment 2 of the present invention;
Fig. 7 is that the schematic diagram after page break is inserted into comment field method of adjustment provided by Embodiment 2 of the present invention;
Fig. 8 is the structure diagram for the comment field adjusting apparatus that the embodiment of the present invention three provides.
Reference numeral:The adjacent text areas of 1-;2- comment fields.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
All other embodiments obtained without creative efforts belong to the scope of protection of the invention.
The term used in the embodiment of the present application is only merely for the purpose of description specific embodiment, and is not intended to be limiting
The present invention." one kind " of used singulative, " described " and "the" are also intended to including most shapes in the embodiment of the present application
Formula, unless context clearly shows that other meanings.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, represent
There may be three kinds of relations, for example, A and/or B, can represent:Individualism A, exists simultaneously A and B, individualism B these three
Situation.In addition, character "/" herein, it is a kind of relation of "or" to typically represent forward-backward correlation object.
Depending on linguistic context, word as used in this " if ", " if " can be construed to " ... when " or
" when ... " or " in response to determining " or " in response to detection ".Similarly, depending on linguistic context, phrase " if it is determined that " or " such as
Fruit detects (condition or event of statement) " " when definite " or " in response to determining " can be construed to or " when detection (statement
Condition or event) when " or " in response to detect (condition or event of statement) ".
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising, so that commodity or system including a series of elements not only include those elements, but also including without clear and definite
It the other element listed or further includes as this commodity or the intrinsic element of system.In the feelings not limited more
Under condition, the element that is limited by sentence "including a ...", it is not excluded that in the commodity including the element or system also
There are other identical elements.
Embodiment one
The embodiment of the present invention one provides a kind of comment field method of adjustment.Fig. 1 is the comment field that the embodiment of the present invention one provides
The flow chart of method of adjustment.As shown in Figure 1, the method in the present embodiment, can include:
The content of step 101, the content for importing text area and comment field, and the text area and the comment field are carried out
Typesetting.
Specifically, the method in the present embodiment can be applied to any scene that typesetting can be carried out to comment field, such as side
System of just circling in the air or Microsoft Office Word etc..Wherein, comment field multidigit is in the lower section of text, the content of comment field
Will not paging, and the content of text area can be with paging.
It, can be first by the content of the comment field of the content of text area when generating the page of document, periodical and publication
It imported into the page.The text area of acquiescence and the comment field of acquiescence can be provided on the page, by the text area
Content imported into the text area of the page fault, the content of the comment field is imported into the annotation of the page fault
In area.
After the completion of importing, typesetting can be carried out to the text area and the comment field.Typesetting can specifically include:According to
Word adjusts height, adjustment text area and mutex propertiy of comment field of text area or comment field etc..
It imports the content of text area and comment field and carries out typesetting and belong to the prior art, repeated no more in the present embodiment.
Step 102, calculate the comment field adjacent text area width.
Wherein, the adjacent text area can be text area adjacent above the comment field.If above the comment field
Have multiple adjacent text areas, then can optionally one as the adjacent text area.
Step 103, the width according to the adjacent text area adjust the width of the comment field.
The width of the adjacent text area can be set according to actual needs with the relation of the width of the comment field.
In most cases, the width of the comment field can be equal with the width of the adjacent text area.It is specifically divided into following several
Situation:
(1), the non-subfield of word above comment field and without retraction, then comment field and the page are wide.Fig. 2 is implemented for the present invention
The position view one of comment field and text area in the comment field method of adjustment that example one provides.As shown in Fig. 2, comment field 2 is located at
Below the page, the non-subfield of word of 2 top of comment field, the text area of 2 surface of comment field is the adjacent text area 1, can
With the width adjustment of the comment field 2 is extremely equal with the width of the adjacent text area 1.
(2), the word subfield above comment field and without retraction, then it is wide identical with column to annotate sector width.Fig. 3 is real for the present invention
The position view two of comment field and text area in the comment field method of adjustment of the offer of example one is provided.As shown in figure 3, comment field 2
In page lower left, the word of 2 top of comment field is divided into two columns of left and right, and the text area on one column of the left side is the adjacent text area 1,
It can be extremely equal with the width of the adjacent text area 1 by the width adjustment of the comment field 2.
(3), the non-subfield of word above comment field and there is retraction, then annotate sector width and subtract retraction distance for pagewidth
(being retracted including left and right), comment field left end and word left alignment.Fig. 4 is the comment field adjustment side that the embodiment of the present invention one provides
The position view three of comment field and text area in method.As shown in figure 4, comment field 2 is located at below the page, 2 top of comment field
The non-subfield of word, but be retracted to the left, the text area directly over comment field 2 is the adjacent text area 1, can be by the note
The width adjustment for releasing area 2 is extremely equal with the width of the adjacent text area 1.
(4), the word subfield above comment field and have retraction, then annotate sector width for column it is wide subtract retraction distance (including
Left and right retraction), comment field left end and word left alignment.Fig. 5 is in the comment field method of adjustment that the embodiment of the present invention one provides
Comment field and the position view four of text area.As shown in figure 5, comment field 2 is located at page lower left, the text of 2 top of comment field
Word is divided into two columns of left and right, and one column of left side is retracted to the left, and the text area on one column of left side is the adjacent text area 1, can be by described in
The width adjustment of comment field 2 is extremely equal with the width of the adjacent text area 1.
It can be seen that no matter the word above comment field whether subfield, whether there is retraction, the width of comment field can adjust
To the equivalent width with the adjacent text area.Therefore, the width according to the adjacent text area in this step, described in adjustment
The width of comment field can include:If the width of the comment field and the width of the adjacent text area are inconsistent, by described in
The width adjustment of comment field is the width of the adjacent text area.
Certainly, the width of the comment field can also be inconsistent with the width of the adjacent text area, for example, comment field
Width can be adjusted to the small predetermined threshold value of width than adjacent text area.The width of the width of the comment field and the text area
Relativeness can set or be manually entered by user according to actual needs.
It, can when needing to carry out typesetting to the annotated document of all kinds of bands, periodical and publication in actual application
Text and annotation are imported into the page first, preliminary typesetting then is carried out to text area and comment field, preliminary typesetting is completed
Afterwards, the width of the adjacent text area of the comment field after typesetting can be calculated, then, judges the width of the comment field and the phase
Whether the width of adjacent text area is consistent, if unanimously, need not be adjusted, directly terminate typesetting, if inconsistent, can incite somebody to action
The width adjustment of the comment field is the width of the adjacent text area.
Comment field method of adjustment provided in this embodiment, by importing the content of text area and the content of comment field, to institute
It states text area and the comment field carries out typesetting, calculate the width of the text area of the adjacent comment field, and according to described adjacent
The width of text area adjusts the width of the comment field, can quickly and accurately by comment field adjust to text area phase
Match somebody with somebody, without manually being adjusted, effectively increase regulated efficiency, saved publication cost.
Further, it is described to include before the content and the content of comment field for importing text area:Receive user
The subfield configuration information of input, by the comment field when subfield configuration information is including word subfield adjacent above comment field
It is arranged on the lower section on which column.
Correspondingly, when carrying out typesetting to the text area and the comment field, if text adjacent above the comment field
Word is divided into multicolumn, then the comment field is arranged on to the lower section of corresponding column text area according to the subfield configuration information.
For example, user can input subfield configuration information before typesetting, the subfield configuration information represents the comment field
It is arranged on the lower section of one column text area of left side.During typesetting, if the word above comment field is divided into two columns of left and right, by institute
It states comment field and is arranged on the underface of left side text area, and be consistent with the width of left side text area.
Embodiment two
The embodiment of the present invention two provides a kind of comment field method of adjustment.Fig. 6 is comment field provided by Embodiment 2 of the present invention
The flow chart of method of adjustment.As shown in fig. 6, the method in the present embodiment, can include:
The content of step 201, the content for importing text area and comment field.
Step 202 carries out typesetting to the text area and the comment field, calculates the width and record of comment field.
Step 203, calculate the comment field adjacent text area width.
Whether step 204, the width for judging comment field are identical with the width of adjacent text area.
If the width of the comment field and the width of adjacent text area differ, step 205 is performed;If identical, tie
Beam.
In this step, if being of same size for the width of the comment field and adjacent text area, illustrates that comment field is adjusted
It is good, without being adjusted again, can directly terminate at this time.If the width of the width of the comment field and adjacent text area not phase
Together, explanation may also need to further adjust comment field, perform step 205 at this time.
Whether step 205, the width for judging adjacent text area are identical with any width of recorded comment field.
If the width of the adjacent text area and any width of recorded comment field differ, step is performed
206;If the width of the adjacent text area is of same size with any of recorded comment field, step 207 is performed.
The width adjustment of the comment field is the width of the adjacent text area, and re-executes step by step 206
202。
In practical applications, by the width adjustment of comment field for the width of adjacent text area and after re-starting typesetting,
It is possible that the width of comment field and the width of adjacent text area and inconsistent situation after adjustment.
For example, in certain periodical, text includes two sections, and the width of first segment is 10cm, and the width of second segment is 5cm, is noted
The width for releasing area is 8cm.After importing text and annotation, comment field is located at the lower section of second segment.At this point, according to above-mentioned steps, it can
Using the width 5cm by the width adjustment of comment field as adjacent text area, that is, second segment.
But after adjustment, the height of comment field can change.Due to the word size in comment field and number not
Become, the width of comment field is turned down, correspondingly, the height of comment field becomes larger, the space of text area can be tied up.Therefore, to note
Release area and after text area re-starts typesetting, the second segment of text area may move on to lower one page, in this way, first segment just becomes
The adjacent text area of comment field at this point, comment field has been adjusted to 5cm, is mismatched with the width 10cm of first segment, therefore, needed
Adjustment is re-started to comment field.
Specifically, with reference to step 202 to step 206, after each typesetting terminates, the width in current annotation area can be calculated
Degree, and record the width in current annotation area.After typesetting, if the width of comment field and the width of adjacent text area differ,
Just need to be adjusted comment field, at this point it is possible to first determine whether adjacent text area width whether the note with recorded mistake
It is identical to release sector width.
Can be adjacent by the width adjustment of comment field if the width of adjacent text area is differed with the width recorded
The width of text area, and whether detection comment field is consistent with the width of adjacent text area after typesetting again, if unanimously, illustrating to annotate
Area has met the requirements, and can terminate;If inconsistent, it is necessary to re-start adjustment, that is, step 202 is re-executed to step 204.
Step 207 is inserted into page break after the end mark of text area penultimate paragraph, by the width of the comment field
Degree is adjusted to the width of the penultimate paragraph.
It,, can be first when the width of comment field and the inconsistent width of adjacent text area after typesetting in the present embodiment
First according to the method in step 205, judge whether the width of adjacent text area any is of same size with recorded.
If the width of adjacent text area is differed with any one recorded width, can be according to step 206
In method, by the width adjustment of comment field be adjacent text area width.If the width of adjacent text area with it is recorded
It is a certain to be of same size, then it is adjusted before illustrating the width to cross, if being again the width by the width adjustment of comment field,
The step of only infinitely repeating front, it can not terminate forever.
In order to solve the problems, such as this, can adjacent text area width with it is recorded it is any be of same size when, press
According to the method for this step, page break is inserted into after the end mark of text area penultimate paragraph, and by the comment field
Width adjustment is the width of the penultimate paragraph.
It, can be to the annotation after by the width adjustment of the comment field for the width of the penultimate paragraph
Area and the text area carry out typesetting, obtain the final page.It is exemplified below.
For example, in certain periodical, text includes two sections, and the width of first segment is 10cm, and the width of second segment is 5cm, is noted
The acquiescence width for releasing area is 8cm.After importing text and annotation, comment field is located at the lower section of second segment.At this point, according to step 202
To step 206, the width 8cm of comment field is recorded, and by width that the width adjustment of comment field is adjacent text area, that is, second segment
5cm。
Step 202 is re-executed to step 206, records the width 5cm of comment field, after typesetting, comment field becomes higher, and squeezes
The space of text area is accounted for, second segment can move on to lower one page, and first segment just becomes the adjacent text area of comment field, at this point, note
It releases area and has been adjusted to 5cm, mismatched with the width 10cm of first segment, therefore, it is necessary to re-start adjustment to comment field, adjustment
Comment field afterwards is 10cm.
Step 202 is re-executed, records the width 10cm of comment field, after typesetting, comment field is lower, and text space increases
Greatly, second segment comes back to this page, becomes the adjacent text area of comment field, at this point, annotation sector width is 10cm, adjacent text area
I.e. the width of second segment is 5cm, is still differed, therefore performs step 205.
There are three the width of recorded comment field:8cm, 5cm and 10cm.Due to adjacent text area width 5cm with
One of them recorded is of same size, therefore, if again readjusted the width of comment field for 5cm, will infinitely be followed
Ring goes down.At this point it is possible at second from the bottom section of text area, that is, a paging is added in after the end mark of the first segment of text
Symbol, second page is assigned to lower one page, then, then by the width adjustment of comment field is to be of same size with first segment.
Fig. 7 is that the schematic diagram after page break is inserted into comment field method of adjustment provided by Embodiment 2 of the present invention.Such as Fig. 7 institutes
Show, after second from the bottom section of text area insertion page break, the original final stage of text area can move on to next line, and former reciprocal the
Two sections become final stage, also just become the adjacent text area 2 of comment field 1.According to this method of adjustment, final comment field 1
It may be stayed between adjacent text area 2 and have certain blank space.
Comment field method of adjustment provided in this embodiment by recording the width of comment field after each typesetting, and is adjusting
During annotating sector width, if the width of adjacent text area is identical with recorded any width value, fallen in text area
Number second segment insertion page break, can terminate comment field adjustment repeatedly, improve the efficiency of comment field adjustment.
Embodiment three
The embodiment of the present invention three provides a kind of comment field adjusting apparatus.Fig. 8 is the comment field that the embodiment of the present invention three provides
The structure diagram of adjusting apparatus.As shown in figure 8, the device in the present embodiment, can include:
Import modul 301, for importing the content of the content of text area and comment field, and to the text area and the note
It releases area and carries out typesetting;
Computing module 302, for calculating the width of the adjacent text area of the comment field;
Module 303 is adjusted, for the width according to the adjacent text area, adjusts the width of the comment field.
Device in the present embodiment can be used for performing the comment field method of adjustment described in embodiment one, specific implementation
Principle is similar with embodiment one, and details are not described herein again.
Comment field adjusting apparatus provided in this embodiment, by importing the content of text area and the content of comment field, to institute
It states text area and the comment field carries out typesetting, calculate the width of the text area of the adjacent comment field, and according to described adjacent
The width of text area adjusts the width of the comment field, can quickly and accurately by comment field adjust to text area phase
Match somebody with somebody, without manually being adjusted, effectively increase regulated efficiency, saved publication cost.
Further, the adjustment module 303, is specifically used for:
If the width of the comment field and the width of the adjacent text area are inconsistent, by the width tune of the comment field
The whole width for the adjacent text area.
Further, the import modul 301 is additionally operable to:
After the content and the content of comment field for importing text area, the width and record of comment field are calculated;
Correspondingly, the adjustment module 303 is specifically used for:
If the width of the comment field and the width of the adjacent text area are inconsistent, following steps are repeated, until
Judgement show that the width of adjacent text area is of same size with any of recorded comment field:Judge the width of adjacent text area
It is whether identical with any width of recorded comment field;If the width of the adjacent text area and recorded comment field
Any width differ, then by the width adjustment of the comment field be the adjacent text area width;To the text
Area and the comment field carry out typesetting, calculate and record the width of the comment field.
Further, the adjustment module 303 is additionally operable to:
It is reciprocal in text area if the width of the adjacent text area is of same size with any of recorded comment field
Page break is inserted into after the end mark of second paragraph;
By the width that the width adjustment of the comment field is the penultimate paragraph;
Typesetting is carried out to the comment field and the text area.
Further, the import modul 301 is additionally operable to:
Before the content and the content of comment field for importing text area, subfield configuration information input by user is received, it is described
Subfield configuration information includes the comment field is arranged on to the lower section on which column during word subfield adjacent above comment field;
Correspondingly, when carrying out typesetting to the text area and the comment field, if text adjacent above the comment field
Word is divided into multicolumn, then the comment field is arranged on to the lower section of corresponding column text area according to the subfield configuration information.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical characteristic into
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is not made to depart from various embodiments of the present invention technology
The scope of scheme.