# How to control page breaks in Markdown

> Markdown has no page break because it has no pages. The three methods that work, what each one costs you, and the breaks you should not insert by hand.

Canonical: https://buk.press/blog/markdown-page-breaks

21 August 2026 · 4 min read

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:

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

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:

```
<code>\newpage</code>
```

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.

```
<code>The chapter ends here.

---

# The next one starts on a fresh page</code>
```

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:

```
<code>She closed the door.

----

Morning came without asking.</code>
```

The practical difference from the other two methods is that the break appears in the preview immediately, as an actual page ending, rather than being a promise the export may or may not keep.

## Which to use

| Your setup | Use | Portable? |
|---|---|---|
| Printing from a browser | `<div style="page-break-after: always">` | Only to browsers |
| Pandoc → LaTeX → PDF | `\newpage` | No |
| Pandoc → several formats | A conditional raw block | With effort |
| A renderer with its own marker | That marker | Yes, it stays plain text |
| Publishing to the web only | None, as there are no pages | n/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](https://buk.press/sample-book) has chapter breaks, a table crossing a page and dividers between scenes. Or read on for [why tables lose their headers](https://buk.press/blog/markdown-tables-pdf) specifically, which is the version of this problem people hit most.

**About this article.** Written by the team that builds bukpress, which turns Markdown into print-ready PDF and EPUB books. Spotted something wrong or out of date? Write to [support@buk.press](mailto:support@buk.press).

## Read next

How-to 24 August 2026 · 4 min read

## [Markdown tables that survive the page break](https://buk.press/blog/markdown-tables-pdf)

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](https://buk.press/blog/markdown-tables-pdf)

Guides 21 August 2026 · 8 min read

## [Markdown to PDF: 5 ways to convert an MD file](https://buk.press/blog/markdown-to-pdf-guide)

To convert Markdown to PDF, open the .md file in a tool that renders it and export: print to PDF from a browser preview, use a VS Code extension, paste it into an online converter, run Pandoc from the command line, or use a hosted typesetting tool. The quick routes are fine for a draft; for a document someone will read, sell or print, pick the route that gives you real page breaks, embedded fonts and margins you chose.

[Read it](https://buk.press/blog/markdown-to-pdf-guide)

Tools 30 August 2026 · 5 min read

## [Pandoc Markdown to PDF: the commands, and where it stops](https://buk.press/blog/pandoc-for-books)

To convert Markdown to PDF with Pandoc, install Pandoc and a PDF engine (a LaTeX distribution such as TeX Live or MiKTeX, or an alternative like Typst or WeasyPrint), then run pandoc input.md -o output.pdf. Add --pdf-engine=xelatex to use your own fonts, -V geometry:margin=2.5cm for margins and --toc for a contents page. Pandoc is the best tool for documents with citations, cross-references or mathematics, and for books built by a script; it stops being pragmatic when the requirements are visual, because every visual change means LaTeX or a template.

[Read it](https://buk.press/blog/pandoc-for-books)

## 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, ever.

[Get Lifetime, $27 once](https://app.buk.press/signup)
