[texhax] Calculate remaining space after a page break and a \penalty of 10000
Wolfgang Lorenz
wl-chmw at gmx.de
Fri Nov 12 21:29:25 CET 2010
Am 12 Nov 2010 11:32:44 -0800
schrieb Donald Arseneau <asnd at triumf.ca>:
> Until there is a possible breakpoint, \pagetotal may not
> include the most recent contributions. You have to give
> a breakpoint, even \penalty9999, to get an accurate
> \pagetotal.
Thank you, I didn't know this...
> Since you are worried about being after section titles,
I am worried about any content that may occur, with a penalty of 10000.
The section titles were only meant as an example, because in the
document I am working on the lyrics may come directly after a section
change. But I'd like the package to behave more generally.
> I recommend a heuristic:
>
> Record \pagetotal (call it \subtotal)
> check \if at nobreak to see if breaks are forbidden
> For no-break case, choose to introduce a \penalty9999
> only if \subtotal is well short of a page, say .75\pagegoal
> For the else case, always give \penalty9999
> Finally, check the real pagetotal.
I've thought about leaving it up to the user to limit the space
bbLyrics is using for the "first page", but that would be a hack I'd
rather not implement. If all else fails, this will be the way I go,
though.
Thanks for your suggestions!
Wolfgang
More information about the texhax
mailing list