Jeremias Maerki wrote:

What is the expected output?

In this case it has to generate a blank page IMO.

Oh, right, I did not think of an empty page! :-)

The problem is with the "page x of y" hack that won't work like this if
the last empty block ends up on the second-to-last page. [...]

What about the following approach?

Run the breaker without special last-page handling, then inspect the
allocated BPD for the last part. If it fits into the last page, just
exchange the page-master (*) and paint it there. If it doesn't fit,
paint it using the non-last page-master and add a blank page with the
last page-master. If there's a box w=0 at the end of the element list,
force a new part and paint that on the last page to handle the "page x
of y" case.

I think this would work with my idea too: in this case, if the last empty block and the difference in page bpd (that cannot be parted) do not fit in the non-last page under construction, they would be placed in a new page; so, a page-number-citation pointing to the empty block would return the last page-number. This would avoid the need to exchange page-masters, and to have a special handling for zero-width box at the end of the sequence.

Regards
    Luca

Reply via email to