Page numbering
::pagenumber{start=1}::pagenumber{offset=-2}| Attribute | Value | Meaning |
|---|---|---|
start | whole number ≥ 0 | This page becomes start; later pages count up |
offset | whole number, may be negative | This page’s number is shifted by offset; later pages count up |
Exactly one of the two is required.
::header[Annual report||2026]::footer[|Page {page} of {pages}|]
# Annual Report 2026
Prepared for the board.
::pagebreak::hide{header}
::toc{depth=2}
::pagebreak::pagenumber{start=1}
## Summary
MDLeaf lays Markdown out on real pages. Paragraphs flow from page to page, and the page view shows exactly what the PDF will contain.
MDLeaf lays Markdown out on real pages. Paragraphs flow from page to page, and the page view shows exactly what the PDF will contain.
::pagebreak
## Results
MDLeaf lays Markdown out on real pages. Paragraphs flow from page to page, and the page view shows exactly what the PDF will contain.
MDLeaf lays Markdown out on real pages. Paragraphs flow from page to page, and the page view shows exactly what the PDF will contain. Download sample (.mdl)
Open it in MDLeaf with Library → Import .mdl. If MDLeaf is installed, you can also open the file directly.
Typical use
Section titled “Typical use”# Report title::pagebreak::toc::pagebreak::pagenumber{start=1}# Chapter 1The cover and contents pages are numbered 1 and 2; the first chapter starts again at 1.
- The first page is 1. Each page is the previous one plus one, then the page’s
::pagenumberdirectives apply in order. - Numbers can be zero or negative, and are printed as they are. Only Arabic numerals are supported.
{pages}is the displayed number of the last page, so restarts change it. The table of contents shows displayed numbers too.
Common mistakes
Section titled “Common mistakes”::pagenumberalone, or with bothstartandoffset:directive-attr-invalid.::pagenumber{start=i}— only whole numbers.