MDPress

Contents, cover, numbers

Markdown to PDF with table of contents, cover page and page numbers

Long documents need a front door. MDPress builds a contents page from your headings, works out the real page number for each one, and puts a cover page in front with your title, author and date. Page numbers run in the footer. You write Markdown and switch on what you need.

Open the converter

Add a contents page and cover in three steps

  1. 01

    Structure the document with headings

    Paste your Markdown or upload the file. Use one # heading for the title, ## for sections and ### for subsections. Headings down to level three are listed on the contents page.

  2. 02

    Switch on Contents and Cover

    Open the Contents tool and add a contents page. Open the Cover tool and add a cover page, then type a title, subtitle, author and date, or let front matter fill them in.

  3. 03

    Check the numbers and download

    The preview shows the cover, the contents page and the footer numbering as they will print. When the layout looks right, download the PDF in A4, A5 or US Letter.

A report with front matter and nested headings

This report sets its cover details in front matter and uses two levels of section headings.

---
title: Annual energy review
author: Dana Whitfield
date: 3 March 2026
---

# Annual energy review

## Summary
Usage fell 8 percent against last year.

## Consumption
### Electricity
Office demand dropped after the lighting refit.
### Gas
Heating use stayed flat.

\newpage

## Recommendations
### Next steps
Replace the two oldest boilers.

Annual energy review

Summary

Usage fell 8 percent against last year.

Consumption

Electricity

Office demand dropped after the lighting refit.

Gas

Heating use stayed flat.

Recommendations

Next steps

Replace the two oldest boilers.

Why build the front pages here

Page numbers that are correct

The PDF is laid out first, then each heading is looked up to find the page it landed on. The contents page shows those real numbers, so nothing drifts when you add a section.

A cover from front matter

Put title, subtitle, author and date in a YAML block at the top of the file and the cover fills itself in. Anything you type in the Cover tool takes priority over the file.

Links and footers included

Every entry on the contents page links to its heading inside the PDF. The footer carries the page number and the total, and you can turn numbering off with one switch.

Tips for front matter and page breaks

  • Front matter reads these keys: title, subtitle, author, date, subject, and keywords or tags. Other keys are ignored, and the block is never printed in the body.
  • Start a chapter on a fresh page by putting \newpage on a line of its own. The contents page updates its numbers to match.
  • Headings at level four and deeper still appear in the document but are left off the contents page. Lines that look like headings inside code blocks are skipped too.

Table of contents and cover page questions

How do I add a table of contents to a Markdown PDF?
Open the Contents tool in the converter and switch on the contents page. MDPress lists your level one to three headings on their own page at the front and adds the page number of each. You do not write the list yourself.
Can I add a cover page without editing my Markdown?
Yes. The Cover tool has fields for the title, subtitle, author and date, and a Today button for the date. If you leave the title empty, the first heading in your document is used.
Where do the page numbers appear?
In the page footer, shown as the current page out of the total. The Page numbers switch in the page settings turns them off. The contents page has its own switch for showing numbers next to the headings.

Build a PDF with a cover and contents

Paste your report, switch on Cover and Contents, and check the page numbers in the preview.

Open the converter