title
, author
, date
allow identification of basic aspects of the document. Included in PDF metadata through LaTeX and ConTeXt. These can be set through a pandoc title block, which allows for multiple authors, or through a YAML metadata block:
---
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.
subtitle
abstract
abstract-title
lang
,
but can be manually overridden.
keywords
author
, above
subject
description
Comments
metadata.
category
Additionally, 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.
lang
identifies the main language of the document using IETF language tags
(following the BCP 47
standard), such as en
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}
dir
the base script direction, either rtl
(right-to-left) or
ltr
(left-to-right).
For bidirectional documents, native pandoc span
s and
div
s 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-css
styles.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
.
mainfont
font-family
property on the html
element.
fontsize
font-size
, which you’d usually set to
e.g. 20px
, but it also accepts pt
(12pt = 16px
in most browsers).
fontcolor
color
property on the html
element.
linkcolor
color
property on all links.
monofont
font-family
property on code
elements.
monobackgroundcolor
background-color
property on code
elements and adds extra padding.
linestretch
line-height
property on the html
element, which is preferred to be unitless.
maxwidth
max-width
property (default is 32em).
backgroundcolor
background-color
property on the
html
element.
margin-left
, margin-right
,
margin-top
, margin-bottom
padding
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
-M classoption=fleqn
.
These affect HTML output when producing slide shows with pandoc.
institute
revealjs-url
https://unpkg.com/reveal.js@^4/
)
s5-url
s5/default
)
slidy-url
https://www.w3.org/Talks/Tools/Slidy2
)
slideous-url
slideous
)
title-slide-attributes
All 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
.
aspectratio
43
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{}
institute
logo
navigation
empty
for no
navigation symbols; other valid values are frame
,
vertical
, and horizontal
)
section-titles
theme
, colortheme
, fonttheme
,
innertheme
, outertheme
themeoptions
titlegraphic
These variables control the visual aspects of a slide show that are not easily controlled via templates.
monofont
Pandoc uses these variables when creating a PDF with a LaTeX engine.
block-headings
make \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}
...
classoption
option for document class, e.g. oneside
; repeat for
multiple options:
---
classoption:
- twocolumn
- landscape
...
documentclass
article
, book
, and report
; the KOMA-Script equivalents,
scrartcl
, scrbook
, and scrreprt
,
which default to smaller margins; or memoir
geometry
option for geometry
package,
e.g. margin=1in
; repeat for multiple options:
---
geometry:
- top=30mm
- left=20mm
- heightrounded
...
hyperrefoptions
option for hyperref
package,
e.g. linktoc=all
; repeat for multiple options:
---
hyperrefoptions:
- linktoc=all
- pdfwindowui
- pdfpagemode=FullScreen
...
indent
linestretch
setspace
package,
e.g. 1.25
, 1.5
margin-left
, margin-right
,
margin-top
, margin-bottom
geometry
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)
papersize
letter
, a4
secnumdepth
--number-sections
option
or numbersections
variable)
beamerarticle
fontenc
fontenc
package (with pdflatex
); default is T1
(see LaTeX font encodings guide)
fontfamily
pdflatex
: TeX Live includes many options,
documented in the LaTeX Font
Catalogue. The default is Latin
Modern.
fontfamilyoptions
options for package used as fontfamily
; 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
...
fontsize
documentclass
to one of the
KOMA-Script classes, such
as scrartcl
or scrbook
.
mainfont
, sansfont
, monofont
,
mathfont
, CJKmainfont
xelatex
or
lualatex
: take the name of any system font, using the fontspec
package.
CJKmainfont
uses the xecjk
package.
mainfontoptions
, sansfontoptions
,
monofontoptions
, mathfontoptions
,
CJKoptions
options to use with mainfont
, 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
...
microtypeoptions
colorlinks
linkcolor
, filecolor
, citecolor
,
urlcolor
, or toccolor
are set
boxlinks
colorlinks
is set)
linkcolor
, filecolor
,
citecolor
, urlcolor
,
toccolor
xcolor
, including
the dvipsnames
, svgnames
, and
x11names
lists
links-as-notes
urlstyle
lof
, lot
thanks
toc
--toc/--table-of-contents
)
toc-depth
These variables function when using BibLaTeX for citation rendering.
biblatexoptions
biblio-style
--natbib
and
--biblatex
biblio-title
--natbib
and
--biblatex
bibliography
natbiboptions
Pandoc uses these variables when creating a PDF with ConTeXt.
fontsize
10pt
, 12pt
)
headertext
, footertext
indenting
yes,small,next
(see ConTeXt
Indentation); repeat for multiple options
interlinespace
4ex
(using setupinterlinespace
);
repeat for multiple options
layout
linkcolor
, contrastcolor
red
,
blue
(see ConTeXt Color)
linkstyle
normal
, bold
,
slanted
, boldslanted
, type
,
cap
, small
lof
, lot
mainfont
, sansfont
, monofont
,
mathfont
margin-left
, margin-right
,
margin-top
, margin-bottom
layout
is not used (otherwise
layout
overrides these)
pagenumbering
setuppagenumbering
);
repeat for multiple options
papersize
letter
, A4
,
landscape
(see ConTeXt Paper
Setup); repeat for multiple options
pdfa
1a: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.
pdfaiccprofile
pdfa
, 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.
pdfaintent
pdfa
, 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
)
whitespace
none
, small
(using setupwhitespace
)
includesource
wkhtmltopdf
Pandoc uses these variables when creating a PDF with wkhtmltopdf
. The
--css
option also affects the output.
footer-html
, header-html
margin-left
, margin-right
,
margin-top
, margin-bottom
papersize
adjusting
l
), right (r
), center
(c
), or both (b
) margins
footer
header
hyphenate
true
(the default), hyphenation will be used
section
fontfamily
A
(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.
indent
2m
)
lineheight
12p
)
pointsize
10p
)
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:
body
date-meta
date
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-json
numbersections
-N/--number-sections
was specified
sourcefile
, outputfile
source and destination filenames, as given on the command line.
sourcefile
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$
.
curdir
pandoc-version
toc
--toc/--table-of-contents
was specified
toc-title