Skip to content

Page breaks

::pagebreak

Starts a new page in page view and in the PDF. In draft view it shows as a dashed line labelled Page break. It takes no label and no attributes. Insert one with macOS: ⌘↵, Windows and Linux: Ctrl+Enter.

page-breaks/document.md
# Page breaks
The first page.
::pagebreak
## Second page
This page starts after a single `::pagebreak`.
::pagebreak
::pagebreak
## Third page
The two breaks above collapse into one.
::pagebreak
 
::pagebreak
## Fifth page
The page before this one is intentionally blank: it contains only a non-breaking space.
A page break starts a new page. Two breaks in a row produce only one; put a non-breaking space between them for a blank page.
Download sample (.mdl)

Open it in MDLeaf with Library → Import .mdl. If MDLeaf is installed, you can also open the file directly.

  • Consecutive breaks collapse. Two ::pagebreak lines in a row produce one break, not an empty page. A break at the very start or end of the document does nothing. A break that falls exactly where a page ends anyway does not add a page either.

  • Blank pages on purpose: put a paragraph containing only a non-breaking space between two breaks:

    ::pagebreak
     
    ::pagebreak
  • Directives that apply to a page, such as ::hide or ::pagenumber, belong right after the break: then they are guaranteed to land on the new page.

  • ::pagebreak (indented) or - ::pagebreak (in a list) is text: directive-misplaced.
  • ::page-break is not a directive: directive-unknown.
  • ::pagebreak{now}: attributes are ignored with directive-attr-unknown.