Column Footer Algorithm

I applied the basic page layout algorithm to place the footnote. Primarily:

  • The markup of the line of the main text.
  • If it contains links to footnotes, lay out the footnotes in rows.
  • Go to 1.

At each step, I check if the overall height (body text + footnote text + space) exceeds the page height. If so, I delete the most recent laid out line and the page is complete.

My question is: How can I deal with a situation where the body text is in two columns?

Essentially, I would need to know the total permissible height of the body text in advance in order to lay out the columns correctly, but it is impossible to find out until I know the height of the footnote text.

I also can’t just take the accumulated height of the text lines of the body and divide by 2 due to changes in line height, line spacing, paragraph spacing, etc.

+3
source share
2 answers

You have 3 blocks - two for columns and one for footnotes. Obviously (column height + footnote height + clearance) should be lower than the page height.

You can use your old algorithm for the first column. For the second column, when you add a footnote, and this causes the first column to be too long, move the rows from the end of the first column to the beginning of the second. If this makes the second column too long, move the row (s) back to the first column and delete the last row of the footnote.

+1
source

. (: .)

, ?

, . , .

, :

  • .

, . . (, ). .

/:

  • : , , , , .

  • ? , , , .

  • , , , : ( ), , , , , , .

+1

Source: https://habr.com/ru/post/1760959/


All Articles