Skip to content

Book metadata

pandoc.yaml holds everything about how your book looks and what metadata it carries. This page is the complete key reference, grouped by purpose. The file ships commented — a line per key, grouped, each group linking the page that owns it. What the project is called and how it builds is project.conf.

Where a key below names a default, it is the value pandoc.yaml ships. An empty key takes the engine's fallback instead, which for some keys is a different value; toc, numbersections and colorlinks reject an empty value outright. Many keys are explained in depth in their own guide; this page links out rather than repeating them.

Identity

Key Notes
title The book title (cover and metadata).
subtitle Optional subtitle.
author Author or organization; comma-separate multiple.
date auto (the default) uses the build date; also disabled or literal text.
lang BCP-47 language code; sets hyphenation and the auto-generated labels — the TOC title ("Contents"), the "Chapter" prefix, and the like. Defaults to en-US.
keywords A list of keywords for the document metadata.

title and author are required for every target.

Summary fields

Your target requires one of these (see Targets); Keystone fills the others in from it, abstract to description to subject, so setting the one your target asks for populates every slot:

Key Notes
description Required for book and scrbook; the short blurb. Becomes dc:description in EPUB, DOCX and ODT.
abstract Required for article, report and their KOMA counterparts. Renders as an abstract block in the PDF, and fills description when that is blank.
subject The subject field in every format — PDF /Subject, and dc:subject in EPUB, DOCX and ODT. Filled from description when blank, so set it only when the two should differ.

Structure

Key Notes
target The document class. Defaults to book. See Targets.
toc Generate a table of contents. Defaults to true. EPUB keeps its reader navigation regardless — see Output formats.
toc-depth Heading levels shown in the TOC (# = level 1); the same depth in every format. A whole number of 1 or greater. Defaults to 3.
numbersections Number headings; exempt one with {.unnumbered}. Defaults to true. No effect in ODT — see Output formats.
secnumdepth Deepest heading level that is numbered (# = level 1); deeper headings are unnumbered, identically in every format. A whole number of 1 or greater; empty (the default) numbers every level.

See Manuscript & structure for headings and numbering.

Body text

Key Notes
fontfamily Document body font; any registry key. Defaults to libertine. See Typography.
monofont Code/monospace font; any registry key. Empty (the default) falls back to latin-modern-mono. See The code font.
fontsize PDF base size; the allowed set depends on the target. Defaults to 11pt, and empty falls back to it. See Base font size.
linestretch Line-spacing multiplier (PDF); empty (the default) or 1.0 is single-spaced, 1.15 looser, 2.0 double. See Typography.
justify-control auto (the default; follows the target) or disabled (ragged-right).
indent-control auto (the default; follows the target) or disabled (no first-line indent).

auto follows the target's convention — justified, first-line-indented body for book; block paragraphs for article/report.

Key Notes
colorlinks Color link text instead of boxing it; gates the colors below. Defaults to false.
linkcolor Internal links and cross-references.
urlcolor External URLs.
citecolor Citations.
toccolor Table-of-contents entries.

Each color is a quoted #RRGGBB hex value. See Typography.

Notes & citations

Key Notes
note-placement footnotes or endnotes (PDF). Empty (the default), the target chooses.
bibliography A .bib/CSL-JSON file (or list) in manuscript/; enables citations.
csl A shipped style name or a .csl file in manuscript/. Empty (the default) falls back to chicago-author-date.
link-citations Hyperlink citations to the bibliography. Defaults to true.

nocite is also supported for including uncited entries. See Notes & citations.

Running headers & footers (PDF)

Key Notes
header-text, footer-text Center-slot running content on body pages.
header-text-recto / -verso Per-parity overrides (two-sided targets).
footer-text-recto / -verso Per-parity footer overrides.
footer-text-opening Footer on opening pages. Empty (the default) renders {page}; disabled leaves them bare.
footer-text-opening-column Empty (the default) or center centers the line; auto follows the body folio's column.
page-number-position <row>:<col> placement of the page number on body pages. Empty (the default), the target chooses: footer:outer on a two-sided document, footer:center on a one-sided one.
header-rule enabled draws a rule under the header. Defaults to disabled.
marks Author-declared running-header mark channels.

Fully covered in Running headers & footers.

Page layout (PDF)

Key Notes
papersize A page size by name, written without the paper suffix — a4, not a4paper. Common values: letter (8.5×11in), a4 (210×297mm), a5 (148×210mm), b5 (176×250mm); the full list is below. A name outside it stops the build. Empty falls back to letter, unless geometry sizes the page.
geometry How the page is laid out. auto (the shipped value) sizes the text block to the page and follows the target's sidedness; any LaTeX geometry options replace it. Empty falls back to auto.
classoption A list of document-class options; common ones are oneside, twoside, twocolumn, landscape. A page size or base font size here stops the build — those belong to papersize and fontsize. landscape needs geometry: auto; with geometry of your own it goes among those options instead.
draft Watermark text. Empty (the default) or disabled draws none; enabled draws "DRAFT"; any other value is used as written.
draft-scale Watermark size multiplier, where 1.0 fits about five characters across the diagonal. A positive number; empty (the default) shrinks longer text to fit.

geometry is where LaTeX keeps four separate jobs: the size of the page, the margins around the text, the gutter a binding takes, and which way the page turns. auto settles the margins and, with them, orientation; it leaves the size to papersize and reserves nothing for the gutter. Options of your own replace auto — the sections below cover each job in turn, because which of them a value takes over is not all-or-nothing.

Page sizes

papersize names one of:

Series Names
ISO A a0 a1 a2 a3 a4 a5 a6
ISO B b0 b1 b2 b3 b4 b5 b6
ISO C c0 c1 c2 c3 c4 c5 c6
North American letter legal executive ansia ansib ansic ansid ansie

Every name works on every target. For a trim size with no name — most print-on-demand formats — give the dimensions to geometry and leave papersize empty:

papersize:
geometry: paperwidth=6in,paperheight=9in,margin=0.75in

geometry can also name a size itself — the a5paper spellings, and screen, a fixed 225×180mm page for reading on a display rather than printing. Those size the page as much as the dimensions above do.

One key sizes the page

Leave papersize empty whenever geometry sizes the page, whichever way it does — setting it in both stops the build, since only one of the two answers can reach the page. The shipped pandoc.yaml carries papersize: letter, so moving to a custom trim means clearing it.

A small trim wants a smaller base size with it: at 11pt an A6 page cannot reach a comfortable line length at any margin — see Base font size.

Margins

auto sizes the text block to the page. On a two-sided target it also splits the side margins unevenly, setting the inner margin — the one at the spine — narrower than the outer, following the convention that the two inner margins of an open spread meet and read as a single band.

Options of your own replace that with whatever they say:

geometry: inner=30mm, outer=20mm, top=25mm, bottom=25mm

classoption: twoside/oneside flips a target's recto/verso behavior — and with it which side is inner — without changing the document class. See Targets.

The gutter

A perfect-bound book curves into the spine, and part of the inner margin turns away from the reader with it — more of it the thicker the book. Text set to the convention above will sit in that curve. The extra inner margin that pulls the text clear is the gutter.

auto reserves nothing for binding

Keystone does not know whether a file will be read on screen, saddle-stitched, or perfect-bound, and the allowance a bound book needs depends on that choice and on its page count. Binding is the author's decision, so auto settles typesetting and stops there.

So a bound book wants its inner margin widened, the opposite of what the convention gives. Any options of your own replace auto rather than adding to it, and auto alongside them stops the build. Replacing it need not mean writing four margins, though: bindingoffset reserves the gutter and leaves the proportions alone:

geometry: bindingoffset=10mm

The size still comes from papersize: a geometry speaking only about margins does not replace it.

Print-on-demand platforms publish a minimum inner margin per page count — match theirs, either through that offset or by setting the margins directly:

geometry: inner=30mm, outer=20mm, top=25mm, bottom=25mm

The two combine when a platform specifies both:

geometry: inner=20mm, outer=20mm, bindingoffset=10mm

Orientation

Orientation follows whoever owns the page. Under auto that is Keystone, so classoption: landscape turns it:

papersize: a5
geometry: auto
classoption: [landscape]

Give geometry options of your own and the page becomes yours, orientation included — landscape goes among them, and a classoption: landscape alongside stops the build rather than being quietly dropped:

papersize: a5
geometry: inner=30mm, outer=20mm, landscape

The build stops because LaTeX honors a class option when the page is named and ignores it when the page is given in dimensions. Writing it in geometry holds either way, so that is where it goes once the page is yours.

Code & output metadata

Key Notes
code-theme Syntax-highlighting theme. Defaults to tango. See Code blocks.
xmp-metadata auto (the default) embeds an XMP packet alongside the PDF's Info dictionary. disabled omits the packet — roughly halving the typesetting time, at the cost of keywords surviving only in the legacy Info dictionary, where many readers and indexers do not look.

EPUB

Key Notes
cover-image Path to the cover image (EPUB only), e.g. assets/cover.jpg.

Reserved keys

Anything starting with keystone- belongs to the target that declares it, so no key you set carries that prefix. documentclass, css, and header-includes are standard Pandoc keys the targets own as well — all of them carry the build's core wiring. Setting one in pandoc.yaml stops the build with an error naming the key (see Overriding a reserved key). Choose the layout with target (see Targets).