Headers and footers
::header[Centre text]::header[Left|Right]::header[Left|Centre|Right]::footer[|Page {page} of {pages}|]::header[]A definition applies from the page that contains it to every later page, until the next definition of the same kind. Before the first definition, pages have none.
::header[*Field guide*||Chapter 1]::footer[|Page {page} of {pages}|]
# Chapter 1
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.
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::header[*Field guide*||Chapter 2]
# Chapter 2
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.
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.
The label has up to three slots separated by |:
| Label | Left | Centre | Right |
|---|---|---|---|
[Text] | Text | ||
[Left|Right] | Left | Right | |
[A|B|C] | A | B | C |
[|Page {page}|] | Page 1 |
Slots accept inline Markdown — *italic*, **bold**, `code`, ~~struck~~. Links and images show only their text. Write \| for a literal bar and \] for a bracket. The Running header… command builds the label from three fields for you.
Placeholders
Section titled “Placeholders”{page}— the displayed number of the page.{pages}— the displayed number of the last page. With::pagenumber{start=1}after a cover and a contents page, a five-page body reads Page 1 of 5.{{and}}write literal braces.
Clearing
Section titled “Clearing”::header[] or ::footer[] with an empty label removes it from that page on.
If a page contains several definitions of the same kind, the last one wins for that page.
Common mistakes
Section titled “Common mistakes”::header[A|B|C|D]— at most three slots:directive-attr-invalid.{total}is not a placeholder:placeholder-unknown.- Headers live in the page margin. If your top margin is very small, the header is clipped; increase the margin in the profile.