How to control page breaks in Markdown

Markdown has no page break because it describes structure, not pages — so every method is really an instruction to whatever renders it. The three that work are a raw HTML div with a CSS page-break rule, a LaTeX \newpage command through Pandoc, or a renderer that assigns a meaning to a plain-text marker.

This is one of the most-searched Markdown questions, and almost every answer online gives a snippet without saying why the format needs one. The why matters, because it tells you which snippet will work in your situation.

Why there is no syntax for it

Markdown was designed to be a readable way to write for the web. A web page is a single continuous scroll with no fixed height, so a page break has nothing to refer to. The format has no syntax for it in the same way it has no syntax for margins: those are properties of paper, and Markdown was never about paper.

The consequence is that a page break can only ever be an instruction to the thing doing the rendering. So the question is not "what is the Markdown for a page break" but "what does my renderer understand".

Method 1: raw HTML with a CSS rule

Most Markdown processors pass raw HTML through untouched. If your output goes through a browser — printing, or a headless-Chrome exporter — you can insert an empty element carrying a print rule:

<div style="page-break-after: always;"></div>

The modern property is break-after: page; page-break-after: always is the legacy alias, which browsers are required to treat as a synonym for it. Write the modern one — MDN recommends it and support has been universal for years. Keep the old name in mind only if you are feeding an unmaintained converter such as an old wkhtmltopdf build.

Caveats worth knowing before you scatter these through a manuscript. The rule only applies in a paged context, so it does nothing in the on-screen preview and you will not see the effect until you export. Some processors strip raw HTML by default for safety, and it will silently vanish. And your plain-text file now has HTML in it, which is a small betrayal of the reason you chose Markdown.

Method 2: \newpage through Pandoc

If you are producing PDFs through Pandoc and a LaTeX engine, the native instruction is a raw LaTeX block:

\newpage

This is the most reliable of the three for that toolchain, because it speaks to the typesetter in its own language. \clearpage is its stronger sibling — it also flushes any pending floating figures before breaking, which is what you want if an image has drifted somewhere unhelpful.

The cost is portability. That line is LaTeX, so it is meaningless to any other renderer, and the same file exported to HTML or EPUB will print the command as literal text unless you wrap it in a conditional block. A manuscript peppered with \newpage is a manuscript committed to one output format.

Method 3: a marker the renderer understands

The third approach is to keep the file plain and let the renderer assign meaning to something that is already valid Markdown. This is what bukpress does: a line of three dashes is a hard page break.

The chapter ends here.

---

# The next one starts on a fresh page

In standard Markdown --- is a horizontal rule, which is close to meaningless in a book — a printed line across the page is rarely what anyone wanted. Reassigning it to "break here" spends a piece of syntax nobody uses on the thing everybody needs, and your file stays readable in any editor.

Because a rule between sections is *occasionally* what you want, four dashes prints the ornamental divider instead:

She closed the door.

----

Morning came without asking.

Which to use

Your setupUsePortable?
Printing from a browser<div style="page-break-after: always">Only to browsers
Pandoc → LaTeX → PDF\newpageNo
Pandoc → several formatsA conditional raw blockWith effort
A renderer with its own markerThat markerYes — it stays plain text
Publishing to the web onlyNone — there are no pagesn/a

The breaks you should not be inserting by hand

Worth saying, because it is the more common problem. Most bad page breaks are not missing breaks — they are the renderer breaking in a place no typesetter would, and the fix is a rule rather than a manual break.

  • A heading alone at the foot of a page. Its section starts overleaf and the heading is orphaned from it. The fix is a rule that keeps a heading with the block after it, not a hand-placed break.
  • One line of a paragraph stranded at the top or bottom of a page — a widow or an orphan. Again a rule, applied everywhere, not a break you insert on page 34 and have to move when page 12 changes.
  • A table that loses its header row when it crosses the fold, leaving columns of unlabelled numbers. The fix is repeating the header, which is a property of the table, not a break.

The reason this distinction matters: hand-placed breaks are correct only for the exact document you have right now. Add a paragraph on page two and every manual break after it is in the wrong place, and you will not notice until someone else opens the file. Rules survive editing. Manual breaks do not.

So the honest advice is to insert breaks only where they are semantic — a chapter starts on a new page because chapters do — and to fix everything else with rules that apply to the whole document.

If you want to see what that looks like in a finished file, the sample book has chapter breaks, a table crossing a page and dividers between scenes. Or read on for why tables lose their headers specifically, which is the version of this problem people hit most.

Read next

How-to · 4 min read

Markdown tables that survive the page break

A table that crosses a page loses its header because most Markdown-to-PDF pipelines emit a plain HTML table with no thead, and repeating a header row requires the renderer to know which row is the header. Fix the markup first, then the renderer.

Read it
Guides · 5 min read

Five ways to convert Markdown to PDF, and what each one costs you

There are five practical routes from a Markdown file to a PDF: printing from a browser or editor preview, a VS Code extension, an online converter, Pandoc with a LaTeX engine, or a hosted typesetting tool. They differ almost entirely in how much control you get over the page — and the page is the whole problem.

Read it
Tools · 4 min read

Pandoc for books: what it is superb at, and where it stops

Pandoc is the best tool available for documents with citations, cross-references or mathematics, and for any book whose production is automated by a build. It stops being the pragmatic choice when your requirements are visual rather than structural, because every visual change is made by writing LaTeX or a template.

Read it

Write it in Markdown. Ship a book.

bukpress turns the file you are already writing into a typeset PDF and EPUB — your type, your covers, no watermark on any plan.

Start free — no card required