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