Vincent Hennebert wrote:

I don't think there is much you can do in that case. It appears that the
15 lines of text at 12 pt exactly fill the 3 inch-high page. So that
makes a feasible node which is always preferred to too-short nodes.
Change the page-height to 3.1 inch and you no longer have the footnotes
deferred to the next page.
That's exactly why I introduced the MIN_NORMAL_PAGE_FILL_RATIO constant
in PageBreakingAlgorithm: to give a chance to underfull pages with no
deferred floats to be preferred over full pages with deferred ones. Keep
the page-height of 3 inches and change that constant to 0.9 and you have
your footnotes back on the first page.

I agree that, in a sense, the "error" is in the fo file, defining a fixed-height footnote separator that does not fit well the page; with an heigth of 12 pt, all would be ok. In alternative, it could be defined using a min-opt-max line height or space-*, allowing for some stretch and shrink (not sure this would be handled correctly at the moment, but this is not the point).

But I don't agree with you when you say "that makes a feasible node which is always preferred to too-short nodes". I'm not at all convinced that it is a "feasible" break. Even if the FO recommendation says that the footnote body could be placed in a page following the one with the anchor, I think it should be read in a "restrictive" interpretation, deferring a footnote only if there isn't any possible alternative.

In this case, it is possible to place the footnote in the same page that contains its citation, so I think that the algorithm should not be allowed to prefer a break that defers it. Note [:-)] that the footnote could appear after *many* pages, if there are lots of 12pt-high lines of normal text.

In this respect, from a user perspective, footnotes and before floats are quite different: while it's completely acceptable for a figure or a table to be placed in a page following the text referring to it, I'm sure most users would be quite disappointed to find out that a footnote has been unnecessarily deferred.

So, while I think the idea of the page fill ratio is very good for the placement of before floats, I think footnotes should have a different handling, a "preferential treatment" limiting deferments to the extremely unlikely case of an unbreakable group of lines with a lot of footnotes, a few of which does not fit in the page (or some other extreme situations).

The actual problem IMO is to define the right demerits for underfull
pages and deferred before-floats and footnotes in order to have a decent
result (i.e., that a human would expect) in every case.

I don't think it would be enough: the "expected" break (the one with both footnotes on page 1) is a "short" solution and is not recorded, it just updates lastTooShort. As long as there is not a restart (and having just 12pt-high lines it will never happen), it doesn't have a chance to be used.

I think that, after all, this could be fixed just by checking some additional condition before calling handleNode() the first time (when footnotes and before floats are not not taken into account).

Regards
    Luca

Reply via email to