Forum How do I...?

Optional page breaks

navlrac
Coming from a LaTeX background, I'm used to the concept of the optional (weighted) page-break.
I can't see to find an equivalent in the Prince/CSS specs. Maybe someone can enlighten me or tell me its not possible.

There are the following:
page-break-before: auto | always | avoid | left | right

where 'auto' seems a bit different it TeX, it doesn't really change anything: given my understanding that its the default so specifying auto doesn't make any difference, or does it?

In LaTeX you have:
/pagebreak or /pagebreak[p] with p=0..4 (priority)

This allows you to weight where you would prefer a pagebreak, but it does not force one. Its very handy for hinting to the layout engine where you would prefer page-breaks, if they are needed.

Its much simpler to use this, than to add "avoid" around a whole lot of small display blocks that you would prefer to stay together.

So my best case would be if I could do something like:
<div style="softbreak:2"></div>

but even

<div style="softbreak"></div>
would be ok.
mikeday
Right, at the moment CSS only has three options: forced page breaks (always), discouraged page breaks (avoid, widows/orphans), and arbitrary page breaks (auto). So I guess that is like three priorities: -10, 0, and +10, without any intermediate values.
navlrac
Any plans for a Prince (or CSS) extension along these lines?
Trying to use prince for technical documentation where PDF is the main output can become slightly tedious in this area.
mikeday
At the moment our layout engine would not be able to take advantage of more fine-grained page breaking hints, although we hope to do so in the future. If you have many small elements that you wish to keep together, could you wrap them up in a block and use "page-break-inside: avoid"?