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