title, author, date---
author:
- Aristotle
- Peter Abelard
...
Note that if you just want to set PDF or HTML metadata, without
including a title block in the document itself, you can set the
title-meta, author-meta, and
date-meta variables. (By default these are set
automatically, based on title, author, and
date.) The page title in HTML is set by
pagetitle, which is equal to title by default.
subtitleabstractabstract-titlelang, but can be manually overridden.
keywordsauthor, above
subjectdescriptionComments metadata.
categoryAdditionally, any root-level string metadata, not included in ODT, docx or pptx metadata is added as a custom property. The following YAML metadata block for instance:
---
title: 'This is the title'
subtitle: "This is the subtitle"
author:
- Author One
- Author Two
description: |
This is a long
description.
It consists of two paragraphs
...
will include title, author and
description as standard document properties and
subtitle as a custom property when converting to docx, ODT
or pptx.
langen or en-GB. The Language subtag lookup
tool can look up or verify these tags. This affects most formats, and
controls hyphenation in PDF output when using LaTeX (through babel and polyglossia) or
ConTeXt.
Use native pandoc Divs
and Spans with the lang attribute to switch the
language:
---
lang: en-GB
...
Text in the main document language (British English).
::: {lang=fr-CA}
> Cette citation est écrite en français canadien.
:::
More text in English. ['Zitat auf Deutsch.']{lang=de}
dirrtl (right-to-left) or
ltr (left-to-right).
For bidirectional documents, native pandoc spans and
divs with the dir attribute (value
rtl or ltr) can be used to override the base
direction in some output formats. This may not always be necessary if
the final renderer (e.g. the browser, when generating HTML) supports the
Unicode
Bidirectional Algorithm.
When using LaTeX for bidirectional documents, only the
xelatex engine is fully supported (use
--pdf-engine=xelatex).
document-cssstyles.html partial (have a look with
pandoc --print-default-data-file=templates/styles.html).
Unless you use --css, this variable is set to
true by default. You can disable it with
e.g. pandoc -M document-css=false.
mainfontfont-family property on the html
element.
fontsizefont-size, which you’d usually set to
e.g. 20px, but it also accepts pt (12pt = 16px
in most browsers).
fontcolorcolor property on the html
element.
linkcolorcolor property on all links.
monofontfont-family property on code
elements.
monobackgroundcolorbackground-color property on code
elements and adds extra padding.
linestretchline-height property on the html
element, which is preferred to be unitless.
maxwidthmax-width property (default is 36em).
backgroundcolorbackground-color property on the
html element.
margin-left, margin-right,
margin-top, margin-bottompadding properties on the
body element.
To override or extend some CSS for just one document, include for example:
---
header-includes: |
<style>
blockquote {
font-style: italic;
}
tr.even {
background-color: #f0f0f0;
}
td, th {
padding: 0.5em 2em 0.5em 0.5em;
}
tbody {
border-bottom: none;
}
</style>
---
classoption--katex, you can render display math equations
flush left using YAML metadata
or with -M classoption=fleqn.
These affect HTML output when producing slide shows with pandoc.
instituterevealjs-urlhttps://unpkg.com/reveal.js@^5)
s5-urls5/default)
slidy-urlhttps://www.w3.org/Talks/Tools/Slidy2)
slideous-urlslideous)
title-slide-attributesAll reveal.js configuration
options are available as variables. To turn off boolean flags that
default to true in reveal.js, use 0.
These variables change the appearance of PDF slides using beamer.
aspectratio43 for 4:3 [default], 169
for 16:9, 1610 for 16:10, 149 for 14:9,
141 for 1.41:1, 54 for 5:4, 32
for 3:2)
beameroption\setbeameroption{}
institutelogonavigationempty for no
navigation symbols; other valid values are frame,
vertical, and horizontal)
section-titlestheme, colortheme, fonttheme,
innertheme, outerthemethemeoptions, colorthemeoptions,
fontthemeoptions, innerthemeoptions,
outerthemeoptionstitlegraphictitlegraphicoptionsshorttitle, shortsubtitle,
shortauthor, shortinstitute,
shortdateThese variables control the visual aspects of a slide show that are not easily controlled via templates.
monofontPandoc uses these variables when creating a PDF with a LaTeX engine.
block-headings\paragraph and \subparagraph (fourth- and
fifth-level headings, or fifth- and sixth-level with book classes)
free-standing rather than run-in; requires further formatting to
distinguish from \subsubsection (third- or fourth-level
headings). Instead of using this option, KOMA-Script can adjust
headings more extensively:
---
documentclass: scrartcl
header-includes: |
\RedeclareSectionCommand[
beforeskip=-10pt plus -2pt minus -1pt,
afterskip=1sp plus -1sp minus 1sp,
font=\normalfont\itshape]{paragraph}
\RedeclareSectionCommand[
beforeskip=-10pt plus -2pt minus -1pt,
afterskip=1sp plus -1sp minus 1sp,
font=\normalfont\scshape,
indent=0pt]{subparagraph}
...
classoptiononeside; repeat for
multiple options:
---
classoption:
- twocolumn
- landscape
...
documentclassarticle, book, and report; the KOMA-Script equivalents,
scrartcl, scrbook, and scrreprt,
which default to smaller margins; or memoir
geometrygeometry package,
e.g. margin=1in; repeat for multiple options:
---
geometry:
- top=30mm
- left=20mm
- heightrounded
...
shorthandsbabel. (By
default, pandoc includes shorthands=off when loading
babel, disabling language-specific shorthands.)
hyperrefoptionshyperref package,
e.g. linktoc=all; repeat for multiple options:
---
hyperrefoptions:
- linktoc=all
- pdfwindowui
- pdfpagemode=FullScreen
...
indentlinestretchsetspace package,
e.g. 1.25, 1.5
margin-left, margin-right,
margin-top, margin-bottomgeometry is not used (otherwise
geometry overrides these)
pagestyle\pagestyle{}: the default article class supports
plain (default), empty (no running heads or
page numbers), and headings (section titles in running
heads)
papersizeletter, a4
secnumdepth--number-sections option
or numbersections variable)
beamerarticlepandoc -Vbeamerarticle -t beamer --template default.latex.
handoutcsquotescsquotes package and use \enquote or
\enquote* for quoted text.
csquotesoptionscsquotes package (repeat for multiple
options).
babeloptionsprovide=* if the main language
isn’t a European language written with Latin or Cyrillic script or
Vietnamese. Most users will not need to adjust the default setting.
fontencfontenc
package (with pdflatex); default is T1 (see LaTeX font encodings guide)
fontfamilypdflatex: TeX Live includes many options,
documented in the LaTeX Font
Catalogue. The default is Latin
Modern.
fontfamilyoptionsfontfamily; repeat for multiple
options. For example, to use the Libertine font with proportional
lowercase (old-style) figures through the libertinus
package:
---
fontfamily: libertinus
fontfamilyoptions:
- osf
- p
...
fontsizedocumentclass to one of the
KOMA-Script classes, such
as scrartcl or scrbook.
mainfont, sansfont, monofont,
mathfont, CJKmainfont,
CJKsansfont, CJKmonofontxelatex or
lualatex: take the name of any system font, using the fontspec package.
CJKmainfont uses the xecjk package if
xelatex is used, or the luatexja package
if lualatex is used.
mainfontoptions, sansfontoptions,
monofontoptions, mathfontoptions,
CJKoptions, luatexjapresetoptionsmainfont, sansfont,
monofont, mathfont, CJKmainfont
in xelatex and lualatex. Allow for any choices
available through fontspec; repeat
for multiple options. For example, to use the TeX Gyre
version of Palatino with lowercase figures:
---
mainfont: TeX Gyre Pagella
mainfontoptions:
- Numbers=Lowercase
- Numbers=Proportional
...
mainfontfallback, sansfontfallback,
monofontfallbackmainfont,
sansfont, or monofont respectively. These are
lists. The font name must be followed by a colon and optionally a set of
options, for example:
---
mainfontfallback:
- "FreeSans:"
- "NotoColorEmoji:mode=harf"
...
Font fallbacks currently only work with lualatex.
babelfontschinese) to the font to
be used with the language:
---
babelfonts:
chinese-hant: "Noto Serif CJK TC"
russian: "Noto Serif"
...
microtypeoptionscolorlinkslinkcolor, filecolor, citecolor,
urlcolor, or toccolor are set
boxlinkscolorlinks
is set)
linkcolor, filecolor,
citecolor, urlcolor,
toccolorxcolor, including
the dvipsnames, svgnames, and
x11names lists
links-as-notesurlstylett, rm, sf,
and, the default, same)
lof, lot--lof/--list-of-figures,
--lot/--list-of-tables)
thankstoc--toc/--table-of-contents)
toc-depthThese variables function when using BibLaTeX for citation rendering.
biblatexoptionsbiblio-style--natbib and
--biblatex
biblio-title--natbib and
--biblatex
bibliographynatbiboptionspdf-trailer-id<00112233445566778899aabbccddeeff> <00112233445566778899aabbccddeeff>.
See the section on reproducible
builds.
Pandoc uses these variables when creating a PDF with ConTeXt.
fontsize10pt, 12pt)
headertext, footertextindentingyes,small,next
(see ConTeXt
Indentation); repeat for multiple options
interlinespace4ex (using setupinterlinespace);
repeat for multiple options
layoutlinkcolor, contrastcolorred,
blue (see ConTeXt Color)
linkstylenormal, bold,
slanted, boldslanted, type,
cap, small
lof, lotmainfont, sansfont, monofont,
mathfontmainfontfallback, sansfontfallback,
monofontfallback\definefallbackfamily-compatible font name
syntax. Emoji fonts are unsupported.
margin-left, margin-right,
margin-top, margin-bottomlayout is not used (otherwise
layout overrides these)
pagenumberingsetuppagenumbering);
repeat for multiple options
papersizeletter, A4,
landscape (see ConTeXt
Paper Setup); repeat for multiple options
pdfa1a:2005, 2a. If no type is
specified (i.e. the value is set to True, by e.g.
--metadata=pdfa or pdfa: true in a YAML
metadata block), 1b:2005 will be used as default, for
reasons of backwards compatibility. Using --variable=pdfa
without specified value is not supported. To successfully generate PDF/A
the required ICC color profiles have to be available and the content and
all included files (such as images) have to be standard-conforming. The
ICC profiles and output intent may be specified using the variables
pdfaiccprofile and pdfaintent. See also ConTeXt
PDFA for more details.
pdfaiccprofilepdfa, specifies the ICC
profile to use in the PDF, e.g. default.cmyk. If left
unspecified, sRGB.icc is used as default. May be repeated
to include multiple profiles. Note that the profiles have to be
available on the system. They can be obtained from ConTeXt
ICC Profiles.
pdfaintentpdfa, specifies the output
intent for the colors,
e.g. ISO coated v2 300\letterpercent\space (ECI) If left
unspecified, sRGB IEC61966-2.1 is used as default.
toc--toc/--table-of-contents)
urlstylenormal,
bold, slanted, boldslanted,
type, cap, small
whitespacenone, small
(using setupwhitespace)
includesourcewkhtmltopdfPandoc uses these variables when creating a PDF with wkhtmltopdf. The
--css option also affects the output.
footer-html, header-htmlmargin-left, margin-right,
margin-top, margin-bottompapersizeadjustingl), right (r), center
(c), or both (b) margins
footerheadersectionversionfilenametemplatemarginx, y, top, bottom,
left, right.
papersizea4, us-letter, etc.
mainfontfontsize12pt).
section-numbering1.A.1.
page-numbering1 or
i, or an empty string to omit page numbering.
columnsthanksmathfont, codefontlinestretch1.25, 1.5
linkcolor, filecolor,
citecolorfontfamilyA (Avant Garde), B (Bookman), C
(Helvetica), HN (Helvetica Narrow), P
(Palatino), or T (Times New Roman). This setting does not
affect source code, which is always displayed using monospace Courier.
These built-in fonts are limited in their coverage of characters.
Additional fonts may be installed using the script install-font.sh
provided by Peter Schaffter and documented in detail on his web
site.
indent2m)
lineheight12p)
pointsize10p)
Pandoc sets these variables automatically in response to options or document contents; users can also modify them. These vary depending on the output format, and include the following:
bodydate-metadate variable converted to ISO 8601 YYYY-MM-DD,
included in all HTML based formats (dzslides, epub, html, html4, html5,
revealjs, s5, slideous, slidy). The recognized formats for
date are: mm/dd/yyyy, mm/dd/yy,
yyyy-mm-dd (ISO 8601), dd MM yyyy (e.g. either
02 Apr 2018 or 02 April 2018),
MM dd, yyyy (e.g. Apr. 02, 2018 or
April 02, 2018),yyyy[mm[dd]](e.g.20180402,
201804 or 2018).
header-includes-H/--include-in-header (may have
multiple values)
include-before-B/--include-before-body (may have
multiple values)
include-after-A/--include-after-body (may have
multiple values)
meta-jsonnumbersections-N/--number-sections was specified
sourcefile, outputfilesourcefile can also be a list if input comes from multiple
files, or empty if input is from stdin. You can use the following
snippet in your template to distinguish them:
$if(sourcefile)$
$for(sourcefile)$
$sourcefile$
$endfor$
$else$
(stdin)
$endif$
Similarly, outputfile can be - if output goes
to the terminal.
If you need absolute paths, use e.g. $curdir$/$sourcefile$.
pdf-engine--pdf-engine, or the
default engine for the format if PDF output is requested.
curdirpandoc-versiontoc--toc/--table-of-contents was specified
toc-titletoc-title will be picked up from metadata,
but cannot be set as a variable.