Appearance
Breaking
As the content in a flow increases in length, so does the chance of the content not fitting within its containing frame. If a page definition doesn't have enough space to fit its entire referenced content flow then the flow will "break", splitting in two to be completed later.
Controlling Block Breaks
The way in which block elements break can be controlled via the break attribute. This can have the following values:
auto
If break="auto" then the block will fit as much content as possible into its current parent and break wherever it needs to.
never
If break="never" then the block will never break. If the current parent doesn't have enough space to fit all the contents of the component, the component will not render until the flow is used on a page with enough space.
prevent-last
If prevent-last="true" then the block will never become the last child of its parent. Essentially, if there isn't enough space to begin printing the block's next sibling then neither it nor the next sibling will be printed (until another parent comes along e.g., on the next page). One example for this is to stop headings appearing as an orphan at the bottom of a page.
group-children
If break="group-children" then the block will never break between its children. Note that it still may break within a child, but the end of one child is guaranteed to be followed by the start of the next.
An example of this is a table figure, where the table may break across a page if the table is tall enough, but we always want the caption to render on the same page as the last page containing the table.
Controlling Inline Breaks
A block element can also specify the integer attribute orphan-lines-threshold which specifies the minimum number of "lines" an inline must have for it to be broken across frames.
For example if, in <styles> the following is set:
xml
<p>
<orphan-lines-threshold>3</orphan-lines-threshold>
</p>then all inline "blocks" within a p element will never break before their 3rd line. This can be used to step a single line of a paragraph appearing at the bottom of a page.
An Example
The above breaking rules can be combined into quite complex behaviour. For example if <styles> contains
xml
<h1>
<prevent-last>true</prevent-last>
</h1>
<p>
<orphan-lines-threshold>3</orphan-lines-threshold>
</p>then no section will end with an h1 (visually this would look quite strange), and all paragraphs will be at least 3 lines long (unless they don't have enough content).
This can prevent, for example, a page ending in a title followed by a single line of text as the breaking rules described above would force both of these elements to be moved to the next available page.