Skip to content

Frontmatter Reference

Sebastian Skov Nielsen edited this page Aug 1, 2026 · 1 revision

Frontmatter Reference

Frontmatter is YAML stored in _frontmatter.md by default:

---
title: Example Report
author:
  - Alex Morgan
date: 2026-08-01
toc: true
---

The document must begin with --- and contain a closing ---. These keys may instead be placed under metadata in .leafmark/config.json. Frontmatter wins when both define a key.

Document identity

Key Type Default Description
title string empty Document title.
subtitle string empty Secondary title.
author string/list empty One or more authors; structured entries are supported.
authors string/list empty Alias for author; author wins.
date string empty Title date and default left footer.
date-format string none LDML-style display pattern.
lang string en for date formatting Pandoc language and date locale.
keywords string/list empty Pandoc document keywords.
abstract string empty Abstract; YAML block strings are supported.
styles string[] empty CSS files for HTML output and rendered HTML blocks.

Authors and ORCID

A string or flat list creates one author per value:

author:
  - Alex Morgan
  - Sam Lee

A nested list creates multiple Markdown-capable lines for each author:

author:
  - - "**Alex Morgan**"
    - Department of Examples
    - alex@example.com
    - orcid: 0000-0002-1825-0097
  - - Sam Lee
    - "orcid: https://orcid.org/0009-0004-1352-0651"

ORCID may be a labeled string, URL, or supported orcid object. PDF and HTML author rendering adds the appropriate ORCID presentation.

Layout and navigation

Key Type Default Description
title-page boolean true Show PDF title block and HTML title header.
toc boolean false Generate a table of contents.
toc-depth integer 3 Deepest heading in the TOC.
toc-own-page boolean false Put the PDF TOC on its own page.
toc-title string Table of Contents TOC heading.
number-sections boolean false Number headings.
hyphens boolean true Allow inside-word hyphenation in PDF and HTML.

PDF headers and footers

Key Type Default
header-left string empty
header-center string empty
header-right string empty
footer-left string/null document date or current LaTeX date
footer-center string empty
footer-right string/null page number

Set a footer to "" or null to hide it. Values are treated as plain text and escaped for LaTeX.

References, cover, and templates

Key Type Default Description
bibliography string/list/false sources.bib when present One or more bibliography paths; false or [] disables citations.
references-title string References Generated bibliography heading.
coverpage string/false disabled Existing PDF prepended with pdfunite.
latex-template string/false configured/default template Frontmatter override for the PDF template.

Relative paths resolve from the active project. Use --no-merge-cover to skip cover merging for one build.

Pandoc template variables

Leafmark forwards unknown metadata to Pandoc and custom themes. Bundled templates recognize:

Key Example
documentclass article
classoption [oneside, openany]
papersize a4 or letter
fontsize 10pt, 11pt, 12pt
geometry margin=2.5cm or a list
linestretch 1.15
toccolor blue
thanks acknowledgement text
include-before string/list inserted before body
include-after string/list inserted after body

Date formatting

date: 2026-02-16
date-format: d. MMMM yyyy
lang: da

Common tokens include dd for day, MM/mm for month number, MMM/MMMM for localized month name, yy for short year, and yyyy/YYYY for full year. Moment-style DD is accepted.

Full example

---
title: Example Report
subtitle: A complete metadata example
author:
  - - "**Alex Morgan**"
    - Department of Examples
    - orcid: 0000-0002-1825-0097
date: 2026-08-01
date-format: d. MMMM yyyy
lang: en
keywords: [documentation, markdown]
abstract: |
  A short summary of the document.
title-page: true
toc: true
toc-depth: 3
toc-own-page: true
toc-title: Contents
number-sections: true
hyphens: true
header-left: Example Report
footer-center: Confidential
bibliography: sources.bib
references-title: Sources
styles:
  - styles/components.css
---

Warning

header-includes is reserved because Leafmark generates its own PDF preamble. Use a theme include, fonts.latexInclude, or a Pandoc plugin instead.

Clone this wiki locally