Appearance
Page Breaking
When flowing content exceeds the bounds available to it, Press will automatically page break. This guide covers how breaking in Press works and how to control where breaks happen.
How Breaking Works
Press flows content into the available space of frames. When an element doesn't fit, Press decides where to split:
- Between siblings -- Press finishes the last frame that fits and moves the next one to a new page.
- Within an element -- e.g., for long text or when breaking between children, Press can split the content mid-element.
Preventing Breaks
break="never"
Add break="never" to keep an element entirely on one page. If it doesn't fit on the current page, the entire element moves to the next page.
xml
<frame break="never" padding="12pt" background-color="#f9fafb" border-radius="4pt">
<h3>Key Finding</h3>
<p>Processing efficiency improved by 34% compared to the previous quarter,
driven primarily by the new automated pipeline.</p>
<p font-size="8pt" font-color="#6b7280">Source: Internal operations report, Q4 2025</p>
</frame>This is essential for elements that make no sense when split -- like a callout box, a figure with its caption, or a summary card.
Forcing Breaks
<frame-break />
Insert <frame-break /> to force a break. A frame-break acts as if no further content can fit into the current frame and will be picked up in a future page:
xml
<flows>
<body>
<h1>Executive Summary</h1>
<p>This quarter saw record growth across all divisions...</p>
<frame-break />
<h1>Detailed Analysis</h1>
<p>We begin with the Northern region...</p>
</body>
</flows>Controlling Widows and Orphans
prevent-last="true"
Prevents an element from being the last element in the parent frame. For instance, we may not want headings to appear at the bottom of the page (orphan) if no other content fits afterwards, and prefer the heading to be rendered on the next page:
xml
<h1 prevent-last="true">
A long paragraph that might break across pages. With prevent-last,
Press ensures at least two lines remain on the page before allowing
a break. If only one line would fit, the entire paragraph moves to
the next page.
</h1>INFO
Headings by default have prevent-last="true" to stop them appearing at the bottom of a page
orphan-lines-threshold
Set the minimum number of lines that must appear before a break is allowed:
xml
<p orphan-lines-threshold="3">
Some lines of text which will only break in the middle if at least three lines fit on the current page. Else the full p will move to the next frame or page.
</p>With a threshold of 3, Press won't break a paragraph unless at least three lines can remain on the current page.
Spacing and Breaks
space-before-desired and space-after-desired
These attributes request spacing between sibling elements.
xml
<h2 space-after-desired="16pt">Section Title</h2>
<p space-after-desired="8pt" space-before-desired="8pt">First paragraph...</p>
<p space-after-desired="8pt">Second paragraph...</p>In a frame, space-before-desired for the first item and space-after-desired for the last item are reduced to zero, preventing awkward whitespace at page and frame edges.
Summary
| Attribute | Effect |
|---|---|
break="auto" | Default. Allow breaks between and within children. |
break="never" | Never break this element. Move it to the next page if it doesn't fit. |
<frame-break /> | Force a break to the next page/frame. |
prevent-last="true" | Don't leave a single line at the bottom before a break. |
orphan-lines-threshold | Minimum lines before allowing a break. |
space-before-desired | Desired space above (compressed at page boundaries). |
space-after-desired | Desired space below (compressed at page boundaries). |