git.iko.soy/typeable/pandoc
on 2.11.1 help sign in
7403 lines 224 kB history raw
1'\" t
2.\" Automatically generated by Pandoc 2.11.1
3.\"
4.TH "Pandoc User\[cq]s Guide" "" "November 3, 2020" "pandoc 2.11.1" ""
5.hy
6.SH NAME
7pandoc - general markup converter
8.SH SYNOPSIS
9.PP
10\f[C]pandoc\f[R] [\f[I]options\f[R]] [\f[I]input-file\f[R]]\&...
11.SH DESCRIPTION
12.PP
13Pandoc is a Haskell library for converting from one markup format to
14another, and a command-line tool that uses this library.
15.PP
16Pandoc can convert between numerous markup and word processing formats,
17including, but not limited to, various flavors of Markdown, HTML, LaTeX
18and Word docx.
19For the full lists of input and output formats, see the \f[C]--from\f[R]
20and \f[C]--to\f[R] options below.
21Pandoc can also produce PDF output: see creating a PDF, below.
22.PP
23Pandoc\[cq]s enhanced version of Markdown includes syntax for tables,
24definition lists, metadata blocks, footnotes, citations, math, and much
25more.
26See below under Pandoc\[cq]s Markdown.
27.PP
28Pandoc has a modular design: it consists of a set of readers, which
29parse text in a given format and produce a native representation of the
30document (an \f[I]abstract syntax tree\f[R] or AST), and a set of
31writers, which convert this native representation into a target format.
32Thus, adding an input or output format requires only adding a reader or
33writer.
34Users can also run custom pandoc filters to modify the intermediate AST.
35.PP
36Because pandoc\[cq]s intermediate representation of a document is less
37expressive than many of the formats it converts between, one should not
38expect perfect conversions between every format and every other.
39Pandoc attempts to preserve the structural elements of a document, but
40not formatting details such as margin size.
41And some document elements, such as complex tables, may not fit into
42pandoc\[cq]s simple document model.
43While conversions from pandoc\[cq]s Markdown to all formats aspire to be
44perfect, conversions from formats more expressive than pandoc\[cq]s
45Markdown can be expected to be lossy.
46.SS Using pandoc
47.PP
48If no \f[I]input-files\f[R] are specified, input is read from
49\f[I]stdin\f[R].
50Output goes to \f[I]stdout\f[R] by default.
51For output to a file, use the \f[C]-o\f[R] option:
52.IP
53.nf
54\f[C]
55pandoc -o output.html input.txt
56\f[R]
57.fi
58.PP
59By default, pandoc produces a document fragment.
60To produce a standalone document (e.g.\ a valid HTML file including
61\f[C]<head>\f[R] and \f[C]<body>\f[R]), use the \f[C]-s\f[R] or
62\f[C]--standalone\f[R] flag:
63.IP
64.nf
65\f[C]
66pandoc -s -o output.html input.txt
67\f[R]
68.fi
69.PP
70For more information on how standalone documents are produced, see
71Templates below.
72.PP
73If multiple input files are given, \f[C]pandoc\f[R] will concatenate
74them all (with blank lines between them) before parsing.
75(Use \f[C]--file-scope\f[R] to parse files individually.)
76.SS Specifying formats
77.PP
78The format of the input and output can be specified explicitly using
79command-line options.
80The input format can be specified using the \f[C]-f/--from\f[R] option,
81the output format using the \f[C]-t/--to\f[R] option.
82Thus, to convert \f[C]hello.txt\f[R] from Markdown to LaTeX, you could
83type:
84.IP
85.nf
86\f[C]
87pandoc -f markdown -t latex hello.txt
88\f[R]
89.fi
90.PP
91To convert \f[C]hello.html\f[R] from HTML to Markdown:
92.IP
93.nf
94\f[C]
95pandoc -f html -t markdown hello.html
96\f[R]
97.fi
98.PP
99Supported input and output formats are listed below under Options (see
100\f[C]-f\f[R] for input formats and \f[C]-t\f[R] for output formats).
101You can also use \f[C]pandoc --list-input-formats\f[R] and
102\f[C]pandoc --list-output-formats\f[R] to print lists of supported
103formats.
104.PP
105If the input or output format is not specified explicitly,
106\f[C]pandoc\f[R] will attempt to guess it from the extensions of the
107filenames.
108Thus, for example,
109.IP
110.nf
111\f[C]
112pandoc -o hello.tex hello.txt
113\f[R]
114.fi
115.PP
116will convert \f[C]hello.txt\f[R] from Markdown to LaTeX.
117If no output file is specified (so that output goes to
118\f[I]stdout\f[R]), or if the output file\[cq]s extension is unknown, the
119output format will default to HTML.
120If no input file is specified (so that input comes from
121\f[I]stdin\f[R]), or if the input files\[cq] extensions are unknown, the
122input format will be assumed to be Markdown.
123.SS Character encoding
124.PP
125Pandoc uses the UTF-8 character encoding for both input and output.
126If your local character encoding is not UTF-8, you should pipe input and
127output through \f[C]iconv\f[R]:
128.IP
129.nf
130\f[C]
131iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
132\f[R]
133.fi
134.PP
135Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,
136OPML, DocBook, and Texinfo), information about the character encoding is
137included in the document header, which will only be included if you use
138the \f[C]-s/--standalone\f[R] option.
139.SS Creating a PDF
140.PP
141To produce a PDF, specify an output file with a \f[C].pdf\f[R]
142extension:
143.IP
144.nf
145\f[C]
146pandoc test.txt -o test.pdf
147\f[R]
148.fi
149.PP
150By default, pandoc will use LaTeX to create the PDF, which requires that
151a LaTeX engine be installed (see \f[C]--pdf-engine\f[R] below).
152Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an
153intermediate format.
154To do this, specify an output file with a \f[C].pdf\f[R] extension, as
155before, but add the \f[C]--pdf-engine\f[R] option or
156\f[C]-t context\f[R], \f[C]-t html\f[R], or \f[C]-t ms\f[R] to the
157command line.
158The tool used to generate the PDF from the intermediate format may be
159specified using \f[C]--pdf-engine\f[R].
160.PP
161You can control the PDF style using variables, depending on the
162intermediate format used: see variables for LaTeX, variables for
163ConTeXt, variables for \f[C]wkhtmltopdf\f[R], variables for ms.
164When HTML is used as an intermediate format, the output can be styled
165using \f[C]--css\f[R].
166.PP
167To debug the PDF creation, it can be useful to look at the intermediate
168representation: instead of \f[C]-o test.pdf\f[R], use for example
169\f[C]-s -o test.tex\f[R] to output the generated LaTeX.
170You can then test it with \f[C]pdflatex test.tex\f[R].
171.PP
172When using LaTeX, the following packages need to be available (they are
173included with all recent versions of TeX Live): \f[C]amsfonts\f[R],
174\f[C]amsmath\f[R], \f[C]lm\f[R], \f[C]unicode-math\f[R],
175\f[C]ifxetex\f[R], \f[C]ifluatex\f[R], \f[C]listings\f[R] (if the
176\f[C]--listings\f[R] option is used), \f[C]fancyvrb\f[R],
177\f[C]longtable\f[R], \f[C]booktabs\f[R], \f[C]graphicx\f[R] (if the
178document contains images), \f[C]hyperref\f[R], \f[C]xcolor\f[R],
179\f[C]ulem\f[R], \f[C]geometry\f[R] (with the \f[C]geometry\f[R] variable
180set), \f[C]setspace\f[R] (with \f[C]linestretch\f[R]), and
181\f[C]babel\f[R] (with \f[C]lang\f[R]).
182The use of \f[C]xelatex\f[R] or \f[C]lualatex\f[R] as the PDF engine
183requires \f[C]fontspec\f[R].
184\f[C]lualatex\f[R] uses \f[C]selnolig\f[R].
185\f[C]xelatex\f[R] uses \f[C]polyglossia\f[R] (with \f[C]lang\f[R]),
186\f[C]xecjk\f[R], and \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable
187set).
188If the \f[C]mathspec\f[R] variable is set, \f[C]xelatex\f[R] will use
189\f[C]mathspec\f[R] instead of \f[C]unicode-math\f[R].
190The \f[C]upquote\f[R] and \f[C]microtype\f[R] packages are used if
191available, and \f[C]csquotes\f[R] will be used for typography if the
192\f[C]csquotes\f[R] variable or metadata field is set to a true value.
193The \f[C]natbib\f[R], \f[C]biblatex\f[R], \f[C]bibtex\f[R], and
194\f[C]biber\f[R] packages can optionally be used for citation rendering.
195The following packages will be used to improve output quality if
196present, but pandoc does not require them to be present:
197\f[C]upquote\f[R] (for straight quotes in verbatim environments),
198\f[C]microtype\f[R] (for better spacing adjustments), \f[C]parskip\f[R]
199(for better inter-paragraph spaces), \f[C]xurl\f[R] (for better line
200breaks in URLs), \f[C]bookmark\f[R] (for better PDF bookmarks), and
201\f[C]footnotehyper\f[R] or \f[C]footnote\f[R] (to allow footnotes in
202tables).
203.SS Reading from the Web
204.PP
205Instead of an input file, an absolute URI may be given.
206In this case pandoc will fetch the content using HTTP:
207.IP
208.nf
209\f[C]
210pandoc -f html -t markdown https://www.fsf.org
211\f[R]
212.fi
213.PP
214It is possible to supply a custom User-Agent string or other header when
215requesting a document from a URL:
216.IP
217.nf
218\f[C]
219pandoc -f html -t markdown --request-header User-Agent:\[dq]Mozilla/5.0\[dq] \[rs]
220 https://www.fsf.org
221\f[R]
222.fi
223.SH OPTIONS
224.SS General options
225.TP
226\f[B]\f[CB]-f\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-r\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--from=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--read=\f[B]\f[R]\f[I]FORMAT\f[R]
227Specify input format.
228\f[I]FORMAT\f[R] can be:
229.RS
230.IP \[bu] 2
231\f[C]bibtex\f[R] (BibTeX bibliography)
232.IP \[bu] 2
233\f[C]biblatex\f[R] (BibLaTeX bibliography)
234.IP \[bu] 2
235\f[C]commonmark\f[R] (CommonMark Markdown)
236.IP \[bu] 2
237\f[C]commonmark_x\f[R] (CommonMark Markdown with extensions)
238.IP \[bu] 2
239\f[C]creole\f[R] (Creole 1.0)
240.IP \[bu] 2
241\f[C]csljson\f[R] (CSL JSON bibliography)
242.IP \[bu] 2
243\f[C]csv\f[R] (CSV table)
244.IP \[bu] 2
245\f[C]docbook\f[R] (DocBook)
246.IP \[bu] 2
247\f[C]docx\f[R] (Word docx)
248.IP \[bu] 2
249\f[C]dokuwiki\f[R] (DokuWiki markup)
250.IP \[bu] 2
251\f[C]epub\f[R] (EPUB)
252.IP \[bu] 2
253\f[C]fb2\f[R] (FictionBook2 e-book)
254.IP \[bu] 2
255\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
256accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
257if you need extensions not supported in \f[C]gfm\f[R].
258.IP \[bu] 2
259\f[C]haddock\f[R] (Haddock markup)
260.IP \[bu] 2
261\f[C]html\f[R] (HTML)
262.IP \[bu] 2
263\f[C]ipynb\f[R] (Jupyter notebook)
264.IP \[bu] 2
265\f[C]jats\f[R] (JATS XML)
266.IP \[bu] 2
267\f[C]jira\f[R] (Jira/Confluence wiki markup)
268.IP \[bu] 2
269\f[C]json\f[R] (JSON version of native AST)
270.IP \[bu] 2
271\f[C]latex\f[R] (LaTeX)
272.IP \[bu] 2
273\f[C]markdown\f[R] (Pandoc\[cq]s Markdown)
274.IP \[bu] 2
275\f[C]markdown_mmd\f[R] (MultiMarkdown)
276.IP \[bu] 2
277\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
278.IP \[bu] 2
279\f[C]markdown_strict\f[R] (original unextended Markdown)
280.IP \[bu] 2
281\f[C]mediawiki\f[R] (MediaWiki markup)
282.IP \[bu] 2
283\f[C]man\f[R] (roff man)
284.IP \[bu] 2
285\f[C]muse\f[R] (Muse)
286.IP \[bu] 2
287\f[C]native\f[R] (native Haskell)
288.IP \[bu] 2
289\f[C]odt\f[R] (ODT)
290.IP \[bu] 2
291\f[C]opml\f[R] (OPML)
292.IP \[bu] 2
293\f[C]org\f[R] (Emacs Org mode)
294.IP \[bu] 2
295\f[C]rst\f[R] (reStructuredText)
296.IP \[bu] 2
297\f[C]t2t\f[R] (txt2tags)
298.IP \[bu] 2
299\f[C]textile\f[R] (Textile)
300.IP \[bu] 2
301\f[C]tikiwiki\f[R] (TikiWiki markup)
302.IP \[bu] 2
303\f[C]twiki\f[R] (TWiki markup)
304.IP \[bu] 2
305\f[C]vimwiki\f[R] (Vimwiki)
306.PP
307Extensions can be individually enabled or disabled by appending
308\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
309See Extensions below, for a list of extensions and their names.
310See \f[C]--list-input-formats\f[R] and \f[C]--list-extensions\f[R],
311below.
312.RE
313.TP
314\f[B]\f[CB]-t\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-w\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--to=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--write=\f[B]\f[R]\f[I]FORMAT\f[R]
315Specify output format.
316\f[I]FORMAT\f[R] can be:
317.RS
318.IP \[bu] 2
319\f[C]asciidoc\f[R] (AsciiDoc) or \f[C]asciidoctor\f[R] (AsciiDoctor)
320.IP \[bu] 2
321\f[C]beamer\f[R] (LaTeX beamer slide show)
322.IP \[bu] 2
323\f[C]commonmark\f[R] (CommonMark Markdown)
324.IP \[bu] 2
325\f[C]commonmark_x\f[R] (CommonMark Markdown with extensions)
326.IP \[bu] 2
327\f[C]context\f[R] (ConTeXt)
328.IP \[bu] 2
329\f[C]csljson\f[R] (CSL JSON bibliography)
330.IP \[bu] 2
331\f[C]docbook\f[R] or \f[C]docbook4\f[R] (DocBook 4)
332.IP \[bu] 2
333\f[C]docbook5\f[R] (DocBook 5)
334.IP \[bu] 2
335\f[C]docx\f[R] (Word docx)
336.IP \[bu] 2
337\f[C]dokuwiki\f[R] (DokuWiki markup)
338.IP \[bu] 2
339\f[C]epub\f[R] or \f[C]epub3\f[R] (EPUB v3 book)
340.IP \[bu] 2
341\f[C]epub2\f[R] (EPUB v2)
342.IP \[bu] 2
343\f[C]fb2\f[R] (FictionBook2 e-book)
344.IP \[bu] 2
345\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
346accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
347if you need extensions not supported in \f[C]gfm\f[R].
348.IP \[bu] 2
349\f[C]haddock\f[R] (Haddock markup)
350.IP \[bu] 2
351\f[C]html\f[R] or \f[C]html5\f[R] (HTML, i.e.\ HTML5/XHTML polyglot
352markup)
353.IP \[bu] 2
354\f[C]html4\f[R] (XHTML 1.0 Transitional)
355.IP \[bu] 2
356\f[C]icml\f[R] (InDesign ICML)
357.IP \[bu] 2
358\f[C]ipynb\f[R] (Jupyter notebook)
359.IP \[bu] 2
360\f[C]jats_archiving\f[R] (JATS XML, Archiving and Interchange Tag Set)
361.IP \[bu] 2
362\f[C]jats_articleauthoring\f[R] (JATS XML, Article Authoring Tag Set)
363.IP \[bu] 2
364\f[C]jats_publishing\f[R] (JATS XML, Journal Publishing Tag Set)
365.IP \[bu] 2
366\f[C]jats\f[R] (alias for \f[C]jats_archiving\f[R])
367.IP \[bu] 2
368\f[C]jira\f[R] (Jira/Confluence wiki markup)
369.IP \[bu] 2
370\f[C]json\f[R] (JSON version of native AST)
371.IP \[bu] 2
372\f[C]latex\f[R] (LaTeX)
373.IP \[bu] 2
374\f[C]man\f[R] (roff man)
375.IP \[bu] 2
376\f[C]markdown\f[R] (Pandoc\[cq]s Markdown)
377.IP \[bu] 2
378\f[C]markdown_mmd\f[R] (MultiMarkdown)
379.IP \[bu] 2
380\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
381.IP \[bu] 2
382\f[C]markdown_strict\f[R] (original unextended Markdown)
383.IP \[bu] 2
384\f[C]mediawiki\f[R] (MediaWiki markup)
385.IP \[bu] 2
386\f[C]ms\f[R] (roff ms)
387.IP \[bu] 2
388\f[C]muse\f[R] (Muse),
389.IP \[bu] 2
390\f[C]native\f[R] (native Haskell),
391.IP \[bu] 2
392\f[C]odt\f[R] (OpenOffice text document)
393.IP \[bu] 2
394\f[C]opml\f[R] (OPML)
395.IP \[bu] 2
396\f[C]opendocument\f[R] (OpenDocument)
397.IP \[bu] 2
398\f[C]org\f[R] (Emacs Org mode)
399.IP \[bu] 2
400\f[C]pdf\f[R] (PDF)
401.IP \[bu] 2
402\f[C]plain\f[R] (plain text),
403.IP \[bu] 2
404\f[C]pptx\f[R] (PowerPoint slide show)
405.IP \[bu] 2
406\f[C]rst\f[R] (reStructuredText)
407.IP \[bu] 2
408\f[C]rtf\f[R] (Rich Text Format)
409.IP \[bu] 2
410\f[C]texinfo\f[R] (GNU Texinfo)
411.IP \[bu] 2
412\f[C]textile\f[R] (Textile)
413.IP \[bu] 2
414\f[C]slideous\f[R] (Slideous HTML and JavaScript slide show)
415.IP \[bu] 2
416\f[C]slidy\f[R] (Slidy HTML and JavaScript slide show)
417.IP \[bu] 2
418\f[C]dzslides\f[R] (DZSlides HTML5 + JavaScript slide show),
419.IP \[bu] 2
420\f[C]revealjs\f[R] (reveal.js HTML5 + JavaScript slide show)
421.IP \[bu] 2
422\f[C]s5\f[R] (S5 HTML and JavaScript slide show)
423.IP \[bu] 2
424\f[C]tei\f[R] (TEI Simple)
425.IP \[bu] 2
426\f[C]xwiki\f[R] (XWiki markup)
427.IP \[bu] 2
428\f[C]zimwiki\f[R] (ZimWiki markup)
429.IP \[bu] 2
430the path of a custom Lua writer, see Custom writers below
431.PP
432Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and
433\f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless
434forced with \f[C]-o -\f[R].
435.PP
436Extensions can be individually enabled or disabled by appending
437\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
438See Extensions below, for a list of extensions and their names.
439See \f[C]--list-output-formats\f[R] and \f[C]--list-extensions\f[R],
440below.
441.RE
442.TP
443\f[B]\f[CB]-o\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--output=\f[B]\f[R]\f[I]FILE\f[R]
444Write output to \f[I]FILE\f[R] instead of \f[I]stdout\f[R].
445If \f[I]FILE\f[R] is \f[C]-\f[R], output will go to \f[I]stdout\f[R],
446even if a non-textual format (\f[C]docx\f[R], \f[C]odt\f[R],
447\f[C]epub2\f[R], \f[C]epub3\f[R]) is specified.
448.TP
449\f[B]\f[CB]--data-dir=\f[B]\f[R]\f[I]DIRECTORY\f[R]
450Specify the user data directory to search for pandoc data files.
451If this option is not specified, the default user data directory will be
452used.
453On *nix and macOS systems this will be the \f[C]pandoc\f[R] subdirectory
454of the XDG data directory (by default, \f[C]$HOME/.local/share\f[R],
455overridable by setting the \f[C]XDG_DATA_HOME\f[R] environment
456variable).
457If that directory does not exist, \f[C]$HOME/.pandoc\f[R] will be used
458(for backwards compatibility).
459In Windows the default user data directory is
460\f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]pandoc\f[R].
461You can find the default user data directory on your system by looking
462at the output of \f[C]pandoc --version\f[R].
463A \f[C]reference.odt\f[R], \f[C]reference.docx\f[R], \f[C]epub.css\f[R],
464\f[C]templates\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R], or
465\f[C]s5\f[R] directory placed in this directory will override
466pandoc\[cq]s normal defaults.
467.TP
468\f[B]\f[CB]-d\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--defaults=\f[B]\f[R]\f[I]FILE\f[R]
469Specify a set of default option settings.
470\f[I]FILE\f[R] is a YAML file whose fields correspond to command-line
471option settings.
472All options for document conversion, including input and output files,
473can be set using a defaults file.
474The file will be searched for first in the working directory, and then
475in the \f[C]defaults\f[R] subdirectory of the user data directory (see
476\f[C]--data-dir\f[R]).
477The \f[C].yaml\f[R] extension may be omitted.
478See the section Default files for more information on the file format.
479Settings from the defaults file may be overridden or extended by
480subsequent options on the command line.
481.TP
482\f[B]\f[CB]--bash-completion\f[B]\f[R]
483Generate a bash completion script.
484To enable bash completion with pandoc, add this to your
485\f[C].bashrc\f[R]:
486.RS
487.IP
488.nf
489\f[C]
490eval \[dq]$(pandoc --bash-completion)\[dq]
491\f[R]
492.fi
493.RE
494.TP
495\f[B]\f[CB]--verbose\f[B]\f[R]
496Give verbose debugging output.
497.TP
498\f[B]\f[CB]--quiet\f[B]\f[R]
499Suppress warning messages.
500.TP
501\f[B]\f[CB]--fail-if-warnings\f[B]\f[R]
502Exit with error status if there are any warnings.
503.TP
504\f[B]\f[CB]--log=\f[B]\f[R]\f[I]FILE\f[R]
505Write log messages in machine-readable JSON format to \f[I]FILE\f[R].
506All messages above DEBUG level will be written, regardless of verbosity
507settings (\f[C]--verbose\f[R], \f[C]--quiet\f[R]).
508.TP
509\f[B]\f[CB]--list-input-formats\f[B]\f[R]
510List supported input formats, one per line.
511.TP
512\f[B]\f[CB]--list-output-formats\f[B]\f[R]
513List supported output formats, one per line.
514.TP
515\f[B]\f[CB]--list-extensions\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]FORMAT\f[R]]
516List supported extensions for \f[I]FORMAT\f[R], one per line, preceded
517by a \f[C]+\f[R] or \f[C]-\f[R] indicating whether it is enabled by
518default in \f[I]FORMAT\f[R].
519If \f[I]FORMAT\f[R] is not specified, defaults for pandoc\[cq]s Markdown
520are given.
521.TP
522\f[B]\f[CB]--list-highlight-languages\f[B]\f[R]
523List supported languages for syntax highlighting, one per line.
524.TP
525\f[B]\f[CB]--list-highlight-styles\f[B]\f[R]
526List supported styles for syntax highlighting, one per line.
527See \f[C]--highlight-style\f[R].
528.TP
529\f[B]\f[CB]-v\f[B]\f[R], \f[B]\f[CB]--version\f[B]\f[R]
530Print version.
531.TP
532\f[B]\f[CB]-h\f[B]\f[R], \f[B]\f[CB]--help\f[B]\f[R]
533Show usage message.
534.SS Reader options
535.TP
536\f[B]\f[CB]--shift-heading-level-by=\f[B]\f[R]\f[I]NUMBER\f[R]
537Shift heading levels by a positive or negative integer.
538For example, with \f[C]--shift-heading-level-by=-1\f[R], level 2
539headings become level 1 headings, and level 3 headings become level 2
540headings.
541Headings cannot have a level less than 1, so a heading that would be
542shifted below level 1 becomes a regular paragraph.
543Exception: with a shift of -N, a level-N heading at the beginning of the
544document replaces the metadata title.
545\f[C]--shift-heading-level-by=-1\f[R] is a good choice when converting
546HTML or Markdown documents that use an initial level-1 heading for the
547document title and level-2+ headings for sections.
548\f[C]--shift-heading-level-by=1\f[R] may be a good choice for converting
549Markdown documents that use level-1 headings for sections to HTML, since
550pandoc uses a level-1 heading to render the document title.
551.TP
552\f[B]\f[CB]--base-header-level=\f[B]\f[R]\f[I]NUMBER\f[R]
553\f[I]Deprecated. Use \f[CI]--shift-heading-level-by\f[I]=X instead,
554where X = NUMBER - 1.\f[R] Specify the base level for headings (defaults
555to 1).
556.TP
557\f[B]\f[CB]--strip-empty-paragraphs\f[B]\f[R]
558\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension
559instead.\f[R] Ignore paragraphs with no content.
560This option is useful for converting word processing documents where
561users have used empty paragraphs to create inter-paragraph space.
562.TP
563\f[B]\f[CB]--indented-code-classes=\f[B]\f[R]\f[I]CLASSES\f[R]
564Specify classes to use for indented code blocks\[en]for example,
565\f[C]perl,numberLines\f[R] or \f[C]haskell\f[R].
566Multiple classes may be separated by spaces or commas.
567.TP
568\f[B]\f[CB]--default-image-extension=\f[B]\f[R]\f[I]EXTENSION\f[R]
569Specify a default extension to use when image paths/URLs have no
570extension.
571This allows you to use the same source for formats that require
572different kinds of images.
573Currently this option only affects the Markdown and LaTeX readers.
574.TP
575\f[B]\f[CB]--file-scope\f[B]\f[R]
576Parse each file individually before combining for multifile documents.
577This will allow footnotes in different files with the same identifiers
578to work as expected.
579If this option is set, footnotes and links will not work across files.
580Reading binary files (docx, odt, epub) implies \f[C]--file-scope\f[R].
581.TP
582\f[B]\f[CB]-F\f[B]\f[R] \f[I]PROGRAM\f[R], \f[B]\f[CB]--filter=\f[B]\f[R]\f[I]PROGRAM\f[R]
583Specify an executable to be used as a filter transforming the pandoc AST
584after the input is parsed and before the output is written.
585The executable should read JSON from stdin and write JSON to stdout.
586The JSON must be formatted like pandoc\[cq]s own JSON input and output.
587The name of the output format will be passed to the filter as the first
588argument.
589Hence,
590.RS
591.IP
592.nf
593\f[C]
594pandoc --filter ./caps.py -t latex
595\f[R]
596.fi
597.PP
598is equivalent to
599.IP
600.nf
601\f[C]
602pandoc -t json | ./caps.py latex | pandoc -f json -t latex
603\f[R]
604.fi
605.PP
606The latter form may be useful for debugging filters.
607.PP
608Filters may be written in any language.
609\f[C]Text.Pandoc.JSON\f[R] exports \f[C]toJSONFilter\f[R] to facilitate
610writing filters in Haskell.
611Those who would prefer to write filters in python can use the module
612\f[C]pandocfilters\f[R], installable from PyPI.
613There are also pandoc filter libraries in PHP, perl, and
614JavaScript/node.js.
615.PP
616In order of preference, pandoc will look for filters in
617.IP "1." 3
618a specified full or relative path (executable or non-executable)
619.IP "2." 3
620\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
621\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
622above).
623.IP "3." 3
624\f[C]$PATH\f[R] (executable only)
625.PP
626Filters and Lua-filters are applied in the order specified on the
627command line.
628.RE
629.TP
630\f[B]\f[CB]-L\f[B]\f[R] \f[I]SCRIPT\f[R], \f[B]\f[CB]--lua-filter=\f[B]\f[R]\f[I]SCRIPT\f[R]
631Transform the document in a similar fashion as JSON filters (see
632\f[C]--filter\f[R]), but use pandoc\[cq]s built-in Lua filtering system.
633The given Lua script is expected to return a list of Lua filters which
634will be applied in order.
635Each Lua filter must contain element-transforming functions indexed by
636the name of the AST element on which the filter function should be
637applied.
638.RS
639.PP
640The \f[C]pandoc\f[R] Lua module provides helper functions for element
641creation.
642It is always loaded into the script\[cq]s Lua environment.
643.PP
644The following is an example Lua script for macro-expansion:
645.IP
646.nf
647\f[C]
648function expand_hello_world(inline)
649 if inline.c == \[aq]{{helloworld}}\[aq] then
650 return pandoc.Emph{ pandoc.Str \[dq]Hello, World\[dq] }
651 else
652 return inline
653 end
654end
656return {{Str = expand_hello_world}}
657\f[R]
658.fi
659.PP
660In order of preference, pandoc will look for Lua filters in
661.IP "1." 3
662a specified full or relative path (executable or non-executable)
663.IP "2." 3
664\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
665\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
666above).
667.RE
668.TP
669\f[B]\f[CB]-M\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--metadata=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
670Set the metadata field \f[I]KEY\f[R] to the value \f[I]VAL\f[R].
671A value specified on the command line overrides a value specified in the
672document using YAML metadata blocks.
673Values will be parsed as YAML boolean or string values.
674If no value is specified, the value will be treated as Boolean true.
675Like \f[C]--variable\f[R], \f[C]--metadata\f[R] causes template
676variables to be set.
677But unlike \f[C]--variable\f[R], \f[C]--metadata\f[R] affects the
678metadata of the underlying document (which is accessible from filters
679and may be printed in some output formats) and metadata values will be
680escaped when inserted into the template.
681.TP
682\f[B]\f[CB]--metadata-file=\f[B]\f[R]\f[I]FILE\f[R]
683Read metadata from the supplied YAML (or JSON) file.
684This option can be used with every input format, but string scalars in
685the YAML file will always be parsed as Markdown.
686Generally, the input will be handled the same as in YAML metadata
687blocks.
688This option can be used repeatedly to include multiple metadata files;
689values in files specified later on the command line will be preferred
690over those specified in earlier files.
691Metadata values specified inside the document, or by using \f[C]-M\f[R],
692overwrite values specified with this option.
693.TP
694\f[B]\f[CB]-p\f[B]\f[R], \f[B]\f[CB]--preserve-tabs\f[B]\f[R]
695Preserve tabs instead of converting them to spaces.
696(By default, pandoc converts tabs to spaces before parsing its input.)
697Note that this will only affect tabs in literal code spans and code
698blocks.
699Tabs in regular text are always treated as spaces.
700.TP
701\f[B]\f[CB]--tab-stop=\f[B]\f[R]\f[I]NUMBER\f[R]
702Specify the number of spaces per tab (default is 4).
703.TP
704\f[B]\f[CB]--track-changes=accept\f[B]\f[R]|\f[B]\f[CB]reject\f[B]\f[R]|\f[B]\f[CB]all\f[B]\f[R]
705Specifies what to do with insertions, deletions, and comments produced
706by the MS Word \[lq]Track Changes\[rq] feature.
707\f[C]accept\f[R] (the default) processes all the insertions and
708deletions.
709\f[C]reject\f[R] ignores them.
710Both \f[C]accept\f[R] and \f[C]reject\f[R] ignore comments.
711\f[C]all\f[R] includes all insertions, deletions, and comments, wrapped
712in spans with \f[C]insertion\f[R], \f[C]deletion\f[R],
713\f[C]comment-start\f[R], and \f[C]comment-end\f[R] classes,
714respectively.
715The author and time of change is included.
716\f[C]all\f[R] is useful for scripting: only accepting changes from a
717certain reviewer, say, or before a certain date.
718If a paragraph is inserted or deleted, \f[C]track-changes=all\f[R]
719produces a span with the class
720\f[C]paragraph-insertion\f[R]/\f[C]paragraph-deletion\f[R] before the
721affected paragraph break.
722This option only affects the docx reader.
723.TP
724\f[B]\f[CB]--extract-media=\f[B]\f[R]\f[I]DIR\f[R]
725Extract images and other media contained in or linked from the source
726document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
727the images references in the document so they point to the extracted
728files.
729If the source format is a binary container (docx, epub, or odt), the
730media is extracted from the container and the original filenames are
731used.
732Otherwise the media is read from the file system or downloaded, and new
733filenames are constructed based on SHA1 hashes of the contents.
734.TP
735\f[B]\f[CB]--abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
736Specifies a custom abbreviations file, with abbreviations one to a line.
737If this option is not specified, pandoc will read the data file
738\f[C]abbreviations\f[R] from the user data directory or fall back on a
739system default.
740To see the system default, use
741\f[C]pandoc --print-default-data-file=abbreviations\f[R].
742The only use pandoc makes of this list is in the Markdown reader.
743Strings ending in a period that are found in this list will be followed
744by a nonbreaking space, so that the period will not produce
745sentence-ending space in formats like LaTeX.
746.SS General writer options
747.TP
748\f[B]\f[CB]-s\f[B]\f[R], \f[B]\f[CB]--standalone\f[B]\f[R]
749Produce output with an appropriate header and footer (e.g.\ a standalone
750HTML, LaTeX, TEI, or RTF file, not a fragment).
751This option is set automatically for \f[C]pdf\f[R], \f[C]epub\f[R],
752\f[C]epub3\f[R], \f[C]fb2\f[R], \f[C]docx\f[R], and \f[C]odt\f[R]
753output.
754For \f[C]native\f[R] output, this option causes metadata to be included;
755otherwise, metadata is suppressed.
756.TP
757\f[B]\f[CB]--template=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
758Use the specified file as a custom template for the generated document.
759Implies \f[C]--standalone\f[R].
760See Templates, below, for a description of template syntax.
761If no extension is specified, an extension corresponding to the writer
762will be added, so that \f[C]--template=special\f[R] looks for
763\f[C]special.html\f[R] for HTML output.
764If the template is not found, pandoc will search for it in the
765\f[C]templates\f[R] subdirectory of the user data directory (see
766\f[C]--data-dir\f[R]).
767If this option is not used, a default template appropriate for the
768output format will be used (see \f[C]-D/--print-default-template\f[R]).
769.TP
770\f[B]\f[CB]-V\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--variable=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
771Set the template variable \f[I]KEY\f[R] to the value \f[I]VAL\f[R] when
772rendering the document in standalone mode.
773If no \f[I]VAL\f[R] is specified, the key will be given the value
774\f[C]true\f[R].
775.TP
776\f[B]\f[CB]-D\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--print-default-template=\f[B]\f[R]\f[I]FORMAT\f[R]
777Print the system default template for an output \f[I]FORMAT\f[R].
778(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates
779in the user data directory are ignored.
780This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
781output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
782\f[C]--print-default-template\f[R] on the command line.
783.RS
784.PP
785Note that some of the default templates use partials, for example
786\f[C]styles.html\f[R].
787To print the partials, use \f[C]--print-default-data-file\f[R]: for
788example, \f[C]--print-default-data-file=templates/styles.html\f[R].
789.RE
790.TP
791\f[B]\f[CB]--print-default-data-file=\f[B]\f[R]\f[I]FILE\f[R]
792Print a system default data file.
793Files in the user data directory are ignored.
794This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
795output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
796\f[C]--print-default-data-file\f[R] on the command line.
797.TP
798\f[B]\f[CB]--eol=crlf\f[B]\f[R]|\f[B]\f[CB]lf\f[B]\f[R]|\f[B]\f[CB]native\f[B]\f[R]
799Manually specify line endings: \f[C]crlf\f[R] (Windows), \f[C]lf\f[R]
800(macOS/Linux/UNIX), or \f[C]native\f[R] (line endings appropriate to the
801OS on which pandoc is being run).
802The default is \f[C]native\f[R].
803.TP
804\f[B]\f[CB]--dpi\f[B]\f[R]=\f[I]NUMBER\f[R]
805Specify the default dpi (dots per inch) value for conversion from pixels
806to inch/centimeters and vice versa.
807(Technically, the correct term would be ppi: pixels per inch.) The
808default is 96dpi.
809When images contain information about dpi internally, the encoded value
810is used instead of the default specified by this option.
811.TP
812\f[B]\f[CB]--wrap=auto\f[B]\f[R]|\f[B]\f[CB]none\f[B]\f[R]|\f[B]\f[CB]preserve\f[B]\f[R]
813Determine how text is wrapped in the output (the source code, not the
814rendered version).
815With \f[C]auto\f[R] (the default), pandoc will attempt to wrap lines to
816the column width specified by \f[C]--columns\f[R] (default 72).
817With \f[C]none\f[R], pandoc will not wrap lines at all.
818With \f[C]preserve\f[R], pandoc will attempt to preserve the wrapping
819from the source document (that is, where there are nonsemantic newlines
820in the source, there will be nonsemantic newlines in the output as
821well).
822Automatic wrapping does not currently work in HTML output.
823In \f[C]ipynb\f[R] output, this option affects wrapping of the contents
824of markdown cells.
825.TP
826\f[B]\f[CB]--columns=\f[B]\f[R]\f[I]NUMBER\f[R]
827Specify length of lines in characters.
828This affects text wrapping in the generated source code (see
829\f[C]--wrap\f[R]).
830It also affects calculation of column widths for plain text tables (see
831Tables below).
832.TP
833\f[B]\f[CB]--toc\f[B]\f[R], \f[B]\f[CB]--table-of-contents\f[B]\f[R]
834Include an automatically generated table of contents (or, in the case of
835\f[C]latex\f[R], \f[C]context\f[R], \f[C]docx\f[R], \f[C]odt\f[R],
836\f[C]opendocument\f[R], \f[C]rst\f[R], or \f[C]ms\f[R], an instruction
837to create one) in the output document.
838This option has no effect unless \f[C]-s/--standalone\f[R] is used, and
839it has no effect on \f[C]man\f[R], \f[C]docbook4\f[R],
840\f[C]docbook5\f[R], or \f[C]jats\f[R] output.
841.RS
842.PP
843Note that if you are producing a PDF via \f[C]ms\f[R], the table of
844contents will appear at the beginning of the document, before the title.
845If you would prefer it to be at the end of the document, use the option
846\f[C]--pdf-engine-opt=--no-toc-relocation\f[R].
847.RE
848.TP
849\f[B]\f[CB]--toc-depth=\f[B]\f[R]\f[I]NUMBER\f[R]
850Specify the number of section levels to include in the table of
851contents.
852The default is 3 (which means that level-1, 2, and 3 headings will be
853listed in the contents).
854.TP
855\f[B]\f[CB]--strip-comments\f[B]\f[R]
856Strip out HTML comments in the Markdown or Textile source, rather than
857passing them on to Markdown, Textile or HTML output as raw HTML.
858This does not apply to HTML comments inside raw HTML blocks when the
859\f[C]markdown_in_html_blocks\f[R] extension is not set.
860.TP
861\f[B]\f[CB]--no-highlight\f[B]\f[R]
862Disables syntax highlighting for code blocks and inlines, even when a
863language attribute is given.
864.TP
865\f[B]\f[CB]--highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
866Specifies the coloring style to be used in highlighted source code.
867Options are \f[C]pygments\f[R] (the default), \f[C]kate\f[R],
868\f[C]monochrome\f[R], \f[C]breezeDark\f[R], \f[C]espresso\f[R],
869\f[C]zenburn\f[R], \f[C]haddock\f[R], and \f[C]tango\f[R].
870For more information on syntax highlighting in pandoc, see Syntax
871highlighting, below.
872See also \f[C]--list-highlight-styles\f[R].
873.RS
874.PP
875Instead of a \f[I]STYLE\f[R] name, a JSON file with extension
876\f[C].theme\f[R] may be supplied.
877This will be parsed as a KDE syntax highlighting theme and (if valid)
878used as the highlighting style.
879.PP
880To generate the JSON version of an existing style, use
881\f[C]--print-highlight-style\f[R].
882.RE
883.TP
884\f[B]\f[CB]--print-highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
885Prints a JSON version of a highlighting style, which can be modified,
886saved with a \f[C].theme\f[R] extension, and used with
887\f[C]--highlight-style\f[R].
888This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
889output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
890\f[C]--print-highlight-style\f[R] on the command line.
891.TP
892\f[B]\f[CB]--syntax-definition=\f[B]\f[R]\f[I]FILE\f[R]
893Instructs pandoc to load a KDE XML syntax definition file, which will be
894used for syntax highlighting of appropriately marked code blocks.
895This can be used to add support for new languages or to use altered
896syntax definitions for existing languages.
897This option may be repeated to add multiple syntax definitions.
898.TP
899\f[B]\f[CB]-H\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-in-header=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
900Include contents of \f[I]FILE\f[R], verbatim, at the end of the header.
901This can be used, for example, to include special CSS or JavaScript in
902HTML documents.
903This option can be used repeatedly to include multiple files in the
904header.
905They will be included in the order specified.
906Implies \f[C]--standalone\f[R].
907.TP
908\f[B]\f[CB]-B\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-before-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
909Include contents of \f[I]FILE\f[R], verbatim, at the beginning of the
910document body (e.g.\ after the \f[C]<body>\f[R] tag in HTML, or the
911\f[C]\[rs]begin{document}\f[R] command in LaTeX).
912This can be used to include navigation bars or banners in HTML
913documents.
914This option can be used repeatedly to include multiple files.
915They will be included in the order specified.
916Implies \f[C]--standalone\f[R].
917.TP
918\f[B]\f[CB]-A\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-after-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
919Include contents of \f[I]FILE\f[R], verbatim, at the end of the document
920body (before the \f[C]</body>\f[R] tag in HTML, or the
921\f[C]\[rs]end{document}\f[R] command in LaTeX).
922This option can be used repeatedly to include multiple files.
923They will be included in the order specified.
924Implies \f[C]--standalone\f[R].
925.TP
926\f[B]\f[CB]--resource-path=\f[B]\f[R]\f[I]SEARCHPATH\f[R]
927List of paths to search for images and other resources.
928The paths should be separated by \f[C]:\f[R] on Linux, UNIX, and macOS
929systems, and by \f[C];\f[R] on Windows.
930If \f[C]--resource-path\f[R] is not specified, the default resource path
931is the working directory.
932Note that, if \f[C]--resource-path\f[R] is specified, the working
933directory must be explicitly listed or it will not be searched.
934For example: \f[C]--resource-path=.:test\f[R] will search the working
935directory and the \f[C]test\f[R] subdirectory, in that order.
936.RS
937.PP
938\f[C]--resource-path\f[R] only has an effect if (a) the output format
939embeds images (for example, \f[C]docx\f[R], \f[C]pdf\f[R], or
940\f[C]html\f[R] with \f[C]--self-contained\f[R]) or (b) it is used
941together with \f[C]--extract-media\f[R].
942.RE
943.TP
944\f[B]\f[CB]--request-header=\f[B]\f[R]\f[I]NAME\f[R]\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]
945Set the request header \f[I]NAME\f[R] to the value \f[I]VAL\f[R] when
946making HTTP requests (for example, when a URL is given on the command
947line, or when resources used in a document must be downloaded).
948If you\[cq]re behind a proxy, you also need to set the environment
949variable \f[C]http_proxy\f[R] to \f[C]http://...\f[R].
950.TP
951\f[B]\f[CB]--no-check-certificate\f[B]\f[R]
952Disable the certificate verification to allow access to unsecure HTTP
953resources (for example when the certificate is no longer valid or self
954signed).
955.SS Options affecting specific writers
956.TP
957\f[B]\f[CB]--self-contained\f[B]\f[R]
958Produce a standalone HTML file with no external dependencies, using
959\f[C]data:\f[R] URIs to incorporate the contents of linked scripts,
960stylesheets, images, and videos.
961Implies \f[C]--standalone\f[R].
962The resulting file should be \[lq]self-contained,\[rq] in the sense that
963it needs no external files and no net access to be displayed properly by
964a browser.
965This option works only with HTML output formats, including
966\f[C]html4\f[R], \f[C]html5\f[R], \f[C]html+lhs\f[R],
967\f[C]html5+lhs\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
968\f[C]dzslides\f[R], and \f[C]revealjs\f[R].
969Scripts, images, and stylesheets at absolute URLs will be downloaded;
970those at relative URLs will be sought relative to the working directory
971(if the first source file is local) or relative to the base URL (if the
972first source file is remote).
973Elements with the attribute \f[C]data-external=\[dq]1\[dq]\f[R] will be
974left alone; the documents they link to will not be incorporated in the
975document.
976Limitation: resources that are loaded dynamically through JavaScript
977cannot be incorporated; as a result, \f[C]--self-contained\f[R] does not
978work with \f[C]--mathjax\f[R], and some advanced features (e.g.\ zoom or
979speaker notes) may not work in an offline \[lq]self-contained\[rq]
980\f[C]reveal.js\f[R] slide show.
981.TP
982\f[B]\f[CB]--html-q-tags\f[B]\f[R]
983Use \f[C]<q>\f[R] tags for quotes in HTML.
984(This option only has an effect if the \f[C]smart\f[R] extension is
985enabled for the input format used.)
986.TP
987\f[B]\f[CB]--ascii\f[B]\f[R]
988Use only ASCII characters in output.
989Currently supported for XML and HTML formats (which use entities instead
990of UTF-8 when this option is selected), CommonMark, gfm, and Markdown
991(which use entities), roff ms (which use hexadecimal escapes), and to a
992limited degree LaTeX (which uses standard commands for accented
993characters when possible).
994roff man output uses ASCII by default.
995.TP
996\f[B]\f[CB]--reference-links\f[B]\f[R]
997Use reference-style links, rather than inline links, in writing Markdown
998or reStructuredText.
999By default inline links are used.
1000The placement of link references is affected by the
1001\f[C]--reference-location\f[R] option.
1002.TP
1003\f[B]\f[CB]--reference-location = block\f[B]\f[R]|\f[B]\f[CB]section\f[B]\f[R]|\f[B]\f[CB]document\f[B]\f[R]
1004Specify whether footnotes (and references, if \f[C]reference-links\f[R]
1005is set) are placed at the end of the current (top-level) block, the
1006current section, or the document.
1007The default is \f[C]document\f[R].
1008Currently only affects the markdown writer.
1009.TP
1010\f[B]\f[CB]--atx-headers\f[B]\f[R]
1011Use ATX-style headings in Markdown output.
1012The default is to use setext-style headings for levels 1 to 2, and then
1013ATX headings.
1014(Note: for \f[C]gfm\f[R] output, ATX headings are always used.) This
1015option also affects markdown cells in \f[C]ipynb\f[R] output.
1016.TP
1017\f[B]\f[CB]--top-level-division=[default|section|chapter|part]\f[B]\f[R]
1018Treat top-level headings as the given division type in LaTeX, ConTeXt,
1019DocBook, and TEI output.
1020The hierarchy order is part, chapter, then section; all headings are
1021shifted such that the top-level heading becomes the specified type.
1022The default behavior is to determine the best division type via
1023heuristics: unless other conditions apply, \f[C]section\f[R] is chosen.
1024When the \f[C]documentclass\f[R] variable is set to \f[C]report\f[R],
1025\f[C]book\f[R], or \f[C]memoir\f[R] (unless the \f[C]article\f[R] option
1026is specified), \f[C]chapter\f[R] is implied as the setting for this
1027option.
1028If \f[C]beamer\f[R] is the output format, specifying either
1029\f[C]chapter\f[R] or \f[C]part\f[R] will cause top-level headings to
1030become \f[C]\[rs]part{..}\f[R], while second-level headings remain as
1031their default type.
1032.TP
1033\f[B]\f[CB]-N\f[B]\f[R], \f[B]\f[CB]--number-sections\f[B]\f[R]
1034Number section headings in LaTeX, ConTeXt, HTML, Docx, or EPUB output.
1035By default, sections are not numbered.
1036Sections with class \f[C]unnumbered\f[R] will never be numbered, even if
1037\f[C]--number-sections\f[R] is specified.
1038.TP
1039\f[B]\f[CB]--number-offset=\f[B]\f[R]\f[I]NUMBER\f[R][\f[B]\f[CB],\f[B]\f[R]\f[I]NUMBER\f[R]\f[B]\f[CB],\f[B]\f[R]\f[I]\&...\f[R]]
1040Offset for section headings in HTML output (ignored in other output
1041formats).
1042The first number is added to the section number for top-level headings,
1043the second for second-level headings, and so on.
1044So, for example, if you want the first top-level heading in your
1045document to be numbered \[lq]6\[rq], specify
1046\f[C]--number-offset=5\f[R].
1047If your document starts with a level-2 heading which you want to be
1048numbered \[lq]1.5\[rq], specify \f[C]--number-offset=1,4\f[R].
1049Offsets are 0 by default.
1050Implies \f[C]--number-sections\f[R].
1051.TP
1052\f[B]\f[CB]--listings\f[B]\f[R]
1053Use the \f[C]listings\f[R] package for LaTeX code blocks.
1054The package does not support multi-byte encoding for source code.
1055To handle UTF-8 you would need to use a custom template.
1056This issue is fully documented here: Encoding issue with the listings
1057package.
1058.TP
1059\f[B]\f[CB]-i\f[B]\f[R], \f[B]\f[CB]--incremental\f[B]\f[R]
1060Make list items in slide shows display incrementally (one by one).
1061The default is for lists to be displayed all at once.
1062.TP
1063\f[B]\f[CB]--slide-level=\f[B]\f[R]\f[I]NUMBER\f[R]
1064Specifies that headings with the specified level create slides (for
1065\f[C]beamer\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
1066\f[C]dzslides\f[R]).
1067Headings above this level in the hierarchy are used to divide the slide
1068show into sections; headings below this level create subheads within a
1069slide.
1070Note that content that is not contained under slide-level headings will
1071not appear in the slide show.
1072The default is to set the slide level based on the contents of the
1073document; see Structuring the slide show.
1074.TP
1075\f[B]\f[CB]--section-divs\f[B]\f[R]
1076Wrap sections in \f[C]<section>\f[R] tags (or \f[C]<div>\f[R] tags for
1077\f[C]html4\f[R]), and attach identifiers to the enclosing
1078\f[C]<section>\f[R] (or \f[C]<div>\f[R]) rather than the heading itself.
1079See Heading identifiers, below.
1080.TP
1081\f[B]\f[CB]--email-obfuscation=none\f[B]\f[R]|\f[B]\f[CB]javascript\f[B]\f[R]|\f[B]\f[CB]references\f[B]\f[R]
1082Specify a method for obfuscating \f[C]mailto:\f[R] links in HTML
1083documents.
1084\f[C]none\f[R] leaves \f[C]mailto:\f[R] links as they are.
1085\f[C]javascript\f[R] obfuscates them using JavaScript.
1086\f[C]references\f[R] obfuscates them by printing their letters as
1087decimal or hexadecimal character references.
1088The default is \f[C]none\f[R].
1089.TP
1090\f[B]\f[CB]--id-prefix=\f[B]\f[R]\f[I]STRING\f[R]
1091Specify a prefix to be added to all identifiers and internal links in
1092HTML and DocBook output, and to footnote numbers in Markdown and Haddock
1093output.
1094This is useful for preventing duplicate identifiers when generating
1095fragments to be included in other pages.
1096.TP
1097\f[B]\f[CB]-T\f[B]\f[R] \f[I]STRING\f[R], \f[B]\f[CB]--title-prefix=\f[B]\f[R]\f[I]STRING\f[R]
1098Specify \f[I]STRING\f[R] as a prefix at the beginning of the title that
1099appears in the HTML header (but not in the title as it appears at the
1100beginning of the HTML body).
1101Implies \f[C]--standalone\f[R].
1102.TP
1103\f[B]\f[CB]-c\f[B]\f[R] \f[I]URL\f[R], \f[B]\f[CB]--css=\f[B]\f[R]\f[I]URL\f[R]
1104Link to a CSS style sheet.
1105This option can be used repeatedly to include multiple files.
1106They will be included in the order specified.
1107.RS
1108.PP
1109A stylesheet is required for generating EPUB.
1110If none is provided using this option (or the \f[C]css\f[R] or
1111\f[C]stylesheet\f[R] metadata fields), pandoc will look for a file
1112\f[C]epub.css\f[R] in the user data directory (see
1113\f[C]--data-dir\f[R]).
1114If it is not found there, sensible defaults will be used.
1115.RE
1116.TP
1117\f[B]\f[CB]--reference-doc=\f[B]\f[R]\f[I]FILE\f[R]
1118Use the specified file as a style reference in producing a docx or ODT
1119file.
1120.RS
1121.TP
1122Docx
1123For best results, the reference docx should be a modified version of a
1124docx file produced using pandoc.
1125The contents of the reference docx are ignored, but its stylesheets and
1126document properties (including margins, page size, header, and footer)
1127are used in the new docx.
1128If no reference docx is specified on the command line, pandoc will look
1129for a file \f[C]reference.docx\f[R] in the user data directory (see
1130\f[C]--data-dir\f[R]).
1131If this is not found either, sensible defaults will be used.
1132.RS
1133.PP
1134To produce a custom \f[C]reference.docx\f[R], first get a copy of the
1135default \f[C]reference.docx\f[R]:
1136\f[C]pandoc -o custom-reference.docx --print-default-data-file reference.docx\f[R].
1137Then open \f[C]custom-reference.docx\f[R] in Word, modify the styles as
1138you wish, and save the file.
1139For best results, do not make changes to this file other than modifying
1140the styles used by pandoc:
1141.PP
1142Paragraph styles:
1143.IP \[bu] 2
1144Normal
1145.IP \[bu] 2
1146Body Text
1147.IP \[bu] 2
1148First Paragraph
1149.IP \[bu] 2
1150Compact
1151.IP \[bu] 2
1152Title
1153.IP \[bu] 2
1154Subtitle
1155.IP \[bu] 2
1156Author
1157.IP \[bu] 2
1158Date
1159.IP \[bu] 2
1160Abstract
1161.IP \[bu] 2
1162Bibliography
1163.IP \[bu] 2
1164Heading 1
1165.IP \[bu] 2
1166Heading 2
1167.IP \[bu] 2
1168Heading 3
1169.IP \[bu] 2
1170Heading 4
1171.IP \[bu] 2
1172Heading 5
1173.IP \[bu] 2
1174Heading 6
1175.IP \[bu] 2
1176Heading 7
1177.IP \[bu] 2
1178Heading 8
1179.IP \[bu] 2
1180Heading 9
1181.IP \[bu] 2
1182Block Text
1183.IP \[bu] 2
1184Footnote Text
1185.IP \[bu] 2
1186Definition Term
1187.IP \[bu] 2
1188Definition
1189.IP \[bu] 2
1190Caption
1191.IP \[bu] 2
1192Table Caption
1193.IP \[bu] 2
1194Image Caption
1195.IP \[bu] 2
1196Figure
1197.IP \[bu] 2
1198Captioned Figure
1199.IP \[bu] 2
1200TOC Heading
1201.PP
1202Character styles:
1203.IP \[bu] 2
1204Default Paragraph Font
1205.IP \[bu] 2
1206Body Text Char
1207.IP \[bu] 2
1208Verbatim Char
1209.IP \[bu] 2
1210Footnote Reference
1211.IP \[bu] 2
1212Hyperlink
1213.IP \[bu] 2
1214Section Number
1215.PP
1216Table style:
1217.IP \[bu] 2
1218Table
1219.RE
1220.TP
1221ODT
1222For best results, the reference ODT should be a modified version of an
1223ODT produced using pandoc.
1224The contents of the reference ODT are ignored, but its stylesheets are
1225used in the new ODT.
1226If no reference ODT is specified on the command line, pandoc will look
1227for a file \f[C]reference.odt\f[R] in the user data directory (see
1228\f[C]--data-dir\f[R]).
1229If this is not found either, sensible defaults will be used.
1230.RS
1231.PP
1232To produce a custom \f[C]reference.odt\f[R], first get a copy of the
1233default \f[C]reference.odt\f[R]:
1234\f[C]pandoc -o custom-reference.odt --print-default-data-file reference.odt\f[R].
1235Then open \f[C]custom-reference.odt\f[R] in LibreOffice, modify the
1236styles as you wish, and save the file.
1237.RE
1238.TP
1239PowerPoint
1240Templates included with Microsoft PowerPoint 2013 (either with
1241\f[C].pptx\f[R] or \f[C].potx\f[R] extension) are known to work, as are
1242most templates derived from these.
1243.RS
1244.PP
1245The specific requirement is that the template should begin with the
1246following first four layouts:
1247.IP "1." 3
1248Title Slide
1249.IP "2." 3
1250Title and Content
1251.IP "3." 3
1252Section Header
1253.IP "4." 3
1254Two Content
1255.PP
1256All templates included with a recent version of MS PowerPoint will fit
1257these criteria.
1258(You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to
1259check.)
1260.PP
1261You can also modify the default \f[C]reference.pptx\f[R]: first run
1262\f[C]pandoc -o custom-reference.pptx --print-default-data-file reference.pptx\f[R],
1263and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc
1264will use the first four layout slides, as mentioned above).
1265.RE
1266.RE
1267.TP
1268\f[B]\f[CB]--epub-cover-image=\f[B]\f[R]\f[I]FILE\f[R]
1269Use the specified image as the EPUB cover.
1270It is recommended that the image be less than 1000px in width and
1271height.
1272Note that in a Markdown source document you can also specify
1273\f[C]cover-image\f[R] in a YAML metadata block (see EPUB Metadata,
1274below).
1275.TP
1276\f[B]\f[CB]--epub-metadata=\f[B]\f[R]\f[I]FILE\f[R]
1277Look in the specified XML file for metadata for the EPUB.
1278The file should contain a series of Dublin Core elements.
1279For example:
1280.RS
1281.IP
1282.nf
1283\f[C]
1284 <dc:rights>Creative Commons</dc:rights>
1285 <dc:language>es-AR</dc:language>
1286\f[R]
1287.fi
1288.PP
1289By default, pandoc will include the following metadata elements:
1290\f[C]<dc:title>\f[R] (from the document title), \f[C]<dc:creator>\f[R]
1291(from the document authors), \f[C]<dc:date>\f[R] (from the document
1292date, which should be in ISO 8601 format), \f[C]<dc:language>\f[R] (from
1293the \f[C]lang\f[R] variable, or, if is not set, the locale), and
1294\f[C]<dc:identifier id=\[dq]BookId\[dq]>\f[R] (a randomly generated
1295UUID).
1296Any of these may be overridden by elements in the metadata file.
1297.PP
1298Note: if the source document is Markdown, a YAML metadata block in the
1299document can be used instead.
1300See below under EPUB Metadata.
1301.RE
1302.TP
1303\f[B]\f[CB]--epub-embed-font=\f[B]\f[R]\f[I]FILE\f[R]
1304Embed the specified font in the EPUB.
1305This option can be repeated to embed multiple fonts.
1306Wildcards can also be used: for example, \f[C]DejaVuSans-*.ttf\f[R].
1307However, if you use wildcards on the command line, be sure to escape
1308them or put the whole filename in single quotes, to prevent them from
1309being interpreted by the shell.
1310To use the embedded fonts, you will need to add declarations like the
1311following to your CSS (see \f[C]--css\f[R]):
1312.RS
1313.IP
1314.nf
1315\f[C]
1316\[at]font-face {
1317font-family: DejaVuSans;
1318font-style: normal;
1319font-weight: normal;
1320src:url(\[dq]DejaVuSans-Regular.ttf\[dq]);
1322\[at]font-face {
1323font-family: DejaVuSans;
1324font-style: normal;
1325font-weight: bold;
1326src:url(\[dq]DejaVuSans-Bold.ttf\[dq]);
1328\[at]font-face {
1329font-family: DejaVuSans;
1330font-style: italic;
1331font-weight: normal;
1332src:url(\[dq]DejaVuSans-Oblique.ttf\[dq]);
1334\[at]font-face {
1335font-family: DejaVuSans;
1336font-style: italic;
1337font-weight: bold;
1338src:url(\[dq]DejaVuSans-BoldOblique.ttf\[dq]);
1340body { font-family: \[dq]DejaVuSans\[dq]; }
1341\f[R]
1342.fi
1343.RE
1344.TP
1345\f[B]\f[CB]--epub-chapter-level=\f[B]\f[R]\f[I]NUMBER\f[R]
1346Specify the heading level at which to split the EPUB into separate
1347\[lq]chapter\[rq] files.
1348The default is to split into chapters at level-1 headings.
1349This option only affects the internal composition of the EPUB, not the
1350way chapters and sections are displayed to users.
1351Some readers may be slow if the chapter files are too large, so for
1352large documents with few level-1 headings, one might want to use a
1353chapter level of 2 or 3.
1354.TP
1355\f[B]\f[CB]--epub-subdirectory=\f[B]\f[R]\f[I]DIRNAME\f[R]
1356Specify the subdirectory in the OCF container that is to hold the
1357EPUB-specific contents.
1358The default is \f[C]EPUB\f[R].
1359To put the EPUB contents in the top level, use an empty string.
1360.TP
1361\f[B]\f[CB]--ipynb-output=all|none|best\f[B]\f[R]
1362Determines how ipynb output cells are treated.
1363\f[C]all\f[R] means that all of the data formats included in the
1364original are preserved.
1365\f[C]none\f[R] means that the contents of data cells are omitted.
1366\f[C]best\f[R] causes pandoc to try to pick the richest data block in
1367each output cell that is compatible with the output format.
1368The default is \f[C]best\f[R].
1369.TP
1370\f[B]\f[CB]--pdf-engine=\f[B]\f[R]\f[I]PROGRAM\f[R]
1371Use the specified engine when producing PDF output.
1372Valid values are \f[C]pdflatex\f[R], \f[C]lualatex\f[R],
1373\f[C]xelatex\f[R], \f[C]latexmk\f[R], \f[C]tectonic\f[R],
1374\f[C]wkhtmltopdf\f[R], \f[C]weasyprint\f[R], \f[C]prince\f[R],
1375\f[C]context\f[R], and \f[C]pdfroff\f[R].
1376If the engine is not in your PATH, the full path of the engine may be
1377specified here.
1378If this option is not specified, pandoc uses the following defaults
1379depending on the output format specified using \f[C]-t/--to\f[R]:
1380.RS
1381.IP \[bu] 2
1382\f[C]-t latex\f[R] or none: \f[C]pdflatex\f[R] (other options:
1383\f[C]xelatex\f[R], \f[C]lualatex\f[R], \f[C]tectonic\f[R],
1384\f[C]latexmk\f[R])
1385.IP \[bu] 2
1386\f[C]-t context\f[R]: \f[C]context\f[R]
1387.IP \[bu] 2
1388\f[C]-t html\f[R]: \f[C]wkhtmltopdf\f[R] (other options:
1389\f[C]prince\f[R], \f[C]weasyprint\f[R]; see print-css.rocks for a good
1390introduction to PDF generation from HTML/CSS.)
1391.IP \[bu] 2
1392\f[C]-t ms\f[R]: \f[C]pdfroff\f[R]
1393.RE
1394.TP
1395\f[B]\f[CB]--pdf-engine-opt=\f[B]\f[R]\f[I]STRING\f[R]
1396Use the given string as a command-line argument to the
1397\f[C]pdf-engine\f[R].
1398For example, to use a persistent directory \f[C]foo\f[R] for
1399\f[C]latexmk\f[R]\[cq]s auxiliary files, use
1400\f[C]--pdf-engine-opt=-outdir=foo\f[R].
1401Note that no check for duplicate options is done.
1402.SS Citation rendering
1403.TP
1404\f[B]\f[CB]-C\f[B]\f[R], \f[B]\f[CB]--citeproc\f[B]\f[R]
1405Process the citations in the file, replacing them with rendered
1406citations and adding a bibliography.
1407Citation processing will not take place unless bibliographic data is
1408supplied, either through an external file specified using the
1409\f[C]--bibliography\f[R] option or the \f[C]bibliography\f[R] field in
1410metadata, or via a \f[C]references\f[R] section in metadata containing a
1411list of citations in CSL YAML format with Markdown formatting.
1412The style is controlled by a CSL stylesheet specified using the
1413\f[C]--csl\f[R] option or the \f[C]csl\f[R] field in metadata.
1414(If no stylesheet is specified, the \f[C]chicago-author-date\f[R] style
1415will be used by default.) The citation processing transformation may be
1416applied before or after filters or Lua filters (see \f[C]--filter\f[R],
1417\f[C]--lua-filter\f[R]): these transformations are applied in the order
1418they appear on the command line.
1419For more information, see the section on Citations.
1420.TP
1421\f[B]\f[CB]--bibliography=\f[B]\f[R]\f[I]FILE\f[R]
1422Set the \f[C]bibliography\f[R] field in the document\[cq]s metadata to
1423\f[I]FILE\f[R], overriding any value set in the metadata.
1424If you supply this argument multiple times, each \f[I]FILE\f[R] will be
1425added to bibliography.
1426.TP
1427\f[B]\f[CB]--csl=\f[B]\f[R]\f[I]FILE\f[R]
1428Set the \f[C]csl\f[R] field in the document\[cq]s metadata to
1429\f[I]FILE\f[R], overriding any value set in the metadata.
1430(This is equivalent to \f[C]--metadata csl=FILE\f[R].) If \f[I]FILE\f[R]
1431is a URL, it will be fetched via HTTP.
1432If \f[I]FILE\f[R] is not found relative to the working directory, it
1433will be sought in the resource path and finally in the \f[C]csl\f[R]
1434subdirectory of the pandoc user data directory.
1435.TP
1436\f[B]\f[CB]--citation-abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
1437Set the \f[C]citation-abbreviations\f[R] field in the document\[cq]s
1438metadata to \f[I]FILE\f[R], overriding any value set in the metadata.
1439(This is equivalent to
1440\f[C]--metadata citation-abbreviations=FILE\f[R].) If \f[I]FILE\f[R] is
1441a URL, it will be fetched via HTTP.
1442If \f[I]FILE\f[R] is not found relative to the working directory, it
1443will be sought in the resource path and finally in the \f[C]csl\f[R]
1444subdirectory of the pandoc user data directory.
1445.TP
1446\f[B]\f[CB]--natbib\f[B]\f[R]
1447Use \f[C]natbib\f[R] for citations in LaTeX output.
1448This option is not for use with the \f[C]--citeproc\f[R] option or with
1449PDF output.
1450It is intended for use in producing a LaTeX file that can be processed
1451with \f[C]bibtex\f[R].
1452.TP
1453\f[B]\f[CB]--biblatex\f[B]\f[R]
1454Use \f[C]biblatex\f[R] for citations in LaTeX output.
1455This option is not for use with the \f[C]--citeproc\f[R] option or with
1456PDF output.
1457It is intended for use in producing a LaTeX file that can be processed
1458with \f[C]bibtex\f[R] or \f[C]biber\f[R].
1459.SS Math rendering in HTML
1460.PP
1461The default is to render TeX math as far as possible using Unicode
1462characters.
1463Formulas are put inside a \f[C]span\f[R] with
1464\f[C]class=\[dq]math\[dq]\f[R], so that they may be styled differently
1465from the surrounding text if needed.
1466However, this gives acceptable results only for basic math, usually you
1467will want to use \f[C]--mathjax\f[R] or another of the following
1468options.
1469.TP
1470\f[B]\f[CB]--mathjax\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
1471Use MathJax to display embedded TeX math in HTML output.
1472TeX math will be put between \f[C]\[rs](...\[rs])\f[R] (for inline math)
1473or \f[C]\[rs][...\[rs]]\f[R] (for display math) and wrapped in
1474\f[C]<span>\f[R] tags with class \f[C]math\f[R].
1475Then the MathJax JavaScript will render it.
1476The \f[I]URL\f[R] should point to the \f[C]MathJax.js\f[R] load script.
1477If a \f[I]URL\f[R] is not provided, a link to the Cloudflare CDN will be
1478inserted.
1479.TP
1480\f[B]\f[CB]--mathml\f[B]\f[R]
1481Convert TeX math to MathML (in \f[C]epub3\f[R], \f[C]docbook4\f[R],
1482\f[C]docbook5\f[R], \f[C]jats\f[R], \f[C]html4\f[R] and
1483\f[C]html5\f[R]).
1484This is the default in \f[C]odt\f[R] output.
1485Note that currently only Firefox and Safari (and select e-book readers)
1486natively support MathML.
1487.TP
1488\f[B]\f[CB]--webtex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
1489Convert TeX formulas to \f[C]<img>\f[R] tags that link to an external
1490script that converts formulas to images.
1491The formula will be URL-encoded and concatenated with the URL provided.
1492For SVG images you can for example use
1493\f[C]--webtex https://latex.codecogs.com/svg.latex?\f[R].
1494If no URL is specified, the CodeCogs URL generating PNGs will be used
1495(\f[C]https://latex.codecogs.com/png.latex?\f[R]).
1496Note: the \f[C]--webtex\f[R] option will affect Markdown output as well
1497as HTML, which is useful if you\[cq]re targeting a version of Markdown
1498without native math support.
1499.TP
1500\f[B]\f[CB]--katex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
1501Use KaTeX to display embedded TeX math in HTML output.
1502The \f[I]URL\f[R] is the base URL for the KaTeX library.
1503That directory should contain a \f[C]katex.min.js\f[R] and a
1504\f[C]katex.min.css\f[R] file.
1505If a \f[I]URL\f[R] is not provided, a link to the KaTeX CDN will be
1506inserted.
1507.TP
1508\f[B]\f[CB]--gladtex\f[B]\f[R]
1509Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
1510The resulting HTML can then be processed by GladTeX to produce images of
1511the typeset formulas and an HTML file with links to these images.
1512So, the procedure is:
1513.RS
1514.IP
1515.nf
1516\f[C]
1517pandoc -s --gladtex input.md -o myfile.htex
1518gladtex -d myfile-images myfile.htex
1519# produces myfile.html and images in myfile-images
1520\f[R]
1521.fi
1522.RE
1523.SS Options for wrapper scripts
1524.TP
1525\f[B]\f[CB]--dump-args\f[B]\f[R]
1526Print information about command-line arguments to \f[I]stdout\f[R], then
1527exit.
1528This option is intended primarily for use in wrapper scripts.
1529The first line of output contains the name of the output file specified
1530with the \f[C]-o\f[R] option, or \f[C]-\f[R] (for \f[I]stdout\f[R]) if
1531no output file was specified.
1532The remaining lines contain the command-line arguments, one per line, in
1533the order they appear.
1534These do not include regular pandoc options and their arguments, but do
1535include any options appearing after a \f[C]--\f[R] separator at the end
1536of the line.
1537.TP
1538\f[B]\f[CB]--ignore-args\f[B]\f[R]
1539Ignore command-line arguments (for use in wrapper scripts).
1540Regular pandoc options are not ignored.
1541Thus, for example,
1542.RS
1543.IP
1544.nf
1545\f[C]
1546pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
1547\f[R]
1548.fi
1549.PP
1550is equivalent to
1551.IP
1552.nf
1553\f[C]
1554pandoc -o foo.html -s
1555\f[R]
1556.fi
1557.RE
1558.SH EXIT CODES
1559.PP
1560If pandoc completes successfully, it will return exit code 0.
1561Nonzero exit codes have the following meanings:
1562.PP
1563.TS
1564tab(@);
1565r l.
1567Code
1568T}@T{
1569Error
1574T}@T{
1575PandocFailOnWarningError
1579T}@T{
1580PandocAppError
1584T}@T{
1585PandocTemplateError
1589T}@T{
1590PandocOptionError
1594T}@T{
1595PandocUnknownReaderError
1599T}@T{
1600PandocUnknownWriterError
1604T}@T{
1605PandocUnsupportedExtensionError
1609T}@T{
1610PandocCiteprocError
1614T}@T{
1615PandocEpubSubdirectoryError
1619T}@T{
1620PandocPDFError
1624T}@T{
1625PandocPDFProgramNotFoundError
1629T}@T{
1630PandocHttpError
1634T}@T{
1635PandocShouldNeverHappenError
1639T}@T{
1640PandocSomeError
1644T}@T{
1645PandocParseError
1649T}@T{
1650PandocParsecError
1654T}@T{
1655PandocMakePDFError
1659T}@T{
1660PandocSyntaxMapError
1664T}@T{
1665PandocFilterError
1669T}@T{
1670PandocMacroLoop
1674T}@T{
1675PandocUTF8DecodingError
1679T}@T{
1680PandocIpynbDecodingError
1684T}@T{
1685PandocCouldNotFindDataFileError
1689T}@T{
1690PandocResourceNotFound
1692.TE
1693.SH DEFAULT FILES
1694.PP
1695The \f[C]--defaults\f[R] option may be used to specify a package of
1696options.
1697Here is a sample defaults file demonstrating all of the fields that may
1698be used:
1699.IP
1700.nf
1701\f[C]
1702from: markdown+emoji
1703# reader: may be used instead of from:
1704to: html5
1705# writer: may be used instead of to:
1707# leave blank for output to stdout:
1708output-file:
1709# leave blank for input from stdin, use [] for no input:
1710input-files:
1711- preface.md
1712- content.md
1713# or you may use input-file: with a single value
1715template: letter
1716standalone: true
1717self-contained: false
1719# note that structured variables may be specified:
1720variables:
1721 documentclass: book
1722 classoption:
1723 - twosides
1724 - draft
1726# metadata values specified here are parsed as literal
1727# string text, not markdown:
1728metadata:
1729 author:
1730 - Sam Smith
1731 - Julie Liu
1732metadata-files:
1733- boilerplate.yaml
1734# or you may use metadata-file: with a single value
1736# Note that these take files, not their contents:
1737include-before-body: []
1738include-after-body: []
1739include-in-header: []
1740resource-path: [\[dq].\[dq]]
1742# turn on built-in citation processing. Note that if you need
1743# control over when the citeproc processing is done relative
1744# to other filters, you should instead use \[ga]citeproc\[ga] in the
1745# list of \[ga]filters\[ga] (see below).
1746citeproc: true
1747csl: ieee
1748bibliography:
1749- foobar.bib
1750- barbaz.json
1751citation-abbreviations: abbrevs.json
1753# Filters will be assumed to be Lua filters if they have
1754# the .lua extension, and json filters otherwise. But
1755# the filter type can also be specified explicitly, as shown.
1756# Filters are run in the order specified.
1757# To include the built-in citeproc filter, use either \[ga]citeproc\[ga]
1758# or \[ga]{type: citeproc}\[ga].
1759filters:
1760- wordcount.lua
1761- type: json
1762 path: foo.lua
1764file-scope: false
1766data-dir:
1768# ERROR, WARNING, or INFO
1769verbosity: INFO
1770log-file: log.json
1772# citeproc, natbib, or biblatex
1773cite-method: citeproc
1774# part, chapter, section, or default:
1775top-level-division: chapter
1776abbreviations:
1778pdf-engine: pdflatex
1779pdf-engine-opts:
1780- \[dq]-shell-escape\[dq]
1781# you may also use pdf-engine-opt: with a single option
1782# pdf-engine-opt: \[dq]-shell-escape\[dq]
1784# auto, preserve, or none
1785wrap: auto
1786columns: 78
1787dpi: 72
1789extract-media: mediadir
1791table-of-contents: true
1792toc-depth: 2
1793number-sections: false
1794# a list of offsets at each heading level
1795number-offset: [0,0,0,0,0,0]
1796# toc: may also be used instead of table-of-contents:
1797shift-heading-level-by: 1
1798section-divs: true
1799identifier-prefix: foo
1800title-prefix: \[dq]\[dq]
1801strip-empty-paragraphs: true
1802# lf, crlf, or native
1803eol: lf
1804strip-comments: false
1805indented-code-classes: []
1806ascii: true
1807default-image-extension: \[dq].jpg\[dq]
1809# either a style name of a style definition file:
1810highlight-style: pygments
1811syntax-definitions:
1812- c.xml
1813# or you may use syntax-definition: with a single value
1814listings: false
1816reference-doc: myref.docx
1818# method is plain, webtex, gladtex, mathml, mathjax, katex
1819# you may specify a url with webtex, mathjax, katex
1820html-math-method:
1821 method: mathjax
1822 url: \[dq]https://cdn.jsdelivr.net/npm/mathjax\[at]3/es5/tex-mml-chtml.js\[dq]
1823# none, references, or javascript
1824email-obfuscation: javascript
1826tab-stop: 8
1827preserve-tabs: true
1829incremental: false
1830slide-level: 2
1832epub-subdirectory: EPUB
1833epub-metadata: meta.xml
1834epub-fonts:
1835- foobar.otf
1836epub-chapter-level: 1
1837epub-cover-image: cover.jpg
1839reference-links: true
1840# block, section, or document
1841reference-location: block
1842atx-headers: false
1844# accept, reject, or all
1845track-changes: accept
1847html-q-tags: false
1848css:
1849- site.css
1851# none, all, or best
1852ipynb-output: best
1854# A list of two-element lists
1855request-headers:
1856- [\[dq]User-Agent\[dq], \[dq]Mozilla/5.0\[dq]]
1858fail-if-warnings: false
1859dump-args: false
1860ignore-args: false
1861trace: false
1862\f[R]
1863.fi
1864.PP
1865Fields that are omitted will just have their regular default values.
1866So a defaults file can be as simple as one line:
1867.IP
1868.nf
1869\f[C]
1870verbosity: INFO
1871\f[R]
1872.fi
1873.PP
1874Default files can be placed in the \f[C]defaults\f[R] subdirectory of
1875the user data directory and used from any directory.
1876For example, one could create a file specifying defaults for writing
1877letters, save it as \f[C]letter.yaml\f[R] in the \f[C]defaults\f[R]
1878subdirectory of the user data directory, and then invoke these defaults
1879from any directory using \f[C]pandoc --defaults letter\f[R] or
1880\f[C]pandoc -dletter\f[R].
1881.PP
1882When multiple defaults are used, their contents will be combined.
1883.PP
1884Note that, where command-line arguments may be repeated
1885(\f[C]--metadata-file\f[R], \f[C]--css\f[R],
1886\f[C]--include-in-header\f[R], \f[C]--include-before-body\f[R],
1887\f[C]--include-after-body\f[R], \f[C]--variable\f[R],
1888\f[C]--metadata\f[R], \f[C]--syntax-definition\f[R]), the values
1889specified on the command line will combine with values specified in the
1890defaults file, rather than replacing them.
1891.SH TEMPLATES
1892.PP
1893When the \f[C]-s/--standalone\f[R] option is used, pandoc uses a
1894template to add header and footer material that is needed for a
1895self-standing document.
1896To see the default template that is used, just type
1897.IP
1898.nf
1899\f[C]
1900pandoc -D *FORMAT*
1901\f[R]
1902.fi
1903.PP
1904where \f[I]FORMAT\f[R] is the name of the output format.
1905A custom template can be specified using the \f[C]--template\f[R]
1906option.
1907You can also override the system default templates for a given output
1908format \f[I]FORMAT\f[R] by putting a file
1909\f[C]templates/default.*FORMAT*\f[R] in the user data directory (see
1910\f[C]--data-dir\f[R], above).
1911\f[I]Exceptions:\f[R]
1912.IP \[bu] 2
1913For \f[C]odt\f[R] output, customize the \f[C]default.opendocument\f[R]
1914template.
1915.IP \[bu] 2
1916For \f[C]pdf\f[R] output, customize the \f[C]default.latex\f[R] template
1917(or the \f[C]default.context\f[R] template, if you use
1918\f[C]-t context\f[R], or the \f[C]default.ms\f[R] template, if you use
1919\f[C]-t ms\f[R], or the \f[C]default.html\f[R] template, if you use
1920\f[C]-t html\f[R]).
1921.IP \[bu] 2
1922\f[C]docx\f[R] and \f[C]pptx\f[R] have no template (however, you can use
1923\f[C]--reference-doc\f[R] to customize the output).
1924.PP
1925Templates contain \f[I]variables\f[R], which allow for the inclusion of
1926arbitrary information at any point in the file.
1927They may be set at the command line using the \f[C]-V/--variable\f[R]
1928option.
1929If a variable is not set, pandoc will look for the key in the
1930document\[cq]s metadata, which can be set using either YAML metadata
1931blocks or with the \f[C]-M/--metadata\f[R] option.
1932In addition, some variables are given default values by pandoc.
1933See Variables below for a list of variables used in pandoc\[cq]s default
1934templates.
1935.PP
1936If you use custom templates, you may need to revise them as pandoc
1937changes.
1938We recommend tracking the changes in the default templates, and
1939modifying your custom templates accordingly.
1940An easy way to do this is to fork the pandoc-templates repository and
1941merge in changes after each pandoc release.
1942.SS Template syntax
1943.SS Comments
1944.PP
1945Anything between the sequence \f[C]$--\f[R] and the end of the line will
1946be treated as a comment and omitted from the output.
1947.SS Delimiters
1948.PP
1949To mark variables and control structures in the template, either
1950\f[C]$\f[R]\&...\f[C]$\f[R] or \f[C]${\f[R]\&...\f[C]}\f[R] may be used
1951as delimiters.
1952The styles may also be mixed in the same template, but the opening and
1953closing delimiter must match in each case.
1954The opening delimiter may be followed by one or more spaces or tabs,
1955which will be ignored.
1956The closing delimiter may be followed by one or more spaces or tabs,
1957which will be ignored.
1958.PP
1959To include a literal \f[C]$\f[R] in the document, use \f[C]$$\f[R].
1960.SS Interpolated variables
1961.PP
1962A slot for an interpolated variable is a variable name surrounded by
1963matched delimiters.
1964Variable names must begin with a letter and can contain letters,
1965numbers, \f[C]_\f[R], \f[C]-\f[R], and \f[C].\f[R].
1966The keywords \f[C]it\f[R], \f[C]if\f[R], \f[C]else\f[R],
1967\f[C]endif\f[R], \f[C]for\f[R], \f[C]sep\f[R], and \f[C]endfor\f[R] may
1968not be used as variable names.
1969Examples:
1970.IP
1971.nf
1972\f[C]
1973$foo$
1974$foo.bar.baz$
1975$foo_bar.baz-bim$
1976$ foo $
1977${foo}
1978${foo.bar.baz}
1979${foo_bar.baz-bim}
1980${ foo }
1981\f[R]
1982.fi
1983.PP
1984Variable names with periods are used to get at structured variable
1985values.
1986So, for example, \f[C]employee.salary\f[R] will return the value of the
1987\f[C]salary\f[R] field of the object that is the value of the
1988\f[C]employee\f[R] field.
1989.IP \[bu] 2
1990If the value of the variable is simple value, it will be rendered
1991verbatim.
1992(Note that no escaping is done; the assumption is that the calling
1993program will escape the strings appropriately for the output format.)
1994.IP \[bu] 2
1995If the value is a list, the values will be concatenated.
1996.IP \[bu] 2
1997If the value is a map, the string \f[C]true\f[R] will be rendered.
1998.IP \[bu] 2
1999Every other value will be rendered as the empty string.
2000.SS Conditionals
2001.PP
2002A conditional begins with \f[C]if(variable)\f[R] (enclosed in matched
2003delimiters) and ends with \f[C]endif\f[R] (enclosed in matched
2004delimiters).
2005It may optionally contain an \f[C]else\f[R] (enclosed in matched
2006delimiters).
2007The \f[C]if\f[R] section is used if \f[C]variable\f[R] has a non-empty
2008value, otherwise the \f[C]else\f[R] section is used (if present).
2009Examples:
2010.IP
2011.nf
2012\f[C]
2013$if(foo)$bar$endif$
2015$if(foo)$
2016 $foo$
2017$endif$
2019$if(foo)$
2020part one
2021$else$
2022part two
2023$endif$
2025${if(foo)}bar${endif}
2027${if(foo)}
2028 ${foo}
2029${endif}
2031${if(foo)}
2032${ foo.bar }
2033${else}
2034no foo!
2035${endif}
2036\f[R]
2037.fi
2038.PP
2039The keyword \f[C]elseif\f[R] may be used to simplify complex nested
2040conditionals:
2041.IP
2042.nf
2043\f[C]
2044$if(foo)$
2045XXX
2046$elseif(bar)$
2047YYY
2048$else$
2049ZZZ
2050$endif$
2051\f[R]
2052.fi
2053.SS For loops
2054.PP
2055A for loop begins with \f[C]for(variable)\f[R] (enclosed in matched
2056delimiters) and ends with \f[C]endfor\f[R] (enclosed in matched
2057delimiters.
2058.IP \[bu] 2
2059If \f[C]variable\f[R] is an array, the material inside the loop will be
2060evaluated repeatedly, with \f[C]variable\f[R] being set to each value of
2061the array in turn, and concatenated.
2062.IP \[bu] 2
2063If \f[C]variable\f[R] is a map, the material inside will be set to the
2064map.
2065.IP \[bu] 2
2066If the value of the associated variable is not an array or a map, a
2067single iteration will be performed on its value.
2068.PP
2069Examples:
2070.IP
2071.nf
2072\f[C]
2073$for(foo)$$foo$$sep$, $endfor$
2075$for(foo)$
2076 - $foo.last$, $foo.first$
2077$endfor$
2079${ for(foo.bar) }
2080 - ${ foo.bar.last }, ${ foo.bar.first }
2081${ endfor }
2083$for(mymap)$
2084$it.name$: $it.office$
2085$endfor$
2086\f[R]
2087.fi
2088.PP
2089You may optionally specify a separator between consecutive values using
2090\f[C]sep\f[R] (enclosed in matched delimiters).
2091The material between \f[C]sep\f[R] and the \f[C]endfor\f[R] is the
2092separator.
2093.IP
2094.nf
2095\f[C]
2096${ for(foo) }${ foo }${ sep }, ${ endfor }
2097\f[R]
2098.fi
2099.PP
2100Instead of using \f[C]variable\f[R] inside the loop, the special
2101anaphoric keyword \f[C]it\f[R] may be used.
2102.IP
2103.nf
2104\f[C]
2105${ for(foo.bar) }
2106 - ${ it.last }, ${ it.first }
2107${ endfor }
2108\f[R]
2109.fi
2110.SS Partials
2111.PP
2112Partials (subtemplates stored in different files) may be included by
2113using the name of the partial, followed by \f[C]()\f[R], for example:
2114.IP
2115.nf
2116\f[C]
2117${ styles() }
2118\f[R]
2119.fi
2120.PP
2121Partials will be sought in the directory containing the main template.
2122The file name will be assumed to have the same extension as the main
2123template if it lacks an extension.
2124When calling the partial, the full name including file extension can
2125also be used:
2126.IP
2127.nf
2128\f[C]
2129${ styles.html() }
2130\f[R]
2131.fi
2132.PP
2133(If a partial is not found in the directory of the template, it will
2134also be sought in the \f[C]templates\f[R] subdirectory of the user data
2135directory.)
2136.PP
2137Partials may optionally be applied to variables using a colon:
2138.IP
2139.nf
2140\f[C]
2141${ date:fancy() }
2143${ articles:bibentry() }
2144\f[R]
2145.fi
2146.PP
2147If \f[C]articles\f[R] is an array, this will iterate over its values,
2148applying the partial \f[C]bibentry()\f[R] to each one.
2149So the second example above is equivalent to
2150.IP
2151.nf
2152\f[C]
2153${ for(articles) }
2154${ it:bibentry() }
2155${ endfor }
2156\f[R]
2157.fi
2158.PP
2159Note that the anaphoric keyword \f[C]it\f[R] must be used when iterating
2160over partials.
2161In the above examples, the \f[C]bibentry\f[R] partial should contain
2162\f[C]it.title\f[R] (and so on) instead of \f[C]articles.title\f[R].
2163.PP
2164Final newlines are omitted from included partials.
2165.PP
2166Partials may include other partials.
2167.PP
2168A separator between values of an array may be specified in square
2169brackets, immediately after the variable name or partial:
2170.IP
2171.nf
2172\f[C]
2173${months[, ]}$
2175${articles:bibentry()[; ]$
2176\f[R]
2177.fi
2178.PP
2179The separator in this case is literal and (unlike with \f[C]sep\f[R] in
2180an explicit \f[C]for\f[R] loop) cannot contain interpolated variables or
2181other template directives.
2182.SS Nesting
2183.PP
2184To ensure that content is \[lq]nested,\[rq] that is, subsequent lines
2185indented, use the \f[C]\[ha]\f[R] directive:
2186.IP
2187.nf
2188\f[C]
2189$item.number$ $\[ha]$$item.description$ ($item.price$)
2190\f[R]
2191.fi
2192.PP
2193In this example, if \f[C]item.description\f[R] has multiple lines, they
2194will all be indented to line up with the first line:
2195.IP
2196.nf
2197\f[C]
219800123 A fine bottle of 18-year old
2199 Oban whiskey. ($148)
2200\f[R]
2201.fi
2202.PP
2203To nest multiple lines to the same level, align them with the
2204\f[C]\[ha]\f[R] directive in the template.
2205For example:
2206.IP
2207.nf
2208\f[C]
2209$item.number$ $\[ha]$$item.description$ ($item.price$)
2210 (Available til $item.sellby$.)
2211\f[R]
2212.fi
2213.PP
2214will produce
2215.IP
2216.nf
2217\f[C]
221800123 A fine bottle of 18-year old
2219 Oban whiskey. ($148)
2220 (Available til March 30, 2020.)
2221\f[R]
2222.fi
2223.PP
2224If a variable occurs by itself on a line, preceded by whitespace and not
2225followed by further text or directives on the same line, and the
2226variable\[cq]s value contains multiple lines, it will be nested
2227automatically.
2228.SS Breakable spaces
2229.PP
2230Normally, spaces in the template itself (as opposed to values of the
2231interpolated variables) are not breakable, but they can be made
2232breakable in part of the template by using the \f[C]\[ti]\f[R] keyword
2233(ended with another \f[C]\[ti]\f[R]).
2234.IP
2235.nf
2236\f[C]
2237$\[ti]$This long line may break if the document is rendered
2238with a short line length.$\[ti]$
2239\f[R]
2240.fi
2241.SS Pipes
2242.PP
2243A pipe transforms the value of a variable or partial.
2244Pipes are specified using a slash (\f[C]/\f[R]) between the variable
2245name (or partial) and the pipe name.
2246Example:
2247.IP
2248.nf
2249\f[C]
2250$for(name)$
2251$name/uppercase$
2252$endfor$
2254$for(metadata/pairs)$
2255- $it.key$: $it.value$
2256$endfor$
2258$employee:name()/uppercase$
2259\f[R]
2260.fi
2261.PP
2262Pipes may be chained:
2263.IP
2264.nf
2265\f[C]
2266$for(employees/pairs)$
2267$it.key/alpha/uppercase$. $it.name$
2268$endfor$
2269\f[R]
2270.fi
2271.PP
2272Some pipes take parameters:
2273.IP
2274.nf
2275\f[C]
2276|----------------------|------------|
2277$for(employee)$
2278$it.name.first/uppercase/left 20 \[dq]| \[dq]$$it.name.salary/right 10 \[dq] | \[dq] \[dq] |\[dq]$
2279$endfor$
2280|----------------------|------------|
2281\f[R]
2282.fi
2283.PP
2284Currently the following pipes are predefined:
2285.IP \[bu] 2
2286\f[C]pairs\f[R]: Converts a map or array to an array of maps, each with
2287\f[C]key\f[R] and \f[C]value\f[R] fields.
2288If the original value was an array, the \f[C]key\f[R] will be the array
2289index, starting with 1.
2290.IP \[bu] 2
2291\f[C]uppercase\f[R]: Converts text to uppercase.
2292.IP \[bu] 2
2293\f[C]lowercase\f[R]: Converts text to lowercase.
2294.IP \[bu] 2
2295\f[C]length\f[R]: Returns the length of the value: number of characters
2296for a textual value, number of elements for a map or array.
2297.IP \[bu] 2
2298\f[C]reverse\f[R]: Reverses a textual value or array, and has no effect
2299on other values.
2300.IP \[bu] 2
2301\f[C]first\f[R]: Returns the first value of an array, if applied to a
2302non-empty array; otherwise returns the original value.
2303.IP \[bu] 2
2304\f[C]last\f[R]: Returns the last value of an array, if applied to a
2305non-empty array; otherwise returns the original value.
2306.IP \[bu] 2
2307\f[C]rest\f[R]: Returns all but the first value of an array, if applied
2308to a non-empty array; otherwise returns the original value.
2309.IP \[bu] 2
2310\f[C]allbutlast\f[R]: Returns all but the last value of an array, if
2311applied to a non-empty array; otherwise returns the original value.
2312.IP \[bu] 2
2313\f[C]chomp\f[R]: Removes trailing newlines (and breakable space).
2314.IP \[bu] 2
2315\f[C]nowrap\f[R]: Disables line wrapping on breakable spaces.
2316.IP \[bu] 2
2317\f[C]alpha\f[R]: Converts textual values that can be read as an integer
2318into lowercase alphabetic characters \f[C]a..z\f[R] (mod 26).
2319This can be used to get lettered enumeration from array indices.
2320To get uppercase letters, chain with \f[C]uppercase\f[R].
2321.IP \[bu] 2
2322\f[C]roman\f[R]: Converts textual values that can be read as an integer
2323into lowercase roman numerials.
2324This can be used to get lettered enumeration from array indices.
2325To get uppercase roman, chain with \f[C]uppercase\f[R].
2326.IP \[bu] 2
2327\f[C]left n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
2328textual value in a block of width \f[C]n\f[R], aligned to the left, with
2329an optional left and right border.
2330Has no effect on other values.
2331This can be used to align material in tables.
2332Widths are positive integers indicating the number of characters.
2333Borders are strings inside double quotes; literal \f[C]\[dq]\f[R] and
2334\f[C]\[rs]\f[R] characters must be backslash-escaped.
2335.IP \[bu] 2
2336\f[C]right n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
2337textual value in a block of width \f[C]n\f[R], aligned to the right, and
2338has no effect on other values.
2339.IP \[bu] 2
2340\f[C]center n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
2341textual value in a block of width \f[C]n\f[R], aligned to the center,
2342and has no effect on other values.
2343.SS Variables
2344.SS Metadata variables
2345.TP
2346\f[B]\f[CB]title\f[B]\f[R], \f[B]\f[CB]author\f[B]\f[R], \f[B]\f[CB]date\f[B]\f[R]
2347allow identification of basic aspects of the document.
2348Included in PDF metadata through LaTeX and ConTeXt.
2349These can be set through a pandoc title block, which allows for multiple
2350authors, or through a YAML metadata block:
2351.RS
2352.IP
2353.nf
2354\f[C]
2355---
2356author:
2357- Aristotle
2358- Peter Abelard
2359\&...
2360\f[R]
2361.fi
2362.PP
2363Note that if you just want to set PDF or HTML metadata, without
2364including a title block in the document itself, you can set the
2365\f[C]title-meta\f[R], \f[C]author-meta\f[R], and \f[C]date-meta\f[R]
2366variables.
2367(By default these are set automatically, based on \f[C]title\f[R],
2368\f[C]author\f[R], and \f[C]date\f[R].)
2369.RE
2370.TP
2371\f[B]\f[CB]subtitle\f[B]\f[R]
2372document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
2373documents
2374.TP
2375\f[B]\f[CB]abstract\f[B]\f[R]
2376document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx
2377documents
2378.TP
2379\f[B]\f[CB]keywords\f[B]\f[R]
2380list of keywords to be included in HTML, PDF, ODT, pptx, docx and
2381AsciiDoc metadata; repeat as for \f[C]author\f[R], above
2382.TP
2383\f[B]\f[CB]subject\f[B]\f[R]
2384document subject, included in ODT, PDF, docx and pptx metadata
2385.TP
2386\f[B]\f[CB]description\f[B]\f[R]
2387document description, included in ODT, docx and pptx metadata.
2388Some applications show this as \f[C]Comments\f[R] metadata.
2389.TP
2390\f[B]\f[CB]category\f[B]\f[R]
2391document category, included in docx and pptx metadata
2392.PP
2393Additionally, any root-level string metadata, not included in ODT, docx
2394or pptx metadata is added as a \f[I]custom property\f[R].
2395The following YAML metadata block for instance:
2396.IP
2397.nf
2398\f[C]
2399---
2400title: \[aq]This is the title\[aq]
2401subtitle: \[dq]This is the subtitle\[dq]
2402author:
2403- Author One
2404- Author Two
2405description: |
2406 This is a long
2407 description.
2409 It consists of two paragraphs
2410\&...
2411\f[R]
2412.fi
2413.PP
2414will include \f[C]title\f[R], \f[C]author\f[R] and \f[C]description\f[R]
2415as standard document properties and \f[C]subtitle\f[R] as a custom
2416property when converting to docx, ODT or pptx.
2417.SS Language variables
2418.TP
2419\f[B]\f[CB]lang\f[B]\f[R]
2420identifies the main language of the document using IETF language tags
2421(following the BCP 47 standard), such as \f[C]en\f[R] or
2422\f[C]en-GB\f[R].
2423The Language subtag lookup tool can look up or verify these tags.
2424This affects most formats, and controls hyphenation in PDF output when
2425using LaTeX (through \f[C]babel\f[R] and \f[C]polyglossia\f[R]) or
2426ConTeXt.
2427.RS
2428.PP
2429Use native pandoc Divs and Spans with the \f[C]lang\f[R] attribute to
2430switch the language:
2431.IP
2432.nf
2433\f[C]
2434---
2435lang: en-GB
2436\&...
2438Text in the main document language (British English).
2440::: {lang=fr-CA}
2441> Cette citation est \['e]crite en fran\[,c]ais canadien.
2442:::
2444More text in English. [\[aq]Zitat auf Deutsch.\[aq]]{lang=de}
2445\f[R]
2446.fi
2447.RE
2448.TP
2449\f[B]\f[CB]dir\f[B]\f[R]
2450the base script direction, either \f[C]rtl\f[R] (right-to-left) or
2451\f[C]ltr\f[R] (left-to-right).
2452.RS
2453.PP
2454For bidirectional documents, native pandoc \f[C]span\f[R]s and
2455\f[C]div\f[R]s with the \f[C]dir\f[R] attribute (value \f[C]rtl\f[R] or
2456\f[C]ltr\f[R]) can be used to override the base direction in some output
2457formats.
2458This may not always be necessary if the final renderer (e.g.\ the
2459browser, when generating HTML) supports the Unicode Bidirectional
2460Algorithm.
2461.PP
2462When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[R]
2463engine is fully supported (use \f[C]--pdf-engine=xelatex\f[R]).
2464.RE
2465.SS Variables for HTML
2466.TP
2467\f[B]\f[CB]document-css\f[B]\f[R]
2468Enables inclusion of most of the CSS in the \f[C]styles.html\f[R]
2469partial (have a look with
2470\f[C]pandoc --print-default-data-file=templates/styles.html\f[R]).
2471Unless you use \f[C]--css\f[R], this variable is set to \f[C]true\f[R]
2472by default.
2473You can disable it with e.g.\ \f[C]pandoc -M document-css=false\f[R].
2474.TP
2475\f[B]\f[CB]mainfont\f[B]\f[R]
2476sets the CSS \f[C]font-family\f[R] property on the \f[C]html\f[R]
2477element.
2478.TP
2479\f[B]\f[CB]fontsize\f[B]\f[R]
2480sets the base CSS \f[C]font-size\f[R], which you\[cq]d usually set to
2481e.g.\ \f[C]20px\f[R], but it also accepts \f[C]pt\f[R] (12pt = 16px in
2482most browsers).
2483.TP
2484\f[B]\f[CB]fontcolor\f[B]\f[R]
2485sets the CSS \f[C]color\f[R] property on the \f[C]html\f[R] element.
2486.TP
2487\f[B]\f[CB]linkcolor\f[B]\f[R]
2488sets the CSS \f[C]color\f[R] property on all links.
2489.TP
2490\f[B]\f[CB]monofont\f[B]\f[R]
2491sets the CSS \f[C]font-family\f[R] property on \f[C]code\f[R] elements.
2492.TP
2493\f[B]\f[CB]monobackgroundcolor\f[B]\f[R]
2494sets the CSS \f[C]background-color\f[R] property on \f[C]code\f[R]
2495elements and adds extra padding.
2496.TP
2497\f[B]\f[CB]linestretch\f[B]\f[R]
2498sets the CSS \f[C]line-height\f[R] property on the \f[C]html\f[R]
2499element, which is preferred to be unitless.
2500.TP
2501\f[B]\f[CB]backgroundcolor\f[B]\f[R]
2502sets the CSS \f[C]background-color\f[R] property on the \f[C]html\f[R]
2503element.
2504.TP
2505\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2506sets the corresponding CSS \f[C]padding\f[R] properties on the
2507\f[C]body\f[R] element.
2508.PP
2509To override or extend some CSS for just one document, include for
2510example:
2511.IP
2512.nf
2513\f[C]
2514---
2515header-includes: |
2516 <style>
2517 blockquote {
2518 font-style: italic;
2520 tr.even {
2521 background-color: #f0f0f0;
2523 td, th {
2524 padding: 0.5em 2em 0.5em 0.5em;
2526 tbody {
2527 border-bottom: none;
2529 </style>
2530---
2531\f[R]
2532.fi
2533.SS Variables for HTML math
2534.TP
2535\f[B]\f[CB]classoption\f[B]\f[R]
2536when using KaTeX, you can render display math equations flush left using
2537YAML metadata or with \f[C]-M classoption=fleqn\f[R].
2538.SS Variables for HTML slides
2539.PP
2540These affect HTML output when [producing slide shows with pandoc].
2541.PP
2542All reveal.js configuration options are available as variables.
2543To turn off boolean flags that default to true in reveal.js, use
2544\f[C]0\f[R].
2545.TP
2546\f[B]\f[CB]revealjs-url\f[B]\f[R]
2547base URL for reveal.js documents (defaults to
2548\f[C]https://unpkg.com/reveal.js\[at]\[ha]4/\f[R])
2549.TP
2550\f[B]\f[CB]s5-url\f[B]\f[R]
2551base URL for S5 documents (defaults to \f[C]s5/default\f[R])
2552.TP
2553\f[B]\f[CB]slidy-url\f[B]\f[R]
2554base URL for Slidy documents (defaults to
2555\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[R])
2556.TP
2557\f[B]\f[CB]slideous-url\f[B]\f[R]
2558base URL for Slideous documents (defaults to \f[C]slideous\f[R])
2559.TP
2560\f[B]\f[CB]title-slide-attributes\f[B]\f[R]
2561additional attributes for the title slide of reveal.js slide shows.
2562See background in reveal.js and beamer for an example.
2563.SS Variables for Beamer slides
2564.PP
2565These variables change the appearance of PDF slides using
2566\f[C]beamer\f[R].
2567.TP
2568\f[B]\f[CB]aspectratio\f[B]\f[R]
2569slide aspect ratio (\f[C]43\f[R] for 4:3 [default], \f[C]169\f[R] for
257016:9, \f[C]1610\f[R] for 16:10, \f[C]149\f[R] for 14:9, \f[C]141\f[R]
2571for 1.41:1, \f[C]54\f[R] for 5:4, \f[C]32\f[R] for 3:2)
2572.TP
2573\f[B]\f[CB]beamerarticle\f[B]\f[R]
2574produce an article from Beamer slides
2575.TP
2576\f[B]\f[CB]beameroption\f[B]\f[R]
2577add extra beamer option with \f[C]\[rs]setbeameroption{}\f[R]
2578.TP
2579\f[B]\f[CB]institute\f[B]\f[R]
2580author affiliations: can be a list when there are multiple authors
2581.TP
2582\f[B]\f[CB]logo\f[B]\f[R]
2583logo image for slides
2584.TP
2585\f[B]\f[CB]navigation\f[B]\f[R]
2586controls navigation symbols (default is \f[C]empty\f[R] for no
2587navigation symbols; other valid values are \f[C]frame\f[R],
2588\f[C]vertical\f[R], and \f[C]horizontal\f[R])
2589.TP
2590\f[B]\f[CB]section-titles\f[B]\f[R]
2591enables \[lq]title pages\[rq] for new sections (default is true)
2592.TP
2593\f[B]\f[CB]theme\f[B]\f[R], \f[B]\f[CB]colortheme\f[B]\f[R], \f[B]\f[CB]fonttheme\f[B]\f[R], \f[B]\f[CB]innertheme\f[B]\f[R], \f[B]\f[CB]outertheme\f[B]\f[R]
2594beamer themes
2595.TP
2596\f[B]\f[CB]themeoptions\f[B]\f[R]
2597options for LaTeX beamer themes (a list).
2598.TP
2599\f[B]\f[CB]titlegraphic\f[B]\f[R]
2600image for title slide
2601.SS Variables for PowerPoint
2602.PP
2603These variables control the visual aspects of a slide show that are not
2604easily controlled via templates.
2605.TP
2606\f[B]\f[CB]monofont\f[B]\f[R]
2607font to use for code.
2608.SS Variables for LaTeX
2609.PP
2610Pandoc uses these variables when creating a PDF with a LaTeX engine.
2611.SS Layout
2612.TP
2613\f[B]\f[CB]block-headings\f[B]\f[R]
2614make \f[C]\[rs]paragraph\f[R] and \f[C]\[rs]subparagraph\f[R] (fourth-
2615and fifth-level headings, or fifth- and sixth-level with book classes)
2616free-standing rather than run-in; requires further formatting to
2617distinguish from \f[C]\[rs]subsubsection\f[R] (third- or fourth-level
2618headings).
2619Instead of using this option, KOMA-Script can adjust headings more
2620extensively:
2621.RS
2622.IP
2623.nf
2624\f[C]
2625---
2626documentclass: scrartcl
2627header-includes: |
2628 \[rs]RedeclareSectionCommand[
2629 beforeskip=-10pt plus -2pt minus -1pt,
2630 afterskip=1sp plus -1sp minus 1sp,
2631 font=\[rs]normalfont\[rs]itshape]{paragraph}
2632 \[rs]RedeclareSectionCommand[
2633 beforeskip=-10pt plus -2pt minus -1pt,
2634 afterskip=1sp plus -1sp minus 1sp,
2635 font=\[rs]normalfont\[rs]scshape,
2636 indent=0pt]{subparagraph}
2637\&...
2638\f[R]
2639.fi
2640.RE
2641.TP
2642\f[B]\f[CB]classoption\f[B]\f[R]
2643option for document class, e.g.\ \f[C]oneside\f[R]; repeat for multiple
2644options:
2645.RS
2646.IP
2647.nf
2648\f[C]
2649---
2650classoption:
2651- twocolumn
2652- landscape
2653\&...
2654\f[R]
2655.fi
2656.RE
2657.TP
2658\f[B]\f[CB]documentclass\f[B]\f[R]
2659document class: usually one of the standard classes, \f[C]article\f[R],
2660\f[C]book\f[R], and \f[C]report\f[R]; the KOMA-Script equivalents,
2661\f[C]scrartcl\f[R], \f[C]scrbook\f[R], and \f[C]scrreprt\f[R], which
2662default to smaller margins; or \f[C]memoir\f[R]
2663.TP
2664\f[B]\f[CB]geometry\f[B]\f[R]
2665option for \f[C]geometry\f[R] package, e.g.\ \f[C]margin=1in\f[R];
2666repeat for multiple options:
2667.RS
2668.IP
2669.nf
2670\f[C]
2671---
2672geometry:
2673- top=30mm
2674- left=20mm
2675- heightrounded
2676\&...
2677\f[R]
2678.fi
2679.RE
2680.TP
2681\f[B]\f[CB]hyperrefoptions\f[B]\f[R]
2682option for \f[C]hyperref\f[R] package, e.g.\ \f[C]linktoc=all\f[R];
2683repeat for multiple options:
2684.RS
2685.IP
2686.nf
2687\f[C]
2688---
2689hyperrefoptions:
2690- linktoc=all
2691- pdfwindowui
2692- pdfpagemode=FullScreen
2693\&...
2694\f[R]
2695.fi
2696.RE
2697.TP
2698\f[B]\f[CB]indent\f[B]\f[R]
2699if true, pandoc will use document class settings for indentation (the
2700default LaTeX template otherwise removes indentation and adds space
2701between paragraphs)
2702.TP
2703\f[B]\f[CB]linestretch\f[B]\f[R]
2704adjusts line spacing using the \f[C]setspace\f[R] package,
2705e.g.\ \f[C]1.25\f[R], \f[C]1.5\f[R]
2706.TP
2707\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2708sets margins if \f[C]geometry\f[R] is not used (otherwise
2709\f[C]geometry\f[R] overrides these)
2710.TP
2711\f[B]\f[CB]pagestyle\f[B]\f[R]
2712control \f[C]\[rs]pagestyle{}\f[R]: the default article class supports
2713\f[C]plain\f[R] (default), \f[C]empty\f[R] (no running heads or page
2714numbers), and \f[C]headings\f[R] (section titles in running heads)
2715.TP
2716\f[B]\f[CB]papersize\f[B]\f[R]
2717paper size, e.g.\ \f[C]letter\f[R], \f[C]a4\f[R]
2718.TP
2719\f[B]\f[CB]secnumdepth\f[B]\f[R]
2720numbering depth for sections (with \f[C]--number-sections\f[R] option or
2721\f[C]numbersections\f[R] variable)
2722.SS Fonts
2723.TP
2724\f[B]\f[CB]fontenc\f[B]\f[R]
2725allows font encoding to be specified through \f[C]fontenc\f[R] package
2726(with \f[C]pdflatex\f[R]); default is \f[C]T1\f[R] (see LaTeX font
2727encodings guide)
2728.TP
2729\f[B]\f[CB]fontfamily\f[B]\f[R]
2730font package for use with \f[C]pdflatex\f[R]: TeX Live includes many
2731options, documented in the LaTeX Font Catalogue.
2732The default is Latin Modern.
2733.TP
2734\f[B]\f[CB]fontfamilyoptions\f[B]\f[R]
2735options for package used as \f[C]fontfamily\f[R]; repeat for multiple
2736options.
2737For example, to use the Libertine font with proportional lowercase
2738(old-style) figures through the \f[C]libertinus\f[R] package:
2739.RS
2740.IP
2741.nf
2742\f[C]
2743---
2744fontfamily: libertinus
2745fontfamilyoptions:
2746- osf
2747- p
2748\&...
2749\f[R]
2750.fi
2751.RE
2752.TP
2753\f[B]\f[CB]fontsize\f[B]\f[R]
2754font size for body text.
2755The standard classes allow 10pt, 11pt, and 12pt.
2756To use another size, set \f[C]documentclass\f[R] to one of the
2757KOMA-Script classes, such as \f[C]scrartcl\f[R] or \f[C]scrbook\f[R].
2758.TP
2759\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R], \f[B]\f[CB]CJKmainfont\f[B]\f[R]
2760font families for use with \f[C]xelatex\f[R] or \f[C]lualatex\f[R]: take
2761the name of any system font, using the \f[C]fontspec\f[R] package.
2762\f[C]CJKmainfont\f[R] uses the \f[C]xecjk\f[R] package.
2763.TP
2764\f[B]\f[CB]mainfontoptions\f[B]\f[R], \f[B]\f[CB]sansfontoptions\f[B]\f[R], \f[B]\f[CB]monofontoptions\f[B]\f[R], \f[B]\f[CB]mathfontoptions\f[B]\f[R], \f[B]\f[CB]CJKoptions\f[B]\f[R]
2765options to use with \f[C]mainfont\f[R], \f[C]sansfont\f[R],
2766\f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R] in
2767\f[C]xelatex\f[R] and \f[C]lualatex\f[R].
2768Allow for any choices available through \f[C]fontspec\f[R]; repeat for
2769multiple options.
2770For example, to use the TeX Gyre version of Palatino with lowercase
2771figures:
2772.RS
2773.IP
2774.nf
2775\f[C]
2776---
2777mainfont: TeX Gyre Pagella
2778mainfontoptions:
2779- Numbers=Lowercase
2780- Numbers=Proportional
2781\&...
2782\f[R]
2783.fi
2784.RE
2785.TP
2786\f[B]\f[CB]microtypeoptions\f[B]\f[R]
2787options to pass to the microtype package
2788.SS Links
2789.TP
2790\f[B]\f[CB]colorlinks\f[B]\f[R]
2791add color to link text; automatically enabled if any of
2792\f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R],
2793\f[C]urlcolor\f[R], or \f[C]toccolor\f[R] are set
2794.TP
2795\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]filecolor\f[B]\f[R], \f[B]\f[CB]citecolor\f[B]\f[R], \f[B]\f[CB]urlcolor\f[B]\f[R], \f[B]\f[CB]toccolor\f[B]\f[R]
2796color for internal links, external links, citation links, linked URLs,
2797and links in table of contents, respectively: uses options allowed by
2798\f[C]xcolor\f[R], including the \f[C]dvipsnames\f[R],
2799\f[C]svgnames\f[R], and \f[C]x11names\f[R] lists
2800.TP
2801\f[B]\f[CB]links-as-notes\f[B]\f[R]
2802causes links to be printed as footnotes
2803.SS Front matter
2804.TP
2805\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
2806include list of figures, list of tables
2807.TP
2808\f[B]\f[CB]thanks\f[B]\f[R]
2809contents of acknowledgments footnote after document title
2810.TP
2811\f[B]\f[CB]toc\f[B]\f[R]
2812include table of contents (can also be set using
2813\f[C]--toc/--table-of-contents\f[R])
2814.TP
2815\f[B]\f[CB]toc-depth\f[B]\f[R]
2816level of section to include in table of contents
2817.SS BibLaTeX Bibliographies
2818.PP
2819These variables function when using BibLaTeX for citation rendering.
2820.TP
2821\f[B]\f[CB]biblatexoptions\f[B]\f[R]
2822list of options for biblatex
2823.TP
2824\f[B]\f[CB]biblio-style\f[B]\f[R]
2825bibliography style, when used with \f[C]--natbib\f[R] and
2826\f[C]--biblatex\f[R].
2827.TP
2828\f[B]\f[CB]biblio-title\f[B]\f[R]
2829bibliography title, when used with \f[C]--natbib\f[R] and
2830\f[C]--biblatex\f[R].
2831.TP
2832\f[B]\f[CB]bibliography\f[B]\f[R]
2833bibliography to use for resolving references
2834.TP
2835\f[B]\f[CB]natbiboptions\f[B]\f[R]
2836list of options for natbib
2837.SS Variables for ConTeXt
2838.PP
2839Pandoc uses these variables when creating a PDF with ConTeXt.
2840.TP
2841\f[B]\f[CB]fontsize\f[B]\f[R]
2842font size for body text (e.g.\ \f[C]10pt\f[R], \f[C]12pt\f[R])
2843.TP
2844\f[B]\f[CB]headertext\f[B]\f[R], \f[B]\f[CB]footertext\f[B]\f[R]
2845text to be placed in running header or footer (see ConTeXt Headers and
2846Footers); repeat up to four times for different placement
2847.TP
2848\f[B]\f[CB]indenting\f[B]\f[R]
2849controls indentation of paragraphs, e.g.\ \f[C]yes,small,next\f[R] (see
2850ConTeXt Indentation); repeat for multiple options
2851.TP
2852\f[B]\f[CB]interlinespace\f[B]\f[R]
2853adjusts line spacing, e.g.\ \f[C]4ex\f[R] (using
2854\f[C]setupinterlinespace\f[R]); repeat for multiple options
2855.TP
2856\f[B]\f[CB]layout\f[B]\f[R]
2857options for page margins and text arrangement (see ConTeXt Layout);
2858repeat for multiple options
2859.TP
2860\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]contrastcolor\f[B]\f[R]
2861color for links outside and inside a page, e.g.\ \f[C]red\f[R],
2862\f[C]blue\f[R] (see ConTeXt Color)
2863.TP
2864\f[B]\f[CB]linkstyle\f[B]\f[R]
2865typeface style for links, e.g.\ \f[C]normal\f[R], \f[C]bold\f[R],
2866\f[C]slanted\f[R], \f[C]boldslanted\f[R], \f[C]type\f[R], \f[C]cap\f[R],
2867\f[C]small\f[R]
2868.TP
2869\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
2870include list of figures, list of tables
2871.TP
2872\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R]
2873font families: take the name of any system font (see ConTeXt Font
2874Switching)
2875.TP
2876\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2877sets margins, if \f[C]layout\f[R] is not used (otherwise
2878\f[C]layout\f[R] overrides these)
2879.TP
2880\f[B]\f[CB]pagenumbering\f[B]\f[R]
2881page number style and location (using \f[C]setuppagenumbering\f[R]);
2882repeat for multiple options
2883.TP
2884\f[B]\f[CB]papersize\f[B]\f[R]
2885paper size, e.g.\ \f[C]letter\f[R], \f[C]A4\f[R], \f[C]landscape\f[R]
2886(see ConTeXt Paper Setup); repeat for multiple options
2887.TP
2888\f[B]\f[CB]pdfa\f[B]\f[R]
2889adds to the preamble the setup necessary to generate PDF/A of the type
2890specified, e.g.\ \f[C]1a:2005\f[R], \f[C]2a\f[R].
2891If no type is specified (i.e.\ the value is set to True, by
2892e.g.\ \f[C]--metadata=pdfa\f[R] or \f[C]pdfa: true\f[R] in a YAML
2893metadata block), \f[C]1b:2005\f[R] will be used as default, for reasons
2894of backwards compatibility.
2895Using \f[C]--variable=pdfa\f[R] without specified value is not
2896supported.
2897To successfully generate PDF/A the required ICC color profiles have to
2898be available and the content and all included files (such as images)
2899have to be standard conforming.
2900The ICC profiles and output intent may be specified using the variables
2901\f[C]pdfaiccprofile\f[R] and \f[C]pdfaintent\f[R].
2902See also ConTeXt PDFA for more details.
2903.TP
2904\f[B]\f[CB]pdfaiccprofile\f[B]\f[R]
2905when used in conjunction with \f[C]pdfa\f[R], specifies the ICC profile
2906to use in the PDF, e.g.\ \f[C]default.cmyk\f[R].
2907If left unspecified, \f[C]sRGB.icc\f[R] is used as default.
2908May be repeated to include multiple profiles.
2909Note that the profiles have to be available on the system.
2910They can be obtained from ConTeXt ICC Profiles.
2911.TP
2912\f[B]\f[CB]pdfaintent\f[B]\f[R]
2913when used in conjunction with \f[C]pdfa\f[R], specifies the output
2914intent for the colors,
2915e.g.\ \f[C]ISO coated v2 300\[rs]letterpercent\[rs]space (ECI)\f[R] If
2916left unspecified, \f[C]sRGB IEC61966-2.1\f[R] is used as default.
2917.TP
2918\f[B]\f[CB]toc\f[B]\f[R]
2919include table of contents (can also be set using
2920\f[C]--toc/--table-of-contents\f[R])
2921.TP
2922\f[B]\f[CB]whitespace\f[B]\f[R]
2923spacing between paragraphs, e.g.\ \f[C]none\f[R], \f[C]small\f[R] (using
2924\f[C]setupwhitespace\f[R])
2925.TP
2926\f[B]\f[CB]includesource\f[B]\f[R]
2927include all source documents as file attachments in the PDF file
2928.SS Variables for \f[C]wkhtmltopdf\f[R]
2929.PP
2930Pandoc uses these variables when creating a PDF with
2931\f[C]wkhtmltopdf\f[R].
2932The \f[C]--css\f[R] option also affects the output.
2933.TP
2934\f[B]\f[CB]footer-html\f[B]\f[R], \f[B]\f[CB]header-html\f[B]\f[R]
2935add information to the header and footer
2936.TP
2937\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2938set the page margins
2939.TP
2940\f[B]\f[CB]papersize\f[B]\f[R]
2941sets the PDF paper size
2942.SS Variables for man pages
2943.TP
2944\f[B]\f[CB]adjusting\f[B]\f[R]
2945adjusts text to left (\f[C]l\f[R]), right (\f[C]r\f[R]), center
2946(\f[C]c\f[R]), or both (\f[C]b\f[R]) margins
2947.TP
2948\f[B]\f[CB]footer\f[B]\f[R]
2949footer in man pages
2950.TP
2951\f[B]\f[CB]header\f[B]\f[R]
2952header in man pages
2953.TP
2954\f[B]\f[CB]hyphenate\f[B]\f[R]
2955if \f[C]true\f[R] (the default), hyphenation will be used
2956.TP
2957\f[B]\f[CB]section\f[B]\f[R]
2958section number in man pages
2959.SS Variables for ms
2960.TP
2961\f[B]\f[CB]fontfamily\f[B]\f[R]
2962font family (e.g.\ \f[C]T\f[R] or \f[C]P\f[R])
2963.TP
2964\f[B]\f[CB]indent\f[B]\f[R]
2965paragraph indent (e.g.\ \f[C]2m\f[R])
2966.TP
2967\f[B]\f[CB]lineheight\f[B]\f[R]
2968line height (e.g.\ \f[C]12p\f[R])
2969.TP
2970\f[B]\f[CB]pointsize\f[B]\f[R]
2971point size (e.g.\ \f[C]10p\f[R])
2972.SS Variables set automatically
2973.PP
2974Pandoc sets these variables automatically in response to options or
2975document contents; users can also modify them.
2976These vary depending on the output format, and include the following:
2977.TP
2978\f[B]\f[CB]body\f[B]\f[R]
2979body of document
2980.TP
2981\f[B]\f[CB]date-meta\f[B]\f[R]
2982the \f[C]date\f[R] variable converted to ISO 8601 YYYY-MM-DD, included
2983in all HTML based formats (dzslides, epub, html, html4, html5, revealjs,
2984s5, slideous, slidy).
2985The recognized formats for \f[C]date\f[R] are: \f[C]mm/dd/yyyy\f[R],
2986\f[C]mm/dd/yy\f[R], \f[C]yyyy-mm-dd\f[R] (ISO 8601),
2987\f[C]dd MM yyyy\f[R] (e.g.\ either \f[C]02 Apr 2018\f[R] or
2988\f[C]02 April 2018\f[R]), \f[C]MM dd, yyyy\f[R]
2989(e.g.\ \f[C]Apr. 02, 2018\f[R] or
2990\f[C]April 02, 2018),\f[R]yyyy[mm[dd]]]\f[C](e.g.\f[R]20180402,
2991\f[C]201804\f[R] or \f[C]2018\f[R]).
2992.TP
2993\f[B]\f[CB]header-includes\f[B]\f[R]
2994contents specified by \f[C]-H/--include-in-header\f[R] (may have
2995multiple values)
2996.TP
2997\f[B]\f[CB]include-before\f[B]\f[R]
2998contents specified by \f[C]-B/--include-before-body\f[R] (may have
2999multiple values)
3000.TP
3001\f[B]\f[CB]include-after\f[B]\f[R]
3002contents specified by \f[C]-A/--include-after-body\f[R] (may have
3003multiple values)
3004.TP
3005\f[B]\f[CB]meta-json\f[B]\f[R]
3006JSON representation of all of the document\[cq]s metadata.
3007Field values are transformed to the selected output format.
3008.TP
3009\f[B]\f[CB]numbersections\f[B]\f[R]
3010non-null value if \f[C]-N/--number-sections\f[R] was specified
3011.TP
3012\f[B]\f[CB]sourcefile\f[B]\f[R], \f[B]\f[CB]outputfile\f[B]\f[R]
3013source and destination filenames, as given on the command line.
3014\f[C]sourcefile\f[R] can also be a list if input comes from multiple
3015files, or empty if input is from stdin.
3016You can use the following snippet in your template to distinguish them:
3017.RS
3018.IP
3019.nf
3020\f[C]
3021$if(sourcefile)$
3022$for(sourcefile)$
3023$sourcefile$
3024$endfor$
3025$else$
3026(stdin)
3027$endif$
3028\f[R]
3029.fi
3030.PP
3031Similarly, \f[C]outputfile\f[R] can be \f[C]-\f[R] if output goes to the
3032terminal.
3033.PP
3034If you need absolute paths, use e.g.\ \f[C]$curdir$/$sourcefile$\f[R].
3035.RE
3036.TP
3037\f[B]\f[CB]curdir\f[B]\f[R]
3038working directory from which pandoc is run.
3039.TP
3040\f[B]\f[CB]toc\f[B]\f[R]
3041non-null value if \f[C]--toc/--table-of-contents\f[R] was specified
3042.TP
3043\f[B]\f[CB]toc-title\f[B]\f[R]
3044title of table of contents (works only with EPUB, HTML, opendocument,
3045odt, docx, pptx, beamer, LaTeX)
3046.SH EXTENSIONS
3047.PP
3048The behavior of some of the readers and writers can be adjusted by
3049enabling or disabling various extensions.
3050.PP
3051An extension can be enabled by adding \f[C]+EXTENSION\f[R] to the format
3052name and disabled by adding \f[C]-EXTENSION\f[R].
3053For example, \f[C]--from markdown_strict+footnotes\f[R] is strict
3054Markdown with footnotes enabled, while
3055\f[C]--from markdown-footnotes-pipe_tables\f[R] is pandoc\[cq]s Markdown
3056without footnotes or pipe tables.
3057.PP
3058The markdown reader and writer make by far the most use of extensions.
3059Extensions only used by them are therefore covered in the section
3060Pandoc\[cq]s Markdown below (See Markdown variants for
3061\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions
3062that also work for other formats are covered.
3063.PP
3064Note that markdown extensions added to the \f[C]ipynb\f[R] format affect
3065Markdown cells in Jupyter notebooks (as do command-line options like
3066\f[C]--atx-headers\f[R]).
3067.SS Typography
3068.SS Extension: \f[C]smart\f[R]
3069.PP
3070Interpret straight quotes as curly quotes, \f[C]---\f[R] as em-dashes,
3071\f[C]--\f[R] as en-dashes, and \f[C]...\f[R] as ellipses.
3072Nonbreaking spaces are inserted after certain abbreviations, such as
3073\[lq]Mr.\[rq]
3074.PP
3075This extension can be enabled/disabled for the following formats:
3076.TP
3077input formats
3078\f[C]markdown\f[R], \f[C]commonmark\f[R], \f[C]latex\f[R],
3079\f[C]mediawiki\f[R], \f[C]org\f[R], \f[C]rst\f[R], \f[C]twiki\f[R]
3080.TP
3081output formats
3082\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R], \f[C]rst\f[R]
3083.TP
3084enabled by default in
3085\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R] (both input and
3086output)
3087.PP
3088Note: If you are \f[I]writing\f[R] Markdown, then the \f[C]smart\f[R]
3089extension has the reverse effect: what would have been curly quotes
3090comes out straight.
3091.PP
3092In LaTeX, \f[C]smart\f[R] means to use the standard TeX ligatures for
3093quotation marks (\f[C]\[ga]\[ga]\f[R] and \f[C]\[aq]\[aq]\f[R] for
3094double quotes, \f[C]\[ga]\f[R] and \f[C]\[aq]\f[R] for single quotes)
3095and dashes (\f[C]--\f[R] for en-dash and \f[C]---\f[R] for em-dash).
3096If \f[C]smart\f[R] is disabled, then in reading LaTeX pandoc will parse
3097these characters literally.
3098In writing LaTeX, enabling \f[C]smart\f[R] tells pandoc to use the
3099ligatures when possible; if \f[C]smart\f[R] is disabled pandoc will use
3100unicode quotation mark and dash characters.
3101.SS Headings and sections
3102.SS Extension: \f[C]auto_identifiers\f[R]
3103.PP
3104A heading without an explicitly specified identifier will be
3105automatically assigned a unique identifier based on the heading text.
3106.PP
3107This extension can be enabled/disabled for the following formats:
3108.TP
3109input formats
3110\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]rst\f[R], \f[C]mediawiki\f[R],
3111\f[C]textile\f[R]
3112.TP
3113output formats
3114\f[C]markdown\f[R], \f[C]muse\f[R]
3115.TP
3116enabled by default in
3117\f[C]markdown\f[R], \f[C]muse\f[R]
3118.PP
3119The default algorithm used to derive the identifier from the heading
3120text is:
3121.IP \[bu] 2
3122Remove all formatting, links, etc.
3123.IP \[bu] 2
3124Remove all footnotes.
3125.IP \[bu] 2
3126Remove all non-alphanumeric characters, except underscores, hyphens, and
3127periods.
3128.IP \[bu] 2
3129Replace all spaces and newlines with hyphens.
3130.IP \[bu] 2
3131Convert all alphabetic characters to lowercase.
3132.IP \[bu] 2
3133Remove everything up to the first letter (identifiers may not begin with
3134a number or punctuation mark).
3135.IP \[bu] 2
3136If nothing is left after this, use the identifier \f[C]section\f[R].
3137.PP
3138Thus, for example,
3139.PP
3140.TS
3141tab(@);
3142l l.
3144Heading
3145T}@T{
3146Identifier
3150\f[C]Heading identifiers in HTML\f[R]
3151T}@T{
3152\f[C]heading-identifiers-in-html\f[R]
3155\f[C]Ma\[^i]tre d\[aq]h\[^o]tel\f[R]
3156T}@T{
3157\f[C]ma\[^i]tre-dh\[^o]tel\f[R]
3160\f[C]*Dogs*?--in *my* house?\f[R]
3161T}@T{
3162\f[C]dogs--in-my-house\f[R]
3165\f[C][HTML], [S5], or [RTF]?\f[R]
3166T}@T{
3167\f[C]html-s5-or-rtf\f[R]
3170\f[C]3. Applications\f[R]
3171T}@T{
3172\f[C]applications\f[R]
3175\f[C]33\f[R]
3176T}@T{
3177\f[C]section\f[R]
3179.TE
3180.PP
3181These rules should, in most cases, allow one to determine the identifier
3182from the heading text.
3183The exception is when several headings have the same text; in this case,
3184the first will get an identifier as described above; the second will get
3185the same identifier with \f[C]-1\f[R] appended; the third with
3186\f[C]-2\f[R]; and so on.
3187.PP
3188(However, a different algorithm is used if
3189\f[C]gfm_auto_identifiers\f[R] is enabled; see below.)
3190.PP
3191These identifiers are used to provide link targets in the table of
3192contents generated by the \f[C]--toc|--table-of-contents\f[R] option.
3193They also make it easy to provide links from one section of a document
3194to another.
3195A link to this section, for example, might look like this:
3196.IP
3197.nf
3198\f[C]
3199See the section on
3200[heading identifiers](#heading-identifiers-in-html-latex-and-context).
3201\f[R]
3202.fi
3203.PP
3204Note, however, that this method of providing links to sections works
3205only in HTML, LaTeX, and ConTeXt formats.
3206.PP
3207If the \f[C]--section-divs\f[R] option is specified, then each section
3208will be wrapped in a \f[C]section\f[R] (or a \f[C]div\f[R], if
3209\f[C]html4\f[R] was specified), and the identifier will be attached to
3210the enclosing \f[C]<section>\f[R] (or \f[C]<div>\f[R]) tag rather than
3211the heading itself.
3212This allows entire sections to be manipulated using JavaScript or
3213treated differently in CSS.
3214.SS Extension: \f[C]ascii_identifiers\f[R]
3215.PP
3216Causes the identifiers produced by \f[C]auto_identifiers\f[R] to be pure
3217ASCII.
3218Accents are stripped off of accented Latin letters, and non-Latin
3219letters are omitted.
3220.SS Extension: \f[C]gfm_auto_identifiers\f[R]
3221.PP
3222Changes the algorithm used by \f[C]auto_identifiers\f[R] to conform to
3223GitHub\[cq]s method.
3224Spaces are converted to dashes (\f[C]-\f[R]), uppercase characters to
3225lowercase characters, and punctuation characters other than \f[C]-\f[R]
3226and \f[C]_\f[R] are removed.
3227Emojis are replaced by their names.
3228.SS Math Input
3229.PP
3230The extensions \f[C]tex_math_dollars\f[R],
3231\f[C]tex_math_single_backslash\f[R], and
3232\f[C]tex_math_double_backslash\f[R] are described in the section about
3233Pandoc\[cq]s Markdown.
3234.PP
3235However, they can also be used with HTML input.
3236This is handy for reading web pages formatted using MathJax, for
3237example.
3238.SS Raw HTML/TeX
3239.PP
3240The following extensions are described in more detail in their
3241respective sections of Pandoc\[cq]s Markdown:
3242.IP \[bu] 2
3243\f[C]raw_html\f[R] allows HTML elements which are not representable in
3244pandoc\[cq]s AST to be parsed as raw HTML.
3245By default, this is disabled for HTML input.
3246.IP \[bu] 2
3247\f[C]raw_tex\f[R] allows raw LaTeX, TeX, and ConTeXt to be included in a
3248document.
3249This extension can be enabled/disabled for the following formats (in
3250addition to \f[C]markdown\f[R]):
3251.RS 2
3252.TP
3253input formats
3254\f[C]latex\f[R], \f[C]textile\f[R], \f[C]html\f[R] (environments,
3255\f[C]\[rs]ref\f[R], and \f[C]\[rs]eqref\f[R] only), \f[C]ipynb\f[R]
3256.TP
3257output formats
3258\f[C]textile\f[R], \f[C]commonmark\f[R]
3259.PP
3260Note: as applied to \f[C]ipynb\f[R], \f[C]raw_html\f[R] and
3261\f[C]raw_tex\f[R] affect not only raw TeX in markdown cells, but data
3262with mime type \f[C]text/html\f[R] in output cells.
3263Since the \f[C]ipynb\f[R] reader attempts to preserve the richest
3264possible outputs when several options are given, you will get best
3265results if you disable \f[C]raw_html\f[R] and \f[C]raw_tex\f[R] when
3266converting to formats like \f[C]docx\f[R] which don\[cq]t allow raw
3267\f[C]html\f[R] or \f[C]tex\f[R].
3268.RE
3269.IP \[bu] 2
3270\f[C]native_divs\f[R] causes HTML \f[C]div\f[R] elements to be parsed as
3271native pandoc Div blocks.
3272If you want them to be parsed as raw HTML, use
3273\f[C]-f html-native_divs+raw_html\f[R].
3274.IP \[bu] 2
3275\f[C]native_spans\f[R] causes HTML \f[C]span\f[R] elements to be parsed
3276as native pandoc Span inlines.
3277If you want them to be parsed as raw HTML, use
3278\f[C]-f html-native_spans+raw_html\f[R].
3279If you want to drop all \f[C]div\f[R]s and \f[C]span\f[R]s when
3280converting HTML to Markdown, you can use
3281\f[C]pandoc -f html-native_divs-native_spans -t markdown\f[R].
3282.SS Literate Haskell support
3283.SS Extension: \f[C]literate_haskell\f[R]
3284.PP
3285Treat the document as literate Haskell source.
3286.PP
3287This extension can be enabled/disabled for the following formats:
3288.TP
3289input formats
3290\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R]
3291.TP
3292output formats
3293\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R], \f[C]html\f[R]
3294.PP
3295If you append \f[C]+lhs\f[R] (or \f[C]+literate_haskell\f[R]) to one of
3296the formats above, pandoc will treat the document as literate Haskell
3297source.
3298This means that
3299.IP \[bu] 2
3300In Markdown input, \[lq]bird track\[rq] sections will be parsed as
3301Haskell code rather than block quotations.
3302Text between \f[C]\[rs]begin{code}\f[R] and \f[C]\[rs]end{code}\f[R]
3303will also be treated as Haskell code.
3304For ATX-style headings the character `=' will be used instead of `#'.
3305.IP \[bu] 2
3306In Markdown output, code blocks with classes \f[C]haskell\f[R] and
3307\f[C]literate\f[R] will be rendered using bird tracks, and block
3308quotations will be indented one space, so they will not be treated as
3309Haskell code.
3310In addition, headings will be rendered setext-style (with underlines)
3311rather than ATX-style (with `#' characters).
3312(This is because ghc treats `#' characters in column 1 as introducing
3313line numbers.)
3314.IP \[bu] 2
3315In restructured text input, \[lq]bird track\[rq] sections will be parsed
3316as Haskell code.
3317.IP \[bu] 2
3318In restructured text output, code blocks with class \f[C]haskell\f[R]
3319will be rendered using bird tracks.
3320.IP \[bu] 2
3321In LaTeX input, text in \f[C]code\f[R] environments will be parsed as
3322Haskell code.
3323.IP \[bu] 2
3324In LaTeX output, code blocks with class \f[C]haskell\f[R] will be
3325rendered inside \f[C]code\f[R] environments.
3326.IP \[bu] 2
3327In HTML output, code blocks with class \f[C]haskell\f[R] will be
3328rendered with class \f[C]literatehaskell\f[R] and bird tracks.
3329.PP
3330Examples:
3331.IP
3332.nf
3333\f[C]
3334pandoc -f markdown+lhs -t html
3335\f[R]
3336.fi
3337.PP
3338reads literate Haskell source formatted with Markdown conventions and
3339writes ordinary HTML (without bird tracks).
3340.IP
3341.nf
3342\f[C]
3343pandoc -f markdown+lhs -t html+lhs
3344\f[R]
3345.fi
3346.PP
3347writes HTML with the Haskell code in bird tracks, so it can be copied
3348and pasted as literate Haskell source.
3349.PP
3350Note that GHC expects the bird tracks in the first column, so indented
3351literate code blocks (e.g.\ inside an itemized environment) will not be
3352picked up by the Haskell compiler.
3353.SS Other extensions
3354.SS Extension: \f[C]empty_paragraphs\f[R]
3355.PP
3356Allows empty paragraphs.
3357By default empty paragraphs are omitted.
3358.PP
3359This extension can be enabled/disabled for the following formats:
3360.TP
3361input formats
3362\f[C]docx\f[R], \f[C]html\f[R]
3363.TP
3364output formats
3365\f[C]docx\f[R], \f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]html\f[R]
3366.SS Extension: \f[C]native_numbering\f[R]
3367.PP
3368Enables native numbering of figures and tables.
3369Enumeration starts at 1.
3370.PP
3371This extension can be enabled/disabled for the following formats:
3372.TP
3373output formats
3374\f[C]odt\f[R], \f[C]opendocument\f[R]
3375.SS Extension: \f[C]styles\f[R]
3376.PP
3377When converting from docx, read all docx styles as divs (for paragraph
3378styles) and spans (for character styles) regardless of whether pandoc
3379understands the meaning of these styles.
3380This can be used with docx custom styles.
3381Disabled by default.
3382.TP
3383input formats
3384\f[C]docx\f[R]
3385.SS Extension: \f[C]amuse\f[R]
3386.PP
3387In the \f[C]muse\f[R] input format, this enables Text::Amuse extensions
3388to Emacs Muse markup.
3389.SS Extension: \f[C]raw_markdown\f[R]
3390.PP
3391In the \f[C]ipynb\f[R] input format, this causes Markdown cells to be
3392included as raw Markdown blocks (allowing lossless round-tripping)
3393rather than being parsed.
3394Use this only when you are targeting \f[C]ipynb\f[R] or a markdown-based
3395output format.
3396.SS Extension: \f[C]citations\f[R]
3397.PP
3398Some aspects of Pandoc\[cq]s Markdown citation syntax are also accepted
3399in \f[C]org\f[R] input.
3400.SS Extension: \f[C]ntb\f[R]
3401.PP
3402In the \f[C]context\f[R] output format this enables the use of Natural
3403Tables (TABLE) instead of the default Extreme Tables (xtables).
3404Natural tables allow more fine-grained global customization but come at
3405a performance penalty compared to extreme tables.
3406.SH PANDOC\[cq]S MARKDOWN
3407.PP
3408Pandoc understands an extended and slightly revised version of John
3409Gruber\[cq]s Markdown syntax.
3410This document explains the syntax, noting differences from standard
3411Markdown.
3412Except where noted, these differences can be suppressed by using the
3413\f[C]markdown_strict\f[R] format instead of \f[C]markdown\f[R].
3414Extensions can be enabled or disabled to specify the behavior more
3415granularly.
3416They are described in the following.
3417See also Extensions above, for extensions that work also on other
3418formats.
3419.SS Philosophy
3420.PP
3421Markdown is designed to be easy to write, and, even more importantly,
3422easy to read:
3423.RS
3424.PP
3425A Markdown-formatted document should be publishable as-is, as plain
3426text, without looking like it\[cq]s been marked up with tags or
3427formatting instructions.
3428\[en] John Gruber
3429.RE
3430.PP
3431This principle has guided pandoc\[cq]s decisions in finding syntax for
3432tables, footnotes, and other extensions.
3433.PP
3434There is, however, one respect in which pandoc\[cq]s aims are different
3435from the original aims of Markdown.
3436Whereas Markdown was originally designed with HTML generation in mind,
3437pandoc is designed for multiple output formats.
3438Thus, while pandoc allows the embedding of raw HTML, it discourages it,
3439and provides other, non-HTMLish ways of representing important document
3440elements like definition lists, tables, mathematics, and footnotes.
3441.SS Paragraphs
3442.PP
3443A paragraph is one or more lines of text followed by one or more blank
3444lines.
3445Newlines are treated as spaces, so you can reflow your paragraphs as you
3446like.
3447If you need a hard line break, put two or more spaces at the end of a
3448line.
3449.SS Extension: \f[C]escaped_line_breaks\f[R]
3450.PP
3451A backslash followed by a newline is also a hard line break.
3452Note: in multiline and grid table cells, this is the only way to create
3453a hard line break, since trailing spaces in the cells are ignored.
3454.SS Headings
3455.PP
3456There are two kinds of headings: Setext and ATX.
3457.SS Setext-style headings
3458.PP
3459A setext-style heading is a line of text \[lq]underlined\[rq] with a row
3460of \f[C]=\f[R] signs (for a level-one heading) or \f[C]-\f[R] signs (for
3461a level-two heading):
3462.IP
3463.nf
3464\f[C]
3465A level-one heading
3466===================
3468A level-two heading
3469-------------------
3470\f[R]
3471.fi
3472.PP
3473The heading text can contain inline formatting, such as emphasis (see
3474Inline formatting, below).
3475.SS ATX-style headings
3476.PP
3477An ATX-style heading consists of one to six \f[C]#\f[R] signs and a line
3478of text, optionally followed by any number of \f[C]#\f[R] signs.
3479The number of \f[C]#\f[R] signs at the beginning of the line is the
3480heading level:
3481.IP
3482.nf
3483\f[C]
3484## A level-two heading
3486### A level-three heading ###
3487\f[R]
3488.fi
3489.PP
3490As with setext-style headings, the heading text can contain formatting:
3491.IP
3492.nf
3493\f[C]
3494# A level-one heading with a [link](/url) and *emphasis*
3495\f[R]
3496.fi
3497.SS Extension: \f[C]blank_before_header\f[R]
3498.PP
3499Standard Markdown syntax does not require a blank line before a heading.
3500Pandoc does require this (except, of course, at the beginning of the
3501document).
3502The reason for the requirement is that it is all too easy for a
3503\f[C]#\f[R] to end up at the beginning of a line by accident (perhaps
3504through line wrapping).
3505Consider, for example:
3506.IP
3507.nf
3508\f[C]
3509I like several of their flavors of ice cream:
3510#22, for example, and #5.
3511\f[R]
3512.fi
3513.SS Extension: \f[C]space_in_atx_header\f[R]
3514.PP
3515Many Markdown implementations do not require a space between the opening
3516\f[C]#\f[R]s of an ATX heading and the heading text, so that
3517\f[C]#5 bolt\f[R] and \f[C]#hashtag\f[R] count as headings.
3518With this extension, pandoc does require the space.
3519.SS Heading identifiers
3520.PP
3521See also the \f[C]auto_identifiers\f[R] extension above.
3522.SS Extension: \f[C]header_attributes\f[R]
3523.PP
3524Headings can be assigned attributes using this syntax at the end of the
3525line containing the heading text:
3526.IP
3527.nf
3528\f[C]
3529{#identifier .class .class key=value key=value}
3530\f[R]
3531.fi
3532.PP
3533Thus, for example, the following headings will all be assigned the
3534identifier \f[C]foo\f[R]:
3535.IP
3536.nf
3537\f[C]
3538# My heading {#foo}
3540## My heading ## {#foo}
3542My other heading {#foo}
3543---------------
3544\f[R]
3545.fi
3546.PP
3547(This syntax is compatible with PHP Markdown Extra.)
3548.PP
3549Note that although this syntax allows assignment of classes and
3550key/value attributes, writers generally don\[cq]t use all of this
3551information.
3552Identifiers, classes, and key/value attributes are used in HTML and
3553HTML-based formats such as EPUB and slidy.
3554Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
3555Textile, Jira markup, and AsciiDoc writers.
3556.PP
3557Headings with the class \f[C]unnumbered\f[R] will not be numbered, even
3558if \f[C]--number-sections\f[R] is specified.
3559A single hyphen (\f[C]-\f[R]) in an attribute context is equivalent to
3560\f[C].unnumbered\f[R], and preferable in non-English documents.
3561So,
3562.IP
3563.nf
3564\f[C]
3565# My heading {-}
3566\f[R]
3567.fi
3568.PP
3569is just the same as
3570.IP
3571.nf
3572\f[C]
3573# My heading {.unnumbered}
3574\f[R]
3575.fi
3576.PP
3577If the \f[C]unlisted\f[R] class is present in addition to
3578\f[C]unnumbered\f[R], the heading will not be included in a table of
3579contents.
3580(Currently this feature is only implemented for certain formats: those
3581based on LaTeX and HTML, PowerPoint, and RTF.)
3582.SS Extension: \f[C]implicit_header_references\f[R]
3583.PP
3584Pandoc behaves as if reference links have been defined for each heading.
3585So, to link to a heading
3586.IP
3587.nf
3588\f[C]
3589# Heading identifiers in HTML
3590\f[R]
3591.fi
3592.PP
3593you can simply write
3594.IP
3595.nf
3596\f[C]
3597[Heading identifiers in HTML]
3598\f[R]
3599.fi
3600.PP
3602.IP
3603.nf
3604\f[C]
3605[Heading identifiers in HTML][]
3606\f[R]
3607.fi
3608.PP
3610.IP
3611.nf
3612\f[C]
3613[the section on heading identifiers][heading identifiers in
3614HTML]
3615\f[R]
3616.fi
3617.PP
3618instead of giving the identifier explicitly:
3619.IP
3620.nf
3621\f[C]
3622[Heading identifiers in HTML](#heading-identifiers-in-html)
3623\f[R]
3624.fi
3625.PP
3626If there are multiple headings with identical text, the corresponding
3627reference will link to the first one only, and you will need to use
3628explicit links to link to the others, as described above.
3629.PP
3630Like regular reference links, these references are case-insensitive.
3631.PP
3632Explicit link reference definitions always take priority over implicit
3633heading references.
3634So, in the following example, the link will point to \f[C]bar\f[R], not
3635to \f[C]#foo\f[R]:
3636.IP
3637.nf
3638\f[C]
3639# Foo
3641[foo]: bar
3643See [foo]
3644\f[R]
3645.fi
3646.SS Block quotations
3647.PP
3648Markdown uses email conventions for quoting blocks of text.
3649A block quotation is one or more paragraphs or other block elements
3650(such as lists or headings), with each line preceded by a \f[C]>\f[R]
3651character and an optional space.
3652(The \f[C]>\f[R] need not start at the left margin, but it should not be
3653indented more than three spaces.)
3654.IP
3655.nf
3656\f[C]
3657> This is a block quote. This
3658> paragraph has two lines.
3660> 1. This is a list inside a block quote.
3661> 2. Second item.
3662\f[R]
3663.fi
3664.PP
3665A \[lq]lazy\[rq] form, which requires the \f[C]>\f[R] character only on
3666the first line of each block, is also allowed:
3667.IP
3668.nf
3669\f[C]
3670> This is a block quote. This
3671paragraph has two lines.
3673> 1. This is a list inside a block quote.
36742. Second item.
3675\f[R]
3676.fi
3677.PP
3678Among the block elements that can be contained in a block quote are
3679other block quotes.
3680That is, block quotes can be nested:
3681.IP
3682.nf
3683\f[C]
3684> This is a block quote.
3686> > A block quote within a block quote.
3687\f[R]
3688.fi
3689.PP
3690If the \f[C]>\f[R] character is followed by an optional space, that
3691space will be considered part of the block quote marker and not part of
3692the indentation of the contents.
3693Thus, to put an indented code block in a block quote, you need five
3694spaces after the \f[C]>\f[R]:
3695.IP
3696.nf
3697\f[C]
3698> code
3699\f[R]
3700.fi
3701.SS Extension: \f[C]blank_before_blockquote\f[R]
3702.PP
3703Standard Markdown syntax does not require a blank line before a block
3704quote.
3705Pandoc does require this (except, of course, at the beginning of the
3706document).
3707The reason for the requirement is that it is all too easy for a
3708\f[C]>\f[R] to end up at the beginning of a line by accident (perhaps
3709through line wrapping).
3710So, unless the \f[C]markdown_strict\f[R] format is used, the following
3711does not produce a nested block quote in pandoc:
3712.IP
3713.nf
3714\f[C]
3715> This is a block quote.
3716>> Nested.
3717\f[R]
3718.fi
3719.SS Verbatim (code) blocks
3720.SS Indented code blocks
3721.PP
3722A block of text indented four spaces (or one tab) is treated as verbatim
3723text: that is, special characters do not trigger special formatting, and
3724all spaces and line breaks are preserved.
3725For example,
3726.IP
3727.nf
3728\f[C]
3729 if (a > 3) {
3730 moveShip(5 * gravity, DOWN);
3732\f[R]
3733.fi
3734.PP
3735The initial (four space or one tab) indentation is not considered part
3736of the verbatim text, and is removed in the output.
3737.PP
3738Note: blank lines in the verbatim text need not begin with four spaces.
3739.SS Fenced code blocks
3740.SS Extension: \f[C]fenced_code_blocks\f[R]
3741.PP
3742In addition to standard indented code blocks, pandoc supports
3743\f[I]fenced\f[R] code blocks.
3744These begin with a row of three or more tildes (\f[C]\[ti]\f[R]) and end
3745with a row of tildes that must be at least as long as the starting row.
3746Everything between these lines is treated as code.
3747No indentation is necessary:
3748.IP
3749.nf
3750\f[C]
3751\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3752if (a > 3) {
3753 moveShip(5 * gravity, DOWN);
3755\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3756\f[R]
3757.fi
3758.PP
3759Like regular code blocks, fenced code blocks must be separated from
3760surrounding text by blank lines.
3761.PP
3762If the code itself contains a row of tildes or backticks, just use a
3763longer row of tildes or backticks at the start and end:
3764.IP
3765.nf
3766\f[C]
3767\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3768\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3769code including tildes
3770\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3771\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3772\f[R]
3773.fi
3774.SS Extension: \f[C]backtick_code_blocks\f[R]
3775.PP
3776Same as \f[C]fenced_code_blocks\f[R], but uses backticks
3777(\f[C]\[ga]\f[R]) instead of tildes (\f[C]\[ti]\f[R]).
3778.SS Extension: \f[C]fenced_code_attributes\f[R]
3779.PP
3780Optionally, you may attach attributes to fenced or backtick code block
3781using this syntax:
3782.IP
3783.nf
3784\f[C]
3785\[ti]\[ti]\[ti]\[ti] {#mycode .haskell .numberLines startFrom=\[dq]100\[dq]}
3786qsort [] = []
3787qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
3788 qsort (filter (>= x) xs)
3789\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3790\f[R]
3791.fi
3792.PP
3793Here \f[C]mycode\f[R] is an identifier, \f[C]haskell\f[R] and
3794\f[C]numberLines\f[R] are classes, and \f[C]startFrom\f[R] is an
3795attribute with value \f[C]100\f[R].
3796Some output formats can use this information to do syntax highlighting.
3797Currently, the only output formats that uses this information are HTML,
3798LaTeX, Docx, Ms, and PowerPoint.
3799If highlighting is supported for your output format and language, then
3800the code block above will appear highlighted, with numbered lines.
3801(To see which languages are supported, type
3802\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block
3803above will appear as follows:
3804.IP
3805.nf
3806\f[C]
3807<pre id=\[dq]mycode\[dq] class=\[dq]haskell numberLines\[dq] startFrom=\[dq]100\[dq]>
3808 <code>
3809 ...
3810 </code>
3811</pre>
3812\f[R]
3813.fi
3814.PP
3815The \f[C]numberLines\f[R] (or \f[C]number-lines\f[R]) class will cause
3816the lines of the code block to be numbered, starting with \f[C]1\f[R] or
3817the value of the \f[C]startFrom\f[R] attribute.
3818The \f[C]lineAnchors\f[R] (or \f[C]line-anchors\f[R]) class will cause
3819the lines to be clickable anchors in HTML output.
3820.PP
3821A shortcut form can also be used for specifying the language of the code
3822block:
3823.IP
3824.nf
3825\f[C]
3826\[ga]\[ga]\[ga]haskell
3827qsort [] = []
3828\[ga]\[ga]\[ga]
3829\f[R]
3830.fi
3831.PP
3832This is equivalent to:
3833.IP
3834.nf
3835\f[C]
3836\[ga]\[ga]\[ga] {.haskell}
3837qsort [] = []
3838\[ga]\[ga]\[ga]
3839\f[R]
3840.fi
3841.PP
3842If the \f[C]fenced_code_attributes\f[R] extension is disabled, but input
3843contains class attribute(s) for the code block, the first class
3844attribute will be printed after the opening fence as a bare word.
3845.PP
3846To prevent all highlighting, use the \f[C]--no-highlight\f[R] flag.
3847To set the highlighting style, use \f[C]--highlight-style\f[R].
3848For more information on highlighting, see Syntax highlighting, below.
3849.SS Line blocks
3850.SS Extension: \f[C]line_blocks\f[R]
3851.PP
3852A line block is a sequence of lines beginning with a vertical bar
3853(\f[C]|\f[R]) followed by a space.
3854The division into lines will be preserved in the output, as will any
3855leading spaces; otherwise, the lines will be formatted as Markdown.
3856This is useful for verse and addresses:
3857.IP
3858.nf
3859\f[C]
3860| The limerick packs laughs anatomical
3861| In space that is quite economical.
3862| But the good ones I\[aq]ve seen
3863| So seldom are clean
3864| And the clean ones so seldom are comical
3866| 200 Main St.
3867| Berkeley, CA 94718
3868\f[R]
3869.fi
3870.PP
3871The lines can be hard-wrapped if needed, but the continuation line must
3872begin with a space.
3873.IP
3874.nf
3875\f[C]
3876| The Right Honorable Most Venerable and Righteous Samuel L.
3877 Constable, Jr.
3878| 200 Main St.
3879| Berkeley, CA 94718
3880\f[R]
3881.fi
3882.PP
3883This syntax is borrowed from reStructuredText.
3884.SS Lists
3885.SS Bullet lists
3886.PP
3887A bullet list is a list of bulleted list items.
3888A bulleted list item begins with a bullet (\f[C]*\f[R], \f[C]+\f[R], or
3889\f[C]-\f[R]).
3890Here is a simple example:
3891.IP
3892.nf
3893\f[C]
3894* one
3895* two
3896* three
3897\f[R]
3898.fi
3899.PP
3900This will produce a \[lq]compact\[rq] list.
3901If you want a \[lq]loose\[rq] list, in which each item is formatted as a
3902paragraph, put spaces between the items:
3903.IP
3904.nf
3905\f[C]
3906* one
3908* two
3910* three
3911\f[R]
3912.fi
3913.PP
3914The bullets need not be flush with the left margin; they may be indented
3915one, two, or three spaces.
3916The bullet must be followed by whitespace.
3917.PP
3918List items look best if subsequent lines are flush with the first line
3919(after the bullet):
3920.IP
3921.nf
3922\f[C]
3923* here is my first
3924 list item.
3925* and my second.
3926\f[R]
3927.fi
3928.PP
3929But Markdown also allows a \[lq]lazy\[rq] format:
3930.IP
3931.nf
3932\f[C]
3933* here is my first
3934list item.
3935* and my second.
3936\f[R]
3937.fi
3938.SS Block content in list items
3939.PP
3940A list item may contain multiple paragraphs and other block-level
3941content.
3942However, subsequent paragraphs must be preceded by a blank line and
3943indented to line up with the first non-space content after the list
3944marker.
3945.IP
3946.nf
3947\f[C]
3948 * First paragraph.
3950 Continued.
3952 * Second paragraph. With a code block, which must be indented
3953 eight spaces:
3955 { code }
3956\f[R]
3957.fi
3958.PP
3959Exception: if the list marker is followed by an indented code block,
3960which must begin 5 spaces after the list marker, then subsequent
3961paragraphs must begin two columns after the last character of the list
3962marker:
3963.IP
3964.nf
3965\f[C]
3966* code
3968 continuation paragraph
3969\f[R]
3970.fi
3971.PP
3972List items may include other lists.
3973In this case the preceding blank line is optional.
3974The nested list must be indented to line up with the first non-space
3975character after the list marker of the containing list item.
3976.IP
3977.nf
3978\f[C]
3979* fruits
3980 + apples
3981 - macintosh
3982 - red delicious
3983 + pears
3984 + peaches
3985* vegetables
3986 + broccoli
3987 + chard
3988\f[R]
3989.fi
3990.PP
3991As noted above, Markdown allows you to write list items
3992\[lq]lazily,\[rq] instead of indenting continuation lines.
3993However, if there are multiple paragraphs or other blocks in a list
3994item, the first line of each must be indented.
3995.IP
3996.nf
3997\f[C]
3998+ A lazy, lazy, list
3999item.
4001+ Another one; this looks
4002bad but is legal.
4004 Second paragraph of second
4005list item.
4006\f[R]
4007.fi
4008.SS Ordered lists
4009.PP
4010Ordered lists work just like bulleted lists, except that the items begin
4011with enumerators rather than bullets.
4012.PP
4013In standard Markdown, enumerators are decimal numbers followed by a
4014period and a space.
4015The numbers themselves are ignored, so there is no difference between
4016this list:
4017.IP
4018.nf
4019\f[C]
40201. one
40212. two
40223. three
4023\f[R]
4024.fi
4025.PP
4026and this one:
4027.IP
4028.nf
4029\f[C]
40305. one
40317. two
40321. three
4033\f[R]
4034.fi
4035.SS Extension: \f[C]fancy_lists\f[R]
4036.PP
4037Unlike standard Markdown, pandoc allows ordered list items to be marked
4038with uppercase and lowercase letters and roman numerals, in addition to
4039Arabic numerals.
4040List markers may be enclosed in parentheses or followed by a single
4041right-parentheses or period.
4042They must be separated from the text that follows by at least one space,
4043and, if the list marker is a capital letter with a period, by at least
4044two spaces.
4045.PP
4046The \f[C]fancy_lists\f[R] extension also allows `\f[C]#\f[R]' to be used
4047as an ordered list marker in place of a numeral:
4048.IP
4049.nf
4050\f[C]
4051#. one
4052#. two
4053\f[R]
4054.fi
4055.SS Extension: \f[C]startnum\f[R]
4056.PP
4057Pandoc also pays attention to the type of list marker used, and to the
4058starting number, and both of these are preserved where possible in the
4059output format.
4060Thus, the following yields a list with numbers followed by a single
4061parenthesis, starting with 9, and a sublist with lowercase roman
4062numerals:
4063.IP
4064.nf
4065\f[C]
4066 9) Ninth
406710) Tenth
406811) Eleventh
4069 i. subone
4070 ii. subtwo
4071 iii. subthree
4072\f[R]
4073.fi
4074.PP
4075Pandoc will start a new list each time a different type of list marker
4076is used.
4077So, the following will create three lists:
4078.IP
4079.nf
4080\f[C]
4081(2) Two
4082(5) Three
40831. Four
4084* Five
4085\f[R]
4086.fi
4087.PP
4088If default list markers are desired, use \f[C]#.\f[R]:
4089.IP
4090.nf
4091\f[C]
4092#. one
4093#. two
4094#. three
4095\f[R]
4096.fi
4097.SS Extension: \f[C]task_lists\f[R]
4098.PP
4099Pandoc supports task lists, using the syntax of GitHub-Flavored
4100Markdown.
4101.IP
4102.nf
4103\f[C]
4104- [ ] an unchecked task list item
4105- [x] checked item
4106\f[R]
4107.fi
4108.SS Definition lists
4109.SS Extension: \f[C]definition_lists\f[R]
4110.PP
4111Pandoc supports definition lists, using the syntax of PHP Markdown Extra
4112with some extensions.
4113.IP
4114.nf
4115\f[C]
4116Term 1
4118: Definition 1
4120Term 2 with *inline markup*
4122: Definition 2
4124 { some code, part of Definition 2 }
4126 Third paragraph of definition 2.
4127\f[R]
4128.fi
4129.PP
4130Each term must fit on one line, which may optionally be followed by a
4131blank line, and must be followed by one or more definitions.
4132A definition begins with a colon or tilde, which may be indented one or
4133two spaces.
4134.PP
4135A term may have multiple definitions, and each definition may consist of
4136one or more block elements (paragraph, code block, list, etc.), each
4137indented four spaces or one tab stop.
4138The body of the definition (including the first line, aside from the
4139colon or tilde) should be indented four spaces.
4140However, as with other Markdown lists, you can \[lq]lazily\[rq] omit
4141indentation except at the beginning of a paragraph or other block
4142element:
4143.IP
4144.nf
4145\f[C]
4146Term 1
4148: Definition
4149with lazy continuation.
4151 Second paragraph of the definition.
4152\f[R]
4153.fi
4154.PP
4155If you leave space before the definition (as in the example above), the
4156text of the definition will be treated as a paragraph.
4157In some output formats, this will mean greater spacing between
4158term/definition pairs.
4159For a more compact definition list, omit the space before the
4160definition:
4161.IP
4162.nf
4163\f[C]
4164Term 1
4165 \[ti] Definition 1
4167Term 2
4168 \[ti] Definition 2a
4169 \[ti] Definition 2b
4170\f[R]
4171.fi
4172.PP
4173Note that space between items in a definition list is required.
4174(A variant that loosens this requirement, but disallows \[lq]lazy\[rq]
4175hard wrapping, can be activated with \f[C]compact_definition_lists\f[R]:
4176see Non-pandoc extensions, below.)
4177.SS Numbered example lists
4178.SS Extension: \f[C]example_lists\f[R]
4179.PP
4180The special list marker \f[C]\[at]\f[R] can be used for sequentially
4181numbered examples.
4182The first list item with a \f[C]\[at]\f[R] marker will be numbered `1',
4183the next `2', and so on, throughout the document.
4184The numbered examples need not occur in a single list; each new list
4185using \f[C]\[at]\f[R] will take up where the last stopped.
4186So, for example:
4187.IP
4188.nf
4189\f[C]
4190(\[at]) My first example will be numbered (1).
4191(\[at]) My second example will be numbered (2).
4193Explanation of examples.
4195(\[at]) My third example will be numbered (3).
4196\f[R]
4197.fi
4198.PP
4199Numbered examples can be labeled and referred to elsewhere in the
4200document:
4201.IP
4202.nf
4203\f[C]
4204(\[at]good) This is a good example.
4206As (\[at]good) illustrates, ...
4207\f[R]
4208.fi
4209.PP
4210The label can be any string of alphanumeric characters, underscores, or
4211hyphens.
4212.PP
4213Note: continuation paragraphs in example lists must always be indented
4214four spaces, regardless of the length of the list marker.
4215That is, example lists always behave as if the \f[C]four_space_rule\f[R]
4216extension is set.
4217This is because example labels tend to be long, and indenting content to
4218the first non-space character after the label would be awkward.
4219.SS Ending a list
4220.PP
4221What if you want to put an indented code block after a list?
4222.IP
4223.nf
4224\f[C]
4225- item one
4226- item two
4228 { my code block }
4229\f[R]
4230.fi
4231.PP
4232Trouble! Here pandoc (like other Markdown implementations) will treat
4233\f[C]{ my code block }\f[R] as the second paragraph of item two, and not
4234as a code block.
4235.PP
4236To \[lq]cut off\[rq] the list after item two, you can insert some
4237non-indented content, like an HTML comment, which won\[cq]t produce
4238visible output in any format:
4239.IP
4240.nf
4241\f[C]
4242- item one
4243- item two
4245<!-- end of list -->
4247 { my code block }
4248\f[R]
4249.fi
4250.PP
4251You can use the same trick if you want two consecutive lists instead of
4252one big list:
4253.IP
4254.nf
4255\f[C]
42561. one
42572. two
42583. three
4260<!-- -->
42621. uno
42632. dos
42643. tres
4265\f[R]
4266.fi
4267.SS Horizontal rules
4268.PP
4269A line containing a row of three or more \f[C]*\f[R], \f[C]-\f[R], or
4270\f[C]_\f[R] characters (optionally separated by spaces) produces a
4271horizontal rule:
4272.IP
4273.nf
4274\f[C]
4275* * * *
4277---------------
4278\f[R]
4279.fi
4280.SS Tables
4281.PP
4282Four kinds of tables may be used.
4283The first three kinds presuppose the use of a fixed-width font, such as
4284Courier.
4285The fourth kind can be used with proportionally spaced fonts, as it does
4286not require lining up columns.
4287.SS Extension: \f[C]table_captions\f[R]
4288.PP
4289A caption may optionally be provided with all 4 kinds of tables (as
4290illustrated in the examples below).
4291A caption is a paragraph beginning with the string \f[C]Table:\f[R] (or
4292just \f[C]:\f[R]), which will be stripped off.
4293It may appear either before or after the table.
4294.SS Extension: \f[C]simple_tables\f[R]
4295.PP
4296Simple tables look like this:
4297.IP
4298.nf
4299\f[C]
4300 Right Left Center Default
4301------- ------ ---------- -------
4302 12 12 12 12
4303 123 123 123 123
4304 1 1 1 1
4306Table: Demonstration of simple table syntax.
4307\f[R]
4308.fi
4309.PP
4310The header and table rows must each fit on one line.
4311Column alignments are determined by the position of the header text
4312relative to the dashed line below it:
4313.IP \[bu] 2
4314If the dashed line is flush with the header text on the right side but
4315extends beyond it on the left, the column is right-aligned.
4316.IP \[bu] 2
4317If the dashed line is flush with the header text on the left side but
4318extends beyond it on the right, the column is left-aligned.
4319.IP \[bu] 2
4320If the dashed line extends beyond the header text on both sides, the
4321column is centered.
4322.IP \[bu] 2
4323If the dashed line is flush with the header text on both sides, the
4324default alignment is used (in most cases, this will be left).
4325.PP
4326The table must end with a blank line, or a line of dashes followed by a
4327blank line.
4328.PP
4329The column header row may be omitted, provided a dashed line is used to
4330end the table.
4331For example:
4332.IP
4333.nf
4334\f[C]
4335------- ------ ---------- -------
4336 12 12 12 12
4337 123 123 123 123
4338 1 1 1 1
4339------- ------ ---------- -------
4340\f[R]
4341.fi
4342.PP
4343When the header row is omitted, column alignments are determined on the
4344basis of the first line of the table body.
4345So, in the tables above, the columns would be right, left, center, and
4346right aligned, respectively.
4347.SS Extension: \f[C]multiline_tables\f[R]
4348.PP
4349Multiline tables allow header and table rows to span multiple lines of
4350text (but cells that span multiple columns or rows of the table are not
4351supported).
4352Here is an example:
4353.IP
4354.nf
4355\f[C]
4356-------------------------------------------------------------
4357 Centered Default Right Left
4358 Header Aligned Aligned Aligned
4359----------- ------- --------------- -------------------------
4360 First row 12.0 Example of a row that
4361 spans multiple lines.
4363 Second row 5.0 Here\[aq]s another one. Note
4364 the blank line between
4365 rows.
4366-------------------------------------------------------------
4368Table: Here\[aq]s the caption. It, too, may span
4369multiple lines.
4370\f[R]
4371.fi
4372.PP
4373These work like simple tables, but with the following differences:
4374.IP \[bu] 2
4375They must begin with a row of dashes, before the header text (unless the
4376header row is omitted).
4377.IP \[bu] 2
4378They must end with a row of dashes, then a blank line.
4379.IP \[bu] 2
4380The rows must be separated by blank lines.
4381.PP
4382In multiline tables, the table parser pays attention to the widths of
4383the columns, and the writers try to reproduce these relative widths in
4384the output.
4385So, if you find that one of the columns is too narrow in the output, try
4386widening it in the Markdown source.
4387.PP
4388The header may be omitted in multiline tables as well as simple tables:
4389.IP
4390.nf
4391\f[C]
4392----------- ------- --------------- -------------------------
4393 First row 12.0 Example of a row that
4394 spans multiple lines.
4396 Second row 5.0 Here\[aq]s another one. Note
4397 the blank line between
4398 rows.
4399----------- ------- --------------- -------------------------
4401: Here\[aq]s a multiline table without a header.
4402\f[R]
4403.fi
4404.PP
4405It is possible for a multiline table to have just one row, but the row
4406should be followed by a blank line (and then the row of dashes that ends
4407the table), or the table may be interpreted as a simple table.
4408.SS Extension: \f[C]grid_tables\f[R]
4409.PP
4410Grid tables look like this:
4411.IP
4412.nf
4413\f[C]
4414: Sample grid table.
4416+---------------+---------------+--------------------+
4417| Fruit | Price | Advantages |
4418+===============+===============+====================+
4419| Bananas | $1.34 | - built-in wrapper |
4420| | | - bright color |
4421+---------------+---------------+--------------------+
4422| Oranges | $2.10 | - cures scurvy |
4423| | | - tasty |
4424+---------------+---------------+--------------------+
4425\f[R]
4426.fi
4427.PP
4428The row of \f[C]=\f[R]s separates the header from the table body, and
4429can be omitted for a headerless table.
4430The cells of grid tables may contain arbitrary block elements (multiple
4431paragraphs, code blocks, lists, etc.).
4432Cells that span multiple columns or rows are not supported.
4433Grid tables can be created easily using Emacs\[cq] table-mode
4434(\f[C]M-x table-insert\f[R]).
4435.PP
4436Alignments can be specified as with pipe tables, by putting colons at
4437the boundaries of the separator line after the header:
4438.IP
4439.nf
4440\f[C]
4441+---------------+---------------+--------------------+
4442| Right | Left | Centered |
4443+==============:+:==============+:==================:+
4444| Bananas | $1.34 | built-in wrapper |
4445+---------------+---------------+--------------------+
4446\f[R]
4447.fi
4448.PP
4449For headerless tables, the colons go on the top line instead:
4450.IP
4451.nf
4452\f[C]
4453+--------------:+:--------------+:------------------:+
4454| Right | Left | Centered |
4455+---------------+---------------+--------------------+
4456\f[R]
4457.fi
4458.SS Grid Table Limitations
4459.PP
4460Pandoc does not support grid tables with row spans or column spans.
4461This means that neither variable numbers of columns across rows nor
4462variable numbers of rows across columns are supported by Pandoc.
4463All grid tables must have the same number of columns in each row, and
4464the same number of rows in each column.
4465For example, the Docutils sample grid tables will not render as expected
4466with Pandoc.
4467.SS Extension: \f[C]pipe_tables\f[R]
4468.PP
4469Pipe tables look like this:
4470.IP
4471.nf
4472\f[C]
4473| Right | Left | Default | Center |
4474|------:|:-----|---------|:------:|
4475| 12 | 12 | 12 | 12 |
4476| 123 | 123 | 123 | 123 |
4477| 1 | 1 | 1 | 1 |
4479 : Demonstration of pipe table syntax.
4480\f[R]
4481.fi
4482.PP
4483The syntax is identical to PHP Markdown Extra tables.
4484The beginning and ending pipe characters are optional, but pipes are
4485required between all columns.
4486The colons indicate column alignment as shown.
4487The header cannot be omitted.
4488To simulate a headerless table, include a header with blank cells.
4489.PP
4490Since the pipes indicate column boundaries, columns need not be
4491vertically aligned, as they are in the above example.
4492So, this is a perfectly legal (though ugly) pipe table:
4493.IP
4494.nf
4495\f[C]
4496fruit| price
4497-----|-----:
4498apple|2.05
4499pear|1.37
4500orange|3.09
4501\f[R]
4502.fi
4503.PP
4504The cells of pipe tables cannot contain block elements like paragraphs
4505and lists, and cannot span multiple lines.
4506If a pipe table contains a row whose Markdown content is wider than the
4507column width (see \f[C]--columns\f[R]), then the table will take up the
4508full text width and the cell contents will wrap, with the relative cell
4509widths determined by the number of dashes in the line separating the
4510table header from the table body.
4511(For example \f[C]---|-\f[R] would make the first column 3/4 and the
4512second column 1/4 of the full text width.) On the other hand, if no
4513lines are wider than column width, then cell contents will not be
4514wrapped, and the cells will be sized to their contents.
4515.PP
4516Note: pandoc also recognizes pipe tables of the following form, as can
4517be produced by Emacs\[cq] orgtbl-mode:
4518.IP
4519.nf
4520\f[C]
4521| One | Two |
4522|-----+-------|
4523| my | table |
4524| is | nice |
4525\f[R]
4526.fi
4527.PP
4528The difference is that \f[C]+\f[R] is used instead of \f[C]|\f[R].
4529Other orgtbl features are not supported.
4530In particular, to get non-default column alignment, you\[cq]ll need to
4531add colons as above.
4532.SS Metadata blocks
4533.SS Extension: \f[C]pandoc_title_block\f[R]
4534.PP
4535If the file begins with a title block
4536.IP
4537.nf
4538\f[C]
4539% title
4540% author(s) (separated by semicolons)
4541% date
4542\f[R]
4543.fi
4544.PP
4545it will be parsed as bibliographic information, not regular text.
4546(It will be used, for example, in the title of standalone LaTeX or HTML
4547output.) The block may contain just a title, a title and an author, or
4548all three elements.
4549If you want to include an author but no title, or a title and a date but
4550no author, you need a blank line:
4551.IP
4552.nf
4553\f[C]
4555% Author
4556\f[R]
4557.fi
4558.IP
4559.nf
4560\f[C]
4561% My title
4563% June 15, 2006
4564\f[R]
4565.fi
4566.PP
4567The title may occupy multiple lines, but continuation lines must begin
4568with leading space, thus:
4569.IP
4570.nf
4571\f[C]
4572% My title
4573 on multiple lines
4574\f[R]
4575.fi
4576.PP
4577If a document has multiple authors, the authors may be put on separate
4578lines with leading space, or separated by semicolons, or both.
4579So, all of the following are equivalent:
4580.IP
4581.nf
4582\f[C]
4583% Author One
4584 Author Two
4585\f[R]
4586.fi
4587.IP
4588.nf
4589\f[C]
4590% Author One; Author Two
4591\f[R]
4592.fi
4593.IP
4594.nf
4595\f[C]
4596% Author One;
4597 Author Two
4598\f[R]
4599.fi
4600.PP
4601The date must fit on one line.
4602.PP
4603All three metadata fields may contain standard inline formatting
4604(italics, links, footnotes, etc.).
4605.PP
4606Title blocks will always be parsed, but they will affect the output only
4607when the \f[C]--standalone\f[R] (\f[C]-s\f[R]) option is chosen.
4608In HTML output, titles will appear twice: once in the document head
4609\[en] this is the title that will appear at the top of the window in a
4610browser \[en] and once at the beginning of the document body.
4611The title in the document head can have an optional prefix attached
4612(\f[C]--title-prefix\f[R] or \f[C]-T\f[R] option).
4613The title in the body appears as an H1 element with class
4614\[lq]title\[rq], so it can be suppressed or reformatted with CSS.
4615If a title prefix is specified with \f[C]-T\f[R] and no title block
4616appears in the document, the title prefix will be used by itself as the
4617HTML title.
4618.PP
4619The man page writer extracts a title, man page section number, and other
4620header and footer information from the title line.
4621The title is assumed to be the first word on the title line, which may
4622optionally end with a (single-digit) section number in parentheses.
4623(There should be no space between the title and the parentheses.)
4624Anything after this is assumed to be additional footer and header text.
4625A single pipe character (\f[C]|\f[R]) should be used to separate the
4626footer text from the header text.
4627Thus,
4628.IP
4629.nf
4630\f[C]
4631% PANDOC(1)
4632\f[R]
4633.fi
4634.PP
4635will yield a man page with the title \f[C]PANDOC\f[R] and section 1.
4636.IP
4637.nf
4638\f[C]
4639% PANDOC(1) Pandoc User Manuals
4640\f[R]
4641.fi
4642.PP
4643will also have \[lq]Pandoc User Manuals\[rq] in the footer.
4644.IP
4645.nf
4646\f[C]
4647% PANDOC(1) Pandoc User Manuals | Version 4.0
4648\f[R]
4649.fi
4650.PP
4651will also have \[lq]Version 4.0\[rq] in the header.
4652.SS Extension: \f[C]yaml_metadata_block\f[R]
4653.PP
4654A YAML metadata block is a valid YAML object, delimited by a line of
4655three hyphens (\f[C]---\f[R]) at the top and a line of three hyphens
4656(\f[C]---\f[R]) or three dots (\f[C]...\f[R]) at the bottom.
4657A YAML metadata block may occur anywhere in the document, but if it is
4658not at the beginning, it must be preceded by a blank line.
4659(Note that, because of the way pandoc concatenates input files when
4660several are provided, you may also keep the metadata in a separate YAML
4661file and pass it to pandoc as an argument, along with your Markdown
4662files:
4663.IP
4664.nf
4665\f[C]
4666pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
4667\f[R]
4668.fi
4669.PP
4670Just be sure that the YAML file begins with \f[C]---\f[R] and ends with
4671\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the
4672\f[C]--metadata-file\f[R] option.
4673Using that approach however, you cannot reference content (like
4674footnotes) from the main markdown input document.
4675.PP
4676Metadata will be taken from the fields of the YAML object and added to
4677any existing document metadata.
4678Metadata can contain lists and objects (nested arbitrarily), but all
4679string scalars will be interpreted as Markdown.
4680Fields with names ending in an underscore will be ignored by pandoc.
4681(They may be given a role by external processors.) Field names must not
4682be interpretable as YAML numbers or boolean values (so, for example,
4683\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field
4684names).
4685.PP
4686A document may contain multiple metadata blocks.
4687If two metadata blocks attempt to set the same field, the value from the
4688second block will be taken.
4689.PP
4690When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown
4691document, a YAML metadata block will be produced only if the
4692\f[C]-s/--standalone\f[R] option is used.
4693All of the metadata will appear in a single block at the beginning of
4694the document.
4695.PP
4696Note that YAML escaping rules must be followed.
4697Thus, for example, if a title contains a colon, it must be quoted.
4698The pipe character (\f[C]|\f[R]) can be used to begin an indented block
4699that will be interpreted literally, without need for escaping.
4700This form is necessary when the field contains blank lines or
4701block-level formatting:
4702.IP
4703.nf
4704\f[C]
4705---
4706title: \[aq]This is the title: it contains a colon\[aq]
4707author:
4708- Author One
4709- Author Two
4710keywords: [nothing, nothingness]
4711abstract: |
4712 This is the abstract.
4714 It consists of two paragraphs.
4715\&...
4716\f[R]
4717.fi
4718.PP
4719Template variables will be set automatically from the metadata.
4720Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
4721be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
4722field:
4723.IP
4724.nf
4725\f[C]
4726<p>This is the abstract.</p>
4727<p>It consists of two paragraphs.</p>
4728\f[R]
4729.fi
4730.PP
4731Variables can contain arbitrary YAML structures, but the template must
4732match this structure.
4733The \f[C]author\f[R] variable in the default templates expects a simple
4734list or string, but can be changed to support more complicated
4735structures.
4736The following combination, for example, would add an affiliation to the
4737author if one is given:
4738.IP
4739.nf
4740\f[C]
4741---
4742title: The document title
4743author:
4744- name: Author One
4745 affiliation: University of Somewhere
4746- name: Author Two
4747 affiliation: University of Nowhere
4748\&...
4749\f[R]
4750.fi
4751.PP
4752To use the structured authors in the example above, you would need a
4753custom template:
4754.IP
4755.nf
4756\f[C]
4757$for(author)$
4758$if(author.name)$
4759$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
4760$else$
4761$author$
4762$endif$
4763$endfor$
4764\f[R]
4765.fi
4766.PP
4767Raw content to include in the document\[cq]s header may be specified
4768using \f[C]header-includes\f[R]; however, it is important to mark up
4769this content as raw code for a particular output format, using the
4770\f[C]raw_attribute\f[R] extension), or it will be interpreted as
4771markdown.
4772For example:
4773.IP
4774.nf
4775\f[C]
4776header-includes:
4777- |
4778 \[ga]\[ga]\[ga]{=latex}
4779 \[rs]let\[rs]oldsection\[rs]section
4780 \[rs]renewcommand{\[rs]section}[1]{\[rs]clearpage\[rs]oldsection{#1}}
4781 \[ga]\[ga]\[ga]
4782\f[R]
4783.fi
4784.SS Backslash escapes
4785.SS Extension: \f[C]all_symbols_escapable\f[R]
4786.PP
4787Except inside a code block or inline code, any punctuation or space
4788character preceded by a backslash will be treated literally, even if it
4789would normally indicate formatting.
4790Thus, for example, if one writes
4791.IP
4792.nf
4793\f[C]
4794*\[rs]*hello\[rs]**
4795\f[R]
4796.fi
4797.PP
4798one will get
4799.IP
4800.nf
4801\f[C]
4802<em>*hello*</em>
4803\f[R]
4804.fi
4805.PP
4806instead of
4807.IP
4808.nf
4809\f[C]
4810<strong>hello</strong>
4811\f[R]
4812.fi
4813.PP
4814This rule is easier to remember than standard Markdown\[cq]s rule, which
4815allows only the following characters to be backslash-escaped:
4816.IP
4817.nf
4818\f[C]
4819\[rs]\[ga]*_{}[]()>#+-.!
4820\f[R]
4821.fi
4822.PP
4823(However, if the \f[C]markdown_strict\f[R] format is used, the standard
4824Markdown rule will be used.)
4825.PP
4826A backslash-escaped space is parsed as a nonbreaking space.
4827In TeX output, it will appear as \f[C]\[ti]\f[R].
4828In HTML and XML output, it will appear as a literal unicode nonbreaking
4829space character (note that it will thus actually look
4830\[lq]invisible\[rq] in the generated HTML source; you can still use the
4831\f[C]--ascii\f[R] command-line option to make it appear as an explicit
4832entity).
4833.PP
4834A backslash-escaped newline (i.e.\ a backslash occurring at the end of a
4835line) is parsed as a hard line break.
4836It will appear in TeX output as \f[C]\[rs]\[rs]\f[R] and in HTML as
4837\f[C]<br />\f[R].
4838This is a nice alternative to Markdown\[cq]s \[lq]invisible\[rq] way of
4839indicating hard line breaks using two trailing spaces on a line.
4840.PP
4841Backslash escapes do not work in verbatim contexts.
4842.SS Inline formatting
4843.SS Emphasis
4844.PP
4845To \f[I]emphasize\f[R] some text, surround it with \f[C]*\f[R]s or
4846\f[C]_\f[R], like this:
4847.IP
4848.nf
4849\f[C]
4850This text is _emphasized with underscores_, and this
4851is *emphasized with asterisks*.
4852\f[R]
4853.fi
4854.PP
4855Double \f[C]*\f[R] or \f[C]_\f[R] produces \f[B]strong emphasis\f[R]:
4856.IP
4857.nf
4858\f[C]
4859This is **strong emphasis** and __with underscores__.
4860\f[R]
4861.fi
4862.PP
4863A \f[C]*\f[R] or \f[C]_\f[R] character surrounded by spaces, or
4864backslash-escaped, will not trigger emphasis:
4865.IP
4866.nf
4867\f[C]
4868This is * not emphasized *, and \[rs]*neither is this\[rs]*.
4869\f[R]
4870.fi
4871.SS Extension: \f[C]intraword_underscores\f[R]
4872.PP
4873Because \f[C]_\f[R] is sometimes used inside words and identifiers,
4874pandoc does not interpret a \f[C]_\f[R] surrounded by alphanumeric
4875characters as an emphasis marker.
4876If you want to emphasize just part of a word, use \f[C]*\f[R]:
4877.IP
4878.nf
4879\f[C]
4880feas*ible*, not feas*able*.
4881\f[R]
4882.fi
4883.SS Strikeout
4884.SS Extension: \f[C]strikeout\f[R]
4885.PP
4886To strikeout a section of text with a horizontal line, begin and end it
4887with \f[C]\[ti]\[ti]\f[R].
4888Thus, for example,
4889.IP
4890.nf
4891\f[C]
4892This \[ti]\[ti]is deleted text.\[ti]\[ti]
4893\f[R]
4894.fi
4895.SS Superscripts and subscripts
4896.SS Extension: \f[C]superscript\f[R], \f[C]subscript\f[R]
4897.PP
4898Superscripts may be written by surrounding the superscripted text by
4899\f[C]\[ha]\f[R] characters; subscripts may be written by surrounding the
4900subscripted text by \f[C]\[ti]\f[R] characters.
4901Thus, for example,
4902.IP
4903.nf
4904\f[C]
4905H\[ti]2\[ti]O is a liquid. 2\[ha]10\[ha] is 1024.
4906\f[R]
4907.fi
4908.PP
4909The text between \f[C]\[ha]...\[ha]\f[R] or \f[C]\[ti]...\[ti]\f[R] may
4910not contain spaces or newlines.
4911If the superscripted or subscripted text contains spaces, these spaces
4912must be escaped with backslashes.
4913(This is to prevent accidental superscripting and subscripting through
4914the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R], and also bad
4915interactions with footnotes.) Thus, if you want the letter P with `a
4916cat' in subscripts, use \f[C]P\[ti]a\[rs] cat\[ti]\f[R], not
4917\f[C]P\[ti]a cat\[ti]\f[R].
4918.SS Verbatim
4919.PP
4920To make a short span of text verbatim, put it inside backticks:
4921.IP
4922.nf
4923\f[C]
4924What is the difference between \[ga]>>=\[ga] and \[ga]>>\[ga]?
4925\f[R]
4926.fi
4927.PP
4928If the verbatim text includes a backtick, use double backticks:
4929.IP
4930.nf
4931\f[C]
4932Here is a literal backtick \[ga]\[ga] \[ga] \[ga]\[ga].
4933\f[R]
4934.fi
4935.PP
4936(The spaces after the opening backticks and before the closing backticks
4937will be ignored.)
4938.PP
4939The general rule is that a verbatim span starts with a string of
4940consecutive backticks (optionally followed by a space) and ends with a
4941string of the same number of backticks (optionally preceded by a space).
4942.PP
4943Note that backslash-escapes (and other Markdown constructs) do not work
4944in verbatim contexts:
4945.IP
4946.nf
4947\f[C]
4948This is a backslash followed by an asterisk: \[ga]\[rs]*\[ga].
4949\f[R]
4950.fi
4951.SS Extension: \f[C]inline_code_attributes\f[R]
4952.PP
4953Attributes can be attached to verbatim text, just as with fenced code
4954blocks:
4955.IP
4956.nf
4957\f[C]
4958\[ga]<$>\[ga]{.haskell}
4959\f[R]
4960.fi
4961.SS Small caps
4962.PP
4963To write small caps, use the \f[C]smallcaps\f[R] class:
4964.IP
4965.nf
4966\f[C]
4967[Small caps]{.smallcaps}
4968\f[R]
4969.fi
4970.PP
4971Or, without the \f[C]bracketed_spans\f[R] extension:
4972.IP
4973.nf
4974\f[C]
4975<span class=\[dq]smallcaps\[dq]>Small caps</span>
4976\f[R]
4977.fi
4978.PP
4979For compatibility with other Markdown flavors, CSS is also supported:
4980.IP
4981.nf
4982\f[C]
4983<span style=\[dq]font-variant:small-caps;\[dq]>Small caps</span>
4984\f[R]
4985.fi
4986.PP
4987This will work in all output formats that support small caps.
4988.SS Math
4989.SS Extension: \f[C]tex_math_dollars\f[R]
4990.PP
4991Anything between two \f[C]$\f[R] characters will be treated as TeX math.
4992The opening \f[C]$\f[R] must have a non-space character immediately to
4993its right, while the closing \f[C]$\f[R] must have a non-space character
4994immediately to its left, and must not be followed immediately by a
4995digit.
4996Thus, \f[C]$20,000 and $30,000\f[R] won\[cq]t parse as math.
4997If for some reason you need to enclose text in literal \f[C]$\f[R]
4998characters, backslash-escape them and they won\[cq]t be treated as math
4999delimiters.
5000.PP
5001For display math, use \f[C]$$\f[R] delimiters.
5002(In this case, the delimiters may be separated from the formula by
5003whitespace.)
5004.PP
5005TeX math will be printed in all output formats.
5006How it is rendered depends on the output format:
5007.TP
5008LaTeX
5009It will appear verbatim surrounded by \f[C]\[rs](...\[rs])\f[R] (for
5010inline math) or \f[C]\[rs][...\[rs]]\f[R] (for display math).
5011.TP
5012Markdown, Emacs Org mode, ConTeXt, ZimWiki
5013It will appear verbatim surrounded by \f[C]$...$\f[R] (for inline math)
5014or \f[C]$$...$$\f[R] (for display math).
5015.TP
5016XWiki
5017It will appear verbatim surrounded by
5018\f[C]{{formula}}..{{/formula}}\f[R].
5019.TP
5020reStructuredText
5021It will be rendered using an interpreted text role \f[C]:math:\f[R].
5022.TP
5023AsciiDoc
5024For AsciiDoc output format (\f[C]-t asciidoc\f[R]) it will appear
5025verbatim surrounded by \f[C]latexmath:[$...$]\f[R] (for inline math) or
5026\f[C][latexmath]++++\[rs][...\[rs]]+++\f[R] (for display math).
5027For AsciiDoctor output format (\f[C]-t asciidoctor\f[R]) the LaTex
5028delimiters (\f[C]$..$\f[R] and \f[C]\[rs][..\[rs]]\f[R]) are omitted.
5029.TP
5030Texinfo
5031It will be rendered inside a \f[C]\[at]math\f[R] command.
5032.TP
5033roff man, Jira markup
5034It will be rendered verbatim without \f[C]$\f[R]\[cq]s.
5035.TP
5036MediaWiki, DokuWiki
5037It will be rendered inside \f[C]<math>\f[R] tags.
5038.TP
5039Textile
5040It will be rendered inside \f[C]<span class=\[dq]math\[dq]>\f[R] tags.
5041.TP
5042RTF, OpenDocument
5043It will be rendered, if possible, using Unicode characters, and will
5044otherwise appear verbatim.
5045.TP
5046ODT
5047It will be rendered, if possible, using MathML.
5048.TP
5049DocBook
5050If the \f[C]--mathml\f[R] flag is used, it will be rendered using MathML
5051in an \f[C]inlineequation\f[R] or \f[C]informalequation\f[R] tag.
5052Otherwise it will be rendered, if possible, using Unicode characters.
5053.TP
5054Docx
5055It will be rendered using OMML math markup.
5056.TP
5057FictionBook2
5058If the \f[C]--webtex\f[R] option is used, formulas are rendered as
5059images using CodeCogs or other compatible web service, downloaded and
5060embedded in the e-book.
5061Otherwise, they will appear verbatim.
5062.TP
5063HTML, Slidy, DZSlides, S5, EPUB
5064The way math is rendered in HTML will depend on the command-line options
5065selected.
5066Therefore see Math rendering in HTML above.
5067.SS Raw HTML
5068.SS Extension: \f[C]raw_html\f[R]
5069.PP
5070Markdown allows you to insert raw HTML (or DocBook) anywhere in a
5071document (except verbatim contexts, where \f[C]<\f[R], \f[C]>\f[R], and
5072\f[C]&\f[R] are interpreted literally).
5073(Technically this is not an extension, since standard Markdown allows
5074it, but it has been made an extension so that it can be disabled if
5075desired.)
5076.PP
5077The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
5078DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile
5079output, and suppressed in other formats.
5080.PP
5081For a more explicit way of including raw HTML in a Markdown document,
5082see the \f[C]raw_attribute\f[R] extension.
5083.PP
5084In the CommonMark format, if \f[C]raw_html\f[R] is enabled,
5085superscripts, subscripts, strikeouts and small capitals will be
5086represented as HTML.
5087Otherwise, plain-text fallbacks will be used.
5088Note that even if \f[C]raw_html\f[R] is disabled, tables will be
5089rendered with HTML syntax if they cannot use pipe syntax.
5090.SS Extension: \f[C]markdown_in_html_blocks\f[R]
5091.PP
5092Standard Markdown allows you to include HTML \[lq]blocks\[rq]: blocks of
5093HTML between balanced tags that are separated from the surrounding text
5094with blank lines, and start and end at the left margin.
5095Within these blocks, everything is interpreted as HTML, not Markdown; so
5096(for example), \f[C]*\f[R] does not signify emphasis.
5097.PP
5098Pandoc behaves this way when the \f[C]markdown_strict\f[R] format is
5099used; but by default, pandoc interprets material between HTML block tags
5100as Markdown.
5101Thus, for example, pandoc will turn
5102.IP
5103.nf
5104\f[C]
5105<table>
5106<tr>
5107<td>*one*</td>
5108<td>[a link](https://google.com)</td>
5109</tr>
5110</table>
5111\f[R]
5112.fi
5113.PP
5114into
5115.IP
5116.nf
5117\f[C]
5118<table>
5119<tr>
5120<td><em>one</em></td>
5121<td><a href=\[dq]https://google.com\[dq]>a link</a></td>
5122</tr>
5123</table>
5124\f[R]
5125.fi
5126.PP
5127whereas \f[C]Markdown.pl\f[R] will preserve it as is.
5128.PP
5129There is one exception to this rule: text between \f[C]<script>\f[R] and
5130\f[C]<style>\f[R] tags is not interpreted as Markdown.
5131.PP
5132This departure from standard Markdown should make it easier to mix
5133Markdown with HTML block elements.
5134For example, one can surround a block of Markdown text with
5135\f[C]<div>\f[R] tags without preventing it from being interpreted as
5136Markdown.
5137.SS Extension: \f[C]native_divs\f[R]
5138.PP
5139Use native pandoc \f[C]Div\f[R] blocks for content inside
5140\f[C]<div>\f[R] tags.
5141For the most part this should give the same output as
5142\f[C]markdown_in_html_blocks\f[R], but it makes it easier to write
5143pandoc filters to manipulate groups of blocks.
5144.SS Extension: \f[C]native_spans\f[R]
5145.PP
5146Use native pandoc \f[C]Span\f[R] blocks for content inside
5147\f[C]<span>\f[R] tags.
5148For the most part this should give the same output as
5149\f[C]raw_html\f[R], but it makes it easier to write pandoc filters to
5150manipulate groups of inlines.
5151.SS Extension: \f[C]raw_tex\f[R]
5152.PP
5153In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
5154included in a document.
5155Inline TeX commands will be preserved and passed unchanged to the LaTeX
5156and ConTeXt writers.
5157Thus, for example, you can use LaTeX to include BibTeX citations:
5158.IP
5159.nf
5160\f[C]
5161This result was proved in \[rs]cite{jones.1967}.
5162\f[R]
5163.fi
5164.PP
5165Note that in LaTeX environments, like
5166.IP
5167.nf
5168\f[C]
5169\[rs]begin{tabular}{|l|l|}\[rs]hline
5170Age & Frequency \[rs]\[rs] \[rs]hline
517118--25 & 15 \[rs]\[rs]
517226--35 & 33 \[rs]\[rs]
517336--45 & 22 \[rs]\[rs] \[rs]hline
5174\[rs]end{tabular}
5175\f[R]
5176.fi
5177.PP
5178the material between the begin and end tags will be interpreted as raw
5179LaTeX, not as Markdown.
5180.PP
5181For a more explicit and flexible way of including raw TeX in a Markdown
5182document, see the \f[C]raw_attribute\f[R] extension.
5183.PP
5184Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
5185Emacs Org mode, and ConTeXt.
5186.SS Generic raw attribute
5187.SS Extension: \f[C]raw_attribute\f[R]
5188.PP
5189Inline spans and fenced code blocks with a special kind of attribute
5190will be parsed as raw content with the designated format.
5191For example, the following produces a raw roff \f[C]ms\f[R] block:
5192.IP
5193.nf
5194\f[C]
5195\[ga]\[ga]\[ga]{=ms}
5196\&.MYMACRO
5197blah blah
5198\[ga]\[ga]\[ga]
5199\f[R]
5200.fi
5201.PP
5202And the following produces a raw \f[C]html\f[R] inline element:
5203.IP
5204.nf
5205\f[C]
5206This is \[ga]<a>html</a>\[ga]{=html}
5207\f[R]
5208.fi
5209.PP
5210This can be useful to insert raw xml into \f[C]docx\f[R] documents, e.g.
5211a pagebreak:
5212.IP
5213.nf
5214\f[C]
5215\[ga]\[ga]\[ga]{=openxml}
5216<w:p>
5217 <w:r>
5218 <w:br w:type=\[dq]page\[dq]/>
5219 </w:r>
5220</w:p>
5221\[ga]\[ga]\[ga]
5222\f[R]
5223.fi
5224.PP
5225The format name should match the target format name (see
5226\f[C]-t/--to\f[R], above, for a list, or use
5227\f[C]pandoc --list-output-formats\f[R]).
5228Use \f[C]openxml\f[R] for \f[C]docx\f[R] output, \f[C]opendocument\f[R]
5229for \f[C]odt\f[R] output, \f[C]html5\f[R] for \f[C]epub3\f[R] output,
5230\f[C]html4\f[R] for \f[C]epub2\f[R] output, and \f[C]latex\f[R],
5231\f[C]beamer\f[R], \f[C]ms\f[R], or \f[C]html5\f[R] for \f[C]pdf\f[R]
5232output (depending on what you use for \f[C]--pdf-engine\f[R]).
5233.PP
5234This extension presupposes that the relevant kind of inline code or
5235fenced code block is enabled.
5236Thus, for example, to use a raw attribute with a backtick code block,
5237\f[C]backtick_code_blocks\f[R] must be enabled.
5238.PP
5239The raw attribute cannot be combined with regular attributes.
5240.SS LaTeX macros
5241.SS Extension: \f[C]latex_macros\f[R]
5242.PP
5243When this extension is enabled, pandoc will parse LaTeX macro
5244definitions and apply the resulting macros to all LaTeX math and raw
5245LaTeX.
5246So, for example, the following will work in all output formats, not just
5247LaTeX:
5248.IP
5249.nf
5250\f[C]
5251\[rs]newcommand{\[rs]tuple}[1]{\[rs]langle #1 \[rs]rangle}
5253$\[rs]tuple{a, b, c}$
5254\f[R]
5255.fi
5256.PP
5257Note that LaTeX macros will not be applied if they occur inside a raw
5258span or block marked with the \f[C]raw_attribute\f[R] extension.
5259.PP
5260When \f[C]latex_macros\f[R] is disabled, the raw LaTeX and math will not
5261have macros applied.
5262This is usually a better approach when you are targeting LaTeX or PDF.
5263.PP
5264Macro definitions in LaTeX will be passed through as raw LaTeX only if
5265\f[C]latex_macros\f[R] is not enabled.
5266Macro definitions in Markdown source (or other formats allowing
5267\f[C]raw_tex\f[R]) will be passed through regardless of whether
5268\f[C]latex_macros\f[R] is enabled.
5269.SS Links
5270.PP
5271Markdown allows links to be specified in several ways.
5272.SS Automatic links
5273.PP
5274If you enclose a URL or email address in pointy brackets, it will become
5275a link:
5276.IP
5277.nf
5278\f[C]
5279<https://google.com>
5280<sam\[at]green.eggs.ham>
5281\f[R]
5282.fi
5283.SS Inline links
5284.PP
5285An inline link consists of the link text in square brackets, followed by
5286the URL in parentheses.
5287(Optionally, the URL can be followed by a link title, in quotes.)
5288.IP
5289.nf
5290\f[C]
5291This is an [inline link](/url), and here\[aq]s [one with
5292a title](https://fsf.org \[dq]click here for a good time!\[dq]).
5293\f[R]
5294.fi
5295.PP
5296There can be no space between the bracketed part and the parenthesized
5297part.
5298The link text can contain formatting (such as emphasis), but the title
5299cannot.
5300.PP
5301Email addresses in inline links are not autodetected, so they have to be
5302prefixed with \f[C]mailto\f[R]:
5303.IP
5304.nf
5305\f[C]
5306[Write me!](mailto:sam\[at]green.eggs.ham)
5307\f[R]
5308.fi
5309.SS Reference links
5310.PP
5311An \f[I]explicit\f[R] reference link has two parts, the link itself and
5312the link definition, which may occur elsewhere in the document (either
5313before or after the link).
5314.PP
5315The link consists of link text in square brackets, followed by a label
5316in square brackets.
5317(There cannot be space between the two unless the
5318\f[C]spaced_reference_links\f[R] extension is enabled.) The link
5319definition consists of the bracketed label, followed by a colon and a
5320space, followed by the URL, and optionally (after a space) a link title
5321either in quotes or in parentheses.
5322The label must not be parseable as a citation (assuming the
5323\f[C]citations\f[R] extension is enabled): citations take precedence
5324over link labels.
5325.PP
5326Here are some examples:
5327.IP
5328.nf
5329\f[C]
5330[my label 1]: /foo/bar.html \[dq]My title, optional\[dq]
5331[my label 2]: /foo
5332[my label 3]: https://fsf.org (The free software foundation)
5333[my label 4]: /bar#special \[aq]A title in single quotes\[aq]
5334\f[R]
5335.fi
5336.PP
5337The URL may optionally be surrounded by angle brackets:
5338.IP
5339.nf
5340\f[C]
5341[my label 5]: <http://foo.bar.baz>
5342\f[R]
5343.fi
5344.PP
5345The title may go on the next line:
5346.IP
5347.nf
5348\f[C]
5349[my label 3]: https://fsf.org
5350 \[dq]The free software foundation\[dq]
5351\f[R]
5352.fi
5353.PP
5354Note that link labels are not case sensitive.
5355So, this will work:
5356.IP
5357.nf
5358\f[C]
5359Here is [my link][FOO]
5361[Foo]: /bar/baz
5362\f[R]
5363.fi
5364.PP
5365In an \f[I]implicit\f[R] reference link, the second pair of brackets is
5366empty:
5367.IP
5368.nf
5369\f[C]
5370See [my website][].
5372[my website]: http://foo.bar.baz
5373\f[R]
5374.fi
5375.PP
5376Note: In \f[C]Markdown.pl\f[R] and most other Markdown implementations,
5377reference link definitions cannot occur in nested constructions such as
5378list items or block quotes.
5379Pandoc lifts this arbitrary seeming restriction.
5380So the following is fine in pandoc, though not in most other
5381implementations:
5382.IP
5383.nf
5384\f[C]
5385> My block [quote].
5387> [quote]: /foo
5388\f[R]
5389.fi
5390.SS Extension: \f[C]shortcut_reference_links\f[R]
5391.PP
5392In a \f[I]shortcut\f[R] reference link, the second pair of brackets may
5393be omitted entirely:
5394.IP
5395.nf
5396\f[C]
5397See [my website].
5399[my website]: http://foo.bar.baz
5400\f[R]
5401.fi
5402.SS Internal links
5403.PP
5404To link to another section of the same document, use the automatically
5405generated identifier (see Heading identifiers).
5406For example:
5407.IP
5408.nf
5409\f[C]
5410See the [Introduction](#introduction).
5411\f[R]
5412.fi
5413.PP
5415.IP
5416.nf
5417\f[C]
5418See the [Introduction].
5420[Introduction]: #introduction
5421\f[R]
5422.fi
5423.PP
5424Internal links are currently supported for HTML formats (including HTML
5425slide shows and EPUB), LaTeX, and ConTeXt.
5426.SS Images
5427.PP
5428A link immediately preceded by a \f[C]!\f[R] will be treated as an
5429image.
5430The link text will be used as the image\[cq]s alt text:
5431.IP
5432.nf
5433\f[C]
5434![la lune](lalune.jpg \[dq]Voyage to the moon\[dq])
5436![movie reel]
5438[movie reel]: movie.gif
5439\f[R]
5440.fi
5441.SS Extension: \f[C]implicit_figures\f[R]
5442.PP
5443An image with nonempty alt text, occurring by itself in a paragraph,
5444will be rendered as a figure with a caption.
5445The image\[cq]s alt text will be used as the caption.
5446.IP
5447.nf
5448\f[C]
5449![This is the caption](/url/of/image.png)
5450\f[R]
5451.fi
5452.PP
5453How this is rendered depends on the output format.
5454Some output formats (e.g.\ RTF) do not yet support figures.
5455In those formats, you\[cq]ll just get an image in a paragraph by itself,
5456with no caption.
5457.PP
5458If you just want a regular inline image, just make sure it is not the
5459only thing in the paragraph.
5460One way to do this is to insert a nonbreaking space after the image:
5461.IP
5462.nf
5463\f[C]
5464![This image won\[aq]t be a figure](/url/of/image.png)\[rs]
5465\f[R]
5466.fi
5467.PP
5468Note that in reveal.js slide shows, an image in a paragraph by itself
5469that has the \f[C]stretch\f[R] class will fill the screen, and the
5470caption and figure tags will be omitted.
5471.SS Extension: \f[C]link_attributes\f[R]
5472.PP
5473Attributes can be set on links and images:
5474.IP
5475.nf
5476\f[C]
5477An inline ![image](foo.jpg){#id .class width=30 height=20px}
5478and a reference ![image][ref] with attributes.
5480[ref]: foo.jpg \[dq]optional title\[dq] {#id .class key=val key2=\[dq]val 2\[dq]}
5481\f[R]
5482.fi
5483.PP
5484(This syntax is compatible with PHP Markdown Extra when only
5485\f[C]#id\f[R] and \f[C].class\f[R] are used.)
5486.PP
5487For HTML and EPUB, all known HTML5 attributes except \f[C]width\f[R] and
5488\f[C]height\f[R] (but including \f[C]srcset\f[R] and \f[C]sizes\f[R])
5489are passed through as is.
5490Unknown attributes are passed through as custom attributes, with
5491\f[C]data-\f[R] prepended.
5492The other writers ignore attributes that are not specifically supported
5493by their output format.
5494.PP
5495The \f[C]width\f[R] and \f[C]height\f[R] attributes on images are
5496treated specially.
5497When used without a unit, the unit is assumed to be pixels.
5498However, any of the following unit identifiers can be used:
5499\f[C]px\f[R], \f[C]cm\f[R], \f[C]mm\f[R], \f[C]in\f[R], \f[C]inch\f[R]
5500and \f[C]%\f[R].
5501There must not be any spaces between the number and the unit.
5502For example:
5503.IP
5504.nf
5505\f[C]
5506![](file.jpg){ width=50% }
5507\f[R]
5508.fi
5509.IP \[bu] 2
5510Dimensions may be converted to a form that is compatible with the output
5511format (for example, dimensions given in pixels will be converted to
5512inches when converting HTML to LaTeX).
5513Conversion between pixels and physical measurements is affected by the
5514\f[C]--dpi\f[R] option (by default, 96 dpi is assumed, unless the image
5515itself contains dpi information).
5516.IP \[bu] 2
5517The \f[C]%\f[R] unit is generally relative to some available space.
5518For example the above example will render to the following.
5519.RS 2
5520.IP \[bu] 2
5521HTML:
5522\f[C]<img href=\[dq]file.jpg\[dq] style=\[dq]width: 50%;\[dq] />\f[R]
5523.IP \[bu] 2
5524LaTeX:
5525\f[C]\[rs]includegraphics[width=0.5\[rs]textwidth,height=\[rs]textheight]{file.jpg}\f[R]
5526(If you\[cq]re using a custom template, you need to configure
5527\f[C]graphicx\f[R] as in the default template.)
5528.IP \[bu] 2
5529ConTeXt:
5530\f[C]\[rs]externalfigure[file.jpg][width=0.5\[rs]textwidth]\f[R]
5531.RE
5532.IP \[bu] 2
5533Some output formats have a notion of a class (ConTeXt) or a unique
5534identifier (LaTeX \f[C]\[rs]caption\f[R]), or both (HTML).
5535.IP \[bu] 2
5536When no \f[C]width\f[R] or \f[C]height\f[R] attributes are specified,
5537the fallback is to look at the image resolution and the dpi metadata
5538embedded in the image file.
5539.SS Divs and Spans
5540.PP
5541Using the \f[C]native_divs\f[R] and \f[C]native_spans\f[R] extensions
5542(see above), HTML syntax can be used as part of markdown to create
5543native \f[C]Div\f[R] and \f[C]Span\f[R] elements in the pandoc AST (as
5544opposed to raw HTML).
5545However, there is also nicer syntax available:
5546.SS Extension: \f[C]fenced_divs\f[R]
5547.PP
5548Allow special fenced syntax for native \f[C]Div\f[R] blocks.
5549A Div starts with a fence containing at least three consecutive colons
5550plus some attributes.
5551The attributes may optionally be followed by another string of
5552consecutive colons.
5553The attribute syntax is exactly as in fenced code blocks (see Extension:
5554\f[C]fenced_code_attributes\f[R]).
5555As with fenced code blocks, one can use either attributes in curly
5556braces or a single unbraced word, which will be treated as a class name.
5557The Div ends with another line containing a string of at least three
5558consecutive colons.
5559The fenced Div should be separated by blank lines from preceding and
5560following blocks.
5561.PP
5562Example:
5563.IP
5564.nf
5565\f[C]
5566::::: {#special .sidebar}
5567Here is a paragraph.
5569And another.
5570:::::
5571\f[R]
5572.fi
5573.PP
5574Fenced divs can be nested.
5575Opening fences are distinguished because they \f[I]must\f[R] have
5576attributes:
5577.IP
5578.nf
5579\f[C]
5580::: Warning ::::::
5581This is a warning.
5583::: Danger
5584This is a warning within a warning.
5585:::
5586::::::::::::::::::
5587\f[R]
5588.fi
5589.PP
5590Fences without attributes are always closing fences.
5591Unlike with fenced code blocks, the number of colons in the closing
5592fence need not match the number in the opening fence.
5593However, it can be helpful for visual clarity to use fences of different
5594lengths to distinguish nested divs from their parents.
5595.SS Extension: \f[C]bracketed_spans\f[R]
5596.PP
5597A bracketed sequence of inlines, as one would use to begin a link, will
5598be treated as a \f[C]Span\f[R] with attributes if it is followed
5599immediately by attributes:
5600.IP
5601.nf
5602\f[C]
5603[This is *some text*]{.class key=\[dq]val\[dq]}
5604\f[R]
5605.fi
5606.SS Footnotes
5607.SS Extension: \f[C]footnotes\f[R]
5608.PP
5609Pandoc\[cq]s Markdown allows footnotes, using the following syntax:
5610.IP
5611.nf
5612\f[C]
5613Here is a footnote reference,[\[ha]1] and another.[\[ha]longnote]
5615[\[ha]1]: Here is the footnote.
5617[\[ha]longnote]: Here\[aq]s one with multiple blocks.
5619 Subsequent paragraphs are indented to show that they
5620belong to the previous footnote.
5622 { some.code }
5624 The whole paragraph can be indented, or just the first
5625 line. In this way, multi-paragraph footnotes work like
5626 multi-paragraph list items.
5628This paragraph won\[aq]t be part of the note, because it
5629isn\[aq]t indented.
5630\f[R]
5631.fi
5632.PP
5633The identifiers in footnote references may not contain spaces, tabs, or
5634newlines.
5635These identifiers are used only to correlate the footnote reference with
5636the note itself; in the output, footnotes will be numbered sequentially.
5637.PP
5638The footnotes themselves need not be placed at the end of the document.
5639They may appear anywhere except inside other block elements (lists,
5640block quotes, tables, etc.).
5641Each footnote should be separated from surrounding content (including
5642other footnotes) by blank lines.
5643.SS Extension: \f[C]inline_notes\f[R]
5644.PP
5645Inline footnotes are also allowed (though, unlike regular notes, they
5646cannot contain multiple paragraphs).
5647The syntax is as follows:
5648.IP
5649.nf
5650\f[C]
5651Here is an inline note.\[ha][Inlines notes are easier to write, since
5652you don\[aq]t have to pick an identifier and move down to type the
5653note.]
5654\f[R]
5655.fi
5656.PP
5657Inline and regular footnotes may be mixed freely.
5658.SS Citation syntax
5659.SS Extension: \f[C]citations\f[R]
5660.PP
5661Markdown citations go inside square brackets and are separated by
5662semicolons.
5663Each citation must have a key, composed of `\[at]' + the citation
5664identifier from the database, and may optionally have a prefix, a
5665locator, and a suffix.
5666The citation key must begin with a letter, digit, or \f[C]_\f[R], and
5667may contain alphanumerics, \f[C]_\f[R], and internal punctuation
5668characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]).
5669Here are some examples:
5670.IP
5671.nf
5672\f[C]
5673Blah blah [see \[at]doe99, pp. 33-35; also \[at]smith04, chap. 1].
5675Blah blah [\[at]doe99, pp. 33-35, 38-39 and *passim*].
5677Blah blah [\[at]smith04; \[at]doe99].
5678\f[R]
5679.fi
5680.PP
5681\f[C]pandoc\f[R] detects locator terms in the CSL locale files.
5682Either abbreviated or unabbreviated forms are accepted.
5683In the \f[C]en-US\f[R] locale, locator terms can be written in either
5684singular or plural forms, as \f[C]book\f[R],
5685\f[C]bk.\f[R]/\f[C]bks.\f[R]; \f[C]chapter\f[R],
5686\f[C]chap.\f[R]/\f[C]chaps.\f[R]; \f[C]column\f[R],
5687\f[C]col.\f[R]/\f[C]cols.\f[R]; \f[C]figure\f[R],
5688\f[C]fig.\f[R]/\f[C]figs.\f[R]; \f[C]folio\f[R],
5689\f[C]fol.\f[R]/\f[C]fols.\f[R]; \f[C]number\f[R],
5690\f[C]no.\f[R]/\f[C]nos.\f[R]; \f[C]line\f[R],
5691\f[C]l.\f[R]/\f[C]ll.\f[R]; \f[C]note\f[R], \f[C]n.\f[R]/\f[C]nn.\f[R];
5692\f[C]opus\f[R], \f[C]op.\f[R]/\f[C]opp.\f[R]; \f[C]page\f[R],
5693\f[C]p.\f[R]/\f[C]pp.\f[R]; \f[C]paragraph\f[R],
5694\f[C]para.\f[R]/\f[C]paras.\f[R]; \f[C]part\f[R],
5695\f[C]pt.\f[R]/\f[C]pts.\f[R]; \f[C]section\f[R],
5696\f[C]sec.\f[R]/\f[C]secs.\f[R]; \f[C]sub verbo\f[R],
5697\f[C]s.v.\f[R]/\f[C]s.vv.\f[R]; \f[C]verse\f[R],
5698\f[C]v.\f[R]/\f[C]vv.\f[R]; \f[C]volume\f[R],
5699\f[C]vol.\f[R]/\f[C]vols.\f[R]; \f[C]\[ps]\f[R]/\f[C]\[ps]\[ps]\f[R];
5700\f[C]\[sc]\f[R]/\f[C]\[sc]\[sc]\f[R].
5701If no locator term is used, \[lq]page\[rq] is assumed.
5702.PP
5703\f[C]pandoc\f[R] will use heuristics to distinguish the locator from the
5704suffix.
5705In complex cases, the locator can be enclosed in curly braces:
5706.IP
5707.nf
5708\f[C]
5709[\[at]smith{ii, A, D-Z}, with a suffix]
5710[\[at]smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
5711\f[R]
5712.fi
5713.PP
5714A minus sign (\f[C]-\f[R]) before the \f[C]\[at]\f[R] will suppress
5715mention of the author in the citation.
5716This can be useful when the author is already mentioned in the text:
5717.IP
5718.nf
5719\f[C]
5720Smith says blah [-\[at]smith04].
5721\f[R]
5722.fi
5723.PP
5724You can also write an in-text citation, as follows:
5725.IP
5726.nf
5727\f[C]
5728\[at]smith04 says blah.
5730\[at]smith04 [p. 33] says blah.
5731\f[R]
5732.fi
5733.SS Non-pandoc extensions
5734.PP
5735The following Markdown syntax extensions are not enabled by default in
5736pandoc, but may be enabled by adding \f[C]+EXTENSION\f[R] to the format
5737name, where \f[C]EXTENSION\f[R] is the name of the extension.
5738Thus, for example, \f[C]markdown+hard_line_breaks\f[R] is Markdown with
5739hard line breaks.
5740.SS Extension: \f[C]attributes\f[R]
5741.PP
5742Allows attributes to be attached to any inline or block-level element.
5743The syntax for the attributes is the same as that used in
5744\f[C]header_attributes\f[R].
5745.IP \[bu] 2
5746Attributes that occur immediately after an inline element affect that
5747element.
5748If they follow a space, then they belong to the space.
5749(Hence, this option subsumes \f[C]inline_code_attributes\f[R] and
5750\f[C]link_attributes\f[R].)
5751.IP \[bu] 2
5752Attributes that occur immediately before a block element, on a line by
5753themselves, affect that element.
5754.IP \[bu] 2
5755Consecutive attribute specifiers may be used, either for blocks or for
5756inlines.
5757Their attributes will be combined.
5758.IP \[bu] 2
5759Attributes that occur at the end of the text of a Setext or ATX heading
5760(separated by whitespace from the text) affect the heading element.
5761(Hence, this option subsumes \f[C]header_attributes\f[R].)
5762.IP \[bu] 2
5763Attributes that occur after the opening fence in a fenced code block
5764affect the code block element.
5765(Hence, this option subsumes \f[C]fenced_code_attributes\f[R].)
5766.IP \[bu] 2
5767Attributes that occur at the end of a reference link definition affect
5768links that refer to that definition.
5769.PP
5770Note that pandoc\[cq]s AST does not currently allow attributes to be
5771attached to arbitrary elements.
5772Hence a Span or Div container will be added if needed.
5773.SS Extension: \f[C]old_dashes\f[R]
5774.PP
5775Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
5776\f[C]-\f[R] before a numeral is an en-dash, and \f[C]--\f[R] is an
5777em-dash.
5778This option only has an effect if \f[C]smart\f[R] is enabled.
5779It is selected automatically for \f[C]textile\f[R] input.
5780.SS Extension: \f[C]angle_brackets_escapable\f[R]
5781.PP
5782Allow \f[C]<\f[R] and \f[C]>\f[R] to be backslash-escaped, as they can
5783be in GitHub flavored Markdown but not original Markdown.
5784This is implied by pandoc\[cq]s default \f[C]all_symbols_escapable\f[R].
5785.SS Extension: \f[C]lists_without_preceding_blankline\f[R]
5786.PP
5787Allow a list to occur right after a paragraph, with no intervening blank
5788space.
5789.SS Extension: \f[C]four_space_rule\f[R]
5790.PP
5791Selects the pandoc <= 2.0 behavior for parsing lists, so that four
5792spaces indent are needed for list item continuation paragraphs.
5793.SS Extension: \f[C]spaced_reference_links\f[R]
5794.PP
5795Allow whitespace between the two components of a reference link, for
5796example,
5797.IP
5798.nf
5799\f[C]
5800[foo] [bar].
5801\f[R]
5802.fi
5803.SS Extension: \f[C]hard_line_breaks\f[R]
5804.PP
5805Causes all newlines within a paragraph to be interpreted as hard line
5806breaks instead of spaces.
5807.SS Extension: \f[C]ignore_line_breaks\f[R]
5808.PP
5809Causes newlines within a paragraph to be ignored, rather than being
5810treated as spaces or as hard line breaks.
5811This option is intended for use with East Asian languages where spaces
5812are not used between words, but text is divided into lines for
5813readability.
5814.SS Extension: \f[C]east_asian_line_breaks\f[R]
5815.PP
5816Causes newlines within a paragraph to be ignored, rather than being
5817treated as spaces or as hard line breaks, when they occur between two
5818East Asian wide characters.
5819This is a better choice than \f[C]ignore_line_breaks\f[R] for texts that
5820include a mix of East Asian wide characters and other characters.
5821.SS Extension: \f[C]emoji\f[R]
5822.PP
5823Parses textual emojis like \f[C]:smile:\f[R] as Unicode emoticons.
5824.SS Extension: \f[C]tex_math_single_backslash\f[R]
5825.PP
5826Causes anything between \f[C]\[rs](\f[R] and \f[C]\[rs])\f[R] to be
5827interpreted as inline TeX math, and anything between \f[C]\[rs][\f[R]
5828and \f[C]\[rs]]\f[R] to be interpreted as display TeX math.
5829Note: a drawback of this extension is that it precludes escaping
5830\f[C](\f[R] and \f[C][\f[R].
5831.SS Extension: \f[C]tex_math_double_backslash\f[R]
5832.PP
5833Causes anything between \f[C]\[rs]\[rs](\f[R] and \f[C]\[rs]\[rs])\f[R]
5834to be interpreted as inline TeX math, and anything between
5835\f[C]\[rs]\[rs][\f[R] and \f[C]\[rs]\[rs]]\f[R] to be interpreted as
5836display TeX math.
5837.SS Extension: \f[C]markdown_attribute\f[R]
5838.PP
5839By default, pandoc interprets material inside block-level tags as
5840Markdown.
5841This extension changes the behavior so that Markdown is only parsed
5842inside block-level tags if the tags have the attribute
5843\f[C]markdown=1\f[R].
5844.SS Extension: \f[C]mmd_title_block\f[R]
5845.PP
5846Enables a MultiMarkdown style title block at the top of the document,
5847for example:
5848.IP
5849.nf
5850\f[C]
5851Title: My title
5852Author: John Doe
5853Date: September 1, 2008
5854Comment: This is a sample mmd title block, with
5855 a field spanning multiple lines.
5856\f[R]
5857.fi
5858.PP
5859See the MultiMarkdown documentation for details.
5860If \f[C]pandoc_title_block\f[R] or \f[C]yaml_metadata_block\f[R] is
5861enabled, it will take precedence over \f[C]mmd_title_block\f[R].
5862.SS Extension: \f[C]abbreviations\f[R]
5863.PP
5864Parses PHP Markdown Extra abbreviation keys, like
5865.IP
5866.nf
5867\f[C]
5868*[HTML]: Hypertext Markup Language
5869\f[R]
5870.fi
5871.PP
5872Note that the pandoc document model does not support abbreviations, so
5873if this extension is enabled, abbreviation keys are simply skipped (as
5874opposed to being parsed as paragraphs).
5875.SS Extension: \f[C]autolink_bare_uris\f[R]
5876.PP
5877Makes all absolute URIs into links, even when not surrounded by pointy
5878braces \f[C]<...>\f[R].
5879.SS Extension: \f[C]mmd_link_attributes\f[R]
5880.PP
5881Parses multimarkdown style key-value attributes on link and image
5882references.
5883This extension should not be confused with the \f[C]link_attributes\f[R]
5884extension.
5885.IP
5886.nf
5887\f[C]
5888This is a reference ![image][ref] with multimarkdown attributes.
5890[ref]: https://path.to/image \[dq]Image title\[dq] width=20px height=30px
5891 id=myId class=\[dq]myClass1 myClass2\[dq]
5892\f[R]
5893.fi
5894.SS Extension: \f[C]mmd_header_identifiers\f[R]
5895.PP
5896Parses multimarkdown style heading identifiers (in square brackets,
5897after the heading but before any trailing \f[C]#\f[R]s in an ATX
5898heading).
5899.SS Extension: \f[C]compact_definition_lists\f[R]
5900.PP
5901Activates the definition list syntax of pandoc 1.12.x and earlier.
5902This syntax differs from the one described above under Definition lists
5903in several respects:
5904.IP \[bu] 2
5905No blank line is required between consecutive items of the definition
5906list.
5907.IP \[bu] 2
5908To get a \[lq]tight\[rq] or \[lq]compact\[rq] list, omit space between
5909consecutive items; the space between a term and its definition does not
5910affect anything.
5911.IP \[bu] 2
5912Lazy wrapping of paragraphs is not allowed: the entire definition must
5913be indented four spaces.
5914.SS Extension: \f[C]gutenberg\f[R]
5915.PP
5916Use Project Gutenberg conventions for \f[C]plain\f[R] output: all-caps
5917for strong emphasis, surround by underscores for regular emphasis, add
5918extra blank space around headings.
5919.SS Markdown variants
5920.PP
5921In addition to pandoc\[cq]s extended Markdown, the following Markdown
5922variants are supported:
5923.IP \[bu] 2
5924\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
5925.IP \[bu] 2
5926\f[C]markdown_github\f[R] (deprecated GitHub-Flavored Markdown)
5927.IP \[bu] 2
5928\f[C]markdown_mmd\f[R] (MultiMarkdown)
5929.IP \[bu] 2
5930\f[C]markdown_strict\f[R] (Markdown.pl)
5931.IP \[bu] 2
5932\f[C]commonmark\f[R] (CommonMark)
5933.IP \[bu] 2
5934\f[C]gfm\f[R] (Github-Flavored Markdown)
5935.IP \[bu] 2
5936\f[C]commonmark_x\f[R] (CommonMark with many pandoc extensions)
5937.PP
5938To see which extensions are supported for a given format, and which are
5939enabled by default, you can use the command
5940.IP
5941.nf
5942\f[C]
5943pandoc --list-extensions=FORMAT
5944\f[R]
5945.fi
5946.PP
5947where \f[C]FORMAT\f[R] is replaced with the name of the format.
5948.PP
5949Note that the list of extensions for \f[C]commonmark\f[R],
5950\f[C]gfm\f[R], and \f[C]commonmark_x\f[R] are defined relative to
5951default commonmark.
5952So, for example, \f[C]backtick_code_blocks\f[R] does not appear as an
5953extension, since it is enabled by default and cannot be disabled.
5954.SH CITATIONS
5955.PP
5956When the \f[C]--citeproc\f[R] option is used, pandoc can automatically
5957generate citations and a bibliography in a number of styles.
5958Basic usage is
5959.IP
5960.nf
5961\f[C]
5962pandoc --citeproc myinput.txt
5963\f[R]
5964.fi
5965.PP
5966To use this feature, you will need to have
5967.IP \[bu] 2
5968a document containing citations (see Extension: \f[C]citations\f[R]);
5969.IP \[bu] 2
5970a source of bibliographic data: either an external bibliography file or
5971a list of \f[C]references\f[R] in the document\[cq]s YAML metadata
5972.IP \[bu] 2
5973optionally, a CSL citation style.
5974.SS Specifying bibliographic data
5975.PP
5976You can specify an external bibliography using the
5977\f[C]bibliography\f[R] metadata field in a YAML metadata section or the
5978\f[C]--bibliography\f[R] command line argument.
5979If you want to use multiple bibliography files, you can supply multiple
5980\f[C]--bibliography\f[R] arguments or set \f[C]bibliography\f[R]
5981metadata field to YAML array.
5982A bibliography may have any of these formats:
5983.PP
5984.TS
5985tab(@);
5986l l.
5988Format
5989T}@T{
5990File extension
5994BibLaTeX
5995T}@T{
5996\&.bib
5999BibTeX
6000T}@T{
6001\&.bibtex
6004CSL JSON
6005T}@T{
6006\&.json
6009CSL YAML
6010T}@T{
6011\&.yaml
6013.TE
6014.PP
6015Note that \f[C].bib\f[R] can be used with both BibTeX and BibLaTeX
6016files; use the extension \f[C].bibtex\f[R] to force interpretation as
6017BibTeX.
6018.PP
6019In BibTeX and BibLaTeX databases, pandoc parses LaTeX markup inside
6020fields such as \f[C]title\f[R]; in CSL YAML databases, pandoc Markdown;
6021and in CSL JSON databases, an HTML-like markup:
6022.TP
6023\f[B]\f[CB]<i>...</i>\f[B]\f[R]
6024italics
6025.TP
6026\f[B]\f[CB]<b>...</b>\f[B]\f[R]
6027bold
6028.TP
6029\f[B]\f[CB]<span style=\[dq]font-variant:small-caps;\[dq]>...</span>\f[B]\f[R] or \f[B]\f[CB]<sc>...</sc>\f[B]\f[R]
6030small capitals
6031.TP
6032\f[B]\f[CB]<sub>...</sub>\f[B]\f[R]
6033subscript
6034.TP
6035\f[B]\f[CB]<sup>...</sup>\f[B]\f[R]
6036superscript
6037.TP
6038\f[B]\f[CB]<span class=\[dq]nocase\[dq]>...</span>\f[B]\f[R]
6039prevent a phrase from being capitalized as title case
6040.PP
6041As an alternative to specifying a bibliography file using
6042\f[C]--bibliography\f[R] or the YAML metadata field
6043\f[C]bibliography\f[R], you can include the citation data directly in
6044the \f[C]references\f[R] field of the document\[cq]s YAML metadata.
6045The field should contain an array of YAML-encoded references, for
6046example:
6047.IP
6048.nf
6049\f[C]
6050---
6051references:
6052- type: article-journal
6053 id: WatsonCrick1953
6054 author:
6055 - family: Watson
6056 given: J. D.
6057 - family: Crick
6058 given: F. H. C.
6059 issued:
6060 date-parts:
6061 - - 1953
6062 - 4
6063 - 25
6064 title: \[aq]Molecular structure of nucleic acids: a structure for
6065 deoxyribose nucleic acid\[aq]
6066 title-short: Molecular structure of nucleic acids
6067 container-title: Nature
6068 volume: 171
6069 issue: 4356
6070 page: 737-738
6071 DOI: 10.1038/171737a0
6072 URL: https://www.nature.com/articles/171737a0
6073 language: en-GB
6074\&...
6075\f[R]
6076.fi
6077.PP
6078Note that \f[C]pandoc\f[R] can be used to produce such a YAML metadata
6079section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
6080.IP
6081.nf
6082\f[C]
6083pandoc chem.bib -s -f biblatex -t markdown
6084pandoc chem.json -s -f csljson -t markdown
6085\f[R]
6086.fi
6087.PP
6088\f[C]pandoc\f[R] can also be used to produce CSL JSON bibliography from
6089BibTeX, BibLaTeX, or markdown YAML:
6090.IP
6091.nf
6092\f[C]
6093pandoc chem.bib -s -f biblatex -t csljson
6094pandoc chem.yaml -s -f markdown -t csljson
6095\f[R]
6096.fi
6097.PP
6098Running pandoc on a bibliography file with the \f[C]--citeproc\f[R]
6099option will create a formatted bibliography in the format of your
6100choice:
6101.IP
6102.nf
6103\f[C]
6104pandoc chem.bib -s --citeproc -o chem.html
6105pandoc chem.bib -s --citeproc -o chem.pdf
6106\f[R]
6107.fi
6108.SS Capitalization in titles
6109.PP
6110If you are using a bibtex or biblatex bibliography, then observe the
6111following rules:
6112.IP \[bu] 2
6113English titles should be in title case.
6114Non-English titles should be in sentence case, and the \f[C]langid\f[R]
6115field in biblatex should be set to the relevant language.
6116(The following values are treated as English: \f[C]american\f[R],
6117\f[C]british\f[R], \f[C]canadian\f[R], \f[C]english\f[R],
6118\f[C]australian\f[R], \f[C]newzealand\f[R], \f[C]USenglish\f[R], or
6119\f[C]UKenglish\f[R].)
6120.IP \[bu] 2
6121As is standard with bibtex/biblatex, proper names should be protected
6122with curly braces so that they won\[cq]t be lowercased in styles that
6123call for sentence case.
6124For example:
6125.RS 2
6126.IP
6127.nf
6128\f[C]
6129title = {My Dinner with {Andre}}
6130\f[R]
6131.fi
6132.RE
6133.IP \[bu] 2
6134In addition, words that should remain lowercase (or camelCase) should be
6135protected:
6136.RS 2
6137.IP
6138.nf
6139\f[C]
6140title = {Spin Wave Dispersion on the {nm} Scale}
6141\f[R]
6142.fi
6143.PP
6144Though this is not necessary in bibtex/biblatex, it is necessary with
6145citeproc, which stores titles internally in sentence case, and converts
6146to title case in styles that require it.
6147Here we protect \[lq]nm\[rq] so that it doesn\[cq]t get converted to
6148\[lq]Nm\[rq] at this stage.
6149.RE
6150.PP
6151If you are using a CSL bibliography (either JSON or YAML), then observe
6152the following rules:
6153.IP \[bu] 2
6154All titles should be in sentence case.
6155.IP \[bu] 2
6156Use the \f[C]language\f[R] field for non-English titles to prevent their
6157conversion to title case in styles that call for this.
6158(Conversion happens only if \f[C]language\f[R] begins with \f[C]en\f[R]
6159or is left empty.)
6160.IP \[bu] 2
6161Protect words that should not be converted to title case using this
6162syntax:
6163.RS 2
6164.IP
6165.nf
6166\f[C]
6167Spin wave dispersion on the <span class=\[dq]nocase\[dq]>nm</span> scale
6168\f[R]
6169.fi
6170.RE
6171.SS Conference Papers, Published vs.\ Unpublished
6172.PP
6173For a formally published conference paper, use the biblatex entry type
6174\f[C]inproceedings\f[R] (which will be mapped to CSL
6175\f[C]paper-conference\f[R]).
6176.PP
6177For an unpublished manuscript, use the biblatex entry type
6178\f[C]unpublished\f[R] without an \f[C]eventtitle\f[R] field (this entry
6179type will be mapped to CSL \f[C]manuscript\f[R]).
6180.PP
6181For a talk, an unpublished conference paper, or a poster presentation,
6182use the biblatex entry type \f[C]unpublished\f[R] with an
6183\f[C]eventtitle\f[R] field (this entry type will be mapped to CSL
6184\f[C]speech\f[R]).
6185Use the biblatex \f[C]type\f[R] field to indicate the type,
6186e.g.\ \[lq]Paper\[rq], or \[lq]Poster\[rq].
6187\f[C]venue\f[R] and \f[C]eventdate\f[R] may be useful too, though
6188\f[C]eventdate\f[R] will not be rendered by most CSL styles.
6189Note that \f[C]venue\f[R] is for the event\[cq]s venue, unlike
6190\f[C]location\f[R] which describes the publisher\[cq]s location; do not
6191use the latter for an unpublished conference paper.
6192.SS Specifying a citation style
6193.PP
6194Citations and references can be formatted using any style supported by
6195the Citation Style Language, listed in the Zotero Style Repository.
6196These files are specified using the \f[C]--csl\f[R] option or the
6197\f[C]csl\f[R] (or \f[C]citation-style\f[R]) metadata field.
6198By default, pandoc will use the Chicago Manual of Style author-date
6199format.
6200(You can override this default by copying a CSL style of your choice to
6201\f[C]default.csl\f[R] in your user data directory.) The CSL project
6202provides further information on finding and editing styles.
6203.PP
6204The \f[C]--citation-abbreviations\f[R] option (or the
6205\f[C]citation-abbreviations\f[R] metadata field) may be used to specify
6206a JSON file containing abbreviations of journals that should be used in
6207formatted bibliographies when \f[C]form=\[dq]short\[dq]\f[R] is
6208specified.
6209The format of the file can be illustrated with an example:
6210.IP
6211.nf
6212\f[C]
6213{ \[dq]default\[dq]: {
6214 \[dq]container-title\[dq]: {
6215 \[dq]Lloyd\[aq]s Law Reports\[dq]: \[dq]Lloyd\[aq]s Rep\[dq],
6216 \[dq]Estates Gazette\[dq]: \[dq]EG\[dq],
6217 \[dq]Scots Law Times\[dq]: \[dq]SLT\[dq]
6221\f[R]
6222.fi
6223.SS Raw content in a style
6224.PP
6225To include raw content in a prefix, suffix, delimiter, or term, surround
6226it with these tags indicating the format:
6227.IP
6228.nf
6229\f[C]
6230{{jats}}&lt;ref&gt;{{/jats}}
6231\f[R]
6232.fi
6233.PP
6234Without the tags, the string will be interpreted as a string and escaped
6235in the output, rather than being passed through raw.
6236.PP
6237This feature allows stylesheets to be customized to give different
6238output for different output formats.
6239However, stylesheets customized in this way will not be usable by other
6240CSL implementations.
6241.SS Placement of the bibliography
6242.PP
6243If the style calls for a list of works cited, it will be placed in a div
6244with id \f[C]refs\f[R], if one exists:
6245.IP
6246.nf
6247\f[C]
6248::: {#refs}
6249:::
6250\f[R]
6251.fi
6252.PP
6253Otherwise, it will be placed at the end of the document.
6254Generation of the bibliography can be suppressed by setting
6255\f[C]suppress-bibliography: true\f[R] in the YAML metadata.
6256.PP
6257If you wish the bibliography to have a section heading, you can set
6258\f[C]reference-section-title\f[R] in the metadata, or put the heading at
6259the beginning of the div with id \f[C]refs\f[R] (if you are using it) or
6260at the end of your document:
6261.IP
6262.nf
6263\f[C]
6264last paragraph...
6266# References
6267\f[R]
6268.fi
6269.PP
6270The bibliography will be inserted after this heading.
6271Note that the \f[C]unnumbered\f[R] class will be added to this heading,
6272so that the section will not be numbered.
6273.SS Including uncited items in the bibliography
6274.PP
6275If you want to include items in the bibliography without actually citing
6276them in the body text, you can define a dummy \f[C]nocite\f[R] metadata
6277field and put the citations there:
6278.IP
6279.nf
6280\f[C]
6281---
6282nocite: |
6283 \[at]item1, \[at]item2
6284\&...
6286\[at]item3
6287\f[R]
6288.fi
6289.PP
6290In this example, the document will contain a citation for
6291\f[C]item3\f[R] only, but the bibliography will contain entries for
6292\f[C]item1\f[R], \f[C]item2\f[R], and \f[C]item3\f[R].
6293.PP
6294It is possible to create a bibliography with all the citations, whether
6295or not they appear in the document, by using a wildcard:
6296.IP
6297.nf
6298\f[C]
6299---
6300nocite: |
6301 \[at]*
6302\&...
6303\f[R]
6304.fi
6305.PP
6306For LaTeX output, you can also use \f[C]natbib\f[R] or
6307\f[C]biblatex\f[R] to render the bibliography.
6308In order to do so, specify bibliography files as outlined above, and add
6309\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] argument to \f[C]pandoc\f[R]
6310invocation.
6311Bear in mind that bibliography files have to be in either BibTeX (for
6312\f[C]--natbib\f[R]) or BibLaTeX (for \f[C]--biblatex\f[R]) format.
6313.SS Other relevant metadata fields
6314.PP
6315A few other metadata fields affect bibliography formatting:
6316.TP
6317\f[B]\f[CB]link-citation\f[B]\f[R]
6318If true, citations will be hyperlinked to the corresponding bibliography
6319entries (for author-date and numerical styles only).
6320.TP
6321\f[B]\f[CB]lang\f[B]\f[R]
6322The \f[C]lang\f[R] field will affect how the style is localized, for
6323example in the translation of labels and the use of quotation marks.
6324(For backwards compatibility, \f[C]locale\f[R] may be used instead of
6325\f[C]lang\f[R], but this use is deprecated.)
6326.TP
6327\f[B]\f[CB]notes-after-punctuation\f[B]\f[R]
6328If true (the default), pandoc will put footnote citations after
6329following punctuation.
6330For example, if the source contains \f[C]blah blah [\[at]jones99].\f[R],
6331the result will look like \f[C]blah blah.[\[ha]1]\f[R], with the note
6332moved after the period and the space collapsed.
6333If false, the space will still be collapsed, but the footnote will not
6334be moved after the punctuation.
6335.SH SLIDE SHOWS
6336.PP
6337You can use pandoc to produce an HTML + JavaScript slide presentation
6338that can be viewed via a web browser.
6339There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
6340reveal.js.
6341You can also produce a PDF slide show using LaTeX \f[C]beamer\f[R], or
6342slides shows in Microsoft PowerPoint format.
6343.PP
6344Here\[cq]s the Markdown source for a simple slide show,
6345\f[C]habits.txt\f[R]:
6346.IP
6347.nf
6348\f[C]
6349% Habits
6350% John Doe
6351% March 22, 2005
6353# In the morning
6355## Getting up
6357- Turn off alarm
6358- Get out of bed
6360## Breakfast
6362- Eat eggs
6363- Drink coffee
6365# In the evening
6367## Dinner
6369- Eat spaghetti
6370- Drink wine
6372------------------
6374![picture of spaghetti](images/spaghetti.jpg)
6376## Going to sleep
6378- Get in bed
6379- Count sheep
6380\f[R]
6381.fi
6382.PP
6383To produce an HTML/JavaScript slide show, simply type
6384.IP
6385.nf
6386\f[C]
6387pandoc -t FORMAT -s habits.txt -o habits.html
6388\f[R]
6389.fi
6390.PP
6391where \f[C]FORMAT\f[R] is either \f[C]s5\f[R], \f[C]slidy\f[R],
6392\f[C]slideous\f[R], \f[C]dzslides\f[R], or \f[C]revealjs\f[R].
6393.PP
6394For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
6395the \f[C]-s/--standalone\f[R] option embeds a link to JavaScript and CSS
6396files, which are assumed to be available at the relative path
6397\f[C]s5/default\f[R] (for S5), \f[C]slideous\f[R] (for Slideous),
6398\f[C]reveal.js\f[R] (for reveal.js), or at the Slidy website at
6399\f[C]w3.org\f[R] (for Slidy).
6400(These paths can be changed by setting the \f[C]slidy-url\f[R],
6401\f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R]
6402variables; see Variables for HTML slides, above.) For DZSlides, the
6403(relatively short) JavaScript and CSS are included in the file by
6404default.
6405.PP
6406With all HTML slide formats, the \f[C]--self-contained\f[R] option can
6407be used to produce a single file that contains all of the data necessary
6408to display the slide show, including linked scripts, stylesheets,
6409images, and videos.
6410.PP
6411To produce a PDF slide show using beamer, type
6412.IP
6413.nf
6414\f[C]
6415pandoc -t beamer habits.txt -o habits.pdf
6416\f[R]
6417.fi
6418.PP
6419Note that a reveal.js slide show can also be converted to a PDF by
6420printing it to a file from the browser.
6421.PP
6422To produce a Powerpoint slide show, type
6423.IP
6424.nf
6425\f[C]
6426pandoc habits.txt -o habits.pptx
6427\f[R]
6428.fi
6429.SS Structuring the slide show
6430.PP
6431By default, the \f[I]slide level\f[R] is the highest heading level in
6432the hierarchy that is followed immediately by content, and not another
6433heading, somewhere in the document.
6434In the example above, level-1 headings are always followed by level-2
6435headings, which are followed by content, so the slide level is 2.
6436This default can be overridden using the \f[C]--slide-level\f[R] option.
6437.PP
6438The document is carved up into slides according to the following rules:
6439.IP \[bu] 2
6440A horizontal rule always starts a new slide.
6441.IP \[bu] 2
6442A heading at the slide level always starts a new slide.
6443.IP \[bu] 2
6444Headings \f[I]below\f[R] the slide level in the hierarchy create
6445headings \f[I]within\f[R] a slide.
6446.IP \[bu] 2
6447Headings \f[I]above\f[R] the slide level in the hierarchy create
6448\[lq]title slides,\[rq] which just contain the section title and help to
6449break the slide show into sections.
6450Non-slide content under these headings will be included on the title
6451slide (for HTML slide shows) or in a subsequent slide with the same
6452title (for beamer).
6453.IP \[bu] 2
6454A title page is constructed automatically from the document\[cq]s title
6455block, if present.
6456(In the case of beamer, this can be disabled by commenting out some
6457lines in the default template.)
6458.PP
6459These rules are designed to support many different styles of slide show.
6460If you don\[cq]t care about structuring your slides into sections and
6461subsections, you can just use level-1 headings for all each slide.
6462(In that case, level-1 will be the slide level.) But you can also
6463structure the slide show into sections, as in the example above.
6464.PP
6465Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
6466layout will be produced, with level-1 headings building horizontally and
6467level-2 headings building vertically.
6468It is not recommended that you use deeper nesting of section levels with
6469reveal.js.
6470.SS Incremental lists
6471.PP
6472By default, these writers produce lists that display \[lq]all at
6473once.\[rq] If you want your lists to display incrementally (one item at
6474a time), use the \f[C]-i\f[R] option.
6475If you want a particular list to depart from the default, put it in a
6476\f[C]div\f[R] block with class \f[C]incremental\f[R] or
6477\f[C]nonincremental\f[R].
6478So, for example, using the \f[C]fenced div\f[R] syntax, the following
6479would be incremental regardless of the document default:
6480.IP
6481.nf
6482\f[C]
6483::: incremental
6485- Eat spaghetti
6486- Drink wine
6488:::
6489\f[R]
6490.fi
6491.PP
6493.IP
6494.nf
6495\f[C]
6496::: nonincremental
6498- Eat spaghetti
6499- Drink wine
6501:::
6502\f[R]
6503.fi
6504.PP
6505While using \f[C]incremental\f[R] and \f[C]nonincremental\f[R] divs are
6506the recommended method of setting incremental lists on a per-case basis,
6507an older method is also supported: putting lists inside a blockquote
6508will depart from the document default (that is, it will display
6509incrementally without the \f[C]-i\f[R] option and all at once with the
6510\f[C]-i\f[R] option):
6511.IP
6512.nf
6513\f[C]
6514> - Eat spaghetti
6515> - Drink wine
6516\f[R]
6517.fi
6518.PP
6519Both methods allow incremental and nonincremental lists to be mixed in a
6520single document.
6521.PP
6522Note: Neither the \f[C]-i/--incremental\f[R] option nor any of the
6523methods described here currently works for PowerPoint output.
6524.SS Inserting pauses
6525.PP
6526You can add \[lq]pauses\[rq] within a slide by including a paragraph
6527containing three dots, separated by spaces:
6528.IP
6529.nf
6530\f[C]
6531# Slide with a pause
6533content before the pause
6535\&. . .
6537content after the pause
6538\f[R]
6539.fi
6540.PP
6541Note: this feature is not yet implemented for PowerPoint output.
6542.SS Styling the slides
6543.PP
6544You can change the style of HTML slides by putting customized CSS files
6545in \f[C]$DATADIR/s5/default\f[R] (for S5), \f[C]$DATADIR/slidy\f[R] (for
6546Slidy), or \f[C]$DATADIR/slideous\f[R] (for Slideous), where
6547\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
6548above).
6549The originals may be found in pandoc\[cq]s system data directory
6550(generally \f[C]$CABALDIR/pandoc-VERSION/s5/default\f[R]).
6551Pandoc will look there for any files it does not find in the user data
6552directory.
6553.PP
6554For dzslides, the CSS is included in the HTML file itself, and may be
6555modified there.
6556.PP
6557All reveal.js configuration options can be set through variables.
6558For example, themes can be used by setting the \f[C]theme\f[R] variable:
6559.IP
6560.nf
6561\f[C]
6562-V theme=moon
6563\f[R]
6564.fi
6565.PP
6566Or you can specify a custom stylesheet using the \f[C]--css\f[R] option.
6567.PP
6568To style beamer slides, you can specify a \f[C]theme\f[R],
6569\f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], and
6570\f[C]outertheme\f[R], using the \f[C]-V\f[R] option:
6571.IP
6572.nf
6573\f[C]
6574pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
6575\f[R]
6576.fi
6577.PP
6578Note that heading attributes will turn into slide attributes (on a
6579\f[C]<div>\f[R] or \f[C]<section>\f[R]) in HTML slide formats, allowing
6580you to style individual slides.
6581In beamer, the only heading attribute that affects slides is the
6582\f[C]allowframebreaks\f[R] class, which sets the
6583\f[C]allowframebreaks\f[R] option, causing multiple slides to be created
6584if the content overfills the frame.
6585This is recommended especially for bibliographies:
6586.IP
6587.nf
6588\f[C]
6589# References {.allowframebreaks}
6590\f[R]
6591.fi
6592.SS Speaker notes
6593.PP
6594Speaker notes are supported in reveal.js and PowerPoint (pptx) output.
6595You can add notes to your Markdown document thus:
6596.IP
6597.nf
6598\f[C]
6599::: notes
6601This is my note.
6603- It can contain Markdown
6604- like this list
6606:::
6607\f[R]
6608.fi
6609.PP
6610To show the notes window in reveal.js, press \f[C]s\f[R] while viewing
6611the presentation.
6612Speaker notes in PowerPoint will be available, as usual, in handouts and
6613presenter view.
6614.PP
6615Notes are not yet supported for other slide formats, but the notes will
6616not appear on the slides themselves.
6617.SS Columns
6618.PP
6619To put material in side by side columns, you can use a native div
6620container with class \f[C]columns\f[R], containing two or more div
6621containers with class \f[C]column\f[R] and a \f[C]width\f[R] attribute:
6622.IP
6623.nf
6624\f[C]
6625:::::::::::::: {.columns}
6626::: {.column width=\[dq]40%\[dq]}
6627contents...
6628:::
6629::: {.column width=\[dq]60%\[dq]}
6630contents...
6631:::
6632::::::::::::::
6633\f[R]
6634.fi
6635.SS Additional columns attributes in beamer
6636.PP
6637The div containers with classes \f[C]columns\f[R] and \f[C]column\f[R]
6638can optionally have an \f[C]align\f[R] attribute.
6639The class \f[C]columns\f[R] can optionally have a \f[C]totalwidth\f[R]
6640attribute or an \f[C]onlytextwidth\f[R] class.
6641.IP
6642.nf
6643\f[C]
6644:::::::::::::: {.columns align=center totalwidth=8em}
6645::: {.column width=\[dq]40%\[dq]}
6646contents...
6647:::
6648::: {.column width=\[dq]60%\[dq] align=bottom}
6649contents...
6650:::
6651::::::::::::::
6652\f[R]
6653.fi
6654.PP
6655The \f[C]align\f[R] attributes on \f[C]columns\f[R] and \f[C]column\f[R]
6656can be used with the values \f[C]top\f[R], \f[C]top-baseline\f[R],
6657\f[C]center\f[R] and \f[C]bottom\f[R] to vertically align the columns.
6658It defaults to \f[C]top\f[R] in \f[C]columns\f[R].
6659.PP
6660The \f[C]totalwidth\f[R] attribute limits the width of the columns to
6661the given value.
6662.IP
6663.nf
6664\f[C]
6665:::::::::::::: {.columns align=top .onlytextwidth}
6666::: {.column width=\[dq]40%\[dq] align=center}
6667contents...
6668:::
6669::: {.column width=\[dq]60%\[dq]}
6670contents...
6671:::
6672::::::::::::::
6673\f[R]
6674.fi
6675.PP
6676The class \f[C]onlytextwidth\f[R] sets the \f[C]totalwidth\f[R] to
6677\f[C]\[rs]textwidth\f[R].
6678.PP
6679See Section 12.7 of the Beamer User\[cq]s Guide for more details.
6680.SS Frame attributes in beamer
6681.PP
6682Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[R] option to
6683a frame in beamer (for example, when using the \f[C]minted\f[R]
6684environment).
6685This can be forced by adding the \f[C]fragile\f[R] class to the heading
6686introducing the slide:
6687.IP
6688.nf
6689\f[C]
6690# Fragile slide {.fragile}
6691\f[R]
6692.fi
6693.PP
6694All of the other frame attributes described in Section 8.1 of the Beamer
6695User\[cq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R],
6696\f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R],
6697\f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R],
6698\f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R].
6699.SS Background in reveal.js and beamer
6700.PP
6701Background images can be added to self-contained reveal.js slideshows
6702and to beamer slideshows.
6703.PP
6704For the same image on every slide, use the configuration option
6705\f[C]background-image\f[R] either in the YAML metadata block or as a
6706command-line variable.
6707(There are no other options in beamer and the rest of this section
6708concerns reveal.js slideshows.)
6709.PP
6710For reveal.js, you can instead use the reveal.js-native option
6711\f[C]parallaxBackgroundImage\f[R].
6712You can also set \f[C]parallaxBackgroundHorizontal\f[R] and
6713\f[C]parallaxBackgroundVertical\f[R] the same way and must also set
6714\f[C]parallaxBackgroundSize\f[R] to have your values take effect.
6715.PP
6716To set an image for a particular reveal.js slide, add
6717\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first
6718slide-level heading on the slide (which may even be empty).
6719.PP
6720In reveal.js\[cq]s overview mode, the parallaxBackgroundImage will show
6721up only on the first slide.
6722.PP
6723Other reveal.js background settings also work on individual slides,
6724including \f[C]data-background-size\f[R],
6725\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R],
6726\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R].
6727.PP
6728To add a background image to the automatically generated title slide,
6729use the \f[C]title-slide-attributes\f[R] variable in the YAML metadata
6730block.
6731It must contain a map of attribute names and values.
6732.PP
6733See the reveal.js documentation for more details.
6734.PP
6735For example in reveal.js:
6736.IP
6737.nf
6738\f[C]
6739---
6740title: My Slideshow
6741parallaxBackgroundImage: /path/to/my/background_image.png
6742title-slide-attributes:
6743 data-background-image: /path/to/title_image.png
6744 data-background-size: contain
6745---
6747## Slide One
6749Slide 1 has background_image.png as its background.
6751## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]}
6753Slide 2 has a special image for its background, even though the heading has no content.
6754\f[R]
6755.fi
6756.SH EPUBS
6757.SS EPUB Metadata
6758.PP
6759EPUB metadata may be specified using the \f[C]--epub-metadata\f[R]
6760option, but if the source document is Markdown, it is better to use a
6761YAML metadata block.
6762Here is an example:
6763.IP
6764.nf
6765\f[C]
6766---
6767title:
6768- type: main
6769 text: My Book
6770- type: subtitle
6771 text: An investigation of metadata
6772creator:
6773- role: author
6774 text: John Smith
6775- role: editor
6776 text: Sarah Jones
6777identifier:
6778- scheme: DOI
6779 text: doi:10.234234.234/33
6780publisher: My Press
6781rights: \[co] 2007 John Smith, CC BY-NC
6782ibooks:
6783 version: 1.3.4
6784\&...
6785\f[R]
6786.fi
6787.PP
6788The following fields are recognized:
6789.TP
6790\f[B]\f[CB]identifier\f[B]\f[R]
6791Either a string value or an object with fields \f[C]text\f[R] and
6792\f[C]scheme\f[R].
6793Valid values for \f[C]scheme\f[R] are \f[C]ISBN-10\f[R],
6794\f[C]GTIN-13\f[R], \f[C]UPC\f[R], \f[C]ISMN-10\f[R], \f[C]DOI\f[R],
6795\f[C]LCCN\f[R], \f[C]GTIN-14\f[R], \f[C]ISBN-13\f[R],
6796\f[C]Legal deposit number\f[R], \f[C]URN\f[R], \f[C]OCLC\f[R],
6797\f[C]ISMN-13\f[R], \f[C]ISBN-A\f[R], \f[C]JP\f[R], \f[C]OLCC\f[R].
6798.TP
6799\f[B]\f[CB]title\f[B]\f[R]
6800Either a string value, or an object with fields \f[C]file-as\f[R] and
6801\f[C]type\f[R], or a list of such objects.
6802Valid values for \f[C]type\f[R] are \f[C]main\f[R], \f[C]subtitle\f[R],
6803\f[C]short\f[R], \f[C]collection\f[R], \f[C]edition\f[R],
6804\f[C]extended\f[R].
6805.TP
6806\f[B]\f[CB]creator\f[B]\f[R]
6807Either a string value, or an object with fields \f[C]role\f[R],
6808\f[C]file-as\f[R], and \f[C]text\f[R], or a list of such objects.
6809Valid values for \f[C]role\f[R] are MARC relators, but pandoc will
6810attempt to translate the human-readable versions (like \[lq]author\[rq]
6811and \[lq]editor\[rq]) to the appropriate marc relators.
6812.TP
6813\f[B]\f[CB]contributor\f[B]\f[R]
6814Same format as \f[C]creator\f[R].
6815.TP
6816\f[B]\f[CB]date\f[B]\f[R]
6817A string value in \f[C]YYYY-MM-DD\f[R] format.
6818(Only the year is necessary.) Pandoc will attempt to convert other
6819common date formats.
6820.TP
6821\f[B]\f[CB]lang\f[B]\f[R] (or legacy: \f[B]\f[CB]language\f[B]\f[R])
6822A string value in BCP 47 format.
6823Pandoc will default to the local language if nothing is specified.
6824.TP
6825\f[B]\f[CB]subject\f[B]\f[R]
6826A string value or a list of such values.
6827.TP
6828\f[B]\f[CB]description\f[B]\f[R]
6829A string value.
6830.TP
6831\f[B]\f[CB]type\f[B]\f[R]
6832A string value.
6833.TP
6834\f[B]\f[CB]format\f[B]\f[R]
6835A string value.
6836.TP
6837\f[B]\f[CB]relation\f[B]\f[R]
6838A string value.
6839.TP
6840\f[B]\f[CB]coverage\f[B]\f[R]
6841A string value.
6842.TP
6843\f[B]\f[CB]rights\f[B]\f[R]
6844A string value.
6845.TP
6846\f[B]\f[CB]cover-image\f[B]\f[R]
6847A string value (path to cover image).
6848.TP
6849\f[B]\f[CB]css\f[B]\f[R] (or legacy: \f[B]\f[CB]stylesheet\f[B]\f[R])
6850A string value (path to CSS stylesheet).
6851.TP
6852\f[B]\f[CB]page-progression-direction\f[B]\f[R]
6853Either \f[C]ltr\f[R] or \f[C]rtl\f[R].
6854Specifies the \f[C]page-progression-direction\f[R] attribute for the
6855\f[C]spine\f[R] element.
6856.TP
6857\f[B]\f[CB]ibooks\f[B]\f[R]
6858iBooks-specific metadata, with the following fields:
6859.RS
6860.IP \[bu] 2
6861\f[C]version\f[R]: (string)
6862.IP \[bu] 2
6863\f[C]specified-fonts\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
6864\f[C]false\f[R])
6865.IP \[bu] 2
6866\f[C]ipad-orientation-lock\f[R]:
6867\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
6868.IP \[bu] 2
6869\f[C]iphone-orientation-lock\f[R]:
6870\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
6871.IP \[bu] 2
6872\f[C]binding\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
6873\f[C]true\f[R])
6874.IP \[bu] 2
6875\f[C]scroll-axis\f[R]:
6876\f[C]vertical\f[R]|\f[C]horizontal\f[R]|\f[C]default\f[R]
6877.RE
6878.SS The \f[C]epub:type\f[R] attribute
6879.PP
6880For \f[C]epub3\f[R] output, you can mark up the heading that corresponds
6881to an EPUB chapter using the \f[C]epub:type\f[R] attribute.
6882For example, to set the attribute to the value \f[C]prologue\f[R], use
6883this markdown:
6884.IP
6885.nf
6886\f[C]
6887# My chapter {epub:type=prologue}
6888\f[R]
6889.fi
6890.PP
6891Which will result in:
6892.IP
6893.nf
6894\f[C]
6895<body epub:type=\[dq]frontmatter\[dq]>
6896 <section epub:type=\[dq]prologue\[dq]>
6897 <h1>My chapter</h1>
6898\f[R]
6899.fi
6900.PP
6901Pandoc will output \f[C]<body epub:type=\[dq]bodymatter\[dq]>\f[R],
6902unless you use one of the following values, in which case either
6903\f[C]frontmatter\f[R] or \f[C]backmatter\f[R] will be output.
6904.PP
6905.TS
6906tab(@);
6907l l.
6909\f[C]epub:type\f[R] of first section
6910T}@T{
6911\f[C]epub:type\f[R] of body
6915prologue
6916T}@T{
6917frontmatter
6920abstract
6921T}@T{
6922frontmatter
6925acknowledgments
6926T}@T{
6927frontmatter
6930copyright-page
6931T}@T{
6932frontmatter
6935dedication
6936T}@T{
6937frontmatter
6940credits
6941T}@T{
6942frontmatter
6945keywords
6946T}@T{
6947frontmatter
6950imprint
6951T}@T{
6952frontmatter
6955contributors
6956T}@T{
6957frontmatter
6960other-credits
6961T}@T{
6962frontmatter
6965errata
6966T}@T{
6967frontmatter
6970revision-history
6971T}@T{
6972frontmatter
6975titlepage
6976T}@T{
6977frontmatter
6980halftitlepage
6981T}@T{
6982frontmatter
6985seriespage
6986T}@T{
6987frontmatter
6990foreword
6991T}@T{
6992frontmatter
6995preface
6996T}@T{
6997frontmatter
7000appendix
7001T}@T{
7002backmatter
7005colophon
7006T}@T{
7007backmatter
7010bibliography
7011T}@T{
7012backmatter
7015index
7016T}@T{
7017backmatter
7019.TE
7020.SS Linked media
7021.PP
7022By default, pandoc will download media referenced from any
7023\f[C]<img>\f[R], \f[C]<audio>\f[R], \f[C]<video>\f[R] or
7024\f[C]<source>\f[R] element present in the generated EPUB, and include it
7025in the EPUB container, yielding a completely self-contained EPUB.
7026If you want to link to external media resources instead, use raw HTML in
7027your source and add \f[C]data-external=\[dq]1\[dq]\f[R] to the tag with
7028the \f[C]src\f[R] attribute.
7029For example:
7030.IP
7031.nf
7032\f[C]
7033<audio controls=\[dq]1\[dq]>
7034 <source src=\[dq]https://example.com/music/toccata.mp3\[dq]
7035 data-external=\[dq]1\[dq] type=\[dq]audio/mpeg\[dq]>
7036 </source>
7037</audio>
7038\f[R]
7039.fi
7040.SH JUPYTER NOTEBOOKS
7041.PP
7042When creating a Jupyter notebook, pandoc will try to infer the notebook
7043structure.
7044Code blocks with the class \f[C]code\f[R] will be taken as code cells,
7045and intervening content will be taken as Markdown cells.
7046Attachments will automatically be created for images in Markdown cells.
7047Metadata will be taken from the \f[C]jupyter\f[R] metadata field.
7048For example:
7049.IP
7050.nf
7051\f[C]
7052---
7053title: My notebook
7054jupyter:
7055 nbformat: 4
7056 nbformat_minor: 5
7057 kernelspec:
7058 display_name: Python 2
7059 language: python
7060 name: python2
7061 language_info:
7062 codemirror_mode:
7063 name: ipython
7064 version: 2
7065 file_extension: \[dq].py\[dq]
7066 mimetype: \[dq]text/x-python\[dq]
7067 name: \[dq]python\[dq]
7068 nbconvert_exporter: \[dq]python\[dq]
7069 pygments_lexer: \[dq]ipython2\[dq]
7070 version: \[dq]2.7.15\[dq]
7071---
7073# Lorem ipsum
7075**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
7076bibendum felis dictum sodales.
7078\[ga]\[ga]\[ga] code
7079print(\[dq]hello\[dq])
7080\[ga]\[ga]\[ga]
7082## Pyout
7084\[ga]\[ga]\[ga] code
7085from IPython.display import HTML
7086HTML(\[dq]\[dq]\[dq]
7087<script>
7088console.log(\[dq]hello\[dq]);
7089</script>
7090<b>HTML</b>
7091\[dq]\[dq]\[dq])
7092\[ga]\[ga]\[ga]
7094## Image
7096This image ![image](myimage.png) will be
7097included as a cell attachment.
7098\f[R]
7099.fi
7100.PP
7101If you want to add cell attributes, group cells differently, or add
7102output to code cells, then you need to include divs to indicate the
7103structure.
7104You can use either fenced divs or native divs for this.
7105Here is an example:
7106.IP
7107.nf
7108\f[C]
7109:::::: {.cell .markdown}
7110# Lorem
7112**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
7113bibendum felis dictum sodales.
7114::::::
7116:::::: {.cell .code execution_count=1}
7117\[ga]\[ga]\[ga] {.python}
7118print(\[dq]hello\[dq])
7119\[ga]\[ga]\[ga]
7121::: {.output .stream .stdout}
7122\[ga]\[ga]\[ga]
7123hello
7124\[ga]\[ga]\[ga]
7125:::
7126::::::
7128:::::: {.cell .code execution_count=2}
7129\[ga]\[ga]\[ga] {.python}
7130from IPython.display import HTML
7131HTML(\[dq]\[dq]\[dq]
7132<script>
7133console.log(\[dq]hello\[dq]);
7134</script>
7135<b>HTML</b>
7136\[dq]\[dq]\[dq])
7137\[ga]\[ga]\[ga]
7139::: {.output .execute_result execution_count=2}
7140\[ga]\[ga]\[ga]{=html}
7141<script>
7142console.log(\[dq]hello\[dq]);
7143</script>
7144<b>HTML</b>
7145hello
7146\[ga]\[ga]\[ga]
7147:::
7148::::::
7149\f[R]
7150.fi
7151.PP
7152If you include raw HTML or TeX in an output cell, use the [raw
7153attribute][Extension: \f[C]fenced_attribute\f[R]], as shown in the last
7154cell of the example above.
7155Although pandoc can process \[lq]bare\[rq] raw HTML and TeX, the result
7156is often interspersed raw elements and normal textual elements, and in
7157an output cell pandoc expects a single, connected raw block.
7158To avoid using raw HTML or TeX except when marked explicitly using raw
7159attributes, we recommend specifying the extensions
7160\f[C]-raw_html-raw_tex+raw_attribute\f[R] when translating between
7161Markdown and ipynb notebooks.
7162.PP
7163Note that options and extensions that affect reading and writing of
7164Markdown will also affect Markdown cells in ipynb notebooks.
7165For example, \f[C]--wrap=preserve\f[R] will preserve soft line breaks in
7166Markdown cells; \f[C]--atx-headers\f[R] will cause ATX-style headings to
7167be used; and \f[C]--preserve-tabs\f[R] will prevent tabs from being
7168turned to spaces.
7169.SH SYNTAX HIGHLIGHTING
7170.PP
7171Pandoc will automatically highlight syntax in fenced code blocks that
7172are marked with a language name.
7173The Haskell library skylighting is used for highlighting.
7174Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and
7175LaTeX/PDF output.
7176To see a list of language names that pandoc will recognize, type
7177\f[C]pandoc --list-highlight-languages\f[R].
7178.PP
7179The color scheme can be selected using the \f[C]--highlight-style\f[R]
7180option.
7181The default color scheme is \f[C]pygments\f[R], which imitates the
7182default color scheme used by the Python library pygments (though
7183pygments is not actually used to do the highlighting).
7184To see a list of highlight styles, type
7185\f[C]pandoc --list-highlight-styles\f[R].
7186.PP
7187If you are not satisfied with the predefined styles, you can use
7188\f[C]--print-highlight-style\f[R] to generate a JSON \f[C].theme\f[R]
7189file which can be modified and used as the argument to
7190\f[C]--highlight-style\f[R].
7191To get a JSON version of the \f[C]pygments\f[R] style, for example:
7192.IP
7193.nf
7194\f[C]
7195pandoc --print-highlight-style pygments > my.theme
7196\f[R]
7197.fi
7198.PP
7199Then edit \f[C]my.theme\f[R] and use it like this:
7200.IP
7201.nf
7202\f[C]
7203pandoc --highlight-style my.theme
7204\f[R]
7205.fi
7206.PP
7207If you are not satisfied with the built-in highlighting, or you want
7208highlight a language that isn\[cq]t supported, you can use the
7209\f[C]--syntax-definition\f[R] option to load a KDE-style XML syntax
7210definition file.
7211Before writing your own, have a look at KDE\[cq]s repository of syntax
7212definitions.
7213.PP
7214To disable highlighting, use the \f[C]--no-highlight\f[R] option.
7215.SH CUSTOM STYLES
7216.PP
7217Custom styles can be used in the docx and ICML formats.
7218.SS Output
7219.PP
7220By default, pandoc\[cq]s docx and ICML output applies a predefined set
7221of styles for blocks such as paragraphs and block quotes, and uses
7222largely default formatting (italics, bold) for inlines.
7223This will work for most purposes, especially alongside a
7224\f[C]reference.docx\f[R] file.
7225However, if you need to apply your own styles to blocks, or match a
7226preexisting set of styles, pandoc allows you to define custom styles for
7227blocks and text using \f[C]div\f[R]s and \f[C]span\f[R]s, respectively.
7228.PP
7229If you define a \f[C]div\f[R] or \f[C]span\f[R] with the attribute
7230\f[C]custom-style\f[R], pandoc will apply your specified style to the
7231contained elements (with the exception of elements whose function
7232depends on a style, like headings, code blocks, block quotes, or links).
7233So, for example, using the \f[C]bracketed_spans\f[R] syntax,
7234.IP
7235.nf
7236\f[C]
7237[Get out]{custom-style=\[dq]Emphatically\[dq]}, he said.
7238\f[R]
7239.fi
7240.PP
7241would produce a docx file with \[lq]Get out\[rq] styled with character
7242style \f[C]Emphatically\f[R].
7243Similarly, using the \f[C]fenced_divs\f[R] syntax,
7244.IP
7245.nf
7246\f[C]
7247Dickinson starts the poem simply:
7249::: {custom-style=\[dq]Poetry\[dq]}
7250| A Bird came down the Walk---
7251| He did not know I saw---
7252:::
7253\f[R]
7254.fi
7255.PP
7256would style the two contained lines with the \f[C]Poetry\f[R] paragraph
7257style.
7258.PP
7259For docx output, styles will be defined in the output file as inheriting
7260from normal text, if the styles are not yet in your reference.docx.
7261If they are already defined, pandoc will not alter the definition.
7262.PP
7263This feature allows for greatest customization in conjunction with
7264pandoc filters.
7265If you want all paragraphs after block quotes to be indented, you can
7266write a filter to apply the styles necessary.
7267If you want all italics to be transformed to the \f[C]Emphasis\f[R]
7268character style (perhaps to change their color), you can write a filter
7269which will transform all italicized inlines to inlines within an
7270\f[C]Emphasis\f[R] custom-style \f[C]span\f[R].
7271.PP
7272For docx output, you don\[cq]t need to enable any extensions for custom
7273styles to work.
7274.SS Input
7275.PP
7276The docx reader, by default, only reads those styles that it can convert
7277into pandoc elements, either by direct conversion or interpreting the
7278derivation of the input document\[cq]s styles.
7279.PP
7280By enabling the \f[C]styles\f[R] extension in the docx reader
7281(\f[C]-f docx+styles\f[R]), you can produce output that maintains the
7282styles of the input document, using the \f[C]custom-style\f[R] class.
7283Paragraph styles are interpreted as divs, while character styles are
7284interpreted as spans.
7285.PP
7286For example, using the \f[C]custom-style-reference.docx\f[R] file in the
7287test directory, we have the following different outputs:
7288.PP
7289Without the \f[C]+styles\f[R] extension:
7290.IP
7291.nf
7292\f[C]
7293$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
7294This is some text.
7296This is text with an *emphasized* text style. And this is text with a
7297**strengthened** text style.
7299> Here is a styled paragraph that inherits from Block Text.
7300\f[R]
7301.fi
7302.PP
7303And with the extension:
7304.IP
7305.nf
7306\f[C]
7307$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
7309::: {custom-style=\[dq]First Paragraph\[dq]}
7310This is some text.
7311:::
7313::: {custom-style=\[dq]Body Text\[dq]}
7314This is text with an [emphasized]{custom-style=\[dq]Emphatic\[dq]} text style.
7315And this is text with a [strengthened]{custom-style=\[dq]Strengthened\[dq]}
7316text style.
7317:::
7319::: {custom-style=\[dq]My Block Style\[dq]}
7320> Here is a styled paragraph that inherits from Block Text.
7321:::
7322\f[R]
7323.fi
7324.PP
7325With these custom styles, you can use your input document as a
7326reference-doc while creating docx output (see below), and maintain the
7327same styles in your input and output files.
7328.SH CUSTOM WRITERS
7329.PP
7330Pandoc can be extended with custom writers written in Lua.
7331(Pandoc includes a Lua interpreter, so Lua need not be installed
7332separately.)
7333.PP
7334To use a custom writer, simply specify the path to the Lua script in
7335place of the output format.
7336For example:
7337.IP
7338.nf
7339\f[C]
7340pandoc -t data/sample.lua
7341\f[R]
7342.fi
7343.PP
7344Creating a custom writer requires writing a Lua function for each
7345possible element in a pandoc document.
7346To get a documented example which you can modify according to your
7347needs, do
7348.IP
7349.nf
7350\f[C]
7351pandoc --print-default-data-file sample.lua
7352\f[R]
7353.fi
7354.PP
7355Note that custom writers have no default template.
7356If you want to use \f[C]--standalone\f[R] with a custom writer, you will
7357need to specify a template manually using \f[C]--template\f[R] or add a
7358new default template with the name
7359\f[C]default.NAME_OF_CUSTOM_WRITER.lua\f[R] to the \f[C]templates\f[R]
7360subdirectory of your user data directory (see Templates).
7361.SH A NOTE ON SECURITY
7362.PP
7363If you use pandoc to convert user-contributed content in a web
7364application, here are some things to keep in mind:
7365.IP "1." 3
7366Although pandoc itself will not create or modify any files other than
7367those you explicitly ask it create (with the exception of temporary
7368files used in producing PDFs), a filter or custom writer could in
7369principle do anything on your file system.
7370Please audit filters and custom writers very carefully before using
7371them.
7372.IP "2." 3
7373If your application uses pandoc as a Haskell library (rather than
7374shelling out to the executable), it is possible to use it in a mode that
7375fully isolates pandoc from your file system, by running the pandoc
7376operations in the \f[C]PandocPure\f[R] monad.
7377See the document Using the pandoc API for more details.
7378.IP "3." 3
7379Pandoc\[cq]s parsers can exhibit pathological performance on some corner
7380cases.
7381It is wise to put any pandoc operations under a timeout, to avoid DOS
7382attacks that exploit these issues.
7383If you are using the pandoc executable, you can add the command line
7384options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size
7385to 512MB.
7386.IP "4." 3
7387The HTML generated by pandoc is not guaranteed to be safe.
7388If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
7389inject arbitrary HTML.
7390Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
7391content in attributes for headings, spans, and code blocks.
7392To be safe, you should run all the generated HTML through an HTML
7393sanitizer.
7394.SH AUTHORS
7395.PP
7396Copyright 2006\[en]2020 John MacFarlane (jgm\[at]berkeley.edu).
7397Released under the GPL, version 2 or greater.
7398This software carries no warranty of any kind.
7399(See COPYRIGHT for full copyright and warranty notices.) For a full list
7400of contributors, see the file AUTHORS.md in the pandoc source code.
7401.PP
7402The Pandoc source code and all documentation may be downloaded
7403from <http://pandoc.org>.