Guide

Page breaks in Markdown - H1 starts a new page, the rest is automatic

The renderer makes 95% of the page-break decisions for you. The remaining 5%: H1 always starts a new page, you can force a break with a directive, and the orphan rules keep headings tied to their content.

·3 min read
Open the converter

The rules in one paragraph

Every H1 starts a new page. Every H2 and H3 stays with its first body block - you never see a heading orphaned at the bottom of a page. Tables under thirty rows stay on one page; longer tables split with the header repeated. Code blocks under fourteen lines stay on one page. The line <!-- pagebreak --> forces a break anywhere you put it.

What the converter does automatically

  • H1 starts a new page. Every H1 lands at the top of a fresh page. Structure your document with H1s for sections that should open fresh and you control pagination by structure alone.
  • Orphan guard for H2 / H3. A heading near the bottom of a page gets pushed forward if there is not at least four lines of body room below it.
  • Section clustering. A heading plus its first body block are kept together.
  • Table splitting. Tables over ~30 rows split, with the header row repeated on the next page.
  • Code-block splitting. Code blocks of 14 lines or fewer stay on one page.

Forcing a break

Drop <!-- pagebreak --> on its own line wherever you need a hard break. It is the one HTML-comment directive the converter respects. Useful when a structural H1 isn't right but you still want a clean page split - e.g. between an appendix's first and second tables.

For most documents, structure beats directive. Lead a major section with an H1, let H2 / H3 cluster within it, and you rarely need an explicit break.

What about \\pagebreak and other LaTeX-isms?

We do not parse LaTeX. The <!-- pagebreak --> directive plus structural H1s cover what most documents need. For LaTeX-level control (page floats, widow/orphan tuning), Pandoc plus a TeX engine is still the right tool - see the Pandoc-alternative comparison.

Related