git.iko.soy/typeable/pandoc
on 2.0.1 help sign in
5423 lines 162 kB history raw
1.\"t
2.TH PANDOC 1 "October 31, 2017" "pandoc 2.0.1"
3.SH NAME
4pandoc - general markup converter
5.SH SYNOPSIS
6.PP
7\f[C]pandoc\f[] [\f[I]options\f[]] [\f[I]input\-file\f[]]\&...
8.SH DESCRIPTION
9.PP
10Pandoc is a Haskell library for converting from one markup format to
11another, and a command\-line tool that uses this library.
12It can read Markdown, CommonMark, PHP Markdown Extra, GitHub\-Flavored
13Markdown, MultiMarkdown, and (subsets of) Textile, reStructuredText,
14HTML, LaTeX, MediaWiki markup, TWiki markup, TikiWiki markup, Creole
151.0, Haddock markup, OPML, Emacs Org mode, DocBook, Muse, txt2tags,
16Vimwiki, EPUB, ODT, and Word docx; and it can write plain text,
17Markdown, CommonMark, PHP Markdown Extra, GitHub\-Flavored Markdown,
18MultiMarkdown, reStructuredText, XHTML, HTML5, LaTeX (including
19\f[C]beamer\f[] slide shows), ConTeXt, RTF, OPML, DocBook, OpenDocument,
20ODT, Word docx, GNU Texinfo, MediaWiki markup, DokuWiki markup, ZimWiki
21markup, Haddock markup, EPUB (v2 or v3), FictionBook2, Textile, groff
22man, groff ms, Emacs Org mode, AsciiDoc, InDesign ICML, TEI Simple, Muse
23and Slidy, Slideous, DZSlides, reveal.js or S5 HTML slide shows.
24It can also produce PDF output on systems where LaTeX, ConTeXt,
25\f[C]pdfroff\f[], \f[C]wkhtmltopdf\f[], \f[C]prince\f[], or
26\f[C]weasyprint\f[] is installed.
27.PP
28Pandoc's enhanced version of Markdown includes syntax for footnotes,
29tables, flexible ordered lists, definition lists, fenced code blocks,
30superscripts and subscripts, strikeout, metadata blocks, automatic
31tables of contents, embedded LaTeX math, citations, and Markdown inside
32HTML block elements.
33(These enhancements, described further under Pandoc's Markdown, can be
34disabled using the \f[C]markdown_strict\f[] input or output format.)
35.PP
36In contrast to most existing tools for converting Markdown to HTML,
37which use regex substitutions, pandoc has a modular design: it consists
38of a set of readers, which parse text in a given format and produce a
39native representation of the document, and a set of writers, which
40convert this native representation into a target format.
41Thus, adding an input or output format requires only adding a reader or
42writer.
43.PP
44Because pandoc's intermediate representation of a document is less
45expressive than many of the formats it converts between, one should not
46expect perfect conversions between every format and every other.
47Pandoc attempts to preserve the structural elements of a document, but
48not formatting details such as margin size.
49And some document elements, such as complex tables, may not fit into
50pandoc's simple document model.
51While conversions from pandoc's Markdown to all formats aspire to be
52perfect, conversions from formats more expressive than pandoc's Markdown
53can be expected to be lossy.
54.SS Using \f[C]pandoc\f[]
55.PP
56If no \f[I]input\-file\f[] is specified, input is read from
57\f[I]stdin\f[].
58Otherwise, the \f[I]input\-files\f[] are concatenated (with a blank line
59between each) and used as input.
60Output goes to \f[I]stdout\f[] by default (though output to the terminal
61is disabled for the \f[C]odt\f[], \f[C]docx\f[], \f[C]epub2\f[], and
62\f[C]epub3\f[] output formats, unless it is forced using
63\f[C]\-o\ \-\f[]).
64For output to a file, use the \f[C]\-o\f[] option:
65.IP
66.nf
67\f[C]
68pandoc\ \-o\ output.html\ input.txt
69\f[]
70.fi
71.PP
72By default, pandoc produces a document fragment, not a standalone
73document with a proper header and footer.
74To produce a standalone document, use the \f[C]\-s\f[] or
75\f[C]\-\-standalone\f[] flag:
76.IP
77.nf
78\f[C]
79pandoc\ \-s\ \-o\ output.html\ input.txt
80\f[]
81.fi
82.PP
83For more information on how standalone documents are produced, see
84Templates, below.
85.PP
86Instead of a file, an absolute URI may be given.
87In this case pandoc will fetch the content using HTTP:
88.IP
89.nf
90\f[C]
91pandoc\ \-f\ html\ \-t\ markdown\ http://www.fsf.org
92\f[]
93.fi
94.PP
95It is possible to supply a custom User\-Agent string or other header
96when requesting a document from a URL:
97.IP
98.nf
99\f[C]
100pandoc\ \-f\ html\ \-t\ markdown\ \-\-request\-header\ User\-Agent:"Mozilla/5.0"\ \\
101\ \ http://www.fsf.org
102\f[]
103.fi
104.PP
105If multiple input files are given, \f[C]pandoc\f[] will concatenate them
106all (with blank lines between them) before parsing.
107This feature is disabled for binary input formats such as \f[C]EPUB\f[],
108\f[C]odt\f[], and \f[C]docx\f[].
109.PP
110The format of the input and output can be specified explicitly using
111command\-line options.
112The input format can be specified using the \f[C]\-r/\-\-read\f[] or
113\f[C]\-f/\-\-from\f[] options, the output format using the
114\f[C]\-w/\-\-write\f[] or \f[C]\-t/\-\-to\f[] options.
115Thus, to convert \f[C]hello.txt\f[] from Markdown to LaTeX, you could
116type:
117.IP
118.nf
119\f[C]
120pandoc\ \-f\ markdown\ \-t\ latex\ hello.txt
121\f[]
122.fi
123.PP
124To convert \f[C]hello.html\f[] from HTML to Markdown:
125.IP
126.nf
127\f[C]
128pandoc\ \-f\ html\ \-t\ markdown\ hello.html
129\f[]
130.fi
131.PP
132Supported output formats are listed below under the \f[C]\-t/\-\-to\f[]
133option.
134Supported input formats are listed below under the \f[C]\-f/\-\-from\f[]
135option.
136Note that the \f[C]rst\f[], \f[C]textile\f[], \f[C]latex\f[], and
137\f[C]html\f[] readers are not complete; there are some constructs that
138they do not parse.
139.PP
140If the input or output format is not specified explicitly,
141\f[C]pandoc\f[] will attempt to guess it from the extensions of the
142input and output filenames.
143Thus, for example,
144.IP
145.nf
146\f[C]
147pandoc\ \-o\ hello.tex\ hello.txt
148\f[]
149.fi
150.PP
151will convert \f[C]hello.txt\f[] from Markdown to LaTeX.
152If no output file is specified (so that output goes to \f[I]stdout\f[]),
153or if the output file's extension is unknown, the output format will
154default to HTML.
155If no input file is specified (so that input comes from \f[I]stdin\f[]),
156or if the input files' extensions are unknown, the input format will be
157assumed to be Markdown unless explicitly specified.
158.PP
159Pandoc uses the UTF\-8 character encoding for both input and output.
160If your local character encoding is not UTF\-8, you should pipe input
161and output through \f[C]iconv\f[]:
162.IP
163.nf
164\f[C]
165iconv\ \-t\ utf\-8\ input.txt\ |\ pandoc\ |\ iconv\ \-f\ utf\-8
166\f[]
167.fi
168.PP
169Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,
170OPML, DocBook, and Texinfo), information about the character encoding is
171included in the document header, which will only be included if you use
172the \f[C]\-s/\-\-standalone\f[] option.
173.SS Creating a PDF
174.PP
175To produce a PDF, specify an output file with a \f[C]\&.pdf\f[]
176extension.
177By default, pandoc will use LaTeX to create the PDF:
178.IP
179.nf
180\f[C]
181pandoc\ test.txt\ \-o\ test.pdf
182\f[]
183.fi
184.PP
185Production of a PDF requires that a LaTeX engine be installed (see
186\f[C]\-\-pdf\-engine\f[], below), and assumes that the following LaTeX
187packages are available: \f[C]amsfonts\f[], \f[C]amsmath\f[],
188\f[C]lm\f[], \f[C]unicode\-math\f[], \f[C]ifxetex\f[],
189\f[C]ifluatex\f[], \f[C]listings\f[] (if the \f[C]\-\-listings\f[]
190option is used), \f[C]fancyvrb\f[], \f[C]longtable\f[],
191\f[C]booktabs\f[], \f[C]graphicx\f[] and \f[C]grffile\f[] (if the
192document contains images), \f[C]hyperref\f[], \f[C]xcolor\f[] (with
193\f[C]colorlinks\f[]), \f[C]ulem\f[], \f[C]geometry\f[] (with the
194\f[C]geometry\f[] variable set), \f[C]setspace\f[] (with
195\f[C]linestretch\f[]), and \f[C]babel\f[] (with \f[C]lang\f[]).
196The use of \f[C]xelatex\f[] or \f[C]lualatex\f[] as the LaTeX engine
197requires \f[C]fontspec\f[].
198\f[C]xelatex\f[] uses \f[C]polyglossia\f[] (with \f[C]lang\f[]),
199\f[C]xecjk\f[], and \f[C]bidi\f[] (with the \f[C]dir\f[] variable set).
200If the \f[C]mathspec\f[] variable is set, \f[C]xelatex\f[] will use
201\f[C]mathspec\f[] instead of \f[C]unicode\-math\f[].
202The \f[C]upquote\f[] and \f[C]microtype\f[] packages are used if
203available, and \f[C]csquotes\f[] will be used for typography if added to
204the template or included in any header file.
205The \f[C]natbib\f[], \f[C]biblatex\f[], \f[C]bibtex\f[], and
206\f[C]biber\f[] packages can optionally be used for citation rendering.
207These are included with all recent versions of TeX Live.
208.PP
209Alternatively, pandoc can use ConTeXt, \f[C]pdfroff\f[], or any of the
210following HTML/CSS\-to\-PDF\-engines, to create a PDF:
211\f[C]wkhtmltopdf\f[], \f[C]weasyprint\f[] or \f[C]prince\f[].
212To do this, specify an output file with a \f[C]\&.pdf\f[] extension, as
213before, but add the \f[C]\-\-pdf\-engine\f[] option or
214\f[C]\-t\ context\f[], \f[C]\-t\ html\f[], or \f[C]\-t\ ms\f[] to the
215command line (\f[C]\-t\ html\f[] defaults to
216\f[C]\-\-pdf\-engine=wkhtmltopdf\f[]).
217.PP
218PDF output can be controlled using variables for LaTeX (if LaTeX is
219used) and variables for ConTeXt (if ConTeXt is used).
220When using an HTML/CSS\-to\-PDF\-engine, \f[C]\-\-css\f[] affects the
221output.
222If \f[C]wkhtmltopdf\f[] is used, then the variables
223\f[C]margin\-left\f[], \f[C]margin\-right\f[], \f[C]margin\-top\f[],
224\f[C]margin\-bottom\f[], and \f[C]papersize\f[] will affect the output.
225.SH OPTIONS
226.SS General options
227.TP
228.B \f[C]\-f\f[] \f[I]FORMAT\f[], \f[C]\-r\f[] \f[I]FORMAT\f[], \f[C]\-\-from=\f[]\f[I]FORMAT\f[], \f[C]\-\-read=\f[]\f[I]FORMAT\f[]
229Specify input format.
230\f[I]FORMAT\f[] can be \f[C]native\f[] (native Haskell), \f[C]json\f[]
231(JSON version of native AST), \f[C]markdown\f[] (pandoc's extended
232Markdown), \f[C]markdown_strict\f[] (original unextended Markdown),
233\f[C]markdown_phpextra\f[] (PHP Markdown Extra), \f[C]markdown_mmd\f[]
234(MultiMarkdown), \f[C]gfm\f[] (GitHub\-Flavored Markdown),
235\f[C]commonmark\f[] (CommonMark Markdown), \f[C]textile\f[] (Textile),
236\f[C]rst\f[] (reStructuredText), \f[C]html\f[] (HTML), \f[C]docbook\f[]
237(DocBook), \f[C]t2t\f[] (txt2tags), \f[C]docx\f[] (docx), \f[C]odt\f[]
238(ODT), \f[C]epub\f[] (EPUB), \f[C]opml\f[] (OPML), \f[C]org\f[] (Emacs
239Org mode), \f[C]mediawiki\f[] (MediaWiki markup), \f[C]twiki\f[] (TWiki
240markup), \f[C]tikiwiki\f[] (TikiWiki markup), \f[C]creole\f[] (Creole
2411.0), \f[C]haddock\f[] (Haddock markup), or \f[C]latex\f[] (LaTeX).
242(\f[C]markdown_github\f[] provides deprecated and less accurate suppport
243for Github\-Flavored Markdown; please use \f[C]gfm\f[] instead, unless
244you need to use extensions other than \f[C]smart\f[].) If \f[C]+lhs\f[]
245is appended to \f[C]markdown\f[], \f[C]rst\f[], \f[C]latex\f[], or
246\f[C]html\f[], the input will be treated as literate Haskell source: see
247Literate Haskell support, below.
248Markdown syntax extensions can be individually enabled or disabled by
249appending \f[C]+EXTENSION\f[] or \f[C]\-EXTENSION\f[] to the format
250name.
251So, for example, \f[C]markdown_strict+footnotes+definition_lists\f[] is
252strict Markdown with footnotes and definition lists enabled, and
253\f[C]markdown\-pipe_tables+hard_line_breaks\f[] is pandoc's Markdown
254without pipe tables and with hard line breaks.
255See Pandoc's Markdown, below, for a list of extensions and their names.
256See \f[C]\-\-list\-input\-formats\f[] and \f[C]\-\-list\-extensions\f[],
257below.
258.RS
259.RE
260.TP
261.B \f[C]\-t\f[] \f[I]FORMAT\f[], \f[C]\-w\f[] \f[I]FORMAT\f[], \f[C]\-\-to=\f[]\f[I]FORMAT\f[], \f[C]\-\-write=\f[]\f[I]FORMAT\f[]
262Specify output format.
263\f[I]FORMAT\f[] can be \f[C]native\f[] (native Haskell), \f[C]json\f[]
264(JSON version of native AST), \f[C]plain\f[] (plain text),
265\f[C]markdown\f[] (pandoc's extended Markdown), \f[C]markdown_strict\f[]
266(original unextended Markdown), \f[C]markdown_phpextra\f[] (PHP Markdown
267Extra), \f[C]markdown_mmd\f[] (MultiMarkdown), \f[C]gfm\f[]
268(GitHub\-Flavored Markdown), \f[C]commonmark\f[] (CommonMark Markdown),
269\f[C]rst\f[] (reStructuredText), \f[C]html4\f[] (XHTML 1.0
270Transitional), \f[C]html\f[] or \f[C]html5\f[] (HTML5/XHTML polyglot
271markup), \f[C]latex\f[] (LaTeX), \f[C]beamer\f[] (LaTeX beamer slide
272show), \f[C]context\f[] (ConTeXt), \f[C]man\f[] (groff man),
273\f[C]mediawiki\f[] (MediaWiki markup), \f[C]dokuwiki\f[] (DokuWiki
274markup), \f[C]zimwiki\f[] (ZimWiki markup), \f[C]textile\f[] (Textile),
275\f[C]org\f[] (Emacs Org mode), \f[C]texinfo\f[] (GNU Texinfo),
276\f[C]opml\f[] (OPML), \f[C]docbook\f[] or \f[C]docbook4\f[] (DocBook 4),
277\f[C]docbook5\f[] (DocBook 5), \f[C]jats\f[] (JATS XML),
278\f[C]opendocument\f[] (OpenDocument), \f[C]odt\f[] (OpenOffice text
279document), \f[C]docx\f[] (Word docx), \f[C]haddock\f[] (Haddock markup),
280\f[C]rtf\f[] (rich text format), \f[C]epub2\f[] (EPUB v2 book),
281\f[C]epub\f[] or \f[C]epub3\f[] (EPUB v3), \f[C]fb2\f[] (FictionBook2
282e\-book), \f[C]asciidoc\f[] (AsciiDoc), \f[C]icml\f[] (InDesign ICML),
283\f[C]tei\f[] (TEI Simple), \f[C]slidy\f[] (Slidy HTML and JavaScript
284slide show), \f[C]slideous\f[] (Slideous HTML and JavaScript slide
285show), \f[C]dzslides\f[] (DZSlides HTML5 + JavaScript slide show),
286\f[C]revealjs\f[] (reveal.js HTML5 + JavaScript slide show), \f[C]s5\f[]
287(S5 HTML and JavaScript slide show), or the path of a custom lua writer
288(see Custom writers, below).
289(\f[C]markdown_github\f[] provides deprecated and less accurate suppport
290for Github\-Flavored Markdown; please use \f[C]gfm\f[] instead, unless
291you use extensions that do not work with \f[C]gfm\f[].) Note that
292\f[C]odt\f[], \f[C]epub\f[], and \f[C]epub3\f[] output will not be
293directed to \f[I]stdout\f[]; an output filename must be specified using
294the \f[C]\-o/\-\-output\f[] option.
295If \f[C]+lhs\f[] is appended to \f[C]markdown\f[], \f[C]rst\f[],
296\f[C]latex\f[], \f[C]beamer\f[], \f[C]html4\f[], or \f[C]html5\f[], the
297output will be rendered as literate Haskell source: see Literate Haskell
298support, below.
299Markdown syntax extensions can be individually enabled or disabled by
300appending \f[C]+EXTENSION\f[] or \f[C]\-EXTENSION\f[] to the format
301name, as described above under \f[C]\-f\f[].
302See \f[C]\-\-list\-output\-formats\f[] and
303\f[C]\-\-list\-extensions\f[], below.
304.RS
305.RE
306.TP
307.B \f[C]\-o\f[] \f[I]FILE\f[], \f[C]\-\-output=\f[]\f[I]FILE\f[]
308Write output to \f[I]FILE\f[] instead of \f[I]stdout\f[].
309If \f[I]FILE\f[] is \f[C]\-\f[], output will go to \f[I]stdout\f[], even
310if a non\-textual format (\f[C]docx\f[], \f[C]odt\f[], \f[C]epub2\f[],
311\f[C]epub3\f[]) is specified.
312.RS
313.RE
314.TP
315.B \f[C]\-\-data\-dir=\f[]\f[I]DIRECTORY\f[]
316Specify the user data directory to search for pandoc data files.
317If this option is not specified, the default user data directory will be
318used.
319This is, in UNIX:
320.RS
321.IP
322.nf
323\f[C]
324$HOME/.pandoc
325\f[]
326.fi
327.PP
328in Windows XP:
329.IP
330.nf
331\f[C]
332C:\\Documents\ And\ Settings\\USERNAME\\Application\ Data\\pandoc
333\f[]
334.fi
335.PP
336and in Windows Vista or later:
337.IP
338.nf
339\f[C]
340C:\\Users\\USERNAME\\AppData\\Roaming\\pandoc
341\f[]
342.fi
343.PP
344You can find the default user data directory on your system by looking
345at the output of \f[C]pandoc\ \-\-version\f[].
346A \f[C]reference.odt\f[], \f[C]reference.docx\f[], \f[C]epub.css\f[],
347\f[C]templates\f[], \f[C]slidy\f[], \f[C]slideous\f[], or \f[C]s5\f[]
348directory placed in this directory will override pandoc's normal
349defaults.
350.RE
351.TP
352.B \f[C]\-\-bash\-completion\f[]
353Generate a bash completion script.
354To enable bash completion with pandoc, add this to your
355\f[C]\&.bashrc\f[]:
356.RS
357.IP
358.nf
359\f[C]
360\ eval\ "$(pandoc\ \-\-bash\-completion)"
361\f[]
362.fi
363.RE
364.TP
365.B \f[C]\-\-verbose\f[]
366Give verbose debugging output.
367Currently this only has an effect with PDF output.
368.RS
369.RE
370.TP
371.B \f[C]\-\-quiet\f[]
372Suppress warning messages.
373.RS
374.RE
375.TP
376.B \f[C]\-\-fail\-if\-warnings\f[]
377Exit with error status if there are any warnings.
378.RS
379.RE
380.TP
381.B \f[C]\-\-log=\f[]\f[I]FILE\f[]
382Write log messages in machine\-readable JSON format to \f[I]FILE\f[].
383All messages above DEBUG level will be written, regardless of verbosity
384settings (\f[C]\-\-verbose\f[], \f[C]\-\-quiet\f[]).
385.RS
386.RE
387.TP
388.B \f[C]\-\-list\-input\-formats\f[]
389List supported input formats, one per line.
390.RS
391.RE
392.TP
393.B \f[C]\-\-list\-output\-formats\f[]
394List supported output formats, one per line.
395.RS
396.RE
397.TP
398.B \f[C]\-\-list\-extensions\f[]
399List supported Markdown extensions, one per line, followed by a
400\f[C]+\f[] or \f[C]\-\f[] indicating whether it is enabled by default in
401pandoc's Markdown.
402.RS
403.RE
404.TP
405.B \f[C]\-\-list\-highlight\-languages\f[]
406List supported languages for syntax highlighting, one per line.
407.RS
408.RE
409.TP
410.B \f[C]\-\-list\-highlight\-styles\f[]
411List supported styles for syntax highlighting, one per line.
412See \f[C]\-\-highlight\-style\f[].
413.RS
414.RE
415.TP
416.B \f[C]\-v\f[], \f[C]\-\-version\f[]
417Print version.
418.RS
419.RE
420.TP
421.B \f[C]\-h\f[], \f[C]\-\-help\f[]
422Show usage message.
423.RS
424.RE
425.SS Reader options
426.TP
427.B \f[C]\-\-base\-header\-level=\f[]\f[I]NUMBER\f[]
428Specify the base level for headers (defaults to 1).
429.RS
430.RE
431.TP
432.B \f[C]\-\-indented\-code\-classes=\f[]\f[I]CLASSES\f[]
433Specify classes to use for indented code blocks\[en]for example,
434\f[C]perl,numberLines\f[] or \f[C]haskell\f[].
435Multiple classes may be separated by spaces or commas.
436.RS
437.RE
438.TP
439.B \f[C]\-\-default\-image\-extension=\f[]\f[I]EXTENSION\f[]
440Specify a default extension to use when image paths/URLs have no
441extension.
442This allows you to use the same source for formats that require
443different kinds of images.
444Currently this option only affects the Markdown and LaTeX readers.
445.RS
446.RE
447.TP
448.B \f[C]\-\-file\-scope\f[]
449Parse each file individually before combining for multifile documents.
450This will allow footnotes in different files with the same identifiers
451to work as expected.
452If this option is set, footnotes and links will not work across files.
453Reading binary files (docx, odt, epub) implies \f[C]\-\-file\-scope\f[].
454.RS
455.RE
456.TP
457.B \f[C]\-\-filter=\f[]\f[I]PROGRAM\f[]
458Specify an executable to be used as a filter transforming the pandoc AST
459after the input is parsed and before the output is written.
460The executable should read JSON from stdin and write JSON to stdout.
461The JSON must be formatted like pandoc's own JSON input and output.
462The name of the output format will be passed to the filter as the first
463argument.
464Hence,
465.RS
466.IP
467.nf
468\f[C]
469pandoc\ \-\-filter\ ./caps.py\ \-t\ latex
470\f[]
471.fi
472.PP
473is equivalent to
474.IP
475.nf
476\f[C]
477pandoc\ \-t\ json\ |\ ./caps.py\ latex\ |\ pandoc\ \-f\ json\ \-t\ latex
478\f[]
479.fi
480.PP
481The latter form may be useful for debugging filters.
482.PP
483Filters may be written in any language.
484\f[C]Text.Pandoc.JSON\f[] exports \f[C]toJSONFilter\f[] to facilitate
485writing filters in Haskell.
486Those who would prefer to write filters in python can use the module
487\f[C]pandocfilters\f[], installable from PyPI.
488There are also pandoc filter libraries in PHP, perl, and
489JavaScript/node.js.
490.PP
491In order of preference, pandoc will look for filters in
492.IP "1." 3
493a specified full or relative path (executable or non\-executable)
494.IP "2." 3
495\f[C]$DATADIR/filters\f[] (executable or non\-executable) where
496\f[C]$DATADIR\f[] is the user data directory (see
497\f[C]\-\-data\-dir\f[], above).
498.IP "3." 3
499\f[C]$PATH\f[] (executable only)
500.RE
501.TP
502.B \f[C]\-\-lua\-filter=\f[]\f[I]SCRIPT\f[]
503Transform the document in a similar fashion as JSON filters (see
504\f[C]\-\-filter\f[]), but use pandoc's build\-in lua filtering system.
505The given lua script is expected to return a list of lua filters which
506will be applied in order.
507Each lua filter must contain element\-transforming functions indexed by
508the name of the AST element on which the filter function should be
509applied.
510.RS
511.PP
512The \f[C]pandoc\f[] lua module provides helper functions for element
513creation.
514It is always loaded into the script's lua environment.
515.PP
516The following is an example lua script for macro\-expansion:
517.IP
518.nf
519\f[C]
520function\ expand_hello_world(inline)
521\ \ if\ inline.c\ ==\ \[aq]{{helloworld}}\[aq]\ then
522\ \ \ \ return\ pandoc.Emph{\ pandoc.Str\ "Hello,\ World"\ }
523\ \ else
524\ \ \ \ return\ inline
525\ \ end
526end
528return\ {{Str\ =\ expand_hello_world}}
529\f[]
530.fi
531.RE
532.TP
533.B \f[C]\-M\f[] \f[I]KEY\f[][\f[C]=\f[]\f[I]VAL\f[]], \f[C]\-\-metadata=\f[]\f[I]KEY\f[][\f[C]:\f[]\f[I]VAL\f[]]
534Set the metadata field \f[I]KEY\f[] to the value \f[I]VAL\f[].
535A value specified on the command line overrides a value specified in the
536document.
537Values will be parsed as YAML boolean or string values.
538If no value is specified, the value will be treated as Boolean true.
539Like \f[C]\-\-variable\f[], \f[C]\-\-metadata\f[] causes template
540variables to be set.
541But unlike \f[C]\-\-variable\f[], \f[C]\-\-metadata\f[] affects the
542metadata of the underlying document (which is accessible from filters
543and may be printed in some output formats).
544.RS
545.RE
546.TP
547.B \f[C]\-p\f[], \f[C]\-\-preserve\-tabs\f[]
548Preserve tabs instead of converting them to spaces (the default).
549Note that this will only affect tabs in literal code spans and code
550blocks; tabs in regular text will be treated as spaces.
551.RS
552.RE
553.TP
554.B \f[C]\-\-tab\-stop=\f[]\f[I]NUMBER\f[]
555Specify the number of spaces per tab (default is 4).
556.RS
557.RE
558.TP
559.B \f[C]\-\-track\-changes=accept\f[]|\f[C]reject\f[]|\f[C]all\f[]
560Specifies what to do with insertions, deletions, and comments produced
561by the MS Word \[lq]Track Changes\[rq] feature.
562\f[C]accept\f[] (the default), inserts all insertions, and ignores all
563deletions.
564\f[C]reject\f[] inserts all deletions and ignores insertions.
565Both \f[C]accept\f[] and \f[C]reject\f[] ignore comments.
566\f[C]all\f[] puts in insertions, deletions, and comments, wrapped in
567spans with \f[C]insertion\f[], \f[C]deletion\f[],
568\f[C]comment\-start\f[], and \f[C]comment\-end\f[] classes,
569respectively.
570The author and time of change is included.
571\f[C]all\f[] is useful for scripting: only accepting changes from a
572certain reviewer, say, or before a certain date.
573This option only affects the docx reader.
574.RS
575.RE
576.TP
577.B \f[C]\-\-extract\-media=\f[]\f[I]DIR\f[]
578Extract images and other media contained in or linked from the source
579document to the path \f[I]DIR\f[], creating it if necessary, and adjust
580the images references in the document so they point to the extracted
581files.
582If the source format is a binary container (docx, epub, or odt), the
583media is extracted from the container and the original filenames are
584used.
585Otherwise the media is read from the file system or downloaded, and new
586filenames are constructed based on SHA1 hashes of the contents.
587.RS
588.RE
589.TP
590.B \f[C]\-\-abbreviations=\f[]\f[I]FILE\f[]
591Specifies a custom abbreviations file, with abbreviations one to a line.
592If this option is not specified, pandoc will read the data file
593\f[C]abbreviations\f[] from the user data directory or fall back on a
594system default.
595To see the system default, use
596\f[C]pandoc\ \-\-print\-default\-data\-file=abbreviations\f[].
597The only use pandoc makes of this list is in the Markdown reader.
598Strings ending in a period that are found in this list will be followed
599by a nonbreaking space, so that the period will not produce
600sentence\-ending space in formats like LaTeX.
601.RS
602.RE
603.SS General writer options
604.TP
605.B \f[C]\-s\f[], \f[C]\-\-standalone\f[]
606Produce output with an appropriate header and footer (e.g.\ a standalone
607HTML, LaTeX, TEI, or RTF file, not a fragment).
608This option is set automatically for \f[C]pdf\f[], \f[C]epub\f[],
609\f[C]epub3\f[], \f[C]fb2\f[], \f[C]docx\f[], and \f[C]odt\f[] output.
610.RS
611.RE
612.TP
613.B \f[C]\-\-template=\f[]\f[I]FILE\f[]
614Use \f[I]FILE\f[] as a custom template for the generated document.
615Implies \f[C]\-\-standalone\f[].
616See Templates, below, for a description of template syntax.
617If no extension is specified, an extension corresponding to the writer
618will be added, so that \f[C]\-\-template=special\f[] looks for
619\f[C]special.html\f[] for HTML output.
620If the template is not found, pandoc will search for it in the
621\f[C]templates\f[] subdirectory of the user data directory (see
622\f[C]\-\-data\-dir\f[]).
623If this option is not used, a default template appropriate for the
624output format will be used (see
625\f[C]\-D/\-\-print\-default\-template\f[]).
626.RS
627.RE
628.TP
629.B \f[C]\-V\f[] \f[I]KEY\f[][\f[C]=\f[]\f[I]VAL\f[]], \f[C]\-\-variable=\f[]\f[I]KEY\f[][\f[C]:\f[]\f[I]VAL\f[]]
630Set the template variable \f[I]KEY\f[] to the value \f[I]VAL\f[] when
631rendering the document in standalone mode.
632This is generally only useful when the \f[C]\-\-template\f[] option is
633used to specify a custom template, since pandoc automatically sets the
634variables used in the default templates.
635If no \f[I]VAL\f[] is specified, the key will be given the value
636\f[C]true\f[].
637.RS
638.RE
639.TP
640.B \f[C]\-D\f[] \f[I]FORMAT\f[], \f[C]\-\-print\-default\-template=\f[]\f[I]FORMAT\f[]
641Print the system default template for an output \f[I]FORMAT\f[].
642(See \f[C]\-t\f[] for a list of possible \f[I]FORMAT\f[]s.) Templates in
643the user data directory are ignored.
644.RS
645.RE
646.TP
647.B \f[C]\-\-print\-default\-data\-file=\f[]\f[I]FILE\f[]
648Print a system default data file.
649Files in the user data directory are ignored.
650.RS
651.RE
652.TP
653.B \f[C]\-\-eol=crlf\f[]|\f[C]lf\f[]|\f[C]native\f[]
654Manually specify line endings: \f[C]crlf\f[] (Windows), \f[C]lf\f[]
655(macOS/Linux/UNIX), or \f[C]native\f[] (line endings appropriate to the
656OS on which pandoc is being run).
657The default is \f[C]native\f[].
658.RS
659.RE
660.TP
661.B \f[C]\-\-dpi\f[]=\f[I]NUMBER\f[]
662Specify the dpi (dots per inch) value for conversion from pixels to
663inch/centimeters and vice versa.
664The default is 96dpi.
665Technically, the correct term would be ppi (pixels per inch).
666.RS
667.RE
668.TP
669.B \f[C]\-\-wrap=auto\f[]|\f[C]none\f[]|\f[C]preserve\f[]
670Determine how text is wrapped in the output (the source code, not the
671rendered version).
672With \f[C]auto\f[] (the default), pandoc will attempt to wrap lines to
673the column width specified by \f[C]\-\-columns\f[] (default 72).
674With \f[C]none\f[], pandoc will not wrap lines at all.
675With \f[C]preserve\f[], pandoc will attempt to preserve the wrapping
676from the source document (that is, where there are nonsemantic newlines
677in the source, there will be nonsemantic newlines in the output as
678well).
679Automatic wrapping does not currently work in HTML output.
680.RS
681.RE
682.TP
683.B \f[C]\-\-columns=\f[]\f[I]NUMBER\f[]
684Specify length of lines in characters.
685This affects text wrapping in the generated source code (see
686\f[C]\-\-wrap\f[]).
687It also affects calculation of column widths for plain text tables (see
688Tables below).
689.RS
690.RE
691.TP
692.B \f[C]\-\-toc\f[], \f[C]\-\-table\-of\-contents\f[]
693Include an automatically generated table of contents (or, in the case of
694\f[C]latex\f[], \f[C]context\f[], \f[C]docx\f[], \f[C]odt\f[],
695\f[C]opendocument\f[], \f[C]rst\f[], or \f[C]ms\f[], an instruction to
696create one) in the output document.
697This option has no effect on \f[C]man\f[], \f[C]docbook4\f[],
698\f[C]docbook5\f[], or \f[C]jats\f[] output.
699.RS
700.RE
701.TP
702.B \f[C]\-\-toc\-depth=\f[]\f[I]NUMBER\f[]
703Specify the number of section levels to include in the table of
704contents.
705The default is 3 (which means that level 1, 2, and 3 headers will be
706listed in the contents).
707.RS
708.RE
709.TP
710.B \f[C]\-\-strip\-comments\f[]
711Strip out HTML comments in the Markdown or Textile source, rather than
712passing them on to Markdown, Textile or HTML output as raw HTML.
713This does not apply to HTML comments inside raw HTML blocks when the
714\f[C]markdown_in_html_blocks\f[] extension is not set.
715.RS
716.RE
717.TP
718.B \f[C]\-\-no\-highlight\f[]
719Disables syntax highlighting for code blocks and inlines, even when a
720language attribute is given.
721.RS
722.RE
723.TP
724.B \f[C]\-\-highlight\-style=\f[]\f[I]STYLE\f[]|\f[I]FILE\f[]
725Specifies the coloring style to be used in highlighted source code.
726Options are \f[C]pygments\f[] (the default), \f[C]kate\f[],
727\f[C]monochrome\f[], \f[C]breezeDark\f[], \f[C]espresso\f[],
728\f[C]zenburn\f[], \f[C]haddock\f[], and \f[C]tango\f[].
729For more information on syntax highlighting in pandoc, see Syntax
730highlighting, below.
731See also \f[C]\-\-list\-highlight\-styles\f[].
732.RS
733.PP
734Instead of a \f[I]STYLE\f[] name, a JSON file with extension
735\f[C]\&.theme\f[] may be supplied.
736This will be parsed as a KDE syntax highlighting theme and (if valid)
737used as the highlighting style.
738To see a sample theme that can be modified,
739\f[C]pandoc\ \-\-print\-default\-data\-file\ default.theme\f[].
740.RE
741.TP
742.B \f[C]\-\-syntax\-definition=\f[]\f[I]FILE\f[]
743Instructs pandoc to load a KDE XML syntax definition file, which will be
744used for syntax highlighting of appropriately marked code blocks.
745This can be used to add support for new languages or to use altered
746syntax definitions for existing languages.
747.RS
748.RE
749.TP
750.B \f[C]\-H\f[] \f[I]FILE\f[], \f[C]\-\-include\-in\-header=\f[]\f[I]FILE\f[]
751Include contents of \f[I]FILE\f[], verbatim, at the end of the header.
752This can be used, for example, to include special CSS or JavaScript in
753HTML documents.
754This option can be used repeatedly to include multiple files in the
755header.
756They will be included in the order specified.
757Implies \f[C]\-\-standalone\f[].
758.RS
759.RE
760.TP
761.B \f[C]\-B\f[] \f[I]FILE\f[], \f[C]\-\-include\-before\-body=\f[]\f[I]FILE\f[]
762Include contents of \f[I]FILE\f[], verbatim, at the beginning of the
763document body (e.g.\ after the \f[C]<body>\f[] tag in HTML, or the
764\f[C]\\begin{document}\f[] command in LaTeX).
765This can be used to include navigation bars or banners in HTML
766documents.
767This option can be used repeatedly to include multiple files.
768They will be included in the order specified.
769Implies \f[C]\-\-standalone\f[].
770.RS
771.RE
772.TP
773.B \f[C]\-A\f[] \f[I]FILE\f[], \f[C]\-\-include\-after\-body=\f[]\f[I]FILE\f[]
774Include contents of \f[I]FILE\f[], verbatim, at the end of the document
775body (before the \f[C]</body>\f[] tag in HTML, or the
776\f[C]\\end{document}\f[] command in LaTeX).
777This option can be used repeatedly to include multiple files.
778They will be included in the order specified.
779Implies \f[C]\-\-standalone\f[].
780.RS
781.RE
782.TP
783.B \f[C]\-\-resource\-path=\f[]\f[I]SEARCHPATH\f[]
784List of paths to search for images and other resources.
785The paths should be separated by \f[C]:\f[] on Linux, UNIX, and macOS
786systems, and by \f[C];\f[] on Windows.
787If \f[C]\-\-resource\-path\f[] is not specified, the default resource
788path is the working directory.
789Note that, if \f[C]\-\-resource\-path\f[] is specified, the working
790directory must be explicitly listed or it will not be searched.
791For example: \f[C]\-\-resource\-path=.:test\f[] will search the working
792directory and the \f[C]test\f[] subdirectory, in that order.
793.RS
794.RE
795.TP
796.B \f[C]\-\-request\-header=\f[]\f[I]NAME\f[]\f[C]:\f[]\f[I]VAL\f[]
797Set the request header \f[I]NAME\f[] to the value \f[I]VAL\f[] when
798making HTTP requests (for example, when a URL is given on the command
799line, or when resources used in a document must be downloaded).
800.RS
801.RE
802.SS Options affecting specific writers
803.TP
804.B \f[C]\-\-self\-contained\f[]
805Produce a standalone HTML file with no external dependencies, using
806\f[C]data:\f[] URIs to incorporate the contents of linked scripts,
807stylesheets, images, and videos.
808The resulting file should be \[lq]self\-contained,\[rq] in the sense
809that it needs no external files and no net access to be displayed
810properly by a browser.
811This option works only with HTML output formats, including
812\f[C]html4\f[], \f[C]html5\f[], \f[C]html+lhs\f[], \f[C]html5+lhs\f[],
813\f[C]s5\f[], \f[C]slidy\f[], \f[C]slideous\f[], \f[C]dzslides\f[], and
814\f[C]revealjs\f[].
815Scripts, images, and stylesheets at absolute URLs will be downloaded;
816those at relative URLs will be sought relative to the working directory
817(if the first source file is local) or relative to the base URL (if the
818first source file is remote).
819Elements with the attribute \f[C]data\-external="1"\f[] will be left
820alone; the documents they link to will not be incorporated in the
821document.
822Limitation: resources that are loaded dynamically through JavaScript
823cannot be incorporated; as a result, \f[C]\-\-self\-contained\f[] does
824not work with \f[C]\-\-mathjax\f[], and some advanced features
825(e.g.\ zoom or speaker notes) may not work in an offline
826\[lq]self\-contained\[rq] \f[C]reveal.js\f[] slide show.
827.RS
828.RE
829.TP
830.B \f[C]\-\-html\-q\-tags\f[]
831Use \f[C]<q>\f[] tags for quotes in HTML.
832.RS
833.RE
834.TP
835.B \f[C]\-\-ascii\f[]
836Use only ASCII characters in output.
837Currently supported only for HTML and DocBook output (which uses
838numerical entities instead of UTF\-8 when this option is selected).
839.RS
840.RE
841.TP
842.B \f[C]\-\-reference\-links\f[]
843Use reference\-style links, rather than inline links, in writing
844Markdown or reStructuredText.
845By default inline links are used.
846The placement of link references is affected by the
847\f[C]\-\-reference\-location\f[] option.
848.RS
849.RE
850.TP
851.B \f[C]\-\-reference\-location\ =\ block\f[]|\f[C]section\f[]|\f[C]document\f[]
852Specify whether footnotes (and references, if \f[C]reference\-links\f[]
853is set) are placed at the end of the current (top\-level) block, the
854current section, or the document.
855The default is \f[C]document\f[].
856Currently only affects the markdown writer.
857.RS
858.RE
859.TP
860.B \f[C]\-\-atx\-headers\f[]
861Use ATX\-style headers in Markdown and AsciiDoc output.
862The default is to use setext\-style headers for levels 1\-2, and then
863ATX headers.
864.RS
865.RE
866.TP
867.B \f[C]\-\-top\-level\-division=[default|section|chapter|part]\f[]
868Treat top\-level headers as the given division type in LaTeX, ConTeXt,
869DocBook, and TEI output.
870The hierarchy order is part, chapter, then section; all headers are
871shifted such that the top\-level header becomes the specified type.
872The default behavior is to determine the best division type via
873heuristics: unless other conditions apply, \f[C]section\f[] is chosen.
874When the LaTeX document class is set to \f[C]report\f[], \f[C]book\f[],
875or \f[C]memoir\f[] (unless the \f[C]article\f[] option is specified),
876\f[C]chapter\f[] is implied as the setting for this option.
877If \f[C]beamer\f[] is the output format, specifying either
878\f[C]chapter\f[] or \f[C]part\f[] will cause top\-level headers to
879become \f[C]\\part{..}\f[], while second\-level headers remain as their
880default type.
881.RS
882.RE
883.TP
884.B \f[C]\-N\f[], \f[C]\-\-number\-sections\f[]
885Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
886By default, sections are not numbered.
887Sections with class \f[C]unnumbered\f[] will never be numbered, even if
888\f[C]\-\-number\-sections\f[] is specified.
889.RS
890.RE
891.TP
892.B \f[C]\-\-number\-offset=\f[]\f[I]NUMBER\f[][\f[C],\f[]\f[I]NUMBER\f[]\f[C],\f[]\f[I]\&...\f[]]
893Offset for section headings in HTML output (ignored in other output
894formats).
895The first number is added to the section number for top\-level headers,
896the second for second\-level headers, and so on.
897So, for example, if you want the first top\-level header in your
898document to be numbered \[lq]6\[rq], specify
899\f[C]\-\-number\-offset=5\f[].
900If your document starts with a level\-2 header which you want to be
901numbered \[lq]1.5\[rq], specify \f[C]\-\-number\-offset=1,4\f[].
902Offsets are 0 by default.
903Implies \f[C]\-\-number\-sections\f[].
904.RS
905.RE
906.TP
907.B \f[C]\-\-listings\f[]
908Use the \f[C]listings\f[] package for LaTeX code blocks
909.RS
910.RE
911.TP
912.B \f[C]\-i\f[], \f[C]\-\-incremental\f[]
913Make list items in slide shows display incrementally (one by one).
914The default is for lists to be displayed all at once.
915.RS
916.RE
917.TP
918.B \f[C]\-\-slide\-level=\f[]\f[I]NUMBER\f[]
919Specifies that headers with the specified level create slides (for
920\f[C]beamer\f[], \f[C]s5\f[], \f[C]slidy\f[], \f[C]slideous\f[],
921\f[C]dzslides\f[]).
922Headers above this level in the hierarchy are used to divide the slide
923show into sections; headers below this level create subheads within a
924slide.
925Note that content that is not contained under slide\-level headers will
926not appear in the slide show.
927The default is to set the slide level based on the contents of the
928document; see Structuring the slide show.
929.RS
930.RE
931.TP
932.B \f[C]\-\-section\-divs\f[]
933Wrap sections in \f[C]<div>\f[] tags (or \f[C]<section>\f[] tags in
934HTML5), and attach identifiers to the enclosing \f[C]<div>\f[] (or
935\f[C]<section>\f[]) rather than the header itself.
936See Header identifiers, below.
937.RS
938.RE
939.TP
940.B \f[C]\-\-email\-obfuscation=none\f[]|\f[C]javascript\f[]|\f[C]references\f[]
941Specify a method for obfuscating \f[C]mailto:\f[] links in HTML
942documents.
943\f[C]none\f[] leaves \f[C]mailto:\f[] links as they are.
944\f[C]javascript\f[] obfuscates them using JavaScript.
945\f[C]references\f[] obfuscates them by printing their letters as decimal
946or hexadecimal character references.
947The default is \f[C]none\f[].
948.RS
949.RE
950.TP
951.B \f[C]\-\-id\-prefix=\f[]\f[I]STRING\f[]
952Specify a prefix to be added to all identifiers and internal links in
953HTML and DocBook output, and to footnote numbers in Markdown and Haddock
954output.
955This is useful for preventing duplicate identifiers when generating
956fragments to be included in other pages.
957.RS
958.RE
959.TP
960.B \f[C]\-T\f[] \f[I]STRING\f[], \f[C]\-\-title\-prefix=\f[]\f[I]STRING\f[]
961Specify \f[I]STRING\f[] as a prefix at the beginning of the title that
962appears in the HTML header (but not in the title as it appears at the
963beginning of the HTML body).
964Implies \f[C]\-\-standalone\f[].
965.RS
966.RE
967.TP
968.B \f[C]\-c\f[] \f[I]URL\f[], \f[C]\-\-css=\f[]\f[I]URL\f[]
969Link to a CSS style sheet.
970This option can be used repeatedly to include multiple files.
971They will be included in the order specified.
972.RS
973.PP
974A stylesheet is required for generating EPUB.
975If none is provided using this option (or the \f[C]stylesheet\f[]
976metadata field), pandoc will look for a file \f[C]epub.css\f[] in the
977user data directory (see \f[C]\-\-data\-dir\f[]).
978If it is not found there, sensible defaults will be used.
979.RE
980.TP
981.B \f[C]\-\-reference\-doc=\f[]\f[I]FILE\f[]
982Use the specified file as a style reference in producing a docx or ODT
983file.
984.RS
985.TP
986.B Docx
987For best results, the reference docx should be a modified version of a
988docx file produced using pandoc.
989The contents of the reference docx are ignored, but its stylesheets and
990document properties (including margins, page size, header, and footer)
991are used in the new docx.
992If no reference docx is specified on the command line, pandoc will look
993for a file \f[C]reference.docx\f[] in the user data directory (see
994\f[C]\-\-data\-dir\f[]).
995If this is not found either, sensible defaults will be used.
996.RS
997.PP
998To produce a custom \f[C]reference.docx\f[], first get a copy of the
999default \f[C]reference.docx\f[]:
1000\f[C]pandoc\ \-\-print\-default\-data\-file\ reference.docx\ >\ custom\-reference.docx\f[].
1001Then open \f[C]custom\-reference.docx\f[] in Word, modify the styles as
1002you wish, and save the file.
1003For best results, do not make changes to this file other than modifying
1004the styles used by pandoc: [paragraph] Normal, Body Text, First
1005Paragraph, Compact, Title, Subtitle, Author, Date, Abstract,
1006Bibliography, Heading 1, Heading 2, Heading 3, Heading 4, Heading 5,
1007Heading 6, Heading 7, Heading 8, Heading 9, Block Text, Footnote Text,
1008Definition Term, Definition, Caption, Table Caption, Image Caption,
1009Figure, Captioned Figure, TOC Heading; [character] Default Paragraph
1010Font, Body Text Char, Verbatim Char, Footnote Reference, Hyperlink;
1011[table] Table.
1012.RE
1013.TP
1014.B ODT
1015For best results, the reference ODT should be a modified version of an
1016ODT produced using pandoc.
1017The contents of the reference ODT are ignored, but its stylesheets are
1018used in the new ODT.
1019If no reference ODT is specified on the command line, pandoc will look
1020for a file \f[C]reference.odt\f[] in the user data directory (see
1021\f[C]\-\-data\-dir\f[]).
1022If this is not found either, sensible defaults will be used.
1023.RS
1024.PP
1025To produce a custom \f[C]reference.odt\f[], first get a copy of the
1026default \f[C]reference.odt\f[]:
1027\f[C]pandoc\ \-\-print\-default\-data\-file\ reference.odt\ >\ custom\-reference.odt\f[].
1028Then open \f[C]custom\-reference.odt\f[] in LibreOffice, modify the
1029styles as you wish, and save the file.
1030.RE
1031.RE
1032.TP
1033.B \f[C]\-\-epub\-cover\-image=\f[]\f[I]FILE\f[]
1034Use the specified image as the EPUB cover.
1035It is recommended that the image be less than 1000px in width and
1036height.
1037Note that in a Markdown source document you can also specify
1038\f[C]cover\-image\f[] in a YAML metadata block (see EPUB Metadata,
1039below).
1040.RS
1041.RE
1042.TP
1043.B \f[C]\-\-epub\-metadata=\f[]\f[I]FILE\f[]
1044Look in the specified XML file for metadata for the EPUB.
1045The file should contain a series of Dublin Core elements.
1046For example:
1047.RS
1048.IP
1049.nf
1050\f[C]
1051\ <dc:rights>Creative\ Commons</dc:rights>
1052\ <dc:language>es\-AR</dc:language>
1053\f[]
1054.fi
1055.PP
1056By default, pandoc will include the following metadata elements:
1057\f[C]<dc:title>\f[] (from the document title), \f[C]<dc:creator>\f[]
1058(from the document authors), \f[C]<dc:date>\f[] (from the document date,
1059which should be in ISO 8601 format), \f[C]<dc:language>\f[] (from the
1060\f[C]lang\f[] variable, or, if is not set, the locale), and
1061\f[C]<dc:identifier\ id="BookId">\f[] (a randomly generated UUID).
1062Any of these may be overridden by elements in the metadata file.
1063.PP
1064Note: if the source document is Markdown, a YAML metadata block in the
1065document can be used instead.
1066See below under EPUB Metadata.
1067.RE
1068.TP
1069.B \f[C]\-\-epub\-embed\-font=\f[]\f[I]FILE\f[]
1070Embed the specified font in the EPUB.
1071This option can be repeated to embed multiple fonts.
1072Wildcards can also be used: for example, \f[C]DejaVuSans\-*.ttf\f[].
1073However, if you use wildcards on the command line, be sure to escape
1074them or put the whole filename in single quotes, to prevent them from
1075being interpreted by the shell.
1076To use the embedded fonts, you will need to add declarations like the
1077following to your CSS (see \f[C]\-\-css\f[]):
1078.RS
1079.IP
1080.nf
1081\f[C]
1082\@font\-face\ {
1083font\-family:\ DejaVuSans;
1084font\-style:\ normal;
1085font\-weight:\ normal;
1086src:url("DejaVuSans\-Regular.ttf");
1088\@font\-face\ {
1089font\-family:\ DejaVuSans;
1090font\-style:\ normal;
1091font\-weight:\ bold;
1092src:url("DejaVuSans\-Bold.ttf");
1094\@font\-face\ {
1095font\-family:\ DejaVuSans;
1096font\-style:\ italic;
1097font\-weight:\ normal;
1098src:url("DejaVuSans\-Oblique.ttf");
1100\@font\-face\ {
1101font\-family:\ DejaVuSans;
1102font\-style:\ italic;
1103font\-weight:\ bold;
1104src:url("DejaVuSans\-BoldOblique.ttf");
1106body\ {\ font\-family:\ "DejaVuSans";\ }
1107\f[]
1108.fi
1109.RE
1110.TP
1111.B \f[C]\-\-epub\-chapter\-level=\f[]\f[I]NUMBER\f[]
1112Specify the header level at which to split the EPUB into separate
1113\[lq]chapter\[rq] files.
1114The default is to split into chapters at level 1 headers.
1115This option only affects the internal composition of the EPUB, not the
1116way chapters and sections are displayed to users.
1117Some readers may be slow if the chapter files are too large, so for
1118large documents with few level 1 headers, one might want to use a
1119chapter level of 2 or 3.
1120.RS
1121.RE
1122.TP
1123.B \f[C]\-\-epub\-subdirectory=\f[]\f[I]DIRNAME\f[]
1124Specify the subdirectory in the OCF container that is to hold the
1125EPUB\-specific contents.
1126The default is \f[C]EPUB\f[].
1127To put the EPUB contents in the top level, use an empty string.
1128.RS
1129.RE
1130.TP
1131.B \f[C]\-\-pdf\-engine=pdflatex\f[]|\f[C]lualatex\f[]|\f[C]xelatex\f[]|\f[C]wkhtmltopdf\f[]|\f[C]weasyprint\f[]|\f[C]prince\f[]|\f[C]context\f[]|\f[C]pdfroff\f[]
1132Use the specified engine when producing PDF output.
1133The default is \f[C]pdflatex\f[].
1134If the engine is not in your PATH, the full path of the engine may be
1135specified here.
1136.RS
1137.RE
1138.TP
1139.B \f[C]\-\-pdf\-engine\-opt=\f[]\f[I]STRING\f[]
1140Use the given string as a command\-line argument to the
1141\f[C]pdf\-engine\f[].
1142If used multiple times, the arguments are provided with spaces between
1143them.
1144Note that no check for duplicate options is done.
1145.RS
1146.RE
1147.SS Citation rendering
1148.TP
1149.B \f[C]\-\-bibliography=\f[]\f[I]FILE\f[]
1150Set the \f[C]bibliography\f[] field in the document's metadata to
1151\f[I]FILE\f[], overriding any value set in the metadata, and process
1152citations using \f[C]pandoc\-citeproc\f[].
1153(This is equivalent to
1154\f[C]\-\-metadata\ bibliography=FILE\ \-\-filter\ pandoc\-citeproc\f[].)
1155If \f[C]\-\-natbib\f[] or \f[C]\-\-biblatex\f[] is also supplied,
1156\f[C]pandoc\-citeproc\f[] is not used, making this equivalent to
1157\f[C]\-\-metadata\ bibliography=FILE\f[].
1158If you supply this argument multiple times, each \f[I]FILE\f[] will be
1159added to bibliography.
1160.RS
1161.RE
1162.TP
1163.B \f[C]\-\-csl=\f[]\f[I]FILE\f[]
1164Set the \f[C]csl\f[] field in the document's metadata to \f[I]FILE\f[],
1165overriding any value set in the metadata.
1166(This is equivalent to \f[C]\-\-metadata\ csl=FILE\f[].) This option is
1167only relevant with \f[C]pandoc\-citeproc\f[].
1168.RS
1169.RE
1170.TP
1171.B \f[C]\-\-citation\-abbreviations=\f[]\f[I]FILE\f[]
1172Set the \f[C]citation\-abbreviations\f[] field in the document's
1173metadata to \f[I]FILE\f[], overriding any value set in the metadata.
1174(This is equivalent to
1175\f[C]\-\-metadata\ citation\-abbreviations=FILE\f[].) This option is
1176only relevant with \f[C]pandoc\-citeproc\f[].
1177.RS
1178.RE
1179.TP
1180.B \f[C]\-\-natbib\f[]
1181Use \f[C]natbib\f[] for citations in LaTeX output.
1182This option is not for use with the \f[C]pandoc\-citeproc\f[] filter or
1183with PDF output.
1184It is intended for use in producing a LaTeX file that can be processed
1185with \f[C]bibtex\f[].
1186.RS
1187.RE
1188.TP
1189.B \f[C]\-\-biblatex\f[]
1190Use \f[C]biblatex\f[] for citations in LaTeX output.
1191This option is not for use with the \f[C]pandoc\-citeproc\f[] filter or
1192with PDF output.
1193It is intended for use in producing a LaTeX file that can be processed
1194with \f[C]bibtex\f[] or \f[C]biber\f[].
1195.RS
1196.RE
1197.SS Math rendering in HTML
1198.TP
1199.B \f[C]\-m\f[] [\f[I]URL\f[]], \f[C]\-\-latexmathml\f[][\f[C]=\f[]\f[I]URL\f[]]
1200Use the LaTeXMathML script to display embedded TeX math in HTML output.
1201To insert a link to a local copy of the \f[C]LaTeXMathML.js\f[] script,
1202provide a \f[I]URL\f[].
1203If no \f[I]URL\f[] is provided, the contents of the script will be
1204inserted directly into the HTML header, preserving portability at the
1205price of efficiency.
1206If you plan to use math on several pages, it is much better to link to a
1207copy of the script, so it can be cached.
1208.RS
1209.RE
1210.TP
1211.B \f[C]\-\-mathml\f[]
1212Convert TeX math to MathML (in \f[C]docbook4\f[], \f[C]docbook5\f[],
1213\f[C]jats\f[], \f[C]html4\f[] and \f[C]html5\f[]).
1214This is the default in \f[C]odt\f[] output.
1215.RS
1216.RE
1217.TP
1218.B \f[C]\-\-jsmath\f[][\f[C]=\f[]\f[I]URL\f[]]
1219Use jsMath to display embedded TeX math in HTML output.
1220The \f[I]URL\f[] should point to the jsMath load script (e.g.
1221\f[C]jsMath/easy/load.js\f[]); if provided, it will be linked to in the
1222header of standalone HTML documents.
1223If a \f[I]URL\f[] is not provided, no link to the jsMath load script
1224will be inserted; it is then up to the author to provide such a link in
1225the HTML template.
1226.RS
1227.RE
1228.TP
1229.B \f[C]\-\-mathjax\f[][\f[C]=\f[]\f[I]URL\f[]]
1230Use MathJax to display embedded TeX math in HTML output.
1231The \f[I]URL\f[] should point to the \f[C]MathJax.js\f[] load script.
1232If a \f[I]URL\f[] is not provided, a link to the MathJax CDN will be
1233inserted.
1234.RS
1235.RE
1236.TP
1237.B \f[C]\-\-gladtex\f[]
1238Enclose TeX math in \f[C]<eq>\f[] tags in HTML output.
1239These can then be processed by gladTeX to produce links to images of the
1240typeset formulas.
1241.RS
1242.RE
1243.TP
1244.B \f[C]\-\-mimetex\f[][\f[C]=\f[]\f[I]URL\f[]]
1245Render TeX math using the mimeTeX CGI script.
1246If \f[I]URL\f[] is not specified, it is assumed that the script is at
1247\f[C]/cgi\-bin/mimetex.cgi\f[].
1248.RS
1249.RE
1250.TP
1251.B \f[C]\-\-webtex\f[][\f[C]=\f[]\f[I]URL\f[]]
1252Render TeX formulas using an external script that converts TeX formulas
1253to images.
1254The formula will be concatenated with the URL provided.
1255If \f[I]URL\f[] is not specified, the CodeCogs will be used.
1256Note: the \f[C]\-\-webtex\f[] option will affect Markdown output as well
1257as HTML, which is useful if you're targeting a version of Markdown
1258without native math support.
1259.RS
1260.RE
1261.TP
1262.B \f[C]\-\-katex\f[][\f[C]=\f[]\f[I]URL\f[]]
1263Use KaTeX to display embedded TeX math in HTML output.
1264The \f[I]URL\f[] is the base URL for the KaTeX library.
1265If a \f[I]URL\f[] is not provided, a link to the KaTeX CDN will be
1266inserted.
1267Note: KaTeX seems to work best with \f[C]html5\f[] output.
1268.RS
1269.RE
1270.TP
1271.B \f[C]\-\-katex\-stylesheet=\f[]\f[I]URL\f[]
1272The \f[I]URL\f[] should point to the \f[C]katex.css\f[] stylesheet.
1273If this option is not specified, a link to the KaTeX CDN will be
1274inserted.
1275Note that this option does not imply \f[C]\-\-katex\f[].
1276.RS
1277.RE
1278.SS Options for wrapper scripts
1279.TP
1280.B \f[C]\-\-dump\-args\f[]
1281Print information about command\-line arguments to \f[I]stdout\f[], then
1282exit.
1283This option is intended primarily for use in wrapper scripts.
1284The first line of output contains the name of the output file specified
1285with the \f[C]\-o\f[] option, or \f[C]\-\f[] (for \f[I]stdout\f[]) if no
1286output file was specified.
1287The remaining lines contain the command\-line arguments, one per line,
1288in the order they appear.
1289These do not include regular pandoc options and their arguments, but do
1290include any options appearing after a \f[C]\-\-\f[] separator at the end
1291of the line.
1292.RS
1293.RE
1294.TP
1295.B \f[C]\-\-ignore\-args\f[]
1296Ignore command\-line arguments (for use in wrapper scripts).
1297Regular pandoc options are not ignored.
1298Thus, for example,
1299.RS
1300.IP
1301.nf
1302\f[C]
1303pandoc\ \-\-ignore\-args\ \-o\ foo.html\ \-s\ foo.txt\ \-\-\ \-e\ latin1
1304\f[]
1305.fi
1306.PP
1307is equivalent to
1308.IP
1309.nf
1310\f[C]
1311pandoc\ \-o\ foo.html\ \-s
1312\f[]
1313.fi
1314.RE
1315.SH TEMPLATES
1316.PP
1317When the \f[C]\-s/\-\-standalone\f[] option is used, pandoc uses a
1318template to add header and footer material that is needed for a
1319self\-standing document.
1320To see the default template that is used, just type
1321.IP
1322.nf
1323\f[C]
1324pandoc\ \-D\ *FORMAT*
1325\f[]
1326.fi
1327.PP
1328where \f[I]FORMAT\f[] is the name of the output format.
1329A custom template can be specified using the \f[C]\-\-template\f[]
1330option.
1331You can also override the system default templates for a given output
1332format \f[I]FORMAT\f[] by putting a file
1333\f[C]templates/default.*FORMAT*\f[] in the user data directory (see
1334\f[C]\-\-data\-dir\f[], above).
1335\f[I]Exceptions:\f[]
1336.IP \[bu] 2
1337For \f[C]odt\f[] output, customize the \f[C]default.opendocument\f[]
1338template.
1339.IP \[bu] 2
1340For \f[C]pdf\f[] output, customize the \f[C]default.latex\f[] template
1341(or the \f[C]default.beamer\f[] template, if you use
1342\f[C]\-t\ beamer\f[], or the \f[C]default.context\f[] template, if you
1343use \f[C]\-t\ context\f[]).
1344.IP \[bu] 2
1345\f[C]docx\f[] has no template (however, you can use
1346\f[C]\-\-reference\-doc\f[] to customize the output).
1347.PP
1348Templates contain \f[I]variables\f[], which allow for the inclusion of
1349arbitrary information at any point in the file.
1350Variables may be set within the document using YAML metadata blocks.
1351They may also be set at the command line using the
1352\f[C]\-V/\-\-variable\f[] option: variables set in this way override
1353metadata fields with the same name.
1354.SS Variables set by pandoc
1355.PP
1356Some variables are set automatically by pandoc.
1357These vary somewhat depending on the output format, but include metadata
1358fields as well as the following:
1359.TP
1360.B \f[C]sourcefile\f[], \f[C]outputfile\f[]
1361source and destination filenames, as given on the command line.
1362\f[C]sourcefile\f[] can also be a list if input comes from multiple
1363files, or empty if input is from stdin.
1364You can use the following snippet in your template to distinguish them:
1365.RS
1366.IP
1367.nf
1368\f[C]
1369$if(sourcefile)$
1370$for(sourcefile)$
1371$sourcefile$
1372$endfor$
1373$else$
1374(stdin)
1375$endif$
1376\f[]
1377.fi
1378.PP
1379Similarly, \f[C]outputfile\f[] can be \f[C]\-\f[] if output goes to the
1380terminal.
1381.RE
1382.TP
1383.B \f[C]title\f[], \f[C]author\f[], \f[C]date\f[]
1384allow identification of basic aspects of the document.
1385Included in PDF metadata through LaTeX and ConTeXt.
1386These can be set through a pandoc title block, which allows for multiple
1387authors, or through a YAML metadata block:
1388.RS
1389.IP
1390.nf
1391\f[C]
1392\-\-\-
1393author:
1394\-\ Aristotle
1395\-\ Peter\ Abelard
1396\&...
1397\f[]
1398.fi
1399.RE
1400.TP
1401.B \f[C]subtitle\f[]
1402document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and Word
1403docx; renders in LaTeX only when using a document class that supports
1404\f[C]\\subtitle\f[], such as \f[C]beamer\f[] or the KOMA\-Script series
1405(\f[C]scrartcl\f[], \f[C]scrreprt\f[], \f[C]scrbook\f[]).
1406.RS
1407.RE
1408.TP
1409.B \f[C]institute\f[]
1410author affiliations (in LaTeX and Beamer only).
1411Can be a list, when there are multiple authors.
1412.RS
1413.RE
1414.TP
1415.B \f[C]abstract\f[]
1416document summary, included in LaTeX, ConTeXt, AsciiDoc, and Word docx
1417.RS
1418.RE
1419.TP
1420.B \f[C]keywords\f[]
1421list of keywords to be included in HTML, PDF, and AsciiDoc metadata; may
1422be repeated as for \f[C]author\f[], above
1423.RS
1424.RE
1425.TP
1426.B \f[C]header\-includes\f[]
1427contents specified by \f[C]\-H/\-\-include\-in\-header\f[] (may have
1428multiple values)
1429.RS
1430.RE
1431.TP
1432.B \f[C]toc\f[]
1433non\-null value if \f[C]\-\-toc/\-\-table\-of\-contents\f[] was
1434specified
1435.RS
1436.RE
1437.TP
1438.B \f[C]toc\-title\f[]
1439title of table of contents (works only with EPUB, opendocument, odt,
1440docx)
1441.RS
1442.RE
1443.TP
1444.B \f[C]include\-before\f[]
1445contents specified by \f[C]\-B/\-\-include\-before\-body\f[] (may have
1446multiple values)
1447.RS
1448.RE
1449.TP
1450.B \f[C]include\-after\f[]
1451contents specified by \f[C]\-A/\-\-include\-after\-body\f[] (may have
1452multiple values)
1453.RS
1454.RE
1455.TP
1456.B \f[C]body\f[]
1457body of document
1458.RS
1459.RE
1460.TP
1461.B \f[C]meta\-json\f[]
1462JSON representation of all of the document's metadata.
1463Field values are transformed to the selected output format.
1464.RS
1465.RE
1466.SS Language variables
1467.TP
1468.B \f[C]lang\f[]
1469identifies the main language of the document, using a code according to
1470BCP 47 (e.g.
1471\f[C]en\f[] or \f[C]en\-GB\f[]).
1472For some output formats, pandoc will convert it to an appropriate format
1473stored in the additional variables \f[C]babel\-lang\f[],
1474\f[C]polyglossia\-lang\f[] (LaTeX) and \f[C]context\-lang\f[] (ConTeXt).
1475.RS
1476.PP
1477Native pandoc \f[C]span\f[]s and \f[C]div\f[]s with the lang attribute
1478(value in BCP 47) can be used to switch the language in that range.
1479.RE
1480.TP
1481.B \f[C]otherlangs\f[]
1482a list of other languages used in the document in the YAML metadata,
1483according to BCP 47.
1484For example: \f[C]otherlangs:\ [en\-GB,\ fr]\f[].
1485This is automatically generated from the \f[C]lang\f[] attributes in all
1486\f[C]span\f[]s and \f[C]div\f[]s but can be overridden.
1487Currently only used by LaTeX through the generated
1488\f[C]babel\-otherlangs\f[] and \f[C]polyglossia\-otherlangs\f[]
1489variables.
1490The LaTeX writer outputs polyglossia commands in the text but the
1491\f[C]babel\-newcommands\f[] variable contains mappings for them to the
1492corresponding babel.
1493.RS
1494.RE
1495.TP
1496.B \f[C]dir\f[]
1497the base direction of the document, either \f[C]rtl\f[]
1498(right\-to\-left) or \f[C]ltr\f[] (left\-to\-right).
1499.RS
1500.PP
1501For bidirectional documents, native pandoc \f[C]span\f[]s and
1502\f[C]div\f[]s with the \f[C]dir\f[] attribute (value \f[C]rtl\f[] or
1503\f[C]ltr\f[]) can be used to override the base direction in some output
1504formats.
1505This may not always be necessary if the final renderer (e.g.\ the
1506browser, when generating HTML) supports the Unicode Bidirectional
1507Algorithm.
1508.PP
1509When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[]
1510engine is fully supported (use \f[C]\-\-pdf\-engine=xelatex\f[]).
1511.RE
1512.SS Variables for slides
1513.PP
1514Variables are available for producing slide shows with pandoc, including
1515all reveal.js configuration options.
1516.TP
1517.B \f[C]titlegraphic\f[]
1518title graphic for Beamer documents
1519.RS
1520.RE
1521.TP
1522.B \f[C]logo\f[]
1523logo for Beamer documents
1524.RS
1525.RE
1526.TP
1527.B \f[C]slidy\-url\f[]
1528base URL for Slidy documents (defaults to
1529\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[])
1530.RS
1531.RE
1532.TP
1533.B \f[C]slideous\-url\f[]
1534base URL for Slideous documents (defaults to \f[C]slideous\f[])
1535.RS
1536.RE
1537.TP
1538.B \f[C]s5\-url\f[]
1539base URL for S5 documents (defaults to \f[C]s5/default\f[])
1540.RS
1541.RE
1542.TP
1543.B \f[C]revealjs\-url\f[]
1544base URL for reveal.js documents (defaults to \f[C]reveal.js\f[])
1545.RS
1546.RE
1547.TP
1548.B \f[C]theme\f[], \f[C]colortheme\f[], \f[C]fonttheme\f[], \f[C]innertheme\f[], \f[C]outertheme\f[]
1549themes for LaTeX \f[C]beamer\f[] documents
1550.RS
1551.RE
1552.TP
1553.B \f[C]themeoptions\f[]
1554options for LaTeX beamer themes (a list).
1555.RS
1556.RE
1557.TP
1558.B \f[C]navigation\f[]
1559controls navigation symbols in \f[C]beamer\f[] documents (default is
1560\f[C]empty\f[] for no navigation symbols; other valid values are
1561\f[C]frame\f[], \f[C]vertical\f[], and \f[C]horizontal\f[]).
1562.RS
1563.RE
1564.TP
1565.B \f[C]section\-titles\f[]
1566enables on \[lq]title pages\[rq] for new sections in \f[C]beamer\f[]
1567documents (default = true).
1568.RS
1569.RE
1570.TP
1571.B \f[C]beamerarticle\f[]
1572when true, the \f[C]beamerarticle\f[] package is loaded (for producing
1573an article from beamer slides).
1574.RS
1575.RE
1576.TP
1577.B \f[C]aspectratio\f[]
1578aspect ratio of slides (for beamer only, \f[C]1610\f[] for 16:10,
1579\f[C]169\f[] for 16:9, \f[C]149\f[] for 14:9, \f[C]141\f[] for 1.41:1,
1580\f[C]54\f[] for 5:4, \f[C]43\f[] for 4:3 which is the default, and
1581\f[C]32\f[] for 3:2).
1582.RS
1583.RE
1584.SS Variables for LaTeX
1585.PP
1586LaTeX variables are used when creating a PDF.
1587.TP
1588.B \f[C]papersize\f[]
1589paper size, e.g.
1590\f[C]letter\f[], \f[C]a4\f[]
1591.RS
1592.RE
1593.TP
1594.B \f[C]fontsize\f[]
1595font size for body text (e.g.
1596\f[C]10pt\f[], \f[C]12pt\f[])
1597.RS
1598.RE
1599.TP
1600.B \f[C]documentclass\f[]
1601document class, e.g.
1602\f[C]article\f[], \f[C]report\f[], \f[C]book\f[], \f[C]memoir\f[]
1603.RS
1604.RE
1605.TP
1606.B \f[C]classoption\f[]
1607option for document class, e.g.
1608\f[C]oneside\f[]; may be repeated for multiple options
1609.RS
1610.RE
1611.TP
1612.B \f[C]geometry\f[]
1613option for \f[C]geometry\f[] package, e.g.
1614\f[C]margin=1in\f[]; may be repeated for multiple options
1615.RS
1616.RE
1617.TP
1618.B \f[C]margin\-left\f[], \f[C]margin\-right\f[], \f[C]margin\-top\f[], \f[C]margin\-bottom\f[]
1619sets margins, if \f[C]geometry\f[] is not used (otherwise
1620\f[C]geometry\f[] overrides these)
1621.RS
1622.RE
1623.TP
1624.B \f[C]linestretch\f[]
1625adjusts line spacing using the \f[C]setspace\f[] package, e.g.
1626\f[C]1.25\f[], \f[C]1.5\f[]
1627.RS
1628.RE
1629.TP
1630.B \f[C]fontfamily\f[]
1631font package for use with \f[C]pdflatex\f[]: TeX Live includes many
1632options, documented in the LaTeX Font Catalogue.
1633The default is Latin Modern.
1634.RS
1635.RE
1636.TP
1637.B \f[C]fontfamilyoptions\f[]
1638options for package used as \f[C]fontfamily\f[]: e.g.
1639\f[C]osf,sc\f[] with \f[C]fontfamily\f[] set to \f[C]mathpazo\f[]
1640provides Palatino with old\-style figures and true small caps; may be
1641repeated for multiple options
1642.RS
1643.RE
1644.TP
1645.B \f[C]mainfont\f[], \f[C]sansfont\f[], \f[C]monofont\f[], \f[C]mathfont\f[], \f[C]CJKmainfont\f[]
1646font families for use with \f[C]xelatex\f[] or \f[C]lualatex\f[]: take
1647the name of any system font, using the \f[C]fontspec\f[] package.
1648Note that if \f[C]CJKmainfont\f[] is used, the \f[C]xecjk\f[] package
1649must be available.
1650.RS
1651.RE
1652.TP
1653.B \f[C]mainfontoptions\f[], \f[C]sansfontoptions\f[], \f[C]monofontoptions\f[], \f[C]mathfontoptions\f[], \f[C]CJKoptions\f[]
1654options to use with \f[C]mainfont\f[], \f[C]sansfont\f[],
1655\f[C]monofont\f[], \f[C]mathfont\f[], \f[C]CJKmainfont\f[] in
1656\f[C]xelatex\f[] and \f[C]lualatex\f[].
1657Allow for any choices available through \f[C]fontspec\f[], such as the
1658OpenType features \f[C]Numbers=OldStyle,Numbers=Proportional\f[].
1659May be repeated for multiple options.
1660.RS
1661.RE
1662.TP
1663.B \f[C]fontenc\f[]
1664allows font encoding to be specified through \f[C]fontenc\f[] package
1665(with \f[C]pdflatex\f[]); default is \f[C]T1\f[] (see guide to LaTeX
1666font encodings)
1667.RS
1668.RE
1669.TP
1670.B \f[C]microtypeoptions\f[]
1671options to pass to the microtype package
1672.RS
1673.RE
1674.TP
1675.B \f[C]colorlinks\f[]
1676add color to link text; automatically enabled if any of
1677\f[C]linkcolor\f[], \f[C]citecolor\f[], \f[C]urlcolor\f[], or
1678\f[C]toccolor\f[] are set
1679.RS
1680.RE
1681.TP
1682.B \f[C]linkcolor\f[], \f[C]citecolor\f[], \f[C]urlcolor\f[], \f[C]toccolor\f[]
1683color for internal links, citation links, external links, and links in
1684table of contents: uses options allowed by \f[C]xcolor\f[], including
1685the \f[C]dvipsnames\f[], \f[C]svgnames\f[], and \f[C]x11names\f[] lists
1686.RS
1687.RE
1688.TP
1689.B \f[C]links\-as\-notes\f[]
1690causes links to be printed as footnotes
1691.RS
1692.RE
1693.TP
1694.B \f[C]indent\f[]
1695uses document class settings for indentation (the default LaTeX template
1696otherwise removes indentation and adds space between paragraphs)
1697.RS
1698.RE
1699.TP
1700.B \f[C]subparagraph\f[]
1701disables default behavior of LaTeX template that redefines
1702(sub)paragraphs as sections, changing the appearance of nested headings
1703in some classes
1704.RS
1705.RE
1706.TP
1707.B \f[C]thanks\f[]
1708specifies contents of acknowledgments footnote after document title.
1709.RS
1710.RE
1711.TP
1712.B \f[C]toc\f[]
1713include table of contents (can also be set using
1714\f[C]\-\-toc/\-\-table\-of\-contents\f[])
1715.RS
1716.RE
1717.TP
1718.B \f[C]toc\-depth\f[]
1719level of section to include in table of contents
1720.RS
1721.RE
1722.TP
1723.B \f[C]secnumdepth\f[]
1724numbering depth for sections, if sections are numbered
1725.RS
1726.RE
1727.TP
1728.B \f[C]lof\f[], \f[C]lot\f[]
1729include list of figures, list of tables
1730.RS
1731.RE
1732.TP
1733.B \f[C]bibliography\f[]
1734bibliography to use for resolving references
1735.RS
1736.RE
1737.TP
1738.B \f[C]biblio\-style\f[]
1739bibliography style, when used with \f[C]\-\-natbib\f[] and
1740\f[C]\-\-biblatex\f[].
1741.RS
1742.RE
1743.TP
1744.B \f[C]biblio\-title\f[]
1745bibliography title, when used with \f[C]\-\-natbib\f[] and
1746\f[C]\-\-biblatex\f[].
1747.RS
1748.RE
1749.TP
1750.B \f[C]biblatexoptions\f[]
1751list of options for biblatex.
1752.RS
1753.RE
1754.TP
1755.B \f[C]natbiboptions\f[]
1756list of options for natbib.
1757.RS
1758.RE
1759.SS Variables for ConTeXt
1760.TP
1761.B \f[C]papersize\f[]
1762paper size, e.g.
1763\f[C]letter\f[], \f[C]A4\f[], \f[C]landscape\f[] (see ConTeXt Paper
1764Setup); may be repeated for multiple options
1765.RS
1766.RE
1767.TP
1768.B \f[C]layout\f[]
1769options for page margins and text arrangement (see ConTeXt Layout); may
1770be repeated for multiple options
1771.RS
1772.RE
1773.TP
1774.B \f[C]margin\-left\f[], \f[C]margin\-right\f[], \f[C]margin\-top\f[], \f[C]margin\-bottom\f[]
1775sets margins, if \f[C]layout\f[] is not used (otherwise \f[C]layout\f[]
1776overrides these)
1777.RS
1778.RE
1779.TP
1780.B \f[C]fontsize\f[]
1781font size for body text (e.g.
1782\f[C]10pt\f[], \f[C]12pt\f[])
1783.RS
1784.RE
1785.TP
1786.B \f[C]mainfont\f[], \f[C]sansfont\f[], \f[C]monofont\f[], \f[C]mathfont\f[]
1787font families: take the name of any system font (see ConTeXt Font
1788Switching)
1789.RS
1790.RE
1791.TP
1792.B \f[C]linkcolor\f[], \f[C]contrastcolor\f[]
1793color for links outside and inside a page, e.g.
1794\f[C]red\f[], \f[C]blue\f[] (see ConTeXt Color)
1795.RS
1796.RE
1797.TP
1798.B \f[C]linkstyle\f[]
1799typeface style for links, e.g.
1800\f[C]normal\f[], \f[C]bold\f[], \f[C]slanted\f[], \f[C]boldslanted\f[],
1801\f[C]type\f[], \f[C]cap\f[], \f[C]small\f[]
1802.RS
1803.RE
1804.TP
1805.B \f[C]indenting\f[]
1806controls indentation of paragraphs, e.g.
1807\f[C]yes,small,next\f[] (see ConTeXt Indentation); may be repeated for
1808multiple options
1809.RS
1810.RE
1811.TP
1812.B \f[C]whitespace\f[]
1813spacing between paragraphs, e.g.
1814\f[C]none\f[], \f[C]small\f[] (using \f[C]setupwhitespace\f[])
1815.RS
1816.RE
1817.TP
1818.B \f[C]interlinespace\f[]
1819adjusts line spacing, e.g.
1820\f[C]4ex\f[] (using \f[C]setupinterlinespace\f[]); may be repeated for
1821multiple options
1822.RS
1823.RE
1824.TP
1825.B \f[C]headertext\f[], \f[C]footertext\f[]
1826text to be placed in running header or footer (see ConTeXt Headers and
1827Footers); may be repeated up to four times for different placement
1828.RS
1829.RE
1830.TP
1831.B \f[C]pagenumbering\f[]
1832page number style and location (using \f[C]setuppagenumbering\f[]); may
1833be repeated for multiple options
1834.RS
1835.RE
1836.TP
1837.B \f[C]toc\f[]
1838include table of contents (can also be set using
1839\f[C]\-\-toc/\-\-table\-of\-contents\f[])
1840.RS
1841.RE
1842.TP
1843.B \f[C]lof\f[], \f[C]lot\f[]
1844include list of figures, list of tables
1845.RS
1846.RE
1847.SS Variables for man pages
1848.TP
1849.B \f[C]section\f[]
1850section number in man pages
1851.RS
1852.RE
1853.TP
1854.B \f[C]header\f[]
1855header in man pages
1856.RS
1857.RE
1858.TP
1859.B \f[C]footer\f[]
1860footer in man pages
1861.RS
1862.RE
1863.TP
1864.B \f[C]adjusting\f[]
1865adjusts text to left (\f[C]l\f[]), right (\f[C]r\f[]), center
1866(\f[C]c\f[]), or both (\f[C]b\f[]) margins
1867.RS
1868.RE
1869.TP
1870.B \f[C]hyphenate\f[]
1871if \f[C]true\f[] (the default), hyphenation will be used
1872.RS
1873.RE
1874.SS Variables for ms
1875.TP
1876.B \f[C]pointsize\f[]
1877point size (e.g.
1878\f[C]10p\f[])
1879.RS
1880.RE
1881.TP
1882.B \f[C]lineheight\f[]
1883line height (e.g.
1884\f[C]12p\f[])
1885.RS
1886.RE
1887.TP
1888.B \f[C]fontfamily\f[]
1889font family (e.g.
1890\f[C]T\f[] or \f[C]P\f[])
1891.RS
1892.RE
1893.TP
1894.B \f[C]indent\f[]
1895paragraph indent (e.g.
1896\f[C]2m\f[])
1897.RS
1898.RE
1899.SS Using variables in templates
1900.PP
1901Variable names are sequences of alphanumerics, \f[C]\-\f[], and
1902\f[C]_\f[], starting with a letter.
1903A variable name surrounded by \f[C]$\f[] signs will be replaced by its
1904value.
1905For example, the string \f[C]$title$\f[] in
1906.IP
1907.nf
1908\f[C]
1909<title>$title$</title>
1910\f[]
1911.fi
1912.PP
1913will be replaced by the document title.
1914.PP
1915To write a literal \f[C]$\f[] in a template, use \f[C]$$\f[].
1916.PP
1917Templates may contain conditionals.
1918The syntax is as follows:
1919.IP
1920.nf
1921\f[C]
1922$if(variable)$
1924$else$
1926$endif$
1927\f[]
1928.fi
1929.PP
1930This will include \f[C]X\f[] in the template if \f[C]variable\f[] has a
1931non\-null value; otherwise it will include \f[C]Y\f[].
1932\f[C]X\f[] and \f[C]Y\f[] are placeholders for any valid template text,
1933and may include interpolated variables or other conditionals.
1934The \f[C]$else$\f[] section may be omitted.
1935.PP
1936When variables can have multiple values (for example, \f[C]author\f[] in
1937a multi\-author document), you can use the \f[C]$for$\f[] keyword:
1938.IP
1939.nf
1940\f[C]
1941$for(author)$
1942<meta\ name="author"\ content="$author$"\ />
1943$endfor$
1944\f[]
1945.fi
1946.PP
1947You can optionally specify a separator to be used between consecutive
1948items:
1949.IP
1950.nf
1951\f[C]
1952$for(author)$$author$$sep$,\ $endfor$
1953\f[]
1954.fi
1955.PP
1956A dot can be used to select a field of a variable that takes an object
1957as its value.
1958So, for example:
1959.IP
1960.nf
1961\f[C]
1962$author.name$\ ($author.affiliation$)
1963\f[]
1964.fi
1965.PP
1966If you use custom templates, you may need to revise them as pandoc
1967changes.
1968We recommend tracking the changes in the default templates, and
1969modifying your custom templates accordingly.
1970An easy way to do this is to fork the pandoc\-templates repository and
1971merge in changes after each pandoc release.
1972.PP
1973Templates may contain comments: anything on a line after \f[C]$\-\-\f[]
1974will be treated as a comment and ignored.
1975.SH PANDOC'S MARKDOWN
1976.PP
1977Pandoc understands an extended and slightly revised version of John
1978Gruber's Markdown syntax.
1979This document explains the syntax, noting differences from standard
1980Markdown.
1981Except where noted, these differences can be suppressed by using the
1982\f[C]markdown_strict\f[] format instead of \f[C]markdown\f[].
1983An extensions can be enabled by adding \f[C]+EXTENSION\f[] to the format
1984name and disabled by adding \f[C]\-EXTENSION\f[].
1985For example, \f[C]markdown_strict+footnotes\f[] is strict Markdown with
1986footnotes enabled, while \f[C]markdown\-footnotes\-pipe_tables\f[] is
1987pandoc's Markdown without footnotes or pipe tables.
1988.SS Philosophy
1989.PP
1990Markdown is designed to be easy to write, and, even more importantly,
1991easy to read:
1992.RS
1993.PP
1994A Markdown\-formatted document should be publishable as\-is, as plain
1995text, without looking like it's been marked up with tags or formatting
1996instructions.
1997\[en] John Gruber
1998.RE
1999.PP
2000This principle has guided pandoc's decisions in finding syntax for
2001tables, footnotes, and other extensions.
2002.PP
2003There is, however, one respect in which pandoc's aims are different from
2004the original aims of Markdown.
2005Whereas Markdown was originally designed with HTML generation in mind,
2006pandoc is designed for multiple output formats.
2007Thus, while pandoc allows the embedding of raw HTML, it discourages it,
2008and provides other, non\-HTMLish ways of representing important document
2009elements like definition lists, tables, mathematics, and footnotes.
2010.SS Paragraphs
2011.PP
2012A paragraph is one or more lines of text followed by one or more blank
2013lines.
2014Newlines are treated as spaces, so you can reflow your paragraphs as you
2015like.
2016If you need a hard line break, put two or more spaces at the end of a
2017line.
2018.SS Extension: \f[C]escaped_line_breaks\f[]
2019.PP
2020A backslash followed by a newline is also a hard line break.
2021Note: in multiline and grid table cells, this is the only way to create
2022a hard line break, since trailing spaces in the cells are ignored.
2023.SS Headers
2024.PP
2025There are two kinds of headers: Setext and ATX.
2026.SS Setext\-style headers
2027.PP
2028A setext\-style header is a line of text \[lq]underlined\[rq] with a row
2029of \f[C]=\f[] signs (for a level one header) or \f[C]\-\f[] signs (for a
2030level two header):
2031.IP
2032.nf
2033\f[C]
2034A\ level\-one\ header
2035==================
2037A\ level\-two\ header
2038\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
2039\f[]
2040.fi
2041.PP
2042The header text can contain inline formatting, such as emphasis (see
2043Inline formatting, below).
2044.SS ATX\-style headers
2045.PP
2046An ATX\-style header consists of one to six \f[C]#\f[] signs and a line
2047of text, optionally followed by any number of \f[C]#\f[] signs.
2048The number of \f[C]#\f[] signs at the beginning of the line is the
2049header level:
2050.IP
2051.nf
2052\f[C]
2053##\ A\ level\-two\ header
2055###\ A\ level\-three\ header\ ###
2056\f[]
2057.fi
2058.PP
2059As with setext\-style headers, the header text can contain formatting:
2060.IP
2061.nf
2062\f[C]
2063#\ A\ level\-one\ header\ with\ a\ [link](/url)\ and\ *emphasis*
2064\f[]
2065.fi
2066.SS Extension: \f[C]blank_before_header\f[]
2067.PP
2068Standard Markdown syntax does not require a blank line before a header.
2069Pandoc does require this (except, of course, at the beginning of the
2070document).
2071The reason for the requirement is that it is all too easy for a
2072\f[C]#\f[] to end up at the beginning of a line by accident (perhaps
2073through line wrapping).
2074Consider, for example:
2075.IP
2076.nf
2077\f[C]
2078I\ like\ several\ of\ their\ flavors\ of\ ice\ cream:
2079#22,\ for\ example,\ and\ #5.
2080\f[]
2081.fi
2082.SS Extension: \f[C]space_in_atx_header\f[]
2083.PP
2084Many Markdown implementations do not require a space between the opening
2085\f[C]#\f[]s of an ATX header and the header text, so that
2086\f[C]#5\ bolt\f[] and \f[C]#hashtag\f[] count as headers.
2087With this extension, pandoc does require the space.
2088.SS Header identifiers
2089.SS Extension: \f[C]header_attributes\f[]
2090.PP
2091Headers can be assigned attributes using this syntax at the end of the
2092line containing the header text:
2093.IP
2094.nf
2095\f[C]
2096{#identifier\ .class\ .class\ key=value\ key=value}
2097\f[]
2098.fi
2099.PP
2100Thus, for example, the following headers will all be assigned the
2101identifier \f[C]foo\f[]:
2102.IP
2103.nf
2104\f[C]
2105#\ My\ header\ {#foo}
2107##\ My\ header\ ##\ \ \ \ {#foo}
2109My\ other\ header\ \ \ {#foo}
2110\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
2111\f[]
2112.fi
2113.PP
2114(This syntax is compatible with PHP Markdown Extra.)
2115.PP
2116Note that although this syntax allows assignment of classes and
2117key/value attributes, writers generally don't use all of this
2118information.
2119Identifiers, classes, and key/value attributes are used in HTML and
2120HTML\-based formats such as EPUB and slidy.
2121Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
2122Textile, and AsciiDoc writers.
2123.PP
2124Headers with the class \f[C]unnumbered\f[] will not be numbered, even if
2125\f[C]\-\-number\-sections\f[] is specified.
2126A single hyphen (\f[C]\-\f[]) in an attribute context is equivalent to
2127\f[C]\&.unnumbered\f[], and preferable in non\-English documents.
2128So,
2129.IP
2130.nf
2131\f[C]
2132#\ My\ header\ {\-}
2133\f[]
2134.fi
2135.PP
2136is just the same as
2137.IP
2138.nf
2139\f[C]
2140#\ My\ header\ {.unnumbered}
2141\f[]
2142.fi
2143.SS Extension: \f[C]auto_identifiers\f[]
2144.PP
2145A header without an explicitly specified identifier will be
2146automatically assigned a unique identifier based on the header text.
2147To derive the identifier from the header text,
2148.IP \[bu] 2
2149Remove all formatting, links, etc.
2150.IP \[bu] 2
2151Remove all footnotes.
2152.IP \[bu] 2
2153Remove all punctuation, except underscores, hyphens, and periods.
2154.IP \[bu] 2
2155Replace all spaces and newlines with hyphens.
2156.IP \[bu] 2
2157Convert all alphabetic characters to lowercase.
2158.IP \[bu] 2
2159Remove everything up to the first letter (identifiers may not begin with
2160a number or punctuation mark).
2161.IP \[bu] 2
2162If nothing is left after this, use the identifier \f[C]section\f[].
2163.PP
2164Thus, for example,
2165.PP
2166.TS
2167tab(@);
2168l l.
2170Header
2171T}@T{
2172Identifier
2176\f[C]Header\ identifiers\ in\ HTML\f[]
2177T}@T{
2178\f[C]header\-identifiers\-in\-html\f[]
2181\f[C]*Dogs*?\-\-in\ *my*\ house?\f[]
2182T}@T{
2183\f[C]dogs\-\-in\-my\-house\f[]
2186\f[C][HTML],\ [S5],\ or\ [RTF]?\f[]
2187T}@T{
2188\f[C]html\-s5\-or\-rtf\f[]
2191\f[C]3.\ Applications\f[]
2192T}@T{
2193\f[C]applications\f[]
2196\f[C]33\f[]
2197T}@T{
2198\f[C]section\f[]
2200.TE
2201.PP
2202These rules should, in most cases, allow one to determine the identifier
2203from the header text.
2204The exception is when several headers have the same text; in this case,
2205the first will get an identifier as described above; the second will get
2206the same identifier with \f[C]\-1\f[] appended; the third with
2207\f[C]\-2\f[]; and so on.
2208.PP
2209These identifiers are used to provide link targets in the table of
2210contents generated by the \f[C]\-\-toc|\-\-table\-of\-contents\f[]
2211option.
2212They also make it easy to provide links from one section of a document
2213to another.
2214A link to this section, for example, might look like this:
2215.IP
2216.nf
2217\f[C]
2218See\ the\ section\ on
2219[header\ identifiers](#header\-identifiers\-in\-html\-latex\-and\-context).
2220\f[]
2221.fi
2222.PP
2223Note, however, that this method of providing links to sections works
2224only in HTML, LaTeX, and ConTeXt formats.
2225.PP
2226If the \f[C]\-\-section\-divs\f[] option is specified, then each section
2227will be wrapped in a \f[C]div\f[] (or a \f[C]section\f[], if
2228\f[C]html5\f[] was specified), and the identifier will be attached to
2229the enclosing \f[C]<div>\f[] (or \f[C]<section>\f[]) tag rather than the
2230header itself.
2231This allows entire sections to be manipulated using JavaScript or
2232treated differently in CSS.
2233.SS Extension: \f[C]implicit_header_references\f[]
2234.PP
2235Pandoc behaves as if reference links have been defined for each header.
2236So, to link to a header
2237.IP
2238.nf
2239\f[C]
2240#\ Header\ identifiers\ in\ HTML
2241\f[]
2242.fi
2243.PP
2244you can simply write
2245.IP
2246.nf
2247\f[C]
2248[Header\ identifiers\ in\ HTML]
2249\f[]
2250.fi
2251.PP
2253.IP
2254.nf
2255\f[C]
2256[Header\ identifiers\ in\ HTML][]
2257\f[]
2258.fi
2259.PP
2261.IP
2262.nf
2263\f[C]
2264[the\ section\ on\ header\ identifiers][header\ identifiers\ in
2265HTML]
2266\f[]
2267.fi
2268.PP
2269instead of giving the identifier explicitly:
2270.IP
2271.nf
2272\f[C]
2273[Header\ identifiers\ in\ HTML](#header\-identifiers\-in\-html)
2274\f[]
2275.fi
2276.PP
2277If there are multiple headers with identical text, the corresponding
2278reference will link to the first one only, and you will need to use
2279explicit links to link to the others, as described above.
2280.PP
2281Like regular reference links, these references are case\-insensitive.
2282.PP
2283Explicit link reference definitions always take priority over implicit
2284header references.
2285So, in the following example, the link will point to \f[C]bar\f[], not
2286to \f[C]#foo\f[]:
2287.IP
2288.nf
2289\f[C]
2290#\ Foo
2292[foo]:\ bar
2294See\ [foo]
2295\f[]
2296.fi
2297.SS Block quotations
2298.PP
2299Markdown uses email conventions for quoting blocks of text.
2300A block quotation is one or more paragraphs or other block elements
2301(such as lists or headers), with each line preceded by a \f[C]>\f[]
2302character and an optional space.
2303(The \f[C]>\f[] need not start at the left margin, but it should not be
2304indented more than three spaces.)
2305.IP
2306.nf
2307\f[C]
2308>\ This\ is\ a\ block\ quote.\ This
2309>\ paragraph\ has\ two\ lines.
2311>\ 1.\ This\ is\ a\ list\ inside\ a\ block\ quote.
2312>\ 2.\ Second\ item.
2313\f[]
2314.fi
2315.PP
2316A \[lq]lazy\[rq] form, which requires the \f[C]>\f[] character only on
2317the first line of each block, is also allowed:
2318.IP
2319.nf
2320\f[C]
2321>\ This\ is\ a\ block\ quote.\ This
2322paragraph\ has\ two\ lines.
2324>\ 1.\ This\ is\ a\ list\ inside\ a\ block\ quote.
23252.\ Second\ item.
2326\f[]
2327.fi
2328.PP
2329Among the block elements that can be contained in a block quote are
2330other block quotes.
2331That is, block quotes can be nested:
2332.IP
2333.nf
2334\f[C]
2335>\ This\ is\ a\ block\ quote.
2337>\ >\ A\ block\ quote\ within\ a\ block\ quote.
2338\f[]
2339.fi
2340.PP
2341If the \f[C]>\f[] character is followed by an optional space, that space
2342will be considered part of the block quote marker and not part of the
2343indentation of the contents.
2344Thus, to put an indented code block in a block quote, you need five
2345spaces after the \f[C]>\f[]:
2346.IP
2347.nf
2348\f[C]
2349>\ \ \ \ \ code
2350\f[]
2351.fi
2352.SS Extension: \f[C]blank_before_blockquote\f[]
2353.PP
2354Standard Markdown syntax does not require a blank line before a block
2355quote.
2356Pandoc does require this (except, of course, at the beginning of the
2357document).
2358The reason for the requirement is that it is all too easy for a
2359\f[C]>\f[] to end up at the beginning of a line by accident (perhaps
2360through line wrapping).
2361So, unless the \f[C]markdown_strict\f[] format is used, the following
2362does not produce a nested block quote in pandoc:
2363.IP
2364.nf
2365\f[C]
2366>\ This\ is\ a\ block\ quote.
2367>>\ Nested.
2368\f[]
2369.fi
2370.SS Verbatim (code) blocks
2371.SS Indented code blocks
2372.PP
2373A block of text indented four spaces (or one tab) is treated as verbatim
2374text: that is, special characters do not trigger special formatting, and
2375all spaces and line breaks are preserved.
2376For example,
2377.IP
2378.nf
2379\f[C]
2380\ \ \ \ if\ (a\ >\ 3)\ {
2381\ \ \ \ \ \ moveShip(5\ *\ gravity,\ DOWN);
2382\ \ \ \ }
2383\f[]
2384.fi
2385.PP
2386The initial (four space or one tab) indentation is not considered part
2387of the verbatim text, and is removed in the output.
2388.PP
2389Note: blank lines in the verbatim text need not begin with four spaces.
2390.SS Fenced code blocks
2391.SS Extension: \f[C]fenced_code_blocks\f[]
2392.PP
2393In addition to standard indented code blocks, pandoc supports
2394\f[I]fenced\f[] code blocks.
2395These begin with a row of three or more tildes (\f[C]~\f[]) and end with
2396a row of tildes that must be at least as long as the starting row.
2397Everything between these lines is treated as code.
2398No indentation is necessary:
2399.IP
2400.nf
2401\f[C]
2402~~~~~~~
2403if\ (a\ >\ 3)\ {
2404\ \ moveShip(5\ *\ gravity,\ DOWN);
2406~~~~~~~
2407\f[]
2408.fi
2409.PP
2410Like regular code blocks, fenced code blocks must be separated from
2411surrounding text by blank lines.
2412.PP
2413If the code itself contains a row of tildes or backticks, just use a
2414longer row of tildes or backticks at the start and end:
2415.IP
2416.nf
2417\f[C]
2418~~~~~~~~~~~~~~~~
2419~~~~~~~~~~
2420code\ including\ tildes
2421~~~~~~~~~~
2422~~~~~~~~~~~~~~~~
2423\f[]
2424.fi
2425.SS Extension: \f[C]backtick_code_blocks\f[]
2426.PP
2427Same as \f[C]fenced_code_blocks\f[], but uses backticks (\f[C]`\f[])
2428instead of tildes (\f[C]~\f[]).
2429.SS Extension: \f[C]fenced_code_attributes\f[]
2430.PP
2431Optionally, you may attach attributes to fenced or backtick code block
2432using this syntax:
2433.IP
2434.nf
2435\f[C]
2436~~~~\ {#mycode\ .haskell\ .numberLines\ startFrom="100"}
2437qsort\ []\ \ \ \ \ =\ []
2438qsort\ (x:xs)\ =\ qsort\ (filter\ (<\ x)\ xs)\ ++\ [x]\ ++
2439\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ qsort\ (filter\ (>=\ x)\ xs)
2440~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2441\f[]
2442.fi
2443.PP
2444Here \f[C]mycode\f[] is an identifier, \f[C]haskell\f[] and
2445\f[C]numberLines\f[] are classes, and \f[C]startFrom\f[] is an attribute
2446with value \f[C]100\f[].
2447Some output formats can use this information to do syntax highlighting.
2448Currently, the only output formats that uses this information are HTML,
2449LaTeX, Docx, and Ms.\ If highlighting is supported for your output
2450format and language, then the code block above will appear highlighted,
2451with numbered lines.
2452(To see which languages are supported, type
2453\f[C]pandoc\ \-\-list\-highlight\-languages\f[].) Otherwise, the code
2454block above will appear as follows:
2455.IP
2456.nf
2457\f[C]
2458<pre\ id="mycode"\ class="haskell\ numberLines"\ startFrom="100">
2459\ \ <code>
2460\ \ ...
2461\ \ </code>
2462</pre>
2463\f[]
2464.fi
2465.PP
2466A shortcut form can also be used for specifying the language of the code
2467block:
2468.IP
2469.nf
2470\f[C]
2471```haskell
2472qsort\ []\ =\ []
2473```
2474\f[]
2475.fi
2476.PP
2477This is equivalent to:
2478.IP
2479.nf
2480\f[C]
2481```\ {.haskell}
2482qsort\ []\ =\ []
2483```
2484\f[]
2485.fi
2486.PP
2487If the \f[C]fenced_code_attributes\f[] extension is disabled, but input
2488contains class attribute(s) for the code block, the first class
2489attribute will be printed after the opening fence as a bare word.
2490.PP
2491To prevent all highlighting, use the \f[C]\-\-no\-highlight\f[] flag.
2492To set the highlighting style, use \f[C]\-\-highlight\-style\f[].
2493For more information on highlighting, see Syntax highlighting, below.
2494.SS Line blocks
2495.SS Extension: \f[C]line_blocks\f[]
2496.PP
2497A line block is a sequence of lines beginning with a vertical bar
2498(\f[C]|\f[]) followed by a space.
2499The division into lines will be preserved in the output, as will any
2500leading spaces; otherwise, the lines will be formatted as Markdown.
2501This is useful for verse and addresses:
2502.IP
2503.nf
2504\f[C]
2505|\ The\ limerick\ packs\ laughs\ anatomical
2506|\ In\ space\ that\ is\ quite\ economical.
2507|\ \ \ \ But\ the\ good\ ones\ I\[aq]ve\ seen
2508|\ \ \ \ So\ seldom\ are\ clean
2509|\ And\ the\ clean\ ones\ so\ seldom\ are\ comical
2511|\ 200\ Main\ St.
2512|\ Berkeley,\ CA\ 94718
2513\f[]
2514.fi
2515.PP
2516The lines can be hard\-wrapped if needed, but the continuation line must
2517begin with a space.
2518.IP
2519.nf
2520\f[C]
2521|\ The\ Right\ Honorable\ Most\ Venerable\ and\ Righteous\ Samuel\ L.
2522\ \ Constable,\ Jr.
2523|\ 200\ Main\ St.
2524|\ Berkeley,\ CA\ 94718
2525\f[]
2526.fi
2527.PP
2528This syntax is borrowed from reStructuredText.
2529.SS Lists
2530.SS Bullet lists
2531.PP
2532A bullet list is a list of bulleted list items.
2533A bulleted list item begins with a bullet (\f[C]*\f[], \f[C]+\f[], or
2534\f[C]\-\f[]).
2535Here is a simple example:
2536.IP
2537.nf
2538\f[C]
2539*\ one
2540*\ two
2541*\ three
2542\f[]
2543.fi
2544.PP
2545This will produce a \[lq]compact\[rq] list.
2546If you want a \[lq]loose\[rq] list, in which each item is formatted as a
2547paragraph, put spaces between the items:
2548.IP
2549.nf
2550\f[C]
2551*\ one
2553*\ two
2555*\ three
2556\f[]
2557.fi
2558.PP
2559The bullets need not be flush with the left margin; they may be indented
2560one, two, or three spaces.
2561The bullet must be followed by whitespace.
2562.PP
2563List items look best if subsequent lines are flush with the first line
2564(after the bullet):
2565.IP
2566.nf
2567\f[C]
2568*\ here\ is\ my\ first
2569\ \ list\ item.
2570*\ and\ my\ second.
2571\f[]
2572.fi
2573.PP
2574But Markdown also allows a \[lq]lazy\[rq] format:
2575.IP
2576.nf
2577\f[C]
2578*\ here\ is\ my\ first
2579list\ item.
2580*\ and\ my\ second.
2581\f[]
2582.fi
2583.SS Block content in list items
2584.PP
2585A list item may contain multiple paragraphs and other block\-level
2586content.
2587However, subsequent paragraphs must be preceded by a blank line and
2588indented to line up with the first non\-space content after the list
2589marker.
2590.IP
2591.nf
2592\f[C]
2593\ \ *\ First\ paragraph.
2595\ \ \ \ Continued.
2597\ \ *\ Second\ paragraph.\ With\ a\ code\ block,\ which\ must\ be\ indented
2598\ \ \ \ eight\ spaces:
2600\ \ \ \ \ \ \ \ {\ code\ }
2601\f[]
2602.fi
2603.PP
2604Exception: if the list marker is followed by an indented code block,
2605which must begin 5 spaces after the list marker, then subsequent
2606paragraphs must begin two columns after the last character of the list
2607marker:
2608.IP
2609.nf
2610\f[C]
2611*\ \ \ \ \ code
2613\ \ continuation\ paragraph
2614\f[]
2615.fi
2616.PP
2617List items may include other lists.
2618In this case the preceding blank line is optional.
2619The nested list must be indented to line up with the first non\-space
2620character after the list marker of the containing list item.
2621.IP
2622.nf
2623\f[C]
2624*\ fruits
2625\ \ +\ apples
2626\ \ \ \ \-\ macintosh
2627\ \ \ \ \-\ red\ delicious
2628\ \ +\ pears
2629\ \ +\ peaches
2630*\ vegetables
2631\ \ +\ broccoli
2632\ \ +\ chard
2633\f[]
2634.fi
2635.PP
2636As noted above, Markdown allows you to write list items
2637\[lq]lazily,\[rq] instead of indenting continuation lines.
2638However, if there are multiple paragraphs or other blocks in a list
2639item, the first line of each must be indented.
2640.IP
2641.nf
2642\f[C]
2643+\ A\ lazy,\ lazy,\ list
2644item.
2646+\ Another\ one;\ this\ looks
2647bad\ but\ is\ legal.
2649\ \ \ \ Second\ paragraph\ of\ second
2650list\ item.
2651\f[]
2652.fi
2653.SS Ordered lists
2654.PP
2655Ordered lists work just like bulleted lists, except that the items begin
2656with enumerators rather than bullets.
2657.PP
2658In standard Markdown, enumerators are decimal numbers followed by a
2659period and a space.
2660The numbers themselves are ignored, so there is no difference between
2661this list:
2662.IP
2663.nf
2664\f[C]
26651.\ \ one
26662.\ \ two
26673.\ \ three
2668\f[]
2669.fi
2670.PP
2671and this one:
2672.IP
2673.nf
2674\f[C]
26755.\ \ one
26767.\ \ two
26771.\ \ three
2678\f[]
2679.fi
2680.SS Extension: \f[C]fancy_lists\f[]
2681.PP
2682Unlike standard Markdown, pandoc allows ordered list items to be marked
2683with uppercase and lowercase letters and roman numerals, in addition to
2684Arabic numerals.
2685List markers may be enclosed in parentheses or followed by a single
2686right\-parentheses or period.
2687They must be separated from the text that follows by at least one space,
2688and, if the list marker is a capital letter with a period, by at least
2689two spaces.
2690.PP
2691The \f[C]fancy_lists\f[] extension also allows `\f[C]#\f[]' to be used
2692as an ordered list marker in place of a numeral:
2693.IP
2694.nf
2695\f[C]
2696#.\ one
2697#.\ two
2698\f[]
2699.fi
2700.SS Extension: \f[C]startnum\f[]
2701.PP
2702Pandoc also pays attention to the type of list marker used, and to the
2703starting number, and both of these are preserved where possible in the
2704output format.
2705Thus, the following yields a list with numbers followed by a single
2706parenthesis, starting with 9, and a sublist with lowercase roman
2707numerals:
2708.IP
2709.nf
2710\f[C]
2711\ 9)\ \ Ninth
271210)\ \ Tenth
271311)\ \ Eleventh
2714\ \ \ \ \ \ \ i.\ subone
2715\ \ \ \ \ \ ii.\ subtwo
2716\ \ \ \ \ iii.\ subthree
2717\f[]
2718.fi
2719.PP
2720Pandoc will start a new list each time a different type of list marker
2721is used.
2722So, the following will create three lists:
2723.IP
2724.nf
2725\f[C]
2726(2)\ Two
2727(5)\ Three
27281.\ \ Four
2729*\ \ \ Five
2730\f[]
2731.fi
2732.PP
2733If default list markers are desired, use \f[C]#.\f[]:
2734.IP
2735.nf
2736\f[C]
2737#.\ \ one
2738#.\ \ two
2739#.\ \ three
2740\f[]
2741.fi
2742.SS Definition lists
2743.SS Extension: \f[C]definition_lists\f[]
2744.PP
2745Pandoc supports definition lists, using the syntax of PHP Markdown Extra
2746with some extensions.
2747.IP
2748.nf
2749\f[C]
2750Term\ 1
2752:\ \ \ Definition\ 1
2754Term\ 2\ with\ *inline\ markup*
2756:\ \ \ Definition\ 2
2758\ \ \ \ \ \ \ \ {\ some\ code,\ part\ of\ Definition\ 2\ }
2760\ \ \ \ Third\ paragraph\ of\ definition\ 2.
2761\f[]
2762.fi
2763.PP
2764Each term must fit on one line, which may optionally be followed by a
2765blank line, and must be followed by one or more definitions.
2766A definition begins with a colon or tilde, which may be indented one or
2767two spaces.
2768.PP
2769A term may have multiple definitions, and each definition may consist of
2770one or more block elements (paragraph, code block, list, etc.), each
2771indented four spaces or one tab stop.
2772The body of the definition (including the first line, aside from the
2773colon or tilde) should be indented four spaces.
2774However, as with other Markdown lists, you can \[lq]lazily\[rq] omit
2775indentation except at the beginning of a paragraph or other block
2776element:
2777.IP
2778.nf
2779\f[C]
2780Term\ 1
2782:\ \ \ Definition
2783with\ lazy\ continuation.
2785\ \ \ \ Second\ paragraph\ of\ the\ definition.
2786\f[]
2787.fi
2788.PP
2789If you leave space before the definition (as in the example above), the
2790text of the definition will be treated as a paragraph.
2791In some output formats, this will mean greater spacing between
2792term/definition pairs.
2793For a more compact definition list, omit the space before the
2794definition:
2795.IP
2796.nf
2797\f[C]
2798Term\ 1
2799\ \ ~\ Definition\ 1
2801Term\ 2
2802\ \ ~\ Definition\ 2a
2803\ \ ~\ Definition\ 2b
2804\f[]
2805.fi
2806.PP
2807Note that space between items in a definition list is required.
2808(A variant that loosens this requirement, but disallows \[lq]lazy\[rq]
2809hard wrapping, can be activated with \f[C]compact_definition_lists\f[]:
2810see Non\-pandoc extensions, below.)
2811.SS Numbered example lists
2812.SS Extension: \f[C]example_lists\f[]
2813.PP
2814The special list marker \f[C]\@\f[] can be used for sequentially
2815numbered examples.
2816The first list item with a \f[C]\@\f[] marker will be numbered `1', the
2817next `2', and so on, throughout the document.
2818The numbered examples need not occur in a single list; each new list
2819using \f[C]\@\f[] will take up where the last stopped.
2820So, for example:
2821.IP
2822.nf
2823\f[C]
2824(\@)\ \ My\ first\ example\ will\ be\ numbered\ (1).
2825(\@)\ \ My\ second\ example\ will\ be\ numbered\ (2).
2827Explanation\ of\ examples.
2829(\@)\ \ My\ third\ example\ will\ be\ numbered\ (3).
2830\f[]
2831.fi
2832.PP
2833Numbered examples can be labeled and referred to elsewhere in the
2834document:
2835.IP
2836.nf
2837\f[C]
2838(\@good)\ \ This\ is\ a\ good\ example.
2840As\ (\@good)\ illustrates,\ ...
2841\f[]
2842.fi
2843.PP
2844The label can be any string of alphanumeric characters, underscores, or
2845hyphens.
2846.SS Compact and loose lists
2847.PP
2848Pandoc behaves differently from \f[C]Markdown.pl\f[] on some \[lq]edge
2849cases\[rq] involving lists.
2850Consider this source:
2851.IP
2852.nf
2853\f[C]
2854+\ \ \ First
2855+\ \ \ Second:
2856\ \ \ \ \-\ \ \ Fee
2857\ \ \ \ \-\ \ \ Fie
2858\ \ \ \ \-\ \ \ Foe
2860+\ \ \ Third
2861\f[]
2862.fi
2863.PP
2864Pandoc transforms this into a \[lq]compact list\[rq] (with no
2865\f[C]<p>\f[] tags around \[lq]First\[rq], \[lq]Second\[rq], or
2866\[lq]Third\[rq]), while Markdown puts \f[C]<p>\f[] tags around
2867\[lq]Second\[rq] and \[lq]Third\[rq] (but not \[lq]First\[rq]), because
2868of the blank space around \[lq]Third\[rq].
2869Pandoc follows a simple rule: if the text is followed by a blank line,
2870it is treated as a paragraph.
2871Since \[lq]Second\[rq] is followed by a list, and not a blank line, it
2872isn't treated as a paragraph.
2873The fact that the list is followed by a blank line is irrelevant.
2874(Note: Pandoc works this way even when the \f[C]markdown_strict\f[]
2875format is specified.
2876This behavior is consistent with the official Markdown syntax
2877description, even though it is different from that of
2878\f[C]Markdown.pl\f[].)
2879.SS Ending a list
2880.PP
2881What if you want to put an indented code block after a list?
2882.IP
2883.nf
2884\f[C]
2885\-\ \ \ item\ one
2886\-\ \ \ item\ two
2888\ \ \ \ {\ my\ code\ block\ }
2889\f[]
2890.fi
2891.PP
2892Trouble! Here pandoc (like other Markdown implementations) will treat
2893\f[C]{\ my\ code\ block\ }\f[] as the second paragraph of item two, and
2894not as a code block.
2895.PP
2896To \[lq]cut off\[rq] the list after item two, you can insert some
2897non\-indented content, like an HTML comment, which won't produce visible
2898output in any format:
2899.IP
2900.nf
2901\f[C]
2902\-\ \ \ item\ one
2903\-\ \ \ item\ two
2905<!\-\-\ end\ of\ list\ \-\->
2907\ \ \ \ {\ my\ code\ block\ }
2908\f[]
2909.fi
2910.PP
2911You can use the same trick if you want two consecutive lists instead of
2912one big list:
2913.IP
2914.nf
2915\f[C]
29161.\ \ one
29172.\ \ two
29183.\ \ three
2920<!\-\-\ \-\->
29221.\ \ uno
29232.\ \ dos
29243.\ \ tres
2925\f[]
2926.fi
2927.SS Horizontal rules
2928.PP
2929A line containing a row of three or more \f[C]*\f[], \f[C]\-\f[], or
2930\f[C]_\f[] characters (optionally separated by spaces) produces a
2931horizontal rule:
2932.IP
2933.nf
2934\f[C]
2935*\ \ *\ \ *\ \ *
2937\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
2938\f[]
2939.fi
2940.SS Tables
2941.PP
2942Four kinds of tables may be used.
2943The first three kinds presuppose the use of a fixed\-width font, such as
2944Courier.
2945The fourth kind can be used with proportionally spaced fonts, as it does
2946not require lining up columns.
2947.SS Extension: \f[C]table_captions\f[]
2948.PP
2949A caption may optionally be provided with all 4 kinds of tables (as
2950illustrated in the examples below).
2951A caption is a paragraph beginning with the string \f[C]Table:\f[] (or
2952just \f[C]:\f[]), which will be stripped off.
2953It may appear either before or after the table.
2954.SS Extension: \f[C]simple_tables\f[]
2955.PP
2956Simple tables look like this:
2957.IP
2958.nf
2959\f[C]
2960\ \ Right\ \ \ \ \ Left\ \ \ \ \ Center\ \ \ \ \ Default
2961\-\-\-\-\-\-\-\ \ \ \ \ \-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\ \ \ \-\-\-\-\-\-\-
2962\ \ \ \ \ 12\ \ \ \ \ 12\ \ \ \ \ \ \ \ 12\ \ \ \ \ \ \ \ \ \ \ \ 12
2963\ \ \ \ 123\ \ \ \ \ 123\ \ \ \ \ \ \ 123\ \ \ \ \ \ \ \ \ \ 123
2964\ \ \ \ \ \ 1\ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ 1
2966Table:\ \ Demonstration\ of\ simple\ table\ syntax.
2967\f[]
2968.fi
2969.PP
2970The headers and table rows must each fit on one line.
2971Column alignments are determined by the position of the header text
2972relative to the dashed line below it:
2973.IP \[bu] 2
2974If the dashed line is flush with the header text on the right side but
2975extends beyond it on the left, the column is right\-aligned.
2976.IP \[bu] 2
2977If the dashed line is flush with the header text on the left side but
2978extends beyond it on the right, the column is left\-aligned.
2979.IP \[bu] 2
2980If the dashed line extends beyond the header text on both sides, the
2981column is centered.
2982.IP \[bu] 2
2983If the dashed line is flush with the header text on both sides, the
2984default alignment is used (in most cases, this will be left).
2985.PP
2986The table must end with a blank line, or a line of dashes followed by a
2987blank line.
2988.PP
2989The column headers may be omitted, provided a dashed line is used to end
2990the table.
2991For example:
2992.IP
2993.nf
2994\f[C]
2995\-\-\-\-\-\-\-\ \ \ \ \ \-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\ \ \ \-\-\-\-\-\-\-
2996\ \ \ \ \ 12\ \ \ \ \ 12\ \ \ \ \ \ \ \ 12\ \ \ \ \ \ \ \ \ \ \ \ \ 12
2997\ \ \ \ 123\ \ \ \ \ 123\ \ \ \ \ \ \ 123\ \ \ \ \ \ \ \ \ \ \ 123
2998\ \ \ \ \ \ 1\ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ 1
2999\-\-\-\-\-\-\-\ \ \ \ \ \-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\ \ \ \-\-\-\-\-\-\-
3000\f[]
3001.fi
3002.PP
3003When headers are omitted, column alignments are determined on the basis
3004of the first line of the table body.
3005So, in the tables above, the columns would be right, left, center, and
3006right aligned, respectively.
3007.SS Extension: \f[C]multiline_tables\f[]
3008.PP
3009Multiline tables allow headers and table rows to span multiple lines of
3010text (but cells that span multiple columns or rows of the table are not
3011supported).
3012Here is an example:
3013.IP
3014.nf
3015\f[C]
3016\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
3017\ Centered\ \ \ Default\ \ \ \ \ \ \ \ \ \ \ Right\ Left
3018\ \ Header\ \ \ \ Aligned\ \ \ \ \ \ \ \ \ Aligned\ Aligned
3019\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
3020\ \ \ First\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12.0\ Example\ of\ a\ row\ that
3021\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ spans\ multiple\ lines.
3023\ \ Second\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5.0\ Here\[aq]s\ another\ one.\ Note
3024\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ blank\ line\ between
3025\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rows.
3026\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
3028Table:\ Here\[aq]s\ the\ caption.\ It,\ too,\ may\ span
3029multiple\ lines.
3030\f[]
3031.fi
3032.PP
3033These work like simple tables, but with the following differences:
3034.IP \[bu] 2
3035They must begin with a row of dashes, before the header text (unless the
3036headers are omitted).
3037.IP \[bu] 2
3038They must end with a row of dashes, then a blank line.
3039.IP \[bu] 2
3040The rows must be separated by blank lines.
3041.PP
3042In multiline tables, the table parser pays attention to the widths of
3043the columns, and the writers try to reproduce these relative widths in
3044the output.
3045So, if you find that one of the columns is too narrow in the output, try
3046widening it in the Markdown source.
3047.PP
3048Headers may be omitted in multiline tables as well as simple tables:
3049.IP
3050.nf
3051\f[C]
3052\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
3053\ \ \ First\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12.0\ Example\ of\ a\ row\ that
3054\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ spans\ multiple\ lines.
3056\ \ Second\ \ \ \ row\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5.0\ Here\[aq]s\ another\ one.\ Note
3057\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ blank\ line\ between
3058\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rows.
3059\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\ \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
3061:\ Here\[aq]s\ a\ multiline\ table\ without\ headers.
3062\f[]
3063.fi
3064.PP
3065It is possible for a multiline table to have just one row, but the row
3066should be followed by a blank line (and then the row of dashes that ends
3067the table), or the table may be interpreted as a simple table.
3068.SS Extension: \f[C]grid_tables\f[]
3069.PP
3070Grid tables look like this:
3071.IP
3072.nf
3073\f[C]
3074:\ Sample\ grid\ table.
3076+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
3077|\ Fruit\ \ \ \ \ \ \ \ \ |\ Price\ \ \ \ \ \ \ \ \ |\ Advantages\ \ \ \ \ \ \ \ \ |
3078+===============+===============+====================+
3079|\ Bananas\ \ \ \ \ \ \ |\ $1.34\ \ \ \ \ \ \ \ \ |\ \-\ built\-in\ wrapper\ |
3080|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \-\ bright\ color\ \ \ \ \ |
3081+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
3082|\ Oranges\ \ \ \ \ \ \ |\ $2.10\ \ \ \ \ \ \ \ \ |\ \-\ cures\ scurvy\ \ \ \ \ |
3083|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |\ \-\ tasty\ \ \ \ \ \ \ \ \ \ \ \ |
3084+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
3085\f[]
3086.fi
3087.PP
3088The row of \f[C]=\f[]s separates the header from the table body, and can
3089be omitted for a headerless table.
3090The cells of grid tables may contain arbitrary block elements (multiple
3091paragraphs, code blocks, lists, etc.).
3092Cells that span multiple columns or rows are not supported.
3093Grid tables can be created easily using Emacs table mode.
3094.PP
3095Alignments can be specified as with pipe tables, by putting colons at
3096the boundaries of the separator line after the header:
3097.IP
3098.nf
3099\f[C]
3100+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
3101|\ Right\ \ \ \ \ \ \ \ \ |\ Left\ \ \ \ \ \ \ \ \ \ |\ Centered\ \ \ \ \ \ \ \ \ \ \ |
3102+==============:+:==============+:==================:+
3103|\ Bananas\ \ \ \ \ \ \ |\ $1.34\ \ \ \ \ \ \ \ \ |\ built\-in\ wrapper\ \ \ |
3104+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
3105\f[]
3106.fi
3107.PP
3108For headerless tables, the colons go on the top line instead:
3109.IP
3110.nf
3111\f[C]
3112+\-\-\-\-\-\-\-\-\-\-\-\-\-\-:+:\-\-\-\-\-\-\-\-\-\-\-\-\-\-+:\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-:+
3113|\ Right\ \ \ \ \ \ \ \ \ |\ Left\ \ \ \ \ \ \ \ \ \ |\ Centered\ \ \ \ \ \ \ \ \ \ \ |
3114+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
3115\f[]
3116.fi
3117.SS Grid Table Limitations
3118.PP
3119Pandoc does not support grid tables with row spans or column spans.
3120This means that neither variable numbers of columns across rows nor
3121variable numbers of rows across columns are supported by Pandoc.
3122All grid tables must have the same number of columns in each row, and
3123the same number of rows in each column.
3124For example, the Docutils sample grid tables will not render as expected
3125with Pandoc.
3126.SS Extension: \f[C]pipe_tables\f[]
3127.PP
3128Pipe tables look like this:
3129.IP
3130.nf
3131\f[C]
3132|\ Right\ |\ Left\ |\ Default\ |\ Center\ |
3133|\-\-\-\-\-\-:|:\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|:\-\-\-\-\-\-:|
3134|\ \ \ 12\ \ |\ \ 12\ \ |\ \ \ \ 12\ \ \ |\ \ \ \ 12\ \ |
3135|\ \ 123\ \ |\ \ 123\ |\ \ \ 123\ \ \ |\ \ \ 123\ \ |
3136|\ \ \ \ 1\ \ |\ \ \ \ 1\ |\ \ \ \ \ 1\ \ \ |\ \ \ \ \ 1\ \ |
3138\ \ :\ Demonstration\ of\ pipe\ table\ syntax.
3139\f[]
3140.fi
3141.PP
3142The syntax is identical to PHP Markdown Extra tables.
3143The beginning and ending pipe characters are optional, but pipes are
3144required between all columns.
3145The colons indicate column alignment as shown.
3146The header cannot be omitted.
3147To simulate a headerless table, include a header with blank cells.
3148.PP
3149Since the pipes indicate column boundaries, columns need not be
3150vertically aligned, as they are in the above example.
3151So, this is a perfectly legal (though ugly) pipe table:
3152.IP
3153.nf
3154\f[C]
3155fruit|\ price
3156\-\-\-\-\-|\-\-\-\-\-:
3157apple|2.05
3158pear|1.37
3159orange|3.09
3160\f[]
3161.fi
3162.PP
3163The cells of pipe tables cannot contain block elements like paragraphs
3164and lists, and cannot span multiple lines.
3165If a pipe table contains a row whose printable content is wider than the
3166column width (see \f[C]\-\-columns\f[]), then the cell contents will
3167wrap, with the relative cell widths determined by the widths of the
3168separator lines.
3169.PP
3170Note: pandoc also recognizes pipe tables of the following form, as can
3171be produced by Emacs' orgtbl\-mode:
3172.IP
3173.nf
3174\f[C]
3175|\ One\ |\ Two\ \ \ |
3176|\-\-\-\-\-+\-\-\-\-\-\-\-|
3177|\ my\ \ |\ table\ |
3178|\ is\ \ |\ nice\ \ |
3179\f[]
3180.fi
3181.PP
3182The difference is that \f[C]+\f[] is used instead of \f[C]|\f[].
3183Other orgtbl features are not supported.
3184In particular, to get non\-default column alignment, you'll need to add
3185colons as above.
3186.SS Metadata blocks
3187.SS Extension: \f[C]pandoc_title_block\f[]
3188.PP
3189If the file begins with a title block
3190.IP
3191.nf
3192\f[C]
3193%\ title
3194%\ author(s)\ (separated\ by\ semicolons)
3195%\ date
3196\f[]
3197.fi
3198.PP
3199it will be parsed as bibliographic information, not regular text.
3200(It will be used, for example, in the title of standalone LaTeX or HTML
3201output.) The block may contain just a title, a title and an author, or
3202all three elements.
3203If you want to include an author but no title, or a title and a date but
3204no author, you need a blank line:
3205.IP
3206.nf
3207\f[C]
3209%\ Author
3211%\ My\ title
3213%\ June\ 15,\ 2006
3214\f[]
3215.fi
3216.PP
3217The title may occupy multiple lines, but continuation lines must begin
3218with leading space, thus:
3219.IP
3220.nf
3221\f[C]
3222%\ My\ title
3223\ \ on\ multiple\ lines
3224\f[]
3225.fi
3226.PP
3227If a document has multiple authors, the authors may be put on separate
3228lines with leading space, or separated by semicolons, or both.
3229So, all of the following are equivalent:
3230.IP
3231.nf
3232\f[C]
3233%\ Author\ One
3234\ \ Author\ Two
3236%\ Author\ One;\ Author\ Two
3238%\ Author\ One;
3239\ \ Author\ Two
3240\f[]
3241.fi
3242.PP
3243The date must fit on one line.
3244.PP
3245All three metadata fields may contain standard inline formatting
3246(italics, links, footnotes, etc.).
3247.PP
3248Title blocks will always be parsed, but they will affect the output only
3249when the \f[C]\-\-standalone\f[] (\f[C]\-s\f[]) option is chosen.
3250In HTML output, titles will appear twice: once in the document head
3251\[en] this is the title that will appear at the top of the window in a
3252browser \[en] and once at the beginning of the document body.
3253The title in the document head can have an optional prefix attached
3254(\f[C]\-\-title\-prefix\f[] or \f[C]\-T\f[] option).
3255The title in the body appears as an H1 element with class
3256\[lq]title\[rq], so it can be suppressed or reformatted with CSS.
3257If a title prefix is specified with \f[C]\-T\f[] and no title block
3258appears in the document, the title prefix will be used by itself as the
3259HTML title.
3260.PP
3261The man page writer extracts a title, man page section number, and other
3262header and footer information from the title line.
3263The title is assumed to be the first word on the title line, which may
3264optionally end with a (single\-digit) section number in parentheses.
3265(There should be no space between the title and the parentheses.)
3266Anything after this is assumed to be additional footer and header text.
3267A single pipe character (\f[C]|\f[]) should be used to separate the
3268footer text from the header text.
3269Thus,
3270.IP
3271.nf
3272\f[C]
3273%\ PANDOC(1)
3274\f[]
3275.fi
3276.PP
3277will yield a man page with the title \f[C]PANDOC\f[] and section 1.
3278.IP
3279.nf
3280\f[C]
3281%\ PANDOC(1)\ Pandoc\ User\ Manuals
3282\f[]
3283.fi
3284.PP
3285will also have \[lq]Pandoc User Manuals\[rq] in the footer.
3286.IP
3287.nf
3288\f[C]
3289%\ PANDOC(1)\ Pandoc\ User\ Manuals\ |\ Version\ 4.0
3290\f[]
3291.fi
3292.PP
3293will also have \[lq]Version 4.0\[rq] in the header.
3294.SS Extension: \f[C]yaml_metadata_block\f[]
3295.PP
3296A YAML metadata block is a valid YAML object, delimited by a line of
3297three hyphens (\f[C]\-\-\-\f[]) at the top and a line of three hyphens
3298(\f[C]\-\-\-\f[]) or three dots (\f[C]\&...\f[]) at the bottom.
3299A YAML metadata block may occur anywhere in the document, but if it is
3300not at the beginning, it must be preceded by a blank line.
3301(Note that, because of the way pandoc concatenates input files when
3302several are provided, you may also keep the metadata in a separate YAML
3303file and pass it to pandoc as an argument, along with your Markdown
3304files:
3305.IP
3306.nf
3307\f[C]
3308pandoc\ chap1.md\ chap2.md\ chap3.md\ metadata.yaml\ \-s\ \-o\ book.html
3309\f[]
3310.fi
3311.PP
3312Just be sure that the YAML file begins with \f[C]\-\-\-\f[] and ends
3313with \f[C]\-\-\-\f[] or \f[C]\&...\f[].)
3314.PP
3315Metadata will be taken from the fields of the YAML object and added to
3316any existing document metadata.
3317Metadata can contain lists and objects (nested arbitrarily), but all
3318string scalars will be interpreted as Markdown.
3319Fields with names ending in an underscore will be ignored by pandoc.
3320(They may be given a role by external processors.)
3321.PP
3322A document may contain multiple metadata blocks.
3323The metadata fields will be combined through a \f[I]left\-biased
3324union\f[]: if two metadata blocks attempt to set the same field, the
3325value from the first block will be taken.
3326.PP
3327When pandoc is used with \f[C]\-t\ markdown\f[] to create a Markdown
3328document, a YAML metadata block will be produced only if the
3329\f[C]\-s/\-\-standalone\f[] option is used.
3330All of the metadata will appear in a single block at the beginning of
3331the document.
3332.PP
3333Note that YAML escaping rules must be followed.
3334Thus, for example, if a title contains a colon, it must be quoted.
3335The pipe character (\f[C]|\f[]) can be used to begin an indented block
3336that will be interpreted literally, without need for escaping.
3337This form is necessary when the field contains blank lines or
3338block\-level formatting:
3339.IP
3340.nf
3341\f[C]
3342\-\-\-
3343title:\ \ \[aq]This\ is\ the\ title:\ it\ contains\ a\ colon\[aq]
3344author:
3345\-\ Author\ One
3346\-\ Author\ Two
3347tags:\ [nothing,\ nothingness]
3348abstract:\ |
3349\ \ This\ is\ the\ abstract.
3351\ \ It\ consists\ of\ two\ paragraphs.
3352\&...
3353\f[]
3354.fi
3355.PP
3356Template variables will be set automatically from the metadata.
3357Thus, for example, in writing HTML, the variable \f[C]abstract\f[] will
3358be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[]
3359field:
3360.IP
3361.nf
3362\f[C]
3363<p>This\ is\ the\ abstract.</p>
3364<p>It\ consists\ of\ two\ paragraphs.</p>
3365\f[]
3366.fi
3367.PP
3368Variables can contain arbitrary YAML structures, but the template must
3369match this structure.
3370The \f[C]author\f[] variable in the default templates expects a simple
3371list or string, but can be changed to support more complicated
3372structures.
3373The following combination, for example, would add an affiliation to the
3374author if one is given:
3375.IP
3376.nf
3377\f[C]
3378\-\-\-
3379title:\ The\ document\ title
3380author:
3381\-\ name:\ Author\ One
3382\ \ affiliation:\ University\ of\ Somewhere
3383\-\ name:\ Author\ Two
3384\ \ affiliation:\ University\ of\ Nowhere
3385\&...
3386\f[]
3387.fi
3388.PP
3389To use the structured authors in the example above, you would need a
3390custom template:
3391.IP
3392.nf
3393\f[C]
3394$for(author)$
3395$if(author.name)$
3396$author.name$$if(author.affiliation)$\ ($author.affiliation$)$endif$
3397$else$
3398$author$
3399$endif$
3400$endfor$
3401\f[]
3402.fi
3403.SS Backslash escapes
3404.SS Extension: \f[C]all_symbols_escapable\f[]
3405.PP
3406Except inside a code block or inline code, any punctuation or space
3407character preceded by a backslash will be treated literally, even if it
3408would normally indicate formatting.
3409Thus, for example, if one writes
3410.IP
3411.nf
3412\f[C]
3413*\\*hello\\**
3414\f[]
3415.fi
3416.PP
3417one will get
3418.IP
3419.nf
3420\f[C]
3421<em>*hello*</em>
3422\f[]
3423.fi
3424.PP
3425instead of
3426.IP
3427.nf
3428\f[C]
3429<strong>hello</strong>
3430\f[]
3431.fi
3432.PP
3433This rule is easier to remember than standard Markdown's rule, which
3434allows only the following characters to be backslash\-escaped:
3435.IP
3436.nf
3437\f[C]
3438\\`*_{}[]()>#+\-.!
3439\f[]
3440.fi
3441.PP
3442(However, if the \f[C]markdown_strict\f[] format is used, the standard
3443Markdown rule will be used.)
3444.PP
3445A backslash\-escaped space is parsed as a nonbreaking space.
3446It will appear in TeX output as \f[C]~\f[] and in HTML and XML as
3447\f[C]\\&#160;\f[] or \f[C]\\&nbsp;\f[].
3448.PP
3449A backslash\-escaped newline (i.e.\ a backslash occurring at the end of
3450a line) is parsed as a hard line break.
3451It will appear in TeX output as \f[C]\\\\\f[] and in HTML as
3452\f[C]<br\ />\f[].
3453This is a nice alternative to Markdown's \[lq]invisible\[rq] way of
3454indicating hard line breaks using two trailing spaces on a line.
3455.PP
3456Backslash escapes do not work in verbatim contexts.
3457.SS Inline formatting
3458.SS Emphasis
3459.PP
3460To \f[I]emphasize\f[] some text, surround it with \f[C]*\f[]s or
3461\f[C]_\f[], like this:
3462.IP
3463.nf
3464\f[C]
3465This\ text\ is\ _emphasized\ with\ underscores_,\ and\ this
3466is\ *emphasized\ with\ asterisks*.
3467\f[]
3468.fi
3469.PP
3470Double \f[C]*\f[] or \f[C]_\f[] produces \f[B]strong emphasis\f[]:
3471.IP
3472.nf
3473\f[C]
3474This\ is\ **strong\ emphasis**\ and\ __with\ underscores__.
3475\f[]
3476.fi
3477.PP
3478A \f[C]*\f[] or \f[C]_\f[] character surrounded by spaces, or
3479backslash\-escaped, will not trigger emphasis:
3480.IP
3481.nf
3482\f[C]
3483This\ is\ *\ not\ emphasized\ *,\ and\ \\*neither\ is\ this\\*.
3484\f[]
3485.fi
3486.SS Extension: \f[C]intraword_underscores\f[]
3487.PP
3488Because \f[C]_\f[] is sometimes used inside words and identifiers,
3489pandoc does not interpret a \f[C]_\f[] surrounded by alphanumeric
3490characters as an emphasis marker.
3491If you want to emphasize just part of a word, use \f[C]*\f[]:
3492.IP
3493.nf
3494\f[C]
3495feas*ible*,\ not\ feas*able*.
3496\f[]
3497.fi
3498.SS Strikeout
3499.SS Extension: \f[C]strikeout\f[]
3500.PP
3501To strikeout a section of text with a horizontal line, begin and end it
3502with \f[C]~~\f[].
3503Thus, for example,
3504.IP
3505.nf
3506\f[C]
3507This\ ~~is\ deleted\ text.~~
3508\f[]
3509.fi
3510.SS Superscripts and subscripts
3511.SS Extension: \f[C]superscript\f[], \f[C]subscript\f[]
3512.PP
3513Superscripts may be written by surrounding the superscripted text by
3514\f[C]^\f[] characters; subscripts may be written by surrounding the
3515subscripted text by \f[C]~\f[] characters.
3516Thus, for example,
3517.IP
3518.nf
3519\f[C]
3520H~2~O\ is\ a\ liquid.\ \ 2^10^\ is\ 1024.
3521\f[]
3522.fi
3523.PP
3524If the superscripted or subscripted text contains spaces, these spaces
3525must be escaped with backslashes.
3526(This is to prevent accidental superscripting and subscripting through
3527the ordinary use of \f[C]~\f[] and \f[C]^\f[].) Thus, if you want the
3528letter P with `a cat' in subscripts, use \f[C]P~a\\\ cat~\f[], not
3529\f[C]P~a\ cat~\f[].
3530.SS Verbatim
3531.PP
3532To make a short span of text verbatim, put it inside backticks:
3533.IP
3534.nf
3535\f[C]
3536What\ is\ the\ difference\ between\ `>>=`\ and\ `>>`?
3537\f[]
3538.fi
3539.PP
3540If the verbatim text includes a backtick, use double backticks:
3541.IP
3542.nf
3543\f[C]
3544Here\ is\ a\ literal\ backtick\ ``\ `\ ``.
3545\f[]
3546.fi
3547.PP
3548(The spaces after the opening backticks and before the closing backticks
3549will be ignored.)
3550.PP
3551The general rule is that a verbatim span starts with a string of
3552consecutive backticks (optionally followed by a space) and ends with a
3553string of the same number of backticks (optionally preceded by a space).
3554.PP
3555Note that backslash\-escapes (and other Markdown constructs) do not work
3556in verbatim contexts:
3557.IP
3558.nf
3559\f[C]
3560This\ is\ a\ backslash\ followed\ by\ an\ asterisk:\ `\\*`.
3561\f[]
3562.fi
3563.SS Extension: \f[C]inline_code_attributes\f[]
3564.PP
3565Attributes can be attached to verbatim text, just as with fenced code
3566blocks:
3567.IP
3568.nf
3569\f[C]
3570`<$>`{.haskell}
3571\f[]
3572.fi
3573.SS Small caps
3574.PP
3575To write small caps, use the \f[C]smallcaps\f[] class:
3576.IP
3577.nf
3578\f[C]
3579[Small\ caps]{.smallcaps}
3580\f[]
3581.fi
3582.PP
3583Or, without the \f[C]bracketed_spans\f[] extension:
3584.IP
3585.nf
3586\f[C]
3587<span\ class="smallcaps">Small\ caps</span>
3588\f[]
3589.fi
3590.PP
3591For compatibility with other Markdown flavors, CSS is also supported:
3592.IP
3593.nf
3594\f[C]
3595<span\ style="font\-variant:small\-caps;">Small\ caps</span>
3596\f[]
3597.fi
3598.PP
3599This will work in all output formats that support small caps.
3600.SS Math
3601.SS Extension: \f[C]tex_math_dollars\f[]
3602.PP
3603Anything between two \f[C]$\f[] characters will be treated as TeX math.
3604The opening \f[C]$\f[] must have a non\-space character immediately to
3605its right, while the closing \f[C]$\f[] must have a non\-space character
3606immediately to its left, and must not be followed immediately by a
3607digit.
3608Thus, \f[C]$20,000\ and\ $30,000\f[] won't parse as math.
3609If for some reason you need to enclose text in literal \f[C]$\f[]
3610characters, backslash\-escape them and they won't be treated as math
3611delimiters.
3612.PP
3613TeX math will be printed in all output formats.
3614How it is rendered depends on the output format:
3615.TP
3616.B Markdown, LaTeX, Emacs Org mode, ConTeXt, ZimWiki
3617It will appear verbatim between \f[C]$\f[] characters.
3618.RS
3619.RE
3620.TP
3621.B reStructuredText
3622It will be rendered using an interpreted text role \f[C]:math:\f[].
3623.RS
3624.RE
3625.TP
3626.B AsciiDoc
3627It will be rendered as \f[C]latexmath:[...]\f[].
3628.RS
3629.RE
3630.TP
3631.B Texinfo
3632It will be rendered inside a \f[C]\@math\f[] command.
3633.RS
3634.RE
3635.TP
3636.B groff man
3637It will be rendered verbatim without \f[C]$\f[]'s.
3638.RS
3639.RE
3640.TP
3641.B MediaWiki, DokuWiki
3642It will be rendered inside \f[C]<math>\f[] tags.
3643.RS
3644.RE
3645.TP
3646.B Textile
3647It will be rendered inside \f[C]<span\ class="math">\f[] tags.
3648.RS
3649.RE
3650.TP
3651.B RTF, OpenDocument
3652It will be rendered, if possible, using Unicode characters, and will
3653otherwise appear verbatim.
3654.RS
3655.RE
3656.TP
3657.B ODT
3658It will be rendered, if possible, using MathML.
3659.RS
3660.RE
3661.TP
3662.B DocBook
3663If the \f[C]\-\-mathml\f[] flag is used, it will be rendered using
3664MathML in an \f[C]inlineequation\f[] or \f[C]informalequation\f[] tag.
3665Otherwise it will be rendered, if possible, using Unicode characters.
3666.RS
3667.RE
3668.TP
3669.B Docx
3670It will be rendered using OMML math markup.
3671.RS
3672.RE
3673.TP
3674.B FictionBook2
3675If the \f[C]\-\-webtex\f[] option is used, formulas are rendered as
3676images using CodeCogs or other compatible web service, downloaded and
3677embedded in the e\-book.
3678Otherwise, they will appear verbatim.
3679.RS
3680.RE
3681.TP
3682.B HTML, Slidy, DZSlides, S5, EPUB
3683The way math is rendered in HTML will depend on the command\-line
3684options selected:
3685.RS
3686.IP "1." 3
3687The default is to render TeX math as far as possible using Unicode
3688characters, as with RTF, DocBook, and OpenDocument output.
3689Formulas are put inside a \f[C]span\f[] with \f[C]class="math"\f[], so
3690that they may be styled differently from the surrounding text if needed.
3691.IP "2." 3
3692If the \f[C]\-\-latexmathml\f[] option is used, TeX math will be
3693displayed between \f[C]$\f[] or \f[C]$$\f[] characters and put in
3694\f[C]<span>\f[] tags with class \f[C]LaTeX\f[].
3695The LaTeXMathML script will be used to render it as formulas.
3696(This trick does not work in all browsers, but it works in Firefox.
3697In browsers that do not support LaTeXMathML, TeX math will appear
3698verbatim between \f[C]$\f[] characters.)
3699.IP "3." 3
3700If the \f[C]\-\-jsmath\f[] option is used, TeX math will be put inside
3701\f[C]<span>\f[] tags (for inline math) or \f[C]<div>\f[] tags (for
3702display math) with class \f[C]math\f[].
3703The jsMath script will be used to render it.
3704.IP "4." 3
3705If the \f[C]\-\-mimetex\f[] option is used, the mimeTeX CGI script will
3706be called to generate images for each TeX formula.
3707This should work in all browsers.
3708The \f[C]\-\-mimetex\f[] option takes an optional URL as argument.
3709If no URL is specified, it will be assumed that the mimeTeX CGI script
3710is at \f[C]/cgi\-bin/mimetex.cgi\f[].
3711.IP "5." 3
3712If the \f[C]\-\-gladtex\f[] option is used, TeX formulas will be
3713enclosed in \f[C]<eq>\f[] tags in the HTML output.
3714The resulting \f[C]htex\f[] file may then be processed by gladTeX, which
3715will produce image files for each formula and an HTML file with links to
3716these images.
3717So, the procedure is:
3718.RS 4
3719.IP
3720.nf
3721\f[C]
3722pandoc\ \-s\ \-\-gladtex\ myfile.txt\ \-o\ myfile.htex
3723gladtex\ \-d\ myfile\-images\ myfile.htex
3724#\ produces\ myfile.html\ and\ images\ in\ myfile\-images
3725\f[]
3726.fi
3727.RE
3728.IP "6." 3
3729If the \f[C]\-\-webtex\f[] option is used, TeX formulas will be
3730converted to \f[C]<img>\f[] tags that link to an external script that
3731converts formulas to images.
3732The formula will be URL\-encoded and concatenated with the URL provided.
3733For SVG images you can for example use
3734\f[C]\-\-webtex\ https://latex.codecogs.com/svg.latex?\f[].
3735If no URL is specified, the CodeCogs URL generating PNGs will be used
3736(\f[C]https://latex.codecogs.com/png.latex?\f[]).
3737.IP "7." 3
3738If the \f[C]\-\-mathjax\f[] option is used, TeX math will be displayed
3739between \f[C]\\(...\\)\f[] (for inline math) or \f[C]\\[...\\]\f[] (for
3740display math) and put in \f[C]<span>\f[] tags with class \f[C]math\f[].
3741The MathJax script will be used to render it as formulas.
3742.RE
3743.SS Raw HTML
3744.SS Extension: \f[C]raw_html\f[]
3745.PP
3746Markdown allows you to insert raw HTML (or DocBook) anywhere in a
3747document (except verbatim contexts, where \f[C]<\f[], \f[C]>\f[], and
3748\f[C]&\f[] are interpreted literally).
3749(Technically this is not an extension, since standard Markdown allows
3750it, but it has been made an extension so that it can be disabled if
3751desired.)
3752.PP
3753The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
3754DZSlides, EPUB, Markdown, Emacs Org mode, and Textile output, and
3755suppressed in other formats.
3756.SS Extension: \f[C]markdown_in_html_blocks\f[]
3757.PP
3758Standard Markdown allows you to include HTML \[lq]blocks\[rq]: blocks of
3759HTML between balanced tags that are separated from the surrounding text
3760with blank lines, and start and end at the left margin.
3761Within these blocks, everything is interpreted as HTML, not Markdown; so
3762(for example), \f[C]*\f[] does not signify emphasis.
3763.PP
3764Pandoc behaves this way when the \f[C]markdown_strict\f[] format is
3765used; but by default, pandoc interprets material between HTML block tags
3766as Markdown.
3767Thus, for example, pandoc will turn
3768.IP
3769.nf
3770\f[C]
3771<table>
3772<tr>
3773<td>*one*</td>
3774<td>[a\ link](http://google.com)</td>
3775</tr>
3776</table>
3777\f[]
3778.fi
3779.PP
3780into
3781.IP
3782.nf
3783\f[C]
3784<table>
3785<tr>
3786<td><em>one</em></td>
3787<td><a\ href="http://google.com">a\ link</a></td>
3788</tr>
3789</table>
3790\f[]
3791.fi
3792.PP
3793whereas \f[C]Markdown.pl\f[] will preserve it as is.
3794.PP
3795There is one exception to this rule: text between \f[C]<script>\f[] and
3796\f[C]<style>\f[] tags is not interpreted as Markdown.
3797.PP
3798This departure from standard Markdown should make it easier to mix
3799Markdown with HTML block elements.
3800For example, one can surround a block of Markdown text with
3801\f[C]<div>\f[] tags without preventing it from being interpreted as
3802Markdown.
3803.SS Extension: \f[C]native_divs\f[]
3804.PP
3805Use native pandoc \f[C]Div\f[] blocks for content inside \f[C]<div>\f[]
3806tags.
3807For the most part this should give the same output as
3808\f[C]markdown_in_html_blocks\f[], but it makes it easier to write pandoc
3809filters to manipulate groups of blocks.
3810.SS Extension: \f[C]native_spans\f[]
3811.PP
3812Use native pandoc \f[C]Span\f[] blocks for content inside
3813\f[C]<span>\f[] tags.
3814For the most part this should give the same output as \f[C]raw_html\f[],
3815but it makes it easier to write pandoc filters to manipulate groups of
3816inlines.
3817.SS Extension: \f[C]fenced_divs\f[]
3818.PP
3819Allow special fenced syntax for native \f[C]Div\f[] blocks.
3820A Div starts with a fence containing at least three consecutive colons
3821plus some attributes.
3822The attributes may optionally be followed by another string of
3823consecutive colons.
3824The attribute syntax is exactly as in fenced code blocks (see Extension:
3825\f[C]fenced_code_attributes\f[]).
3826As with fenced code blocks, one can use either attributes in curly
3827braces or a single unbraced word, which will be treated as a class name.
3828The Div ends with another line containing a string of at least three
3829consecutive colons.
3830The fenced Div should be separated by blank lines from preceding and
3831following blocks.
3832.PP
3833Example:
3834.IP
3835.nf
3836\f[C]
3837:::::\ {#special\ .sidebar}
3838Here\ is\ a\ paragraph.
3840And\ another.
3841:::::
3842\f[]
3843.fi
3844.PP
3845Fenced divs can be nested.
3846Opening fences are distinguished because they \f[I]must\f[] have
3847attributes:
3848.IP
3849.nf
3850\f[C]
3851:::\ Warning\ ::::::
3852This\ is\ a\ warning.
3854:::\ Danger
3855This\ is\ a\ warning\ within\ a\ warning.
3856:::
3857::::::::::::::::::
3858\f[]
3859.fi
3860.SS Extension: \f[C]raw_tex\f[]
3861.PP
3862In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
3863included in a document.
3864Inline TeX commands will be preserved and passed unchanged to the LaTeX
3865and ConTeXt writers.
3866Thus, for example, you can use LaTeX to include BibTeX citations:
3867.IP
3868.nf
3869\f[C]
3870This\ result\ was\ proved\ in\ \\cite{jones.1967}.
3871\f[]
3872.fi
3873.PP
3874Note that in LaTeX environments, like
3875.IP
3876.nf
3877\f[C]
3878\\begin{tabular}{|l|l|}\\hline
3879Age\ &\ Frequency\ \\\\\ \\hline
388018\-\-25\ \ &\ 15\ \\\\
388126\-\-35\ \ &\ 33\ \\\\
388236\-\-45\ \ &\ 22\ \\\\\ \\hline
3883\\end{tabular}
3884\f[]
3885.fi
3886.PP
3887the material between the begin and end tags will be interpreted as raw
3888LaTeX, not as Markdown.
3889.PP
3890Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
3891Emacs Org mode, and ConTeXt.
3892.SS Generic raw attribute
3893.SS Extension: \f[C]raw_attribute\f[]
3894.PP
3895Inline spans and fenced code blocks with a special kind of attribute
3896will be parsed as raw content with the designated format.
3897For example, the following produces a raw groff \f[C]ms\f[] block:
3898.IP
3899.nf
3900\f[C]
3901```{=ms}
3902\&.MYMACRO
3903blah\ blah
3904```
3905\f[]
3906.fi
3907.PP
3908And the following produces a raw \f[C]html\f[] inline element:
3909.IP
3910.nf
3911\f[C]
3912This\ is\ `<a>html</a>`{=html}
3913\f[]
3914.fi
3915.PP
3916The format name should match the target format name (see
3917\f[C]\-t/\-\-to\f[], above, for a list, or use
3918\f[C]pandoc\ \-\-list\-output\-formats\f[]).
3919.PP
3920This extension presupposes that the relevant kind of inline code or
3921fenced code block is enabled.
3922Thus, for example, to use a raw attribute with a backtick code block,
3923\f[C]backtick_code_blocks\f[] must be enabled.
3924.PP
3925The raw attribute cannot be combined with regular attributes.
3926.SS LaTeX macros
3927.SS Extension: \f[C]latex_macros\f[]
3928.PP
3929For output formats other than LaTeX, pandoc will parse LaTeX
3930\f[C]\\newcommand\f[] and \f[C]\\renewcommand\f[] definitions and apply
3931the resulting macros to all LaTeX math.
3932So, for example, the following will work in all output formats, not just
3933LaTeX:
3934.IP
3935.nf
3936\f[C]
3937\\newcommand{\\tuple}[1]{\\langle\ #1\ \\rangle}
3939$\\tuple{a,\ b,\ c}$
3940\f[]
3941.fi
3942.PP
3943In LaTeX output, the \f[C]\\newcommand\f[] definition will simply be
3944passed unchanged to the output.
3945.SS Links
3946.PP
3947Markdown allows links to be specified in several ways.
3948.SS Automatic links
3949.PP
3950If you enclose a URL or email address in pointy brackets, it will become
3951a link:
3952.IP
3953.nf
3954\f[C]
3955<http://google.com>
3956<sam\@green.eggs.ham>
3957\f[]
3958.fi
3959.SS Inline links
3960.PP
3961An inline link consists of the link text in square brackets, followed by
3962the URL in parentheses.
3963(Optionally, the URL can be followed by a link title, in quotes.)
3964.IP
3965.nf
3966\f[C]
3967This\ is\ an\ [inline\ link](/url),\ and\ here\[aq]s\ [one\ with
3968a\ title](http://fsf.org\ "click\ here\ for\ a\ good\ time!").
3969\f[]
3970.fi
3971.PP
3972There can be no space between the bracketed part and the parenthesized
3973part.
3974The link text can contain formatting (such as emphasis), but the title
3975cannot.
3976.PP
3977Email addresses in inline links are not autodetected, so they have to be
3978prefixed with \f[C]mailto\f[]:
3979.IP
3980.nf
3981\f[C]
3982[Write\ me!](mailto:sam\@green.eggs.ham)
3983\f[]
3984.fi
3985.SS Reference links
3986.PP
3987An \f[I]explicit\f[] reference link has two parts, the link itself and
3988the link definition, which may occur elsewhere in the document (either
3989before or after the link).
3990.PP
3991The link consists of link text in square brackets, followed by a label
3992in square brackets.
3993(There cannot be space between the two unless the
3994\f[C]spaced_reference_links\f[] extension is enabled.) The link
3995definition consists of the bracketed label, followed by a colon and a
3996space, followed by the URL, and optionally (after a space) a link title
3997either in quotes or in parentheses.
3998The label must not be parseable as a citation (assuming the
3999\f[C]citations\f[] extension is enabled): citations take precedence over
4000link labels.
4001.PP
4002Here are some examples:
4003.IP
4004.nf
4005\f[C]
4006[my\ label\ 1]:\ /foo/bar.html\ \ "My\ title,\ optional"
4007[my\ label\ 2]:\ /foo
4008[my\ label\ 3]:\ http://fsf.org\ (The\ free\ software\ foundation)
4009[my\ label\ 4]:\ /bar#special\ \ \[aq]A\ title\ in\ single\ quotes\[aq]
4010\f[]
4011.fi
4012.PP
4013The URL may optionally be surrounded by angle brackets:
4014.IP
4015.nf
4016\f[C]
4017[my\ label\ 5]:\ <http://foo.bar.baz>
4018\f[]
4019.fi
4020.PP
4021The title may go on the next line:
4022.IP
4023.nf
4024\f[C]
4025[my\ label\ 3]:\ http://fsf.org
4026\ \ "The\ free\ software\ foundation"
4027\f[]
4028.fi
4029.PP
4030Note that link labels are not case sensitive.
4031So, this will work:
4032.IP
4033.nf
4034\f[C]
4035Here\ is\ [my\ link][FOO]
4037[Foo]:\ /bar/baz
4038\f[]
4039.fi
4040.PP
4041In an \f[I]implicit\f[] reference link, the second pair of brackets is
4042empty:
4043.IP
4044.nf
4045\f[C]
4046See\ [my\ website][].
4048[my\ website]:\ http://foo.bar.baz
4049\f[]
4050.fi
4051.PP
4052Note: In \f[C]Markdown.pl\f[] and most other Markdown implementations,
4053reference link definitions cannot occur in nested constructions such as
4054list items or block quotes.
4055Pandoc lifts this arbitrary seeming restriction.
4056So the following is fine in pandoc, though not in most other
4057implementations:
4058.IP
4059.nf
4060\f[C]
4061>\ My\ block\ [quote].
4063>\ [quote]:\ /foo
4064\f[]
4065.fi
4066.SS Extension: \f[C]shortcut_reference_links\f[]
4067.PP
4068In a \f[I]shortcut\f[] reference link, the second pair of brackets may
4069be omitted entirely:
4070.IP
4071.nf
4072\f[C]
4073See\ [my\ website].
4075[my\ website]:\ http://foo.bar.baz
4076\f[]
4077.fi
4078.SS Internal links
4079.PP
4080To link to another section of the same document, use the automatically
4081generated identifier (see Header identifiers).
4082For example:
4083.IP
4084.nf
4085\f[C]
4086See\ the\ [Introduction](#introduction).
4087\f[]
4088.fi
4089.PP
4091.IP
4092.nf
4093\f[C]
4094See\ the\ [Introduction].
4096[Introduction]:\ #introduction
4097\f[]
4098.fi
4099.PP
4100Internal links are currently supported for HTML formats (including HTML
4101slide shows and EPUB), LaTeX, and ConTeXt.
4102.SS Images
4103.PP
4104A link immediately preceded by a \f[C]!\f[] will be treated as an image.
4105The link text will be used as the image's alt text:
4106.IP
4107.nf
4108\f[C]
4109![la\ lune](lalune.jpg\ "Voyage\ to\ the\ moon")
4111![movie\ reel]
4113[movie\ reel]:\ movie.gif
4114\f[]
4115.fi
4116.SS Extension: \f[C]implicit_figures\f[]
4117.PP
4118An image with nonempty alt text, occurring by itself in a paragraph,
4119will be rendered as a figure with a caption.
4120The image's alt text will be used as the caption.
4121.IP
4122.nf
4123\f[C]
4124![This\ is\ the\ caption](/url/of/image.png)
4125\f[]
4126.fi
4127.PP
4128How this is rendered depends on the output format.
4129Some output formats (e.g.\ RTF) do not yet support figures.
4130In those formats, you'll just get an image in a paragraph by itself,
4131with no caption.
4132.PP
4133If you just want a regular inline image, just make sure it is not the
4134only thing in the paragraph.
4135One way to do this is to insert a nonbreaking space after the image:
4136.IP
4137.nf
4138\f[C]
4139![This\ image\ won\[aq]t\ be\ a\ figure](/url/of/image.png)\\\
4140\f[]
4141.fi
4142.PP
4143Note that in reveal.js slide shows, an image in a paragraph by itself
4144that has the \f[C]stretch\f[] class will fill the screen, and the
4145caption and figure tags will be omitted.
4146.SS Extension: \f[C]link_attributes\f[]
4147.PP
4148Attributes can be set on links and images:
4149.IP
4150.nf
4151\f[C]
4152An\ inline\ ![image](foo.jpg){#id\ .class\ width=30\ height=20px}
4153and\ a\ reference\ ![image][ref]\ with\ attributes.
4155[ref]:\ foo.jpg\ "optional\ title"\ {#id\ .class\ key=val\ key2="val\ 2"}
4156\f[]
4157.fi
4158.PP
4159(This syntax is compatible with PHP Markdown Extra when only
4160\f[C]#id\f[] and \f[C]\&.class\f[] are used.)
4161.PP
4162For HTML and EPUB, all attributes except \f[C]width\f[] and
4163\f[C]height\f[] (but including \f[C]srcset\f[] and \f[C]sizes\f[]) are
4164passed through as is.
4165The other writers ignore attributes that are not supported by their
4166output format.
4167.PP
4168The \f[C]width\f[] and \f[C]height\f[] attributes on images are treated
4169specially.
4170When used without a unit, the unit is assumed to be pixels.
4171However, any of the following unit identifiers can be used: \f[C]px\f[],
4172\f[C]cm\f[], \f[C]mm\f[], \f[C]in\f[], \f[C]inch\f[] and \f[C]%\f[].
4173There must not be any spaces between the number and the unit.
4174For example:
4175.IP
4176.nf
4177\f[C]
4178![](file.jpg){\ width=50%\ }
4179\f[]
4180.fi
4181.IP \[bu] 2
4182Dimensions are converted to inches for output in page\-based formats
4183like LaTeX.
4184Dimensions are converted to pixels for output in HTML\-like formats.
4185Use the \f[C]\-\-dpi\f[] option to specify the number of pixels per
4186inch.
4187The default is 96dpi.
4188.IP \[bu] 2
4189The \f[C]%\f[] unit is generally relative to some available space.
4190For example the above example will render to
4191\f[C]<img\ href="file.jpg"\ style="width:\ 50%;"\ />\f[] (HTML),
4192\f[C]\\includegraphics[width=0.5\\textwidth]{file.jpg}\f[] (LaTeX), or
4193\f[C]\\externalfigure[file.jpg][width=0.5\\textwidth]\f[] (ConTeXt).
4194.IP \[bu] 2
4195Some output formats have a notion of a class (ConTeXt) or a unique
4196identifier (LaTeX \f[C]\\caption\f[]), or both (HTML).
4197.IP \[bu] 2
4198When no \f[C]width\f[] or \f[C]height\f[] attributes are specified, the
4199fallback is to look at the image resolution and the dpi metadata
4200embedded in the image file.
4201.SS Spans
4202.SS Extension: \f[C]bracketed_spans\f[]
4203.PP
4204A bracketed sequence of inlines, as one would use to begin a link, will
4205be treated as a span with attributes if it is followed immediately by
4206attributes:
4207.IP
4208.nf
4209\f[C]
4210[This\ is\ *some\ text*]{.class\ key="val"}
4211\f[]
4212.fi
4213.SS Footnotes
4214.SS Extension: \f[C]footnotes\f[]
4215.PP
4216Pandoc's Markdown allows footnotes, using the following syntax:
4217.IP
4218.nf
4219\f[C]
4220Here\ is\ a\ footnote\ reference,[^1]\ and\ another.[^longnote]
4222[^1]:\ Here\ is\ the\ footnote.
4224[^longnote]:\ Here\[aq]s\ one\ with\ multiple\ blocks.
4226\ \ \ \ Subsequent\ paragraphs\ are\ indented\ to\ show\ that\ they
4227belong\ to\ the\ previous\ footnote.
4229\ \ \ \ \ \ \ \ {\ some.code\ }
4231\ \ \ \ The\ whole\ paragraph\ can\ be\ indented,\ or\ just\ the\ first
4232\ \ \ \ line.\ \ In\ this\ way,\ multi\-paragraph\ footnotes\ work\ like
4233\ \ \ \ multi\-paragraph\ list\ items.
4235This\ paragraph\ won\[aq]t\ be\ part\ of\ the\ note,\ because\ it
4236isn\[aq]t\ indented.
4237\f[]
4238.fi
4239.PP
4240The identifiers in footnote references may not contain spaces, tabs, or
4241newlines.
4242These identifiers are used only to correlate the footnote reference with
4243the note itself; in the output, footnotes will be numbered sequentially.
4244.PP
4245The footnotes themselves need not be placed at the end of the document.
4246They may appear anywhere except inside other block elements (lists,
4247block quotes, tables, etc.).
4248Each footnote should be separated from surrounding content (including
4249other footnotes) by blank lines.
4250.SS Extension: \f[C]inline_notes\f[]
4251.PP
4252Inline footnotes are also allowed (though, unlike regular notes, they
4253cannot contain multiple paragraphs).
4254The syntax is as follows:
4255.IP
4256.nf
4257\f[C]
4258Here\ is\ an\ inline\ note.^[Inlines\ notes\ are\ easier\ to\ write,\ since
4259you\ don\[aq]t\ have\ to\ pick\ an\ identifier\ and\ move\ down\ to\ type\ the
4260note.]
4261\f[]
4262.fi
4263.PP
4264Inline and regular footnotes may be mixed freely.
4265.SS Typography
4266.SS Extension: \f[C]smart\f[]
4267.PP
4268Interpret straight quotes as curly quotes, \f[C]\-\-\-\f[] as
4269em\-dashes, \f[C]\-\-\f[] as en\-dashes, and \f[C]\&...\f[] as ellipses.
4270Nonbreaking spaces are inserted after certain abbreviations, such as
4271\[lq]Mr.\[rq] This option currently affects the input formats
4272\f[C]markdown\f[], \f[C]commonmark\f[], \f[C]latex\f[],
4273\f[C]mediawiki\f[], \f[C]org\f[], \f[C]rst\f[], and \f[C]twiki\f[], and
4274the output formats \f[C]markdown\f[], \f[C]latex\f[], and
4275\f[C]context\f[].
4276.PP
4277Note: If you are \f[I]writing\f[] Markdown, then the \f[C]smart\f[]
4278extension has the reverse effect: what would have been curly quotes
4279comes out straight.
4280.PP
4281In LaTeX, \f[C]smart\f[] means to use the standard TeX ligatures for
4282quotation marks (\f[C]``\f[] and \f[C]\[aq]\[aq]\f[] for double quotes,
4283\f[C]`\f[] and \f[C]\[aq]\f[] for single quotes) and dashes
4284(\f[C]\-\-\f[] for en\-dash and \f[C]\-\-\-\f[] for em\-dash).
4285If \f[C]smart\f[] is disabled, then in reading LaTeX pandoc will parse
4286these characters literally.
4287In writing LaTeX, enabling \f[C]smart\f[] tells pandoc to use the
4288ligatures when possible; if \f[C]smart\f[] is disabled pandoc will use
4289unicode quotation mark and dash characters.
4290.SS Citations
4291.SS Extension: \f[C]citations\f[]
4292.PP
4293Using an external filter, \f[C]pandoc\-citeproc\f[], pandoc can
4294automatically generate citations and a bibliography in a number of
4295styles.
4296Basic usage is
4297.IP
4298.nf
4299\f[C]
4300pandoc\ \-\-filter\ pandoc\-citeproc\ myinput.txt
4301\f[]
4302.fi
4303.PP
4304In order to use this feature, you will need to specify a bibliography
4305file using the \f[C]bibliography\f[] metadata field in a YAML metadata
4306section, or \f[C]\-\-bibliography\f[] command line argument.
4307You can supply multiple \f[C]\-\-bibliography\f[] arguments or set
4308\f[C]bibliography\f[] metadata field to YAML array, if you want to use
4309multiple bibliography files.
4310The bibliography may have any of these formats:
4311.PP
4312.TS
4313tab(@);
4314l l.
4316Format
4317T}@T{
4318File extension
4322BibLaTeX
4323T}@T{
4324\&.bib
4327BibTeX
4328T}@T{
4329\&.bibtex
4332Copac
4333T}@T{
4334\&.copac
4337CSL JSON
4338T}@T{
4339\&.json
4342CSL YAML
4343T}@T{
4344\&.yaml
4347EndNote
4348T}@T{
4349\&.enl
4352EndNote XML
4353T}@T{
4354\&.xml
4357ISI
4358T}@T{
4359\&.wos
4362MEDLINE
4363T}@T{
4364\&.medline
4367MODS
4368T}@T{
4369\&.mods
4372RIS
4373T}@T{
4374\&.ris
4376.TE
4377.PP
4378Note that \f[C]\&.bib\f[] can be used with both BibTeX and BibLaTeX
4379files; use \f[C]\&.bibtex\f[] to force BibTeX.
4380.PP
4381Note that \f[C]pandoc\-citeproc\ \-\-bib2json\f[] and
4382\f[C]pandoc\-citeproc\ \-\-bib2yaml\f[] can produce \f[C]\&.json\f[] and
4383\f[C]\&.yaml\f[] files from any of the supported formats.
4384.PP
4385In\-field markup: In BibTeX and BibLaTeX databases, pandoc\-citeproc
4386parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown;
4387and in CSL JSON databases, an HTML\-like markup:
4388.TP
4389.B \f[C]<i>...</i>\f[]
4390italics
4391.RS
4392.RE
4393.TP
4394.B \f[C]<b>...</b>\f[]
4395bold
4396.RS
4397.RE
4398.TP
4399.B \f[C]<span\ style="font\-variant:small\-caps;">...</span>\f[] or \f[C]<sc>...</sc>\f[]
4400small capitals
4401.RS
4402.RE
4403.TP
4404.B \f[C]<sub>...</sub>\f[]
4405subscript
4406.RS
4407.RE
4408.TP
4409.B \f[C]<sup>...</sup>\f[]
4410superscript
4411.RS
4412.RE
4413.TP
4414.B \f[C]<span\ class="nocase">...</span>\f[]
4415prevent a phrase from being capitalized as title case
4416.RS
4417.RE
4418.PP
4419\f[C]pandoc\-citeproc\ \-j\f[] and \f[C]\-y\f[] interconvert the CSL
4420JSON and CSL YAML formats as far as possible.
4421.PP
4422As an alternative to specifying a bibliography file using
4423\f[C]\-\-bibliography\f[] or the YAML metadata field
4424\f[C]bibliography\f[], you can include the citation data directly in the
4425\f[C]references\f[] field of the document's YAML metadata.
4426The field should contain an array of YAML\-encoded references, for
4427example:
4428.IP
4429.nf
4430\f[C]
4431\-\-\-
4432references:
4433\-\ type:\ article\-journal
4434\ \ id:\ WatsonCrick1953
4435\ \ author:
4436\ \ \-\ family:\ Watson
4437\ \ \ \ given:\ J.\ D.
4438\ \ \-\ family:\ Crick
4439\ \ \ \ given:\ F.\ H.\ C.
4440\ \ issued:
4441\ \ \ \ date\-parts:
4442\ \ \ \ \-\ \-\ 1953
4443\ \ \ \ \ \ \-\ 4
4444\ \ \ \ \ \ \-\ 25
4445\ \ title:\ \[aq]Molecular\ structure\ of\ nucleic\ acids:\ a\ structure\ for\ deoxyribose
4446\ \ \ \ nucleic\ acid\[aq]
4447\ \ title\-short:\ Molecular\ structure\ of\ nucleic\ acids
4448\ \ container\-title:\ Nature
4449\ \ volume:\ 171
4450\ \ issue:\ 4356
4451\ \ page:\ 737\-738
4452\ \ DOI:\ 10.1038/171737a0
4453\ \ URL:\ http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
4454\ \ language:\ en\-GB
4455\&...
4456\f[]
4457.fi
4458.PP
4459(\f[C]pandoc\-citeproc\ \-\-bib2yaml\f[] can produce these from a
4460bibliography file in one of the supported formats.)
4461.PP
4462Citations and references can be formatted using any style supported by
4463the Citation Style Language, listed in the Zotero Style Repository.
4464These files are specified using the \f[C]\-\-csl\f[] option or the
4465\f[C]csl\f[] metadata field.
4466By default, \f[C]pandoc\-citeproc\f[] will use the Chicago Manual of
4467Style author\-date format.
4468The CSL project provides further information on finding and editing
4469styles.
4470.PP
4471To make your citations hyperlinks to the corresponding bibliography
4472entries, add \f[C]link\-citations:\ true\f[] to your YAML metadata.
4473.PP
4474Citations go inside square brackets and are separated by semicolons.
4475Each citation must have a key, composed of `\@' + the citation
4476identifier from the database, and may optionally have a prefix, a
4477locator, and a suffix.
4478The citation key must begin with a letter, digit, or \f[C]_\f[], and may
4479contain alphanumerics, \f[C]_\f[], and internal punctuation characters
4480(\f[C]:.#$%&\-+?<>~/\f[]).
4481Here are some examples:
4482.IP
4483.nf
4484\f[C]
4485Blah\ blah\ [see\ \@doe99,\ pp.\ 33\-35;\ also\ \@smith04,\ chap.\ 1].
4487Blah\ blah\ [\@doe99,\ pp.\ 33\-35,\ 38\-39\ and\ *passim*].
4489Blah\ blah\ [\@smith04;\ \@doe99].
4490\f[]
4491.fi
4492.PP
4493\f[C]pandoc\-citeproc\f[] detects locator terms in the CSL locale files.
4494Either abbreviated or unabbreviated forms are accepted.
4495In the \f[C]en\-US\f[] locale, locator terms can be written in either
4496singular or plural forms, as \f[C]book\f[], \f[C]bk.\f[]/\f[C]bks.\f[];
4497\f[C]chapter\f[], \f[C]chap.\f[]/\f[C]chaps.\f[]; \f[C]column\f[],
4498\f[C]col.\f[]/\f[C]cols.\f[]; \f[C]figure\f[],
4499\f[C]fig.\f[]/\f[C]figs.\f[]; \f[C]folio\f[],
4500\f[C]fol.\f[]/\f[C]fols.\f[]; \f[C]number\f[],
4501\f[C]no.\f[]/\f[C]nos.\f[]; \f[C]line\f[], \f[C]l.\f[]/\f[C]ll.\f[];
4502\f[C]note\f[], \f[C]n.\f[]/\f[C]nn.\f[]; \f[C]opus\f[],
4503\f[C]op.\f[]/\f[C]opp.\f[]; \f[C]page\f[], \f[C]p.\f[]/\f[C]pp.\f[];
4504\f[C]paragraph\f[], \f[C]para.\f[]/\f[C]paras.\f[]; \f[C]part\f[],
4505\f[C]pt.\f[]/\f[C]pts.\f[]; \f[C]section\f[],
4506\f[C]sec.\f[]/\f[C]secs.\f[]; \f[C]sub\ verbo\f[],
4507\f[C]s.v.\f[]/\f[C]s.vv.\f[]; \f[C]verse\f[], \f[C]v.\f[]/\f[C]vv.\f[];
4508\f[C]volume\f[], \f[C]vol.\f[]/\f[C]vols.\f[]; \f[C]¶\f[]/\f[C]¶¶\f[];
4509\f[C]§\f[]/\f[C]§§\f[].
4510If no locator term is used, \[lq]page\[rq] is assumed.
4511.PP
4512A minus sign (\f[C]\-\f[]) before the \f[C]\@\f[] will suppress mention
4513of the author in the citation.
4514This can be useful when the author is already mentioned in the text:
4515.IP
4516.nf
4517\f[C]
4518Smith\ says\ blah\ [\-\@smith04].
4519\f[]
4520.fi
4521.PP
4522You can also write an in\-text citation, as follows:
4523.IP
4524.nf
4525\f[C]
4526\@smith04\ says\ blah.
4528\@smith04\ [p.\ 33]\ says\ blah.
4529\f[]
4530.fi
4531.PP
4532If the style calls for a list of works cited, it will be placed at the
4533end of the document.
4534Normally, you will want to end your document with an appropriate header:
4535.IP
4536.nf
4537\f[C]
4538last\ paragraph...
4540#\ References
4541\f[]
4542.fi
4543.PP
4544The bibliography will be inserted after this header.
4545Note that the \f[C]unnumbered\f[] class will be added to this header, so
4546that the section will not be numbered.
4547.PP
4548If you want to include items in the bibliography without actually citing
4549them in the body text, you can define a dummy \f[C]nocite\f[] metadata
4550field and put the citations there:
4551.IP
4552.nf
4553\f[C]
4554\-\-\-
4555nocite:\ |
4556\ \ \@item1,\ \@item2
4557\&...
4559\@item3
4560\f[]
4561.fi
4562.PP
4563In this example, the document will contain a citation for \f[C]item3\f[]
4564only, but the bibliography will contain entries for \f[C]item1\f[],
4565\f[C]item2\f[], and \f[C]item3\f[].
4566.PP
4567It is possible to create a bibliography with all the citations, whether
4568or not they appear in the document, by using a wildcard:
4569.IP
4570.nf
4571\f[C]
4572\-\-\-
4573nocite:\ |
4574\ \ \@*
4575\&...
4576\f[]
4577.fi
4578.PP
4579For LaTeX or PDF output, you can also use \f[C]natbib\f[] or
4580\f[C]biblatex\f[] to render bibliography.
4581In order to do so, specify bibliography files as outlined above, and add
4582\f[C]\-\-natbib\f[] or \f[C]\-\-biblatex\f[] argument to \f[C]pandoc\f[]
4583invocation.
4584Bear in mind that bibliography files have to be in respective format
4585(either BibTeX or BibLaTeX).
4586.PP
4587For more information, see the pandoc\-citeproc man page.
4588.SS Non\-pandoc extensions
4589.PP
4590The following Markdown syntax extensions are not enabled by default in
4591pandoc, but may be enabled by adding \f[C]+EXTENSION\f[] to the format
4592name, where \f[C]EXTENSION\f[] is the name of the extension.
4593Thus, for example, \f[C]markdown+hard_line_breaks\f[] is Markdown with
4594hard line breaks.
4595.SS Extension: \f[C]old_dashes\f[]
4596.PP
4597Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
4598\f[C]\-\f[] before a numeral is an en\-dash, and \f[C]\-\-\f[] is an
4599em\-dash.
4600This option only has an effect if \f[C]smart\f[] is enabled.
4601It is selected automatically for \f[C]textile\f[] input.
4602.SS Extension: \f[C]angle_brackets_escapable\f[]
4603.PP
4604Allow \f[C]<\f[] and \f[C]>\f[] to be backslash\-escaped, as they can be
4605in GitHub flavored Markdown but not original Markdown.
4606This is implied by pandoc's default \f[C]all_symbols_escapable\f[].
4607.SS Extension: \f[C]lists_without_preceding_blankline\f[]
4608.PP
4609Allow a list to occur right after a paragraph, with no intervening blank
4610space.
4611.SS Extension: \f[C]four_space_rule\f[]
4612.PP
4613Selects the pandoc <= 2.0 behavior for parsing lists, so that four
4614spaces indent are needed for list item continuation paragraphs.
4615.SS Extension: \f[C]spaced_reference_links\f[]
4616.PP
4617Allow whitespace between the two components of a reference link, for
4618example,
4619.IP
4620.nf
4621\f[C]
4622[foo]\ [bar].
4623\f[]
4624.fi
4625.SS Extension: \f[C]hard_line_breaks\f[]
4626.PP
4627Causes all newlines within a paragraph to be interpreted as hard line
4628breaks instead of spaces.
4629.SS Extension: \f[C]ignore_line_breaks\f[]
4630.PP
4631Causes newlines within a paragraph to be ignored, rather than being
4632treated as spaces or as hard line breaks.
4633This option is intended for use with East Asian languages where spaces
4634are not used between words, but text is divided into lines for
4635readability.
4636.SS Extension: \f[C]east_asian_line_breaks\f[]
4637.PP
4638Causes newlines within a paragraph to be ignored, rather than being
4639treated as spaces or as hard line breaks, when they occur between two
4640East Asian wide characters.
4641This is a better choice than \f[C]ignore_line_breaks\f[] for texts that
4642include a mix of East Asian wide characters and other characters.
4643.SS Extension: \f[C]emoji\f[]
4644.PP
4645Parses textual emojis like \f[C]:smile:\f[] as Unicode emoticons.
4646.SS Extension: \f[C]tex_math_single_backslash\f[]
4647.PP
4648Causes anything between \f[C]\\(\f[] and \f[C]\\)\f[] to be interpreted
4649as inline TeX math, and anything between \f[C]\\[\f[] and \f[C]\\]\f[]
4650to be interpreted as display TeX math.
4651Note: a drawback of this extension is that it precludes escaping
4652\f[C](\f[] and \f[C][\f[].
4653.SS Extension: \f[C]tex_math_double_backslash\f[]
4654.PP
4655Causes anything between \f[C]\\\\(\f[] and \f[C]\\\\)\f[] to be
4656interpreted as inline TeX math, and anything between \f[C]\\\\[\f[] and
4657\f[C]\\\\]\f[] to be interpreted as display TeX math.
4658.SS Extension: \f[C]markdown_attribute\f[]
4659.PP
4660By default, pandoc interprets material inside block\-level tags as
4661Markdown.
4662This extension changes the behavior so that Markdown is only parsed
4663inside block\-level tags if the tags have the attribute
4664\f[C]markdown=1\f[].
4665.SS Extension: \f[C]mmd_title_block\f[]
4666.PP
4667Enables a MultiMarkdown style title block at the top of the document,
4668for example:
4669.IP
4670.nf
4671\f[C]
4672Title:\ \ \ My\ title
4673Author:\ \ John\ Doe
4674Date:\ \ \ \ September\ 1,\ 2008
4675Comment:\ This\ is\ a\ sample\ mmd\ title\ block,\ with
4676\ \ \ \ \ \ \ \ \ a\ field\ spanning\ multiple\ lines.
4677\f[]
4678.fi
4679.PP
4680See the MultiMarkdown documentation for details.
4681If \f[C]pandoc_title_block\f[] or \f[C]yaml_metadata_block\f[] is
4682enabled, it will take precedence over \f[C]mmd_title_block\f[].
4683.SS Extension: \f[C]abbreviations\f[]
4684.PP
4685Parses PHP Markdown Extra abbreviation keys, like
4686.IP
4687.nf
4688\f[C]
4689*[HTML]:\ Hypertext\ Markup\ Language
4690\f[]
4691.fi
4692.PP
4693Note that the pandoc document model does not support abbreviations, so
4694if this extension is enabled, abbreviation keys are simply skipped (as
4695opposed to being parsed as paragraphs).
4696.SS Extension: \f[C]autolink_bare_uris\f[]
4697.PP
4698Makes all absolute URIs into links, even when not surrounded by pointy
4699braces \f[C]<...>\f[].
4700.SS Extension: \f[C]ascii_identifiers\f[]
4701.PP
4702Causes the identifiers produced by \f[C]auto_identifiers\f[] to be pure
4703ASCII.
4704Accents are stripped off of accented Latin letters, and non\-Latin
4705letters are omitted.
4706.SS Extension: \f[C]mmd_link_attributes\f[]
4707.PP
4708Parses multimarkdown style key\-value attributes on link and image
4709references.
4710This extension should not be confused with the \f[C]link_attributes\f[]
4711extension.
4712.IP
4713.nf
4714\f[C]
4715This\ is\ a\ reference\ ![image][ref]\ with\ multimarkdown\ attributes.
4717[ref]:\ http://path.to/image\ "Image\ title"\ width=20px\ height=30px
4718\ \ \ \ \ \ \ id=myId\ class="myClass1\ myClass2"
4719\f[]
4720.fi
4721.SS Extension: \f[C]mmd_header_identifiers\f[]
4722.PP
4723Parses multimarkdown style header identifiers (in square brackets, after
4724the header but before any trailing \f[C]#\f[]s in an ATX header).
4725.SS Extension: \f[C]compact_definition_lists\f[]
4726.PP
4727Activates the definition list syntax of pandoc 1.12.x and earlier.
4728This syntax differs from the one described above under Definition lists
4729in several respects:
4730.IP \[bu] 2
4731No blank line is required between consecutive items of the definition
4732list.
4733.IP \[bu] 2
4734To get a \[lq]tight\[rq] or \[lq]compact\[rq] list, omit space between
4735consecutive items; the space between a term and its definition does not
4736affect anything.
4737.IP \[bu] 2
4738Lazy wrapping of paragraphs is not allowed: the entire definition must
4739be indented four spaces.
4740.SS Markdown variants
4741.PP
4742In addition to pandoc's extended Markdown, the following Markdown
4743variants are supported:
4744.TP
4745.B \f[C]markdown_phpextra\f[] (PHP Markdown Extra)
4746\f[C]footnotes\f[], \f[C]pipe_tables\f[], \f[C]raw_html\f[],
4747\f[C]markdown_attribute\f[], \f[C]fenced_code_blocks\f[],
4748\f[C]definition_lists\f[], \f[C]intraword_underscores\f[],
4749\f[C]header_attributes\f[], \f[C]link_attributes\f[],
4750\f[C]abbreviations\f[], \f[C]shortcut_reference_links\f[],
4751\f[C]spaced_reference_links\f[].
4752.RS
4753.RE
4754.TP
4755.B \f[C]markdown_github\f[] (deprecated GitHub\-Flavored Markdown)
4756\f[C]pipe_tables\f[], \f[C]raw_html\f[], \f[C]fenced_code_blocks\f[],
4757\f[C]gfm_auto_identifiers\f[], \f[C]ascii_identifiers\f[],
4758\f[C]backtick_code_blocks\f[], \f[C]autolink_bare_uris\f[],
4759\f[C]space_in_atx_header\f[], \f[C]intraword_underscores\f[],
4760\f[C]strikeout\f[], \f[C]emoji\f[], \f[C]shortcut_reference_links\f[],
4761\f[C]angle_brackets_escapable\f[],
4762\f[C]lists_without_preceding_blankline\f[].
4763.RS
4764.RE
4765.TP
4766.B \f[C]markdown_mmd\f[] (MultiMarkdown)
4767\f[C]pipe_tables\f[], \f[C]raw_html\f[], \f[C]markdown_attribute\f[],
4768\f[C]mmd_link_attributes\f[], \f[C]tex_math_double_backslash\f[],
4769\f[C]intraword_underscores\f[], \f[C]mmd_title_block\f[],
4770\f[C]footnotes\f[], \f[C]definition_lists\f[],
4771\f[C]all_symbols_escapable\f[], \f[C]implicit_header_references\f[],
4772\f[C]auto_identifiers\f[], \f[C]mmd_header_identifiers\f[],
4773\f[C]shortcut_reference_links\f[], \f[C]implicit_figures\f[],
4774\f[C]superscript\f[], \f[C]subscript\f[], \f[C]backtick_code_blocks\f[],
4775\f[C]spaced_reference_links\f[], \f[C]raw_attribute\f[].
4776.RS
4777.RE
4778.TP
4779.B \f[C]markdown_strict\f[] (Markdown.pl)
4780\f[C]raw_html\f[], \f[C]shortcut_reference_links\f[],
4781\f[C]spaced_reference_links\f[].
4782.RS
4783.RE
4784.PP
4785We also support \f[C]gfm\f[] (GitHub\-Flavored Markdown) as a set of
4786extensions on \f[C]commonmark\f[]:
4787.PP
4788: \f[C]pipe_tables\f[], \f[C]raw_html\f[], \f[C]fenced_code_blocks\f[],
4789\f[C]auto_identifiers\f[], \f[C]ascii_identifiers\f[],
4790\f[C]backtick_code_blocks\f[], \f[C]autolink_bare_uris\f[],
4791\f[C]intraword_underscores\f[], \f[C]strikeout\f[],
4792\f[C]hard_line_breaks\f[], \f[C]emoji\f[],
4793\f[C]shortcut_reference_links\f[], \f[C]angle_brackets_escapable\f[].
4794.IP
4795.nf
4796\f[C]
4797These\ can\ all\ be\ individually\ disabled.\ Note,\ however,\ that
4798`commonmark`\ and\ `gfm`\ have\ limited\ support\ for\ extensions:
4799extensions\ other\ than\ those\ listed\ above\ (and\ `smart`)\ will\ have
4800no\ effect\ on\ `commonmark`\ or\ `gfm`.
4801\f[]
4802.fi
4803.SS Extensions with formats other than Markdown
4804.PP
4805Some of the extensions discussed above can be used with formats other
4806than Markdown:
4807.IP \[bu] 2
4808\f[C]auto_identifiers\f[] can be used with \f[C]latex\f[], \f[C]rst\f[],
4809\f[C]mediawiki\f[], and \f[C]textile\f[] input (and is used by default).
4810.IP \[bu] 2
4811\f[C]tex_math_dollars\f[], \f[C]tex_math_single_backslash\f[], and
4812\f[C]tex_math_double_backslash\f[] can be used with \f[C]html\f[] input.
4813(This is handy for reading web pages formatted using MathJax, for
4814example.)
4815.SH PRODUCING SLIDE SHOWS WITH PANDOC
4816.PP
4817You can use pandoc to produce an HTML + JavaScript slide presentation
4818that can be viewed via a web browser.
4819There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
4820reveal.js.
4821You can also produce a PDF slide show using LaTeX \f[C]beamer\f[].
4822.PP
4823Here's the Markdown source for a simple slide show, \f[C]habits.txt\f[]:
4824.IP
4825.nf
4826\f[C]
4827%\ Habits
4828%\ John\ Doe
4829%\ March\ 22,\ 2005
4831#\ In\ the\ morning
4833##\ Getting\ up
4835\-\ Turn\ off\ alarm
4836\-\ Get\ out\ of\ bed
4838##\ Breakfast
4840\-\ Eat\ eggs
4841\-\ Drink\ coffee
4843#\ In\ the\ evening
4845##\ Dinner
4847\-\ Eat\ spaghetti
4848\-\ Drink\ wine
4850\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
4852![picture\ of\ spaghetti](images/spaghetti.jpg)
4854##\ Going\ to\ sleep
4856\-\ Get\ in\ bed
4857\-\ Count\ sheep
4858\f[]
4859.fi
4860.PP
4861To produce an HTML/JavaScript slide show, simply type
4862.IP
4863.nf
4864\f[C]
4865pandoc\ \-t\ FORMAT\ \-s\ habits.txt\ \-o\ habits.html
4866\f[]
4867.fi
4868.PP
4869where \f[C]FORMAT\f[] is either \f[C]s5\f[], \f[C]slidy\f[],
4870\f[C]slideous\f[], \f[C]dzslides\f[], or \f[C]revealjs\f[].
4871.PP
4872For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
4873the \f[C]\-s/\-\-standalone\f[] option embeds a link to JavaScript and
4874CSS files, which are assumed to be available at the relative path
4875\f[C]s5/default\f[] (for S5), \f[C]slideous\f[] (for Slideous),
4876\f[C]reveal.js\f[] (for reveal.js), or at the Slidy website at
4877\f[C]w3.org\f[] (for Slidy).
4878(These paths can be changed by setting the \f[C]slidy\-url\f[],
4879\f[C]slideous\-url\f[], \f[C]revealjs\-url\f[], or \f[C]s5\-url\f[]
4880variables; see Variables for slides, above.) For DZSlides, the
4881(relatively short) JavaScript and CSS are included in the file by
4882default.
4883.PP
4884With all HTML slide formats, the \f[C]\-\-self\-contained\f[] option can
4885be used to produce a single file that contains all of the data necessary
4886to display the slide show, including linked scripts, stylesheets,
4887images, and videos.
4888.PP
4889To produce a PDF slide show using beamer, type
4890.IP
4891.nf
4892\f[C]
4893pandoc\ \-t\ beamer\ habits.txt\ \-o\ habits.pdf
4894\f[]
4895.fi
4896.PP
4897Note that a reveal.js slide show can also be converted to a PDF by
4898printing it to a file from the browser.
4899.SS Structuring the slide show
4900.PP
4901By default, the \f[I]slide level\f[] is the highest header level in the
4902hierarchy that is followed immediately by content, and not another
4903header, somewhere in the document.
4904In the example above, level 1 headers are always followed by level 2
4905headers, which are followed by content, so 2 is the slide level.
4906This default can be overridden using the \f[C]\-\-slide\-level\f[]
4907option.
4908.PP
4909The document is carved up into slides according to the following rules:
4910.IP \[bu] 2
4911A horizontal rule always starts a new slide.
4912.IP \[bu] 2
4913A header at the slide level always starts a new slide.
4914.IP \[bu] 2
4915Headers \f[I]below\f[] the slide level in the hierarchy create headers
4916\f[I]within\f[] a slide.
4917.IP \[bu] 2
4918Headers \f[I]above\f[] the slide level in the hierarchy create
4919\[lq]title slides,\[rq] which just contain the section title and help to
4920break the slide show into sections.
4921.IP \[bu] 2
4922Content \f[I]above\f[] the slide level will not appear in the slide
4923show.
4924.IP \[bu] 2
4925A title page is constructed automatically from the document's title
4926block, if present.
4927(In the case of beamer, this can be disabled by commenting out some
4928lines in the default template.)
4929.PP
4930These rules are designed to support many different styles of slide show.
4931If you don't care about structuring your slides into sections and
4932subsections, you can just use level 1 headers for all each slide.
4933(In that case, level 1 will be the slide level.) But you can also
4934structure the slide show into sections, as in the example above.
4935.PP
4936Note: in reveal.js slide shows, if slide level is 2, a two\-dimensional
4937layout will be produced, with level 1 headers building horizontally and
4938level 2 headers building vertically.
4939It is not recommended that you use deeper nesting of section levels with
4940reveal.js.
4941.SS Incremental lists
4942.PP
4943By default, these writers produce lists that display \[lq]all at
4944once.\[rq] If you want your lists to display incrementally (one item at
4945a time), use the \f[C]\-i\f[] option.
4946If you want a particular list to depart from the default (that is, to
4947display incrementally without the \f[C]\-i\f[] option and all at once
4948with the \f[C]\-i\f[] option), put it in a block quote:
4949.IP
4950.nf
4951\f[C]
4952>\ \-\ Eat\ spaghetti
4953>\ \-\ Drink\ wine
4954\f[]
4955.fi
4956.PP
4957In this way incremental and nonincremental lists can be mixed in a
4958single document.
4959.SS Inserting pauses
4960.PP
4961You can add \[lq]pauses\[rq] within a slide by including a paragraph
4962containing three dots, separated by spaces:
4963.IP
4964.nf
4965\f[C]
4966#\ Slide\ with\ a\ pause
4968content\ before\ the\ pause
4970\&.\ .\ .
4972content\ after\ the\ pause
4973\f[]
4974.fi
4975.SS Styling the slides
4976.PP
4977You can change the style of HTML slides by putting customized CSS files
4978in \f[C]$DATADIR/s5/default\f[] (for S5), \f[C]$DATADIR/slidy\f[] (for
4979Slidy), or \f[C]$DATADIR/slideous\f[] (for Slideous), where
4980\f[C]$DATADIR\f[] is the user data directory (see
4981\f[C]\-\-data\-dir\f[], above).
4982The originals may be found in pandoc's system data directory (generally
4983\f[C]$CABALDIR/pandoc\-VERSION/s5/default\f[]).
4984Pandoc will look there for any files it does not find in the user data
4985directory.
4986.PP
4987For dzslides, the CSS is included in the HTML file itself, and may be
4988modified there.
4989.PP
4990All reveal.js configuration options can be set through variables.
4991For example, themes can be used by setting the \f[C]theme\f[] variable:
4992.IP
4993.nf
4994\f[C]
4995\-V\ theme=moon
4996\f[]
4997.fi
4998.PP
4999Or you can specify a custom stylesheet using the \f[C]\-\-css\f[]
5000option.
5001.PP
5002To style beamer slides, you can specify a \f[C]theme\f[],
5003\f[C]colortheme\f[], \f[C]fonttheme\f[], \f[C]innertheme\f[], and
5004\f[C]outertheme\f[], using the \f[C]\-V\f[] option:
5005.IP
5006.nf
5007\f[C]
5008pandoc\ \-t\ beamer\ habits.txt\ \-V\ theme:Warsaw\ \-o\ habits.pdf
5009\f[]
5010.fi
5011.PP
5012Note that header attributes will turn into slide attributes (on a
5013\f[C]<div>\f[] or \f[C]<section>\f[]) in HTML slide formats, allowing
5014you to style individual slides.
5015In beamer, the only header attribute that affects slides is the
5016\f[C]allowframebreaks\f[] class, which sets the
5017\f[C]allowframebreaks\f[] option, causing multiple slides to be created
5018if the content overfills the frame.
5019This is recommended especially for bibliographies:
5020.IP
5021.nf
5022\f[C]
5023#\ References\ {.allowframebreaks}
5024\f[]
5025.fi
5026.SS Speaker notes
5027.PP
5028reveal.js has good support for speaker notes.
5029You can add notes to your Markdown document thus:
5030.IP
5031.nf
5032\f[C]
5033:::\ notes
5035This\ is\ my\ note.
5037\-\ It\ can\ contain\ Markdown
5038\-\ like\ this\ list
5040:::
5041\f[]
5042.fi
5043.PP
5044To show the notes window, press \f[C]s\f[] while viewing the
5045presentation.
5046Notes are not yet supported for other slide formats, but the notes will
5047not appear on the slides themselves.
5048.SS Columns
5049.PP
5050To put material in side by side columns, you can use a native div
5051container with class \f[C]columns\f[], containing two or more div
5052containers with class \f[C]column\f[] and a \f[C]width\f[] attribute:
5053.IP
5054.nf
5055\f[C]
5056::::::::::::::\ {.columns}
5057:::\ {.column\ width="40%"}
5058contents...
5059:::
5060:::\ {.column\ width="60%"}
5061contents...
5062:::
5063::::::::::::::
5064\f[]
5065.fi
5066.SS Frame attributes in beamer
5067.PP
5068Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[] option to
5069a frame in beamer (for example, when using the \f[C]minted\f[]
5070environment).
5071This can be forced by adding the \f[C]fragile\f[] class to the header
5072introducing the slide:
5073.IP
5074.nf
5075\f[C]
5076#\ Fragile\ slide\ {.fragile}
5077\f[]
5078.fi
5079.PP
5080All of the other frame attributes described in Section 8.1 of the Beamer
5081User's Guide may also be used: \f[C]allowdisplaybreaks\f[],
5082\f[C]allowframebreaks\f[], \f[C]b\f[], \f[C]c\f[], \f[C]t\f[],
5083\f[C]environment\f[], \f[C]label\f[], \f[C]plain\f[], \f[C]shrink\f[].
5084.SH CREATING EPUBS WITH PANDOC
5085.SS EPUB Metadata
5086.PP
5087EPUB metadata may be specified using the \f[C]\-\-epub\-metadata\f[]
5088option, but if the source document is Markdown, it is better to use a
5089YAML metadata block.
5090Here is an example:
5091.IP
5092.nf
5093\f[C]
5094\-\-\-
5095title:
5096\-\ type:\ main
5097\ \ text:\ My\ Book
5098\-\ type:\ subtitle
5099\ \ text:\ An\ investigation\ of\ metadata
5100creator:
5101\-\ role:\ author
5102\ \ text:\ John\ Smith
5103\-\ role:\ editor
5104\ \ text:\ Sarah\ Jones
5105identifier:
5106\-\ scheme:\ DOI
5107\ \ text:\ doi:10.234234.234/33
5108publisher:\ \ My\ Press
5109rights:\ ©\ 2007\ John\ Smith,\ CC\ BY\-NC
5110ibooks:
5111\ \ version:\ 1.3.4
5112\&...
5113\f[]
5114.fi
5115.PP
5116The following fields are recognized:
5117.TP
5118.B \f[C]identifier\f[]
5119Either a string value or an object with fields \f[C]text\f[] and
5120\f[C]scheme\f[].
5121Valid values for \f[C]scheme\f[] are \f[C]ISBN\-10\f[],
5122\f[C]GTIN\-13\f[], \f[C]UPC\f[], \f[C]ISMN\-10\f[], \f[C]DOI\f[],
5123\f[C]LCCN\f[], \f[C]GTIN\-14\f[], \f[C]ISBN\-13\f[],
5124\f[C]Legal\ deposit\ number\f[], \f[C]URN\f[], \f[C]OCLC\f[],
5125\f[C]ISMN\-13\f[], \f[C]ISBN\-A\f[], \f[C]JP\f[], \f[C]OLCC\f[].
5126.RS
5127.RE
5128.TP
5129.B \f[C]title\f[]
5130Either a string value, or an object with fields \f[C]file\-as\f[] and
5131\f[C]type\f[], or a list of such objects.
5132Valid values for \f[C]type\f[] are \f[C]main\f[], \f[C]subtitle\f[],
5133\f[C]short\f[], \f[C]collection\f[], \f[C]edition\f[],
5134\f[C]extended\f[].
5135.RS
5136.RE
5137.TP
5138.B \f[C]creator\f[]
5139Either a string value, or an object with fields \f[C]role\f[],
5140\f[C]file\-as\f[], and \f[C]text\f[], or a list of such objects.
5141Valid values for \f[C]role\f[] are MARC relators, but pandoc will
5142attempt to translate the human\-readable versions (like \[lq]author\[rq]
5143and \[lq]editor\[rq]) to the appropriate marc relators.
5144.RS
5145.RE
5146.TP
5147.B \f[C]contributor\f[]
5148Same format as \f[C]creator\f[].
5149.RS
5150.RE
5151.TP
5152.B \f[C]date\f[]
5153A string value in \f[C]YYYY\-MM\-DD\f[] format.
5154(Only the year is necessary.) Pandoc will attempt to convert other
5155common date formats.
5156.RS
5157.RE
5158.TP
5159.B \f[C]lang\f[] (or legacy: \f[C]language\f[])
5160A string value in BCP 47 format.
5161Pandoc will default to the local language if nothing is specified.
5162.RS
5163.RE
5164.TP
5165.B \f[C]subject\f[]
5166A string value or a list of such values.
5167.RS
5168.RE
5169.TP
5170.B \f[C]description\f[]
5171A string value.
5172.RS
5173.RE
5174.TP
5175.B \f[C]type\f[]
5176A string value.
5177.RS
5178.RE
5179.TP
5180.B \f[C]format\f[]
5181A string value.
5182.RS
5183.RE
5184.TP
5185.B \f[C]relation\f[]
5186A string value.
5187.RS
5188.RE
5189.TP
5190.B \f[C]coverage\f[]
5191A string value.
5192.RS
5193.RE
5194.TP
5195.B \f[C]rights\f[]
5196A string value.
5197.RS
5198.RE
5199.TP
5200.B \f[C]cover\-image\f[]
5201A string value (path to cover image).
5202.RS
5203.RE
5204.TP
5205.B \f[C]stylesheet\f[]
5206A string value (path to CSS stylesheet).
5207.RS
5208.RE
5209.TP
5210.B \f[C]page\-progression\-direction\f[]
5211Either \f[C]ltr\f[] or \f[C]rtl\f[].
5212Specifies the \f[C]page\-progression\-direction\f[] attribute for the
5213\f[C]spine\f[] element.
5214.RS
5215.RE
5216.TP
5217.B \f[C]ibooks\f[]
5218iBooks\-specific metadata, with the following fields:
5219.RS
5220.IP \[bu] 2
5221\f[C]version\f[]: (string)
5222.IP \[bu] 2
5223\f[C]specified\-fonts\f[]: \f[C]true\f[]|\f[C]false\f[] (default
5224\f[C]false\f[])
5225.IP \[bu] 2
5226\f[C]ipad\-orientation\-lock\f[]:
5227\f[C]portrait\-only\f[]|\f[C]landscape\-only\f[]
5228.IP \[bu] 2
5229\f[C]iphone\-orientation\-lock\f[]:
5230\f[C]portrait\-only\f[]|\f[C]landscape\-only\f[]
5231.IP \[bu] 2
5232\f[C]binding\f[]: \f[C]true\f[]|\f[C]false\f[] (default \f[C]true\f[])
5233.IP \[bu] 2
5234\f[C]scroll\-axis\f[]:
5235\f[C]vertical\f[]|\f[C]horizontal\f[]|\f[C]default\f[]
5236.RE
5237.SS Linked media
5238.PP
5239By default, pandoc will download linked media (including audio and
5240video) and include it in the EPUB container, yielding a completely
5241self\-contained EPUB.
5242If you want to link to external media resources instead, use raw HTML in
5243your source and add \f[C]data\-external="1"\f[] to the tag with the
5244\f[C]src\f[] attribute.
5245For example:
5246.IP
5247.nf
5248\f[C]
5249<audio\ controls="1">
5250\ \ <source\ src="http://example.com/music/toccata.mp3"
5251\ \ \ \ \ \ \ \ \ \ data\-external="1"\ type="audio/mpeg">
5252\ \ </source>
5253</audio>
5254\f[]
5255.fi
5256.SH LITERATE HASKELL SUPPORT
5257.PP
5258If you append \f[C]+lhs\f[] (or \f[C]+literate_haskell\f[]) to an
5259appropriate input or output format (\f[C]markdown\f[],
5260\f[C]markdown_strict\f[], \f[C]rst\f[], or \f[C]latex\f[] for input or
5261output; \f[C]beamer\f[], \f[C]html4\f[] or \f[C]html5\f[] for output
5262only), pandoc will treat the document as literate Haskell source.
5263This means that
5264.IP \[bu] 2
5265In Markdown input, \[lq]bird track\[rq] sections will be parsed as
5266Haskell code rather than block quotations.
5267Text between \f[C]\\begin{code}\f[] and \f[C]\\end{code}\f[] will also
5268be treated as Haskell code.
5269For ATX\-style headers the character `=' will be used instead of `#'.
5270.IP \[bu] 2
5271In Markdown output, code blocks with classes \f[C]haskell\f[] and
5272\f[C]literate\f[] will be rendered using bird tracks, and block
5273quotations will be indented one space, so they will not be treated as
5274Haskell code.
5275In addition, headers will be rendered setext\-style (with underlines)
5276rather than ATX\-style (with `#' characters).
5277(This is because ghc treats `#' characters in column 1 as introducing
5278line numbers.)
5279.IP \[bu] 2
5280In restructured text input, \[lq]bird track\[rq] sections will be parsed
5281as Haskell code.
5282.IP \[bu] 2
5283In restructured text output, code blocks with class \f[C]haskell\f[]
5284will be rendered using bird tracks.
5285.IP \[bu] 2
5286In LaTeX input, text in \f[C]code\f[] environments will be parsed as
5287Haskell code.
5288.IP \[bu] 2
5289In LaTeX output, code blocks with class \f[C]haskell\f[] will be
5290rendered inside \f[C]code\f[] environments.
5291.IP \[bu] 2
5292In HTML output, code blocks with class \f[C]haskell\f[] will be rendered
5293with class \f[C]literatehaskell\f[] and bird tracks.
5294.PP
5295Examples:
5296.IP
5297.nf
5298\f[C]
5299pandoc\ \-f\ markdown+lhs\ \-t\ html
5300\f[]
5301.fi
5302.PP
5303reads literate Haskell source formatted with Markdown conventions and
5304writes ordinary HTML (without bird tracks).
5305.IP
5306.nf
5307\f[C]
5308pandoc\ \-f\ markdown+lhs\ \-t\ html+lhs
5309\f[]
5310.fi
5311.PP
5312writes HTML with the Haskell code in bird tracks, so it can be copied
5313and pasted as literate Haskell source.
5314.PP
5315Note that GHC expects the bird tracks in the first column, so indentend
5316literate code blocks (e.g.\ inside an itemized environment) will not be
5317picked up by the Haskell compiler.
5318.SH SYNTAX HIGHLIGHTING
5319.PP
5320Pandoc will automatically highlight syntax in fenced code blocks that
5321are marked with a language name.
5322The Haskell library skylighting is used for highlighting, which works in
5323HTML, Docx, Ms, and LaTeX/PDF output.
5324To see a list of language names that pandoc will recognize, type
5325\f[C]pandoc\ \-\-list\-highlight\-languages\f[].
5326.PP
5327The color scheme can be selected using the \f[C]\-\-highlight\-style\f[]
5328option.
5329The default color scheme is \f[C]pygments\f[], which imitates the
5330default color scheme used by the Python library pygments (though
5331pygments is not actually used to do the highlighting).
5332To see a list of highlight styles, type
5333\f[C]pandoc\ \-\-list\-highlight\-styles\f[].
5334.PP
5335To disable highlighting, use the \f[C]\-\-no\-highlight\f[] option.
5336.SH CUSTOM STYLES IN DOCX OUTPUT
5337.PP
5338By default, pandoc's docx output applies a predefined set of styles for
5339blocks such as paragraphs and block quotes, and uses largely default
5340formatting (italics, bold) for inlines.
5341This will work for most purposes, especially alongside a
5342\f[C]reference.docx\f[] file.
5343However, if you need to apply your own styles to blocks, or match a
5344preexisting set of styles, pandoc allows you to define custom styles for
5345blocks and text using \f[C]div\f[]s and \f[C]span\f[]s, respectively.
5346.PP
5347If you define a \f[C]div\f[] or \f[C]span\f[] with the attribute
5348\f[C]custom\-style\f[], pandoc will apply your specified style to the
5349contained elements.
5350So, for example,
5351.IP
5352.nf
5353\f[C]
5354<span\ custom\-style="Emphatically">Get\ out,</span>\ he\ said.
5355\f[]
5356.fi
5357.PP
5358would produce a docx file with \[lq]Get out,\[rq] styled with character
5359style \f[C]Emphatically\f[].
5360Similarly,
5361.IP
5362.nf
5363\f[C]
5364Dickinson\ starts\ the\ poem\ simply:
5366<div\ custom\-style="Poetry">
5367|\ A\ Bird\ came\ down\ the\ Walk\-\-\-
5368|\ He\ did\ not\ know\ I\ saw\-\-\-
5369</div>
5370\f[]
5371.fi
5372.PP
5373would style the two contained lines with the \f[C]Poetry\f[] paragraph
5374style.
5375.PP
5376If the styles are not yet in your reference.docx, they will be defined
5377in the output file as inheriting from normal text.
5378If they are already defined, pandoc will not alter the definition.
5379.PP
5380This feature allows for greatest customization in conjunction with
5381pandoc filters.
5382If you want all paragraphs after block quotes to be indented, you can
5383write a filter to apply the styles necessary.
5384If you want all italics to be transformed to the \f[C]Emphasis\f[]
5385character style (perhaps to change their color), you can write a filter
5386which will transform all italicized inlines to inlines within an
5387\f[C]Emphasis\f[] custom\-style \f[C]span\f[].
5388.SH CUSTOM WRITERS
5389.PP
5390Pandoc can be extended with custom writers written in lua.
5391(Pandoc includes a lua interpreter, so lua need not be installed
5392separately.)
5393.PP
5394To use a custom writer, simply specify the path to the lua script in
5395place of the output format.
5396For example:
5397.IP
5398.nf
5399\f[C]
5400pandoc\ \-t\ data/sample.lua
5401\f[]
5402.fi
5403.PP
5404Creating a custom writer requires writing a lua function for each
5405possible element in a pandoc document.
5406To get a documented example which you can modify according to your
5407needs, do
5408.IP
5409.nf
5410\f[C]
5411pandoc\ \-\-print\-default\-data\-file\ sample.lua
5412\f[]
5413.fi
5414.SH AUTHORS
5415.PP
5416Copyright 2006\-2017 John MacFarlane (jgm\@berkeley.edu).
5417Released under the GPL, version 2 or greater.
5418This software carries no warranty of any kind.
5419(See COPYRIGHT for full copyright and warranty notices.) For a full list
5420of contributors, see the file AUTHORS.md in the pandoc source code.
5421.PP
5422The Pandoc source code and all documentation may be downloaded
5423from <http://pandoc.org>.