Header and footer on every page

A header and a footer written once in front matter, in Markdown: bold title, italic department, a reference in code style, a struck-through draft mark, and the page count.

A two-line header on each side and a three-part footer, in bold, italics, code and strikethrough, written once in front matter.

Markdown source

Markdown · 62 lines
---
title: Annual Report 2026
page:
  size: A4
  margin: 24mm 20mm 26mm 24mm
  header:
    left: |
      **{title}**
      *Acme Ltd · Finance Office*
    right: |
      `REF-2026-04`
      ~~Draft~~ **Final**
  footer:
    left: "*Confidential: for the board only*"
    center: Page {page} of {pages}
    right: acme.example
---

# Annual Report 2026

## Summary

Revenue grew **12%** to €48.2 million and the operating margin rose to 16.8%. The board proposes a dividend of €0.42 per share.

| Measure | 2025 | 2026 | Change |
|:--|--:|--:|--:|
| Revenue (€m) | 43.0 | 48.2 | +12.1% |
| Operating profit (€m) | 6.1 | 8.1 | +32.8% |
| Free cash flow (€m) | 4.4 | 5.9 | +34.1% |
| Employees | 412 | 436 | +5.8% |

```mermaid
xychart
    title "Revenue by quarter (€m)"
    x-axis [Q1, Q2, Q3, Q4]
    y-axis "€m" 0 --> 15
    bar [10.9, 11.6, 12.3, 13.4]
    line [10.1, 10.6, 10.9, 11.4]
```

## How this page is set up

The header and the footer are written once, in the front matter, in Markdown:

- The header has **two lines on each side**: the title in bold over the department in italics, and a reference in code style over a struck-through *Draft*.
- The footer has three positions: a note in italics, the page count, and the web address.
- `{title}` repeats the front matter title, so the header and the PDF's document title always match.

Each header and footer is drawn **once** and shown on every page; only the page number is set again on each page, which keeps the file small.

## Outlook

For 2027 the company expects revenue between €51 and €53 million. Two new distribution centers open in the spring, and the move to electric delivery vans continues, with 40% of the fleet converted by December.

## Risks

> [!WARNING]
> Energy prices and the euro exchange rate remain the two largest risks to the 2027 margin.

1. **Energy:** a 10% rise in electricity prices lowers the operating margin by 0.4 points.
2. **Currency:** a 5% stronger euro lowers revenue from exports by €1.1 million.
3. **Supply:** one supplier provides 30% of the packaging; a second supplier is qualified by June.

Rendered pages

PDF · 2 pages · 17 KB
  1. Header & footer, page 1 of 2
  2. Header & footer, page 2 of 2

The sample documents describe invented organizations in several countries. All names and figures are illustrative.

Page setup: paper, margins, headers and footers: every sampleIn the Markdown reference