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