2.TH PANDOC 1 "April 5, 2019" "pandoc 2.7.2"
4pandoc - general markup converter
7\f[C]pandoc\f[R] [\f[I]options\f[R]] [\f[I]input-file\f[R]]...
10Pandoc is a Haskell library for converting from one markup format to
11another, and a command-line tool that uses this library.
13Pandoc can convert between numerous markup and word processing formats,
14including, but not limited to, various flavors of Markdown, HTML, LaTeX
16For the full lists of input and output formats, see the \f[C]--from\f[R]
17and \f[C]--to\f[R] options below.
18Pandoc can also produce PDF output: see creating a PDF, below.
20Pandoc\[aq]s enhanced version of Markdown includes syntax for tables,
21definition lists, metadata blocks, footnotes, citations, math, and much
23See below under Pandoc\[aq]s Markdown.
25Pandoc has a modular design: it consists of a set of readers, which
26parse text in a given format and produce a native representation of the
27document (an \f[I]abstract syntax tree\f[R] or AST), and a set of
28writers, which convert this native representation into a target format.
29Thus, adding an input or output format requires only adding a reader or
31Users can also run custom pandoc filters to modify the intermediate AST.
33Because pandoc\[aq]s intermediate representation of a document is less
34expressive than many of the formats it converts between, one should not
35expect perfect conversions between every format and every other.
36Pandoc attempts to preserve the structural elements of a document, but
37not formatting details such as margin size.
38And some document elements, such as complex tables, may not fit into
39pandoc\[aq]s simple document model.
40While conversions from pandoc\[aq]s Markdown to all formats aspire to be
41perfect, conversions from formats more expressive than pandoc\[aq]s
42Markdown can be expected to be lossy.
45If no \f[I]input-files\f[R] are specified, input is read from
47Output goes to \f[I]stdout\f[R] by default.
48For output to a file, use the \f[C]-o\f[R] option:
52pandoc -o output.html input.txt
56By default, pandoc produces a document fragment.
57To produce a standalone document (e.g.
58a valid HTML file including \f[C]<head>\f[R] and \f[C]<body>\f[R]), use
59the \f[C]-s\f[R] or \f[C]--standalone\f[R] flag:
63pandoc -s -o output.html input.txt
67For more information on how standalone documents are produced, see
70If multiple input files are given, \f[C]pandoc\f[R] will concatenate
71them all (with blank lines between them) before parsing.
72(Use \f[C]--file-scope\f[R] to parse files individually.)
75The format of the input and output can be specified explicitly using
77The input format can be specified using the \f[C]-f/--from\f[R] option,
78the output format using the \f[C]-t/--to\f[R] option.
79Thus, to convert \f[C]hello.txt\f[R] from Markdown to LaTeX, you could
84pandoc -f markdown -t latex hello.txt
88To convert \f[C]hello.html\f[R] from HTML to Markdown:
92pandoc -f html -t markdown hello.html
96Supported input and output formats are listed below under Options (see
97\f[C]-f\f[R] for input formats and \f[C]-t\f[R] for output formats).
98You can also use \f[C]pandoc --list-input-formats\f[R] and
99\f[C]pandoc --list-output-formats\f[R] to print lists of supported
102If the input or output format is not specified explicitly,
103\f[C]pandoc\f[R] will attempt to guess it from the extensions of the
109pandoc -o hello.tex hello.txt
113will convert \f[C]hello.txt\f[R] from Markdown to LaTeX.
114If no output file is specified (so that output goes to
115\f[I]stdout\f[R]), or if the output file\[aq]s extension is unknown, the
116output format will default to HTML.
117If no input file is specified (so that input comes from
118\f[I]stdin\f[R]), or if the input files\[aq] extensions are unknown, the
119input format will be assumed to be Markdown.
120.SS Character encoding
122Pandoc uses the UTF-8 character encoding for both input and output.
123If your local character encoding is not UTF-8, you should pipe input and
124output through \f[C]iconv\f[R]:
128iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
132Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,
133OPML, DocBook, and Texinfo), information about the character encoding is
134included in the document header, which will only be included if you use
135the \f[C]-s/--standalone\f[R] option.
138To produce a PDF, specify an output file with a \f[C].pdf\f[R]
143pandoc test.txt -o test.pdf
147By default, pandoc will use LaTeX to create the PDF, which requires that
148a LaTeX engine be installed (see \f[C]--pdf-engine\f[R] below).
150Alternatively, pandoc can use ConTeXt, \f[C]pdfroff\f[R], or any of the
151following HTML/CSS-to-PDF-engines, to create a PDF:
152\f[C]wkhtmltopdf\f[R], \f[C]weasyprint\f[R] or \f[C]prince\f[R].
153To do this, specify an output file with a \f[C].pdf\f[R] extension, as
154before, but add the \f[C]--pdf-engine\f[R] option or
155\f[C]-t context\f[R], \f[C]-t html\f[R], or \f[C]-t ms\f[R] to the
156command line (\f[C]-t html\f[R] defaults to
157\f[C]--pdf-engine=wkhtmltopdf\f[R]).
159PDF output uses variables for LaTeX (with a LaTeX engine); variables for
160ConTeXt (with ConTeXt); or variables for \f[C]wkhtmltopdf\f[R] (an
161HTML/CSS-to-PDF engine; \f[C]--css\f[R] also affects the output).
163To debug the PDF creation, it can be useful to look at the intermediate
164representation: instead of \f[C]-o test.pdf\f[R], use for example
165\f[C]-s -o test.tex\f[R] to output the generated LaTeX.
166You can then test it with \f[C]pdflatex test.tex\f[R].
168When using LaTeX, the following packages need to be available (they are
169included with all recent versions of TeX Live): \f[C]amsfonts\f[R],
170\f[C]amsmath\f[R], \f[C]lm\f[R], \f[C]unicode-math\f[R],
171\f[C]ifxetex\f[R], \f[C]ifluatex\f[R], \f[C]listings\f[R] (if the
172\f[C]--listings\f[R] option is used), \f[C]fancyvrb\f[R],
173\f[C]longtable\f[R], \f[C]booktabs\f[R], \f[C]graphicx\f[R] and
174\f[C]grffile\f[R] (if the document contains images), \f[C]hyperref\f[R],
175\f[C]xcolor\f[R], \f[C]ulem\f[R], \f[C]geometry\f[R] (with the
176\f[C]geometry\f[R] variable set), \f[C]setspace\f[R] (with
177\f[C]linestretch\f[R]), and \f[C]babel\f[R] (with \f[C]lang\f[R]).
178The use of \f[C]xelatex\f[R] or \f[C]lualatex\f[R] as the PDF engine
179requires \f[C]fontspec\f[R].
180\f[C]xelatex\f[R] uses \f[C]polyglossia\f[R] (with \f[C]lang\f[R]),
181\f[C]xecjk\f[R], and \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable
183If the \f[C]mathspec\f[R] variable is set, \f[C]xelatex\f[R] will use
184\f[C]mathspec\f[R] instead of \f[C]unicode-math\f[R].
185The \f[C]upquote\f[R] and \f[C]microtype\f[R] packages are used if
186available, and \f[C]csquotes\f[R] will be used for typography if
187\f[C]\[rs]usepackage{csquotes}\f[R] is present in the template or
188included via \f[C]/H/--include-in-header\f[R].
189The \f[C]natbib\f[R], \f[C]biblatex\f[R], \f[C]bibtex\f[R], and
190\f[C]biber\f[R] packages can optionally be used for citation rendering.
191The following packages will be used to improve output quality if
192present, but pandoc does not require them to be present:
193\f[C]upquote\f[R] (for straight quotes in verbatim environments),
194\f[C]microtype\f[R] (for better spacing adjustments), \f[C]parskip\f[R]
195(for better inter-paragraph spaces), \f[C]xurl\f[R] (for better line
196breaks in URLs), \f[C]bookmark\f[R] (for better PDF bookmarks), and
197\f[C]footnotehyper\f[R] or \f[C]footnote\f[R] (to allow footnotes in
199.SS Reading from the Web
201Instead of an input file, an absolute URI may be given.
202In this case pandoc will fetch the content using HTTP:
206pandoc -f html -t markdown http://www.fsf.org
210It is possible to supply a custom User-Agent string or other header when
211requesting a document from a URL:
215pandoc -f html -t markdown --request-header User-Agent:\[dq]Mozilla/5.0\[dq] \[rs]
222.B \f[C]-f\f[R] \f[I]FORMAT\f[R], \f[C]-r\f[R] \f[I]FORMAT\f[R], \f[C]--from=\f[R]\f[I]FORMAT\f[R], \f[C]--read=\f[R]\f[I]FORMAT\f[R]
224\f[I]FORMAT\f[R] can be:
227\f[C]commonmark\f[R] (CommonMark Markdown)
229\f[C]creole\f[R] (Creole 1.0)
231\f[C]docbook\f[R] (DocBook)
233\f[C]docx\f[R] (Word docx)
235\f[C]dokuwiki\f[R] (DokuWiki markup)
239\f[C]fb2\f[R] (FictionBook2 e-book)
241\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
242accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
243if you need extensions not supported in \f[C]gfm\f[R].
245\f[C]haddock\f[R] (Haddock markup)
249\f[C]ipynb\f[R] (Jupyter notebook)
251\f[C]jats\f[R] (JATS XML)
253\f[C]json\f[R] (JSON version of native AST)
255\f[C]latex\f[R] (LaTeX)
257\f[C]markdown\f[R] (Pandoc\[aq]s Markdown)
259\f[C]markdown_mmd\f[R] (MultiMarkdown)
261\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
263\f[C]markdown_strict\f[R] (original unextended Markdown)
265\f[C]mediawiki\f[R] (MediaWiki markup)
267\f[C]man\f[R] (roff man)
271\f[C]native\f[R] (native Haskell)
277\f[C]org\f[R] (Emacs Org mode)
279\f[C]rst\f[R] (reStructuredText)
281\f[C]t2t\f[R] (txt2tags)
283\f[C]textile\f[R] (Textile)
285\f[C]tikiwiki\f[R] (TikiWiki markup)
287\f[C]twiki\f[R] (TWiki markup)
289\f[C]vimwiki\f[R] (Vimwiki)
291Extensions can be individually enabled or disabled by appending
292\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
293See Extensions below, for a list of extensions and their names.
294See \f[C]--list-input-formats\f[R] and \f[C]--list-extensions\f[R],
298.B \f[C]-t\f[R] \f[I]FORMAT\f[R], \f[C]-w\f[R] \f[I]FORMAT\f[R], \f[C]--to=\f[R]\f[I]FORMAT\f[R], \f[C]--write=\f[R]\f[I]FORMAT\f[R]
299Specify output format.
300\f[I]FORMAT\f[R] can be:
303\f[C]asciidoc\f[R] (AsciiDoc) or \f[C]asciidoctor\f[R] (AsciiDoctor)
305\f[C]beamer\f[R] (LaTeX beamer slide show)
307\f[C]commonmark\f[R] (CommonMark Markdown)
309\f[C]context\f[R] (ConTeXt)
311\f[C]docbook\f[R] or \f[C]docbook4\f[R] (DocBook 4)
313\f[C]docbook5\f[R] (DocBook 5)
315\f[C]docx\f[R] (Word docx)
317\f[C]dokuwiki\f[R] (DokuWiki markup)
319\f[C]epub\f[R] or \f[C]epub3\f[R] (EPUB v3 book)
321\f[C]epub2\f[R] (EPUB v2)
323\f[C]fb2\f[R] (FictionBook2 e-book)
325\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
326accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
327if you need extensions not supported in \f[C]gfm\f[R].
329\f[C]haddock\f[R] (Haddock markup)
331\f[C]html\f[R] or \f[C]html5\f[R] (HTML, i.e.
332HTML5/XHTML polyglot markup)
334\f[C]html4\f[R] (XHTML 1.0 Transitional)
336\f[C]icml\f[R] (InDesign ICML)
338\f[C]ipynb\f[R] (Jupyter notebook)
340\f[C]jats\f[R] (JATS XML)
342\f[C]json\f[R] (JSON version of native AST)
344\f[C]latex\f[R] (LaTeX)
346\f[C]man\f[R] (roff man)
348\f[C]markdown\f[R] (Pandoc\[aq]s Markdown)
350\f[C]markdown_mmd\f[R] (MultiMarkdown)
352\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
354\f[C]markdown_strict\f[R] (original unextended Markdown)
356\f[C]mediawiki\f[R] (MediaWiki markup)
358\f[C]ms\f[R] (roff ms)
360\f[C]muse\f[R] (Muse),
362\f[C]native\f[R] (native Haskell),
364\f[C]odt\f[R] (OpenOffice text document)
368\f[C]opendocument\f[R] (OpenDocument)
370\f[C]org\f[R] (Emacs Org mode)
372\f[C]plain\f[R] (plain text),
374\f[C]pptx\f[R] (PowerPoint slide show)
376\f[C]rst\f[R] (reStructuredText)
378\f[C]rtf\f[R] (Rich Text Format)
380\f[C]texinfo\f[R] (GNU Texinfo)
382\f[C]textile\f[R] (Textile)
384\f[C]slideous\f[R] (Slideous HTML and JavaScript slide show)
386\f[C]slidy\f[R] (Slidy HTML and JavaScript slide show)
388\f[C]dzslides\f[R] (DZSlides HTML5 + JavaScript slide show),
390\f[C]revealjs\f[R] (reveal.js HTML5 + JavaScript slide show)
392\f[C]s5\f[R] (S5 HTML and JavaScript slide show)
394\f[C]tei\f[R] (TEI Simple)
396\f[C]xwiki\f[R] (XWiki markup)
398\f[C]zimwiki\f[R] (ZimWiki markup)
400the path of a custom lua writer, see Custom writers below
402Note that \f[C]odt\f[R], \f[C]docx\f[R], and \f[C]epub\f[R] output will
403not be directed to \f[I]stdout\f[R] unless forced with \f[C]-o -\f[R].
405Extensions can be individually enabled or disabled by appending
406\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
407See Extensions below, for a list of extensions and their names.
408See \f[C]--list-output-formats\f[R] and \f[C]--list-extensions\f[R],
412.B \f[C]-o\f[R] \f[I]FILE\f[R], \f[C]--output=\f[R]\f[I]FILE\f[R]
413Write output to \f[I]FILE\f[R] instead of \f[I]stdout\f[R].
414If \f[I]FILE\f[R] is \f[C]-\f[R], output will go to \f[I]stdout\f[R],
415even if a non-textual format (\f[C]docx\f[R], \f[C]odt\f[R],
416\f[C]epub2\f[R], \f[C]epub3\f[R]) is specified.
418.B \f[C]--data-dir=\f[R]\f[I]DIRECTORY\f[R]
419Specify the user data directory to search for pandoc data files.
420If this option is not specified, the default user data directory will be
422On *nix and macOS systems this will be the \f[C]pandoc\f[R] subdirectory
423of the XDG data directory (by default, \f[C]$HOME/.local/share\f[R],
424overridable by setting the \f[C]XDG_DATA_HOME\f[R] environment
426If that directory does not exist, \f[C]$HOME/.pandoc\f[R] will be used
427(for backwards compatibility).
428In Windows the default user data directory is
429\f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]pandoc\f[R].
430You can find the default user data directory on your system by looking
431at the output of \f[C]pandoc --version\f[R].
432A \f[C]reference.odt\f[R], \f[C]reference.docx\f[R], \f[C]epub.css\f[R],
433\f[C]templates\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R], or
434\f[C]s5\f[R] directory placed in this directory will override
435pandoc\[aq]s normal defaults.
437.B \f[C]--bash-completion\f[R]
438Generate a bash completion script.
439To enable bash completion with pandoc, add this to your
445eval \[dq]$(pandoc --bash-completion)\[dq]
450.B \f[C]--verbose\f[R]
451Give verbose debugging output.
452Currently this only has an effect with PDF output.
455Suppress warning messages.
457.B \f[C]--fail-if-warnings\f[R]
458Exit with error status if there are any warnings.
460.B \f[C]--log=\f[R]\f[I]FILE\f[R]
461Write log messages in machine-readable JSON format to \f[I]FILE\f[R].
462All messages above DEBUG level will be written, regardless of verbosity
463settings (\f[C]--verbose\f[R], \f[C]--quiet\f[R]).
465.B \f[C]--list-input-formats\f[R]
466List supported input formats, one per line.
468.B \f[C]--list-output-formats\f[R]
469List supported output formats, one per line.
471.B \f[C]--list-extensions\f[R][\f[C]=\f[R]\f[I]FORMAT\f[R]]
472List supported extensions, one per line, preceded by a \f[C]+\f[R] or
473\f[C]-\f[R] indicating whether it is enabled by default in
475If \f[I]FORMAT\f[R] is not specified, defaults for pandoc\[aq]s Markdown
478.B \f[C]--list-highlight-languages\f[R]
479List supported languages for syntax highlighting, one per line.
481.B \f[C]--list-highlight-styles\f[R]
482List supported styles for syntax highlighting, one per line.
483See \f[C]--highlight-style\f[R].
485.B \f[C]-v\f[R], \f[C]--version\f[R]
488.B \f[C]-h\f[R], \f[C]--help\f[R]
492.B \f[C]--base-header-level=\f[R]\f[I]NUMBER\f[R]
493Specify the base level for headings (defaults to 1).
495.B \f[C]--strip-empty-paragraphs\f[R]
496\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension
497instead.\f[R] Ignore paragraphs with no content.
498This option is useful for converting word processing documents where
499users have used empty paragraphs to create inter-paragraph space.
501.B \f[C]--indented-code-classes=\f[R]\f[I]CLASSES\f[R]
502Specify classes to use for indented code blocks--for example,
503\f[C]perl,numberLines\f[R] or \f[C]haskell\f[R].
504Multiple classes may be separated by spaces or commas.
506.B \f[C]--default-image-extension=\f[R]\f[I]EXTENSION\f[R]
507Specify a default extension to use when image paths/URLs have no
509This allows you to use the same source for formats that require
510different kinds of images.
511Currently this option only affects the Markdown and LaTeX readers.
513.B \f[C]--file-scope\f[R]
514Parse each file individually before combining for multifile documents.
515This will allow footnotes in different files with the same identifiers
517If this option is set, footnotes and links will not work across files.
518Reading binary files (docx, odt, epub) implies \f[C]--file-scope\f[R].
520.B \f[C]-F\f[R] \f[I]PROGRAM\f[R], \f[C]--filter=\f[R]\f[I]PROGRAM\f[R]
521Specify an executable to be used as a filter transforming the pandoc AST
522after the input is parsed and before the output is written.
523The executable should read JSON from stdin and write JSON to stdout.
524The JSON must be formatted like pandoc\[aq]s own JSON input and output.
525The name of the output format will be passed to the filter as the first
532pandoc --filter ./caps.py -t latex
540pandoc -t json | ./caps.py latex | pandoc -f json -t latex
544The latter form may be useful for debugging filters.
546Filters may be written in any language.
547\f[C]Text.Pandoc.JSON\f[R] exports \f[C]toJSONFilter\f[R] to facilitate
548writing filters in Haskell.
549Those who would prefer to write filters in python can use the module
550\f[C]pandocfilters\f[R], installable from PyPI.
551There are also pandoc filter libraries in PHP, perl, and
554In order of preference, pandoc will look for filters in
556a specified full or relative path (executable or non-executable)
558\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
559\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
562\f[C]$PATH\f[R] (executable only)
564Filters and lua-filters are applied in the order specified on the
568.B \f[C]--lua-filter=\f[R]\f[I]SCRIPT\f[R]
569Transform the document in a similar fashion as JSON filters (see
570\f[C]--filter\f[R]), but use pandoc\[aq]s build-in lua filtering system.
571The given lua script is expected to return a list of lua filters which
572will be applied in order.
573Each lua filter must contain element-transforming functions indexed by
574the name of the AST element on which the filter function should be
578The \f[C]pandoc\f[R] lua module provides helper functions for element
580It is always loaded into the script\[aq]s lua environment.
582The following is an example lua script for macro-expansion:
586function expand_hello_world(inline)
587 if inline.c == \[aq]{{helloworld}}\[aq] then
588 return pandoc.Emph{ pandoc.Str \[dq]Hello, World\[dq] }
594return {{Str = expand_hello_world}}
598In order of preference, pandoc will look for lua filters in
600a specified full or relative path (executable or non-executable)
602\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
603\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
607.B \f[C]-M\f[R] \f[I]KEY\f[R][\f[C]=\f[R]\f[I]VAL\f[R]], \f[C]--metadata=\f[R]\f[I]KEY\f[R][\f[C]:\f[R]\f[I]VAL\f[R]]
608Set the metadata field \f[I]KEY\f[R] to the value \f[I]VAL\f[R].
609A value specified on the command line overrides a value specified in the
610document using YAML metadata blocks.
611Values will be parsed as YAML boolean or string values.
612If no value is specified, the value will be treated as Boolean true.
613Like \f[C]--variable\f[R], \f[C]--metadata\f[R] causes template
615But unlike \f[C]--variable\f[R], \f[C]--metadata\f[R] affects the
616metadata of the underlying document (which is accessible from filters
617and may be printed in some output formats) and metadata values will be
618escaped when inserted into the template.
620.B \f[C]--metadata-file=\f[R]\f[I]FILE\f[R]
621Read metadata from the supplied YAML (or JSON) file.
622This option can be used with every input format, but string scalars in
623the YAML file will always be parsed as Markdown.
624Generally, the input will be handled the same as in YAML metadata
626Metadata values specified inside the document, or by using \f[C]-M\f[R],
627overwrite values specified with this option.
629.B \f[C]-p\f[R], \f[C]--preserve-tabs\f[R]
630Preserve tabs instead of converting them to spaces (the default).
631Note that this will only affect tabs in literal code spans and code
632blocks; tabs in regular text will be treated as spaces.
634.B \f[C]--tab-stop=\f[R]\f[I]NUMBER\f[R]
635Specify the number of spaces per tab (default is 4).
637.B \f[C]--track-changes=accept\f[R]|\f[C]reject\f[R]|\f[C]all\f[R]
638Specifies what to do with insertions, deletions, and comments produced
639by the MS Word \[dq]Track Changes\[dq] feature.
640\f[C]accept\f[R] (the default), inserts all insertions, and ignores all
642\f[C]reject\f[R] inserts all deletions and ignores insertions.
643Both \f[C]accept\f[R] and \f[C]reject\f[R] ignore comments.
644\f[C]all\f[R] puts in insertions, deletions, and comments, wrapped in
645spans with \f[C]insertion\f[R], \f[C]deletion\f[R],
646\f[C]comment-start\f[R], and \f[C]comment-end\f[R] classes,
648The author and time of change is included.
649\f[C]all\f[R] is useful for scripting: only accepting changes from a
650certain reviewer, say, or before a certain date.
651If a paragraph is inserted or deleted, \f[C]track-changes=all\f[R]
652produces a span with the class
653\f[C]paragraph-insertion\f[R]/\f[C]paragraph-deletion\f[R] before the
654affected paragraph break.
655This option only affects the docx reader.
657.B \f[C]--extract-media=\f[R]\f[I]DIR\f[R]
658Extract images and other media contained in or linked from the source
659document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
660the images references in the document so they point to the extracted
662If the source format is a binary container (docx, epub, or odt), the
663media is extracted from the container and the original filenames are
665Otherwise the media is read from the file system or downloaded, and new
666filenames are constructed based on SHA1 hashes of the contents.
668.B \f[C]--abbreviations=\f[R]\f[I]FILE\f[R]
669Specifies a custom abbreviations file, with abbreviations one to a line.
670If this option is not specified, pandoc will read the data file
671\f[C]abbreviations\f[R] from the user data directory or fall back on a
673To see the system default, use
674\f[C]pandoc --print-default-data-file=abbreviations\f[R].
675The only use pandoc makes of this list is in the Markdown reader.
676Strings ending in a period that are found in this list will be followed
677by a nonbreaking space, so that the period will not produce
678sentence-ending space in formats like LaTeX.
679.SS General writer options
681.B \f[C]-s\f[R], \f[C]--standalone\f[R]
682Produce output with an appropriate header and footer (e.g.
683a standalone HTML, LaTeX, TEI, or RTF file, not a fragment).
684This option is set automatically for \f[C]pdf\f[R], \f[C]epub\f[R],
685\f[C]epub3\f[R], \f[C]fb2\f[R], \f[C]docx\f[R], and \f[C]odt\f[R]
687For \f[C]native\f[R] output, this option causes metadata to be included;
688otherwise, metadata is suppressed.
690.B \f[C]--template=\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
691Use the specified file as a custom template for the generated document.
692Implies \f[C]--standalone\f[R].
693See Templates, below, for a description of template syntax.
694If no extension is specified, an extension corresponding to the writer
695will be added, so that \f[C]--template=special\f[R] looks for
696\f[C]special.html\f[R] for HTML output.
697If the template is not found, pandoc will search for it in the
698\f[C]templates\f[R] subdirectory of the user data directory (see
699\f[C]--data-dir\f[R]).
700If this option is not used, a default template appropriate for the
701output format will be used (see \f[C]-D/--print-default-template\f[R]).
703.B \f[C]-V\f[R] \f[I]KEY\f[R][\f[C]=\f[R]\f[I]VAL\f[R]], \f[C]--variable=\f[R]\f[I]KEY\f[R][\f[C]:\f[R]\f[I]VAL\f[R]]
704Set the template variable \f[I]KEY\f[R] to the value \f[I]VAL\f[R] when
705rendering the document in standalone mode.
706This is generally only useful when the \f[C]--template\f[R] option is
707used to specify a custom template, since pandoc automatically sets the
708variables used in the default templates.
709If no \f[I]VAL\f[R] is specified, the key will be given the value
712.B \f[C]-D\f[R] \f[I]FORMAT\f[R], \f[C]--print-default-template=\f[R]\f[I]FORMAT\f[R]
713Print the system default template for an output \f[I]FORMAT\f[R].
714(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates
715in the user data directory are ignored.
716This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
717output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
718\f[C]--print-default-template\f[R] on the command line.
720.B \f[C]--print-default-data-file=\f[R]\f[I]FILE\f[R]
721Print a system default data file.
722Files in the user data directory are ignored.
723This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
724output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
725\f[C]--print-default-data-file\f[R] on the command line.
727.B \f[C]--eol=crlf\f[R]|\f[C]lf\f[R]|\f[C]native\f[R]
728Manually specify line endings: \f[C]crlf\f[R] (Windows), \f[C]lf\f[R]
729(macOS/Linux/UNIX), or \f[C]native\f[R] (line endings appropriate to the
730OS on which pandoc is being run).
731The default is \f[C]native\f[R].
733.B \f[C]--dpi\f[R]=\f[I]NUMBER\f[R]
734Specify the dpi (dots per inch) value for conversion from pixels to
735inch/centimeters and vice versa.
737Technically, the correct term would be ppi (pixels per inch).
739.B \f[C]--wrap=auto\f[R]|\f[C]none\f[R]|\f[C]preserve\f[R]
740Determine how text is wrapped in the output (the source code, not the
742With \f[C]auto\f[R] (the default), pandoc will attempt to wrap lines to
743the column width specified by \f[C]--columns\f[R] (default 72).
744With \f[C]none\f[R], pandoc will not wrap lines at all.
745With \f[C]preserve\f[R], pandoc will attempt to preserve the wrapping
746from the source document (that is, where there are nonsemantic newlines
747in the source, there will be nonsemantic newlines in the output as
749Automatic wrapping does not currently work in HTML output.
750In \f[C]ipynb\f[R] output, this option affects wrapping of the contents
753.B \f[C]--columns=\f[R]\f[I]NUMBER\f[R]
754Specify length of lines in characters.
755This affects text wrapping in the generated source code (see
757It also affects calculation of column widths for plain text tables (see
760.B \f[C]--toc\f[R], \f[C]--table-of-contents\f[R]
761Include an automatically generated table of contents (or, in the case of
762\f[C]latex\f[R], \f[C]context\f[R], \f[C]docx\f[R], \f[C]odt\f[R],
763\f[C]opendocument\f[R], \f[C]rst\f[R], or \f[C]ms\f[R], an instruction
764to create one) in the output document.
765This option has no effect unless \f[C]-s/--standalone\f[R] is used, and
766it has no effect on \f[C]man\f[R], \f[C]docbook4\f[R],
767\f[C]docbook5\f[R], or \f[C]jats\f[R] output.
769.B \f[C]--toc-depth=\f[R]\f[I]NUMBER\f[R]
770Specify the number of section levels to include in the table of
772The default is 3 (which means that level-1, 2, and 3 headings will be
773listed in the contents).
775.B \f[C]--strip-comments\f[R]
776Strip out HTML comments in the Markdown or Textile source, rather than
777passing them on to Markdown, Textile or HTML output as raw HTML.
778This does not apply to HTML comments inside raw HTML blocks when the
779\f[C]markdown_in_html_blocks\f[R] extension is not set.
781.B \f[C]--no-highlight\f[R]
782Disables syntax highlighting for code blocks and inlines, even when a
783language attribute is given.
785.B \f[C]--highlight-style=\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
786Specifies the coloring style to be used in highlighted source code.
787Options are \f[C]pygments\f[R] (the default), \f[C]kate\f[R],
788\f[C]monochrome\f[R], \f[C]breezeDark\f[R], \f[C]espresso\f[R],
789\f[C]zenburn\f[R], \f[C]haddock\f[R], and \f[C]tango\f[R].
790For more information on syntax highlighting in pandoc, see Syntax
792See also \f[C]--list-highlight-styles\f[R].
795Instead of a \f[I]STYLE\f[R] name, a JSON file with extension
796\f[C].theme\f[R] may be supplied.
797This will be parsed as a KDE syntax highlighting theme and (if valid)
798used as the highlighting style.
800To generate the JSON version of an existing style, use
801\f[C]--print-highlight-style\f[R].
804.B \f[C]--print-highlight-style=\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
805Prints a JSON version of a highlighting style, which can be modified,
806saved with a \f[C].theme\f[R] extension, and used with
807\f[C]--highlight-style\f[R].
808This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
809output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
810\f[C]--print-highlight-style\f[R] on the command line.
812.B \f[C]--syntax-definition=\f[R]\f[I]FILE\f[R]
813Instructs pandoc to load a KDE XML syntax definition file, which will be
814used for syntax highlighting of appropriately marked code blocks.
815This can be used to add support for new languages or to use altered
816syntax definitions for existing languages.
818.B \f[C]-H\f[R] \f[I]FILE\f[R], \f[C]--include-in-header=\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
819Include contents of \f[I]FILE\f[R], verbatim, at the end of the header.
820This can be used, for example, to include special CSS or JavaScript in
822This option can be used repeatedly to include multiple files in the
824They will be included in the order specified.
825Implies \f[C]--standalone\f[R].
827.B \f[C]-B\f[R] \f[I]FILE\f[R], \f[C]--include-before-body=\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
828Include contents of \f[I]FILE\f[R], verbatim, at the beginning of the
830after the \f[C]<body>\f[R] tag in HTML, or the
831\f[C]\[rs]begin{document}\f[R] command in LaTeX).
832This can be used to include navigation bars or banners in HTML
834This option can be used repeatedly to include multiple files.
835They will be included in the order specified.
836Implies \f[C]--standalone\f[R].
838.B \f[C]-A\f[R] \f[I]FILE\f[R], \f[C]--include-after-body=\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
839Include contents of \f[I]FILE\f[R], verbatim, at the end of the document
840body (before the \f[C]</body>\f[R] tag in HTML, or the
841\f[C]\[rs]end{document}\f[R] command in LaTeX).
842This option can be used repeatedly to include multiple files.
843They will be included in the order specified.
844Implies \f[C]--standalone\f[R].
846.B \f[C]--resource-path=\f[R]\f[I]SEARCHPATH\f[R]
847List of paths to search for images and other resources.
848The paths should be separated by \f[C]:\f[R] on Linux, UNIX, and macOS
849systems, and by \f[C];\f[R] on Windows.
850If \f[C]--resource-path\f[R] is not specified, the default resource path
851is the working directory.
852Note that, if \f[C]--resource-path\f[R] is specified, the working
853directory must be explicitly listed or it will not be searched.
854For example: \f[C]--resource-path=.:test\f[R] will search the working
855directory and the \f[C]test\f[R] subdirectory, in that order.
858\f[C]--resource-path\f[R] only has an effect if (a) the output format
859embeds images (for example, \f[C]docx\f[R], \f[C]pdf\f[R], or
860\f[C]html\f[R] with \f[C]--self-contained\f[R]) or (b) it is used
861together with \f[C]--extract-media\f[R].
864.B \f[C]--request-header=\f[R]\f[I]NAME\f[R]\f[C]:\f[R]\f[I]VAL\f[R]
865Set the request header \f[I]NAME\f[R] to the value \f[I]VAL\f[R] when
866making HTTP requests (for example, when a URL is given on the command
867line, or when resources used in a document must be downloaded).
868If you\[aq]re behind a proxy, you also need to set the environment
869variable \f[C]http_proxy\f[R] to \f[C]http://...\f[R].
870.SS Options affecting specific writers
872.B \f[C]--self-contained\f[R]
873Produce a standalone HTML file with no external dependencies, using
874\f[C]data:\f[R] URIs to incorporate the contents of linked scripts,
875stylesheets, images, and videos.
876Implies \f[C]--standalone\f[R].
877The resulting file should be \[dq]self-contained,\[dq] in the sense that
878it needs no external files and no net access to be displayed properly by
880This option works only with HTML output formats, including
881\f[C]html4\f[R], \f[C]html5\f[R], \f[C]html+lhs\f[R],
882\f[C]html5+lhs\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
883\f[C]dzslides\f[R], and \f[C]revealjs\f[R].
884Scripts, images, and stylesheets at absolute URLs will be downloaded;
885those at relative URLs will be sought relative to the working directory
886(if the first source file is local) or relative to the base URL (if the
887first source file is remote).
888Elements with the attribute \f[C]data-external=\[dq]1\[dq]\f[R] will be
889left alone; the documents they link to will not be incorporated in the
891Limitation: resources that are loaded dynamically through JavaScript
892cannot be incorporated; as a result, \f[C]--self-contained\f[R] does not
893work with \f[C]--mathjax\f[R], and some advanced features (e.g.
894zoom or speaker notes) may not work in an offline
895\[dq]self-contained\[dq] \f[C]reveal.js\f[R] slide show.
897.B \f[C]--html-q-tags\f[R]
898Use \f[C]<q>\f[R] tags for quotes in HTML.
901Use only ASCII characters in output.
902Currently supported for XML and HTML formats (which use entities instead
903of UTF-8 when this option is selected), CommonMark, gfm, and Markdown
904(which use entities), roff ms (which use hexadecimal escapes), and to a
905limited degree LaTeX (which uses standard commands for accented
906characters when possible).
907roff man output uses ASCII by default.
909.B \f[C]--reference-links\f[R]
910Use reference-style links, rather than inline links, in writing Markdown
912By default inline links are used.
913The placement of link references is affected by the
914\f[C]--reference-location\f[R] option.
916.B \f[C]--reference-location = block\f[R]|\f[C]section\f[R]|\f[C]document\f[R]
917Specify whether footnotes (and references, if \f[C]reference-links\f[R]
918is set) are placed at the end of the current (top-level) block, the
919current section, or the document.
920The default is \f[C]document\f[R].
921Currently only affects the markdown writer.
923.B \f[C]--atx-headers\f[R]
924Use ATX-style headings in Markdown output.
925The default is to use setext-style headings for levels 1 to 2, and then
927(Note: for \f[C]gfm\f[R] output, ATX headings are always used.) This
928option also affects markdown cells in \f[C]ipynb\f[R] output.
930.B \f[C]--top-level-division=[default|section|chapter|part]\f[R]
931Treat top-level headings as the given division type in LaTeX, ConTeXt,
932DocBook, and TEI output.
933The hierarchy order is part, chapter, then section; all headings are
934shifted such that the top-level heading becomes the specified type.
935The default behavior is to determine the best division type via
936heuristics: unless other conditions apply, \f[C]section\f[R] is chosen.
937When the LaTeX document class is set to \f[C]report\f[R],
938\f[C]book\f[R], or \f[C]memoir\f[R] (unless the \f[C]article\f[R] option
939is specified), \f[C]chapter\f[R] is implied as the setting for this
941If \f[C]beamer\f[R] is the output format, specifying either
942\f[C]chapter\f[R] or \f[C]part\f[R] will cause top-level headings to
943become \f[C]\[rs]part{..}\f[R], while second-level headings remain as
946.B \f[C]-N\f[R], \f[C]--number-sections\f[R]
947Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
948By default, sections are not numbered.
949Sections with class \f[C]unnumbered\f[R] will never be numbered, even if
950\f[C]--number-sections\f[R] is specified.
952.B \f[C]--number-offset=\f[R]\f[I]NUMBER\f[R][\f[C],\f[R]\f[I]NUMBER\f[R]\f[C],\f[R]\f[I]...\f[R]]
953Offset for section headings in HTML output (ignored in other output
955The first number is added to the section number for top-level headings,
956the second for second-level headings, and so on.
957So, for example, if you want the first top-level heading in your
958document to be numbered \[dq]6\[dq], specify
959\f[C]--number-offset=5\f[R].
960If your document starts with a level-2 heading which you want to be
961numbered \[dq]1.5\[dq], specify \f[C]--number-offset=1,4\f[R].
962Offsets are 0 by default.
963Implies \f[C]--number-sections\f[R].
965.B \f[C]--listings\f[R]
966Use the \f[C]listings\f[R] package for LaTeX code blocks.
967The package does not support multi-byte encoding for source code.
968To handle UTF-8 you would need to use a custom template.
969This issue is fully documented here: Encoding issue with the listings
972.B \f[C]-i\f[R], \f[C]--incremental\f[R]
973Make list items in slide shows display incrementally (one by one).
974The default is for lists to be displayed all at once.
976.B \f[C]--slide-level=\f[R]\f[I]NUMBER\f[R]
977Specifies that headings with the specified level create slides (for
978\f[C]beamer\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
980Headings above this level in the hierarchy are used to divide the slide
981show into sections; headings below this level create subheads within a
983Note that content that is not contained under slide-level headings will
984not appear in the slide show.
985The default is to set the slide level based on the contents of the
986document; see Structuring the slide show.
988.B \f[C]--section-divs\f[R]
989Wrap sections in \f[C]<section>\f[R] tags (or \f[C]<div>\f[R] tags for
990\f[C]html4\f[R]), and attach identifiers to the enclosing
991\f[C]<section>\f[R] (or \f[C]<div>\f[R]) rather than the heading itself.
992See Heading identifiers, below.
994.B \f[C]--email-obfuscation=none\f[R]|\f[C]javascript\f[R]|\f[C]references\f[R]
995Specify a method for obfuscating \f[C]mailto:\f[R] links in HTML
997\f[C]none\f[R] leaves \f[C]mailto:\f[R] links as they are.
998\f[C]javascript\f[R] obfuscates them using JavaScript.
999\f[C]references\f[R] obfuscates them by printing their letters as
1000decimal or hexadecimal character references.
1001The default is \f[C]none\f[R].
1003.B \f[C]--id-prefix=\f[R]\f[I]STRING\f[R]
1004Specify a prefix to be added to all identifiers and internal links in
1005HTML and DocBook output, and to footnote numbers in Markdown and Haddock
1007This is useful for preventing duplicate identifiers when generating
1008fragments to be included in other pages.
1010.B \f[C]-T\f[R] \f[I]STRING\f[R], \f[C]--title-prefix=\f[R]\f[I]STRING\f[R]
1011Specify \f[I]STRING\f[R] as a prefix at the beginning of the title that
1012appears in the HTML header (but not in the title as it appears at the
1013beginning of the HTML body).
1014Implies \f[C]--standalone\f[R].
1016.B \f[C]-c\f[R] \f[I]URL\f[R], \f[C]--css=\f[R]\f[I]URL\f[R]
1017Link to a CSS style sheet.
1018This option can be used repeatedly to include multiple files.
1019They will be included in the order specified.
1022A stylesheet is required for generating EPUB.
1023If none is provided using this option (or the \f[C]css\f[R] or
1024\f[C]stylesheet\f[R] metadata fields), pandoc will look for a file
1025\f[C]epub.css\f[R] in the user data directory (see
1026\f[C]--data-dir\f[R]).
1027If it is not found there, sensible defaults will be used.
1030.B \f[C]--reference-doc=\f[R]\f[I]FILE\f[R]
1031Use the specified file as a style reference in producing a docx or ODT
1036For best results, the reference docx should be a modified version of a
1037docx file produced using pandoc.
1038The contents of the reference docx are ignored, but its stylesheets and
1039document properties (including margins, page size, header, and footer)
1040are used in the new docx.
1041If no reference docx is specified on the command line, pandoc will look
1042for a file \f[C]reference.docx\f[R] in the user data directory (see
1043\f[C]--data-dir\f[R]).
1044If this is not found either, sensible defaults will be used.
1047To produce a custom \f[C]reference.docx\f[R], first get a copy of the
1048default \f[C]reference.docx\f[R]:
1049\f[C]pandoc -o custom-reference.docx --print-default-data-file reference.docx\f[R].
1050Then open \f[C]custom-reference.docx\f[R] in Word, modify the styles as
1051you wish, and save the file.
1052For best results, do not make changes to this file other than modifying
1053the styles used by pandoc:
1117Default Paragraph Font
1133For best results, the reference ODT should be a modified version of an
1134ODT produced using pandoc.
1135The contents of the reference ODT are ignored, but its stylesheets are
1137If no reference ODT is specified on the command line, pandoc will look
1138for a file \f[C]reference.odt\f[R] in the user data directory (see
1139\f[C]--data-dir\f[R]).
1140If this is not found either, sensible defaults will be used.
1143To produce a custom \f[C]reference.odt\f[R], first get a copy of the
1144default \f[C]reference.odt\f[R]:
1145\f[C]pandoc -o custom-reference.odt --print-default-data-file reference.odt\f[R].
1146Then open \f[C]custom-reference.odt\f[R] in LibreOffice, modify the
1147styles as you wish, and save the file.
1151Templates included with Microsoft PowerPoint 2013 (either with
1152\f[C].pptx\f[R] or \f[C].potx\f[R] extension) are known to work, as are
1153most templates derived from these.
1156The specific requirement is that the template should begin with the
1157following first four layouts:
1167All templates included with a recent version of MS PowerPoint will fit
1169(You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to
1172You can also modify the default \f[C]reference.pptx\f[R]: first run
1173\f[C]pandoc -o custom-reference.pptx --print-default-data-file reference.pptx\f[R],
1174and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc
1175will use the first four layout slides, as mentioned above).
1179.B \f[C]--epub-cover-image=\f[R]\f[I]FILE\f[R]
1180Use the specified image as the EPUB cover.
1181It is recommended that the image be less than 1000px in width and
1183Note that in a Markdown source document you can also specify
1184\f[C]cover-image\f[R] in a YAML metadata block (see EPUB Metadata,
1187.B \f[C]--epub-metadata=\f[R]\f[I]FILE\f[R]
1188Look in the specified XML file for metadata for the EPUB.
1189The file should contain a series of Dublin Core elements.
1195 <dc:rights>Creative Commons</dc:rights>
1196 <dc:language>es-AR</dc:language>
1200By default, pandoc will include the following metadata elements:
1201\f[C]<dc:title>\f[R] (from the document title), \f[C]<dc:creator>\f[R]
1202(from the document authors), \f[C]<dc:date>\f[R] (from the document
1203date, which should be in ISO 8601 format), \f[C]<dc:language>\f[R] (from
1204the \f[C]lang\f[R] variable, or, if is not set, the locale), and
1205\f[C]<dc:identifier id=\[dq]BookId\[dq]>\f[R] (a randomly generated
1207Any of these may be overridden by elements in the metadata file.
1209Note: if the source document is Markdown, a YAML metadata block in the
1210document can be used instead.
1211See below under EPUB Metadata.
1214.B \f[C]--epub-embed-font=\f[R]\f[I]FILE\f[R]
1215Embed the specified font in the EPUB.
1216This option can be repeated to embed multiple fonts.
1217Wildcards can also be used: for example, \f[C]DejaVuSans-*.ttf\f[R].
1218However, if you use wildcards on the command line, be sure to escape
1219them or put the whole filename in single quotes, to prevent them from
1220being interpreted by the shell.
1221To use the embedded fonts, you will need to add declarations like the
1222following to your CSS (see \f[C]--css\f[R]):
1228font-family: DejaVuSans;
1231src:url(\[dq]DejaVuSans-Regular.ttf\[dq]);
1234font-family: DejaVuSans;
1237src:url(\[dq]DejaVuSans-Bold.ttf\[dq]);
1240font-family: DejaVuSans;
1243src:url(\[dq]DejaVuSans-Oblique.ttf\[dq]);
1246font-family: DejaVuSans;
1249src:url(\[dq]DejaVuSans-BoldOblique.ttf\[dq]);
1251body { font-family: \[dq]DejaVuSans\[dq]; }
1256.B \f[C]--epub-chapter-level=\f[R]\f[I]NUMBER\f[R]
1257Specify the heading level at which to split the EPUB into separate
1258\[dq]chapter\[dq] files.
1259The default is to split into chapters at level-1 headings.
1260This option only affects the internal composition of the EPUB, not the
1261way chapters and sections are displayed to users.
1262Some readers may be slow if the chapter files are too large, so for
1263large documents with few level-1 headings, one might want to use a
1264chapter level of 2 or 3.
1266.B \f[C]--epub-subdirectory=\f[R]\f[I]DIRNAME\f[R]
1267Specify the subdirectory in the OCF container that is to hold the
1268EPUB-specific contents.
1269The default is \f[C]EPUB\f[R].
1270To put the EPUB contents in the top level, use an empty string.
1272.B \f[C]--ipynb-output=all|none|best\f[R]
1273Determines how ipynb output cells are treated.
1274\f[C]all\f[R] means that all of the data formats included in the
1275original are preserved.
1276\f[C]none\f[R] means that the contents of data cells are omitted.
1277\f[C]best\f[R] causes pandoc to try to pick the richest data block in
1278each output cell that is compatible with the output format.
1279The default is \f[C]best\f[R].
1281.B \f[C]--pdf-engine=\f[R]\f[I]PROGRAM\f[R]
1282Use the specified engine when producing PDF output.
1283Valid values are \f[C]pdflatex\f[R], \f[C]lualatex\f[R],
1284\f[C]xelatex\f[R], \f[C]latexmk\f[R], \f[C]tectonic\f[R],
1285\f[C]wkhtmltopdf\f[R], \f[C]weasyprint\f[R], \f[C]prince\f[R],
1286\f[C]context\f[R], and \f[C]pdfroff\f[R].
1287The default is \f[C]pdflatex\f[R].
1288If the engine is not in your PATH, the full path of the engine may be
1291.B \f[C]--pdf-engine-opt=\f[R]\f[I]STRING\f[R]
1292Use the given string as a command-line argument to the
1293\f[C]pdf-engine\f[R].
1294For example, to use a persistent directory \f[C]foo\f[R] for
1295\f[C]latexmk\f[R]\[aq]s auxiliary files, use
1296\f[C]--pdf-engine-opt=-outdir=foo\f[R].
1297Note that no check for duplicate options is done.
1298.SS Citation rendering
1300.B \f[C]--bibliography=\f[R]\f[I]FILE\f[R]
1301Set the \f[C]bibliography\f[R] field in the document\[aq]s metadata to
1302\f[I]FILE\f[R], overriding any value set in the metadata, and process
1303citations using \f[C]pandoc-citeproc\f[R].
1304(This is equivalent to
1305\f[C]--metadata bibliography=FILE --filter pandoc-citeproc\f[R].) If
1306\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] is also supplied,
1307\f[C]pandoc-citeproc\f[R] is not used, making this equivalent to
1308\f[C]--metadata bibliography=FILE\f[R].
1309If you supply this argument multiple times, each \f[I]FILE\f[R] will be
1310added to bibliography.
1312.B \f[C]--csl=\f[R]\f[I]FILE\f[R]
1313Set the \f[C]csl\f[R] field in the document\[aq]s metadata to
1314\f[I]FILE\f[R], overriding any value set in the metadata.
1315(This is equivalent to \f[C]--metadata csl=FILE\f[R].) This option is
1316only relevant with \f[C]pandoc-citeproc\f[R].
1318.B \f[C]--citation-abbreviations=\f[R]\f[I]FILE\f[R]
1319Set the \f[C]citation-abbreviations\f[R] field in the document\[aq]s
1320metadata to \f[I]FILE\f[R], overriding any value set in the metadata.
1321(This is equivalent to
1322\f[C]--metadata citation-abbreviations=FILE\f[R].) This option is only
1323relevant with \f[C]pandoc-citeproc\f[R].
1325.B \f[C]--natbib\f[R]
1326Use \f[C]natbib\f[R] for citations in LaTeX output.
1327This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
1329It is intended for use in producing a LaTeX file that can be processed
1330with \f[C]bibtex\f[R].
1332.B \f[C]--biblatex\f[R]
1333Use \f[C]biblatex\f[R] for citations in LaTeX output.
1334This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
1336It is intended for use in producing a LaTeX file that can be processed
1337with \f[C]bibtex\f[R] or \f[C]biber\f[R].
1338.SS Math rendering in HTML
1340The default is to render TeX math as far as possible using Unicode
1342Formulas are put inside a \f[C]span\f[R] with
1343\f[C]class=\[dq]math\[dq]\f[R], so that they may be styled differently
1344from the surrounding text if needed.
1345However, this gives acceptable results only for basic math, usually you
1346will want to use \f[C]--mathjax\f[R] or another of the following
1349.B \f[C]--mathjax\f[R][\f[C]=\f[R]\f[I]URL\f[R]]
1350Use MathJax to display embedded TeX math in HTML output.
1351TeX math will be put between \f[C]\[rs](...\[rs])\f[R] (for inline math)
1352or \f[C]\[rs][...\[rs]]\f[R] (for display math) and wrapped in
1353\f[C]<span>\f[R] tags with class \f[C]math\f[R].
1354Then the MathJax JavaScript will render it.
1355The \f[I]URL\f[R] should point to the \f[C]MathJax.js\f[R] load script.
1356If a \f[I]URL\f[R] is not provided, a link to the Cloudflare CDN will be
1359.B \f[C]--mathml\f[R]
1360Convert TeX math to MathML (in \f[C]epub3\f[R], \f[C]docbook4\f[R],
1361\f[C]docbook5\f[R], \f[C]jats\f[R], \f[C]html4\f[R] and
1363This is the default in \f[C]odt\f[R] output.
1364Note that currently only Firefox and Safari (and select e-book readers)
1365natively support MathML.
1367.B \f[C]--webtex\f[R][\f[C]=\f[R]\f[I]URL\f[R]]
1368Convert TeX formulas to \f[C]<img>\f[R] tags that link to an external
1369script that converts formulas to images.
1370The formula will be URL-encoded and concatenated with the URL provided.
1371For SVG images you can for example use
1372\f[C]--webtex https://latex.codecogs.com/svg.latex?\f[R].
1373If no URL is specified, the CodeCogs URL generating PNGs will be used
1374(\f[C]https://latex.codecogs.com/png.latex?\f[R]).
1375Note: the \f[C]--webtex\f[R] option will affect Markdown output as well
1376as HTML, which is useful if you\[aq]re targeting a version of Markdown
1377without native math support.
1379.B \f[C]--katex\f[R][\f[C]=\f[R]\f[I]URL\f[R]]
1380Use KaTeX to display embedded TeX math in HTML output.
1381The \f[I]URL\f[R] is the base URL for the KaTeX library.
1382That directory should contain a \f[C]katex.min.js\f[R] and a
1383\f[C]katex.min.css\f[R] file.
1384If a \f[I]URL\f[R] is not provided, a link to the KaTeX CDN will be
1387.B \f[C]--gladtex\f[R]
1388Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
1389The resulting HTML can then be processed by GladTeX to produce images of
1390the typeset formulas and an HTML file with links to these images.
1391So, the procedure is:
1396pandoc -s --gladtex input.md -o myfile.htex
1397gladtex -d myfile-images myfile.htex
1398# produces myfile.html and images in myfile-images
1402.SS Options for wrapper scripts
1404.B \f[C]--dump-args\f[R]
1405Print information about command-line arguments to \f[I]stdout\f[R], then
1407This option is intended primarily for use in wrapper scripts.
1408The first line of output contains the name of the output file specified
1409with the \f[C]-o\f[R] option, or \f[C]-\f[R] (for \f[I]stdout\f[R]) if
1410no output file was specified.
1411The remaining lines contain the command-line arguments, one per line, in
1412the order they appear.
1413These do not include regular pandoc options and their arguments, but do
1414include any options appearing after a \f[C]--\f[R] separator at the end
1417.B \f[C]--ignore-args\f[R]
1418Ignore command-line arguments (for use in wrapper scripts).
1419Regular pandoc options are not ignored.
1425pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
1433pandoc -o foo.html -s
1439When the \f[C]-s/--standalone\f[R] option is used, pandoc uses a
1440template to add header and footer material that is needed for a
1441self-standing document.
1442To see the default template that is used, just type
1450where \f[I]FORMAT\f[R] is the name of the output format.
1451A custom template can be specified using the \f[C]--template\f[R]
1453You can also override the system default templates for a given output
1454format \f[I]FORMAT\f[R] by putting a file
1455\f[C]templates/default.*FORMAT*\f[R] in the user data directory (see
1456\f[C]--data-dir\f[R], above).
1457\f[I]Exceptions:\f[R]
1459For \f[C]odt\f[R] output, customize the \f[C]default.opendocument\f[R]
1462For \f[C]pdf\f[R] output, customize the \f[C]default.latex\f[R] template
1463(or the \f[C]default.context\f[R] template, if you use
1464\f[C]-t context\f[R], or the \f[C]default.ms\f[R] template, if you use
1465\f[C]-t ms\f[R], or the \f[C]default.html\f[R] template, if you use
1468\f[C]docx\f[R] and \f[C]pptx\f[R] have no template (however, you can use
1469\f[C]--reference-doc\f[R] to customize the output).
1471Templates contain \f[I]variables\f[R], which allow for the inclusion of
1472arbitrary information at any point in the file.
1473They may be set at the command line using the \f[C]-V/--variable\f[R]
1475If a variable is not set, pandoc will look for the key in the
1476document\[aq]s metadata \[en] which can be set using either YAML
1477metadata blocks or with the \f[C]-M/--metadata\f[R] option.
1478.SS Metadata variables
1480.B \f[C]title\f[R], \f[C]author\f[R], \f[C]date\f[R]
1481allow identification of basic aspects of the document.
1482Included in PDF metadata through LaTeX and ConTeXt.
1483These can be set through a pandoc title block, which allows for multiple
1484authors, or through a YAML metadata block:
1498.B \f[C]subtitle\f[R]
1499document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
1502.B \f[C]abstract\f[R]
1503document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx
1506.B \f[C]keywords\f[R]
1507list of keywords to be included in HTML, PDF, ODT, pptx, docx and
1508AsciiDoc metadata; repeat as for \f[C]author\f[R], above
1511document subject, included in ODT, PDF, docx and pptx metadata
1513.B \f[C]description\f[R]
1514document description, included in ODT, docx and pptx metadata.
1515Some applications show this as \f[C]Comments\f[R] metadata.
1517.B \f[C]category\f[R]
1518document category, included in docx and pptx metadata
1520Additionally, any root-level string metadata, not included in ODT, docx
1521or pptx metadata is added as a \f[I]custom property\f[R].
1522The following YAML metadata block for instance:
1527title: \[aq]This is the title\[aq]
1528subtitle: \[dq]This is the subtitle\[dq]
1536 It consists of two paragraphs
1541will include \f[C]title\f[R], \f[C]author\f[R] and \f[C]description\f[R]
1542as standard document properties and \f[C]subtitle\f[R] as a custom
1543property when converting to docx, ODT or pptx.
1544.SS Language variables
1547identifies the main language of the document using IETF language tags
1548(following the BCP 47 standard), such as \f[C]en\f[R] or
1550The Language subtag lookup tool can look up or verify these tags.
1551This affects most formats, and controls hyphenation in PDF output when
1552using LaTeX (through \f[C]babel\f[R] and \f[C]polyglossia\f[R]) or
1556Use native pandoc Divs and Spans with the \f[C]lang\f[R] attribute to
1565Text in the main document language (British English).
1568> Cette citation est \['e]crite en fran\[,c]ais canadien.
1571More text in English. [\[aq]Zitat auf Deutsch.\[aq]]{lang=de}
1577the base script direction, either \f[C]rtl\f[R] (right-to-left) or
1578\f[C]ltr\f[R] (left-to-right).
1581For bidirectional documents, native pandoc \f[C]span\f[R]s and
1582\f[C]div\f[R]s with the \f[C]dir\f[R] attribute (value \f[C]rtl\f[R] or
1583\f[C]ltr\f[R]) can be used to override the base direction in some output
1585This may not always be necessary if the final renderer (e.g.
1586the browser, when generating HTML) supports the Unicode Bidirectional
1589When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[R]
1590engine is fully supported (use \f[C]--pdf-engine=xelatex\f[R]).
1592.SS Variables for HTML slides
1594These affect HTML output when producing slide shows with pandoc.
1595All reveal.js configuration options are available as variables.
1597.B \f[C]revealjs-url\f[R]
1598base URL for reveal.js documents (defaults to \f[C]reveal.js\f[R])
1601base URL for S5 documents (defaults to \f[C]s5/default\f[R])
1603.B \f[C]slidy-url\f[R]
1604base URL for Slidy documents (defaults to
1605\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[R])
1607.B \f[C]slideous-url\f[R]
1608base URL for Slideous documents (defaults to \f[C]slideous\f[R])
1609.SS Variables for Beamer slides
1611These variables change the appearance of PDF slides using
1614.B \f[C]aspectratio\f[R]
1615slide aspect ratio (\f[C]43\f[R] for 4:3 [default], \f[C]169\f[R] for
161616:9, \f[C]1610\f[R] for 16:10, \f[C]149\f[R] for 14:9, \f[C]141\f[R]
1617for 1.41:1, \f[C]54\f[R] for 5:4, \f[C]32\f[R] for 3:2)
1619.B \f[C]beamerarticle\f[R]
1620produce an article from Beamer slides
1622.B \f[C]beameroption\f[R]
1623add extra beamer option with \f[C]\[rs]setbeameroption{}\f[R]
1625.B \f[C]institute\f[R]
1626author affiliations: can be a list when there are multiple authors
1629logo image for slides
1631.B \f[C]navigation\f[R]
1632controls navigation symbols (default is \f[C]empty\f[R] for no
1633navigation symbols; other valid values are \f[C]frame\f[R],
1634\f[C]vertical\f[R], and \f[C]horizontal\f[R])
1636.B \f[C]section-titles\f[R]
1637enables \[dq]title pages\[dq] for new sections (default is true)
1639.B \f[C]theme\f[R], \f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], \f[C]outertheme\f[R]
1642.B \f[C]themeoptions\f[R]
1643options for LaTeX beamer themes (a list).
1645.B \f[C]titlegraphic\f[R]
1646image for title slide
1647.SS Variables for LaTeX
1649Pandoc uses these variables when creating a PDF with a LaTeX engine.
1652.B \f[C]block-headings\f[R]
1653make \f[C]\[rs]paragraph\f[R] and \f[C]\[rs]subparagraph\f[R] (fourth-
1654and fifth-level headings, or fifth- and sixth-level with book classes)
1655free-standing rather than run-in; requires further formatting to
1656distinguish from \f[C]\[rs]subsubsection\f[R] (third- or fourth-level
1658Instead of using this option, KOMA-Script can adjust headings more
1665documentclass: scrartcl
1667 \[rs]RedeclareSectionCommand[
1668 beforeskip=-10pt plus -2pt minus -1pt,
1669 afterskip=1sp plus -1sp minus 1sp,
1670 font=\[rs]normalfont\[rs]itshape]{paragraph}
1671 \[rs]RedeclareSectionCommand[
1672 beforeskip=-10pt plus -2pt minus -1pt,
1673 afterskip=1sp plus -1sp minus 1sp,
1674 font=\[rs]normalfont\[rs]scshape,
1675 indent=0pt]{subparagraph}
1681.B \f[C]classoption\f[R]
1682option for document class, e.g.
1683\f[C]oneside\f[R]; repeat for multiple options:
1697.B \f[C]documentclass\f[R]
1698document class: usually one of the standard classes, \f[C]article\f[R],
1699\f[C]book\f[R], and \f[C]report\f[R]; the KOMA-Script equivalents,
1700\f[C]scrartcl\f[R], \f[C]scrbook\f[R], and \f[C]scrreprt\f[R], which
1701default to smaller margins; or \f[C]memoir\f[R]
1703.B \f[C]geometry\f[R]
1704option for \f[C]geometry\f[R] package, e.g.
1705\f[C]margin=1in\f[R]; repeat for multiple options:
1721uses document class settings for indentation (the default LaTeX template
1722otherwise removes indentation and adds space between paragraphs)
1724.B \f[C]linestretch\f[R]
1725adjusts line spacing using the \f[C]setspace\f[R] package, e.g.
1726\f[C]1.25\f[R], \f[C]1.5\f[R]
1728.B \f[C]margin-left\f[R], \f[C]margin-right\f[R], \f[C]margin-top\f[R], \f[C]margin-bottom\f[R]
1729sets margins if \f[C]geometry\f[R] is not used (otherwise
1730\f[C]geometry\f[R] overrides these)
1732.B \f[C]pagestyle\f[R]
1733control \f[C]\[rs]pagestyle{}\f[R]: the default article class supports
1734\f[C]plain\f[R] (default), \f[C]empty\f[R] (no running heads or page
1735numbers), and \f[C]headings\f[R] (section titles in running heads)
1737.B \f[C]papersize\f[R]
1739\f[C]letter\f[R], \f[C]a4\f[R]
1741.B \f[C]secnumdepth\f[R]
1742numbering depth for sections (with \f[C]--number-sections\f[R] option or
1743\f[C]numbersections\f[R] variable)
1747allows font encoding to be specified through \f[C]fontenc\f[R] package
1748(with \f[C]pdflatex\f[R]); default is \f[C]T1\f[R] (see LaTeX font
1751.B \f[C]fontfamily\f[R]
1752font package for use with \f[C]pdflatex\f[R]: TeX Live includes many
1753options, documented in the LaTeX Font Catalogue.
1754The default is Latin Modern.
1756.B \f[C]fontfamilyoptions\f[R]
1757options for package used as \f[C]fontfamily\f[R]; repeat for multiple
1759For example, to use the Libertine font with proportional lowercase
1760(old-style) figures through the \f[C]libertinus\f[R] package:
1766fontfamily: libertinus
1775.B \f[C]fontsize\f[R]
1776font size for body text.
1777The standard classes allow 10pt, 11pt, and 12pt.
1778To use another size, set \f[C]documentclass\f[R] to one of the
1779KOMA-Script classes, such as \f[C]scrartcl\f[R] or \f[C]scrbook\f[R].
1781.B \f[C]mainfont\f[R], \f[C]sansfont\f[R], \f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R]
1782font families for use with \f[C]xelatex\f[R] or \f[C]lualatex\f[R]: take
1783the name of any system font, using the \f[C]fontspec\f[R] package.
1784\f[C]CJKmainfont\f[R] uses the \f[C]xecjk\f[R] package.
1786.B \f[C]mainfontoptions\f[R], \f[C]sansfontoptions\f[R], \f[C]monofontoptions\f[R], \f[C]mathfontoptions\f[R], \f[C]CJKoptions\f[R]
1787options to use with \f[C]mainfont\f[R], \f[C]sansfont\f[R],
1788\f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R] in
1789\f[C]xelatex\f[R] and \f[C]lualatex\f[R].
1790Allow for any choices available through \f[C]fontspec\f[R]; repeat for
1792For example, to use the TeX Gyre version of Palatino with lowercase
1799mainfont: TeX Gyre Pagella
1802- Numbers=Proportional
1808.B \f[C]microtypeoptions\f[R]
1809options to pass to the microtype package
1812.B \f[C]colorlinks\f[R]
1813add color to link text; automatically enabled if any of
1814\f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R],
1815\f[C]urlcolor\f[R], or \f[C]toccolor\f[R] are set
1817.B \f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R], \f[C]urlcolor\f[R], \f[C]toccolor\f[R]
1818color for internal links, external links, citation links, linked URLs,
1819and links in table of contents, respectively: uses options allowed by
1820\f[C]xcolor\f[R], including the \f[C]dvipsnames\f[R],
1821\f[C]svgnames\f[R], and \f[C]x11names\f[R] lists
1823.B \f[C]links-as-notes\f[R]
1824causes links to be printed as footnotes
1827.B \f[C]lof\f[R], \f[C]lot\f[R]
1828include list of figures, list of tables
1831contents of acknowledgments footnote after document title
1834include table of contents (can also be set using
1835\f[C]--toc/--table-of-contents\f[R])
1837.B \f[C]toc-depth\f[R]
1838level of section to include in table of contents
1839.SS BibLaTeX Bibliographies
1841These variables function when using BibLaTeX for citation rendering.
1843.B \f[C]biblatexoptions\f[R]
1844list of options for biblatex
1846.B \f[C]biblio-style\f[R]
1847bibliography style, when used with \f[C]--natbib\f[R] and
1848\f[C]--biblatex\f[R].
1850.B \f[C]biblio-title\f[R]
1851bibliography title, when used with \f[C]--natbib\f[R] and
1852\f[C]--biblatex\f[R].
1854.B \f[C]bibliography\f[R]
1855bibliography to use for resolving references
1857.B \f[C]natbiboptions\f[R]
1858list of options for natbib
1859.SS Variables for ConTeXt
1861Pandoc uses these variables when creating a PDF with ConTeXt.
1863.B \f[C]fontsize\f[R]
1864font size for body text (e.g.
1865\f[C]10pt\f[R], \f[C]12pt\f[R])
1867.B \f[C]headertext\f[R], \f[C]footertext\f[R]
1868text to be placed in running header or footer (see ConTeXt Headers and
1869Footers); repeat up to four times for different placement
1871.B \f[C]indenting\f[R]
1872controls indentation of paragraphs, e.g.
1873\f[C]yes,small,next\f[R] (see ConTeXt Indentation); repeat for multiple
1876.B \f[C]interlinespace\f[R]
1877adjusts line spacing, e.g.
1878\f[C]4ex\f[R] (using \f[C]setupinterlinespace\f[R]); repeat for multiple
1882options for page margins and text arrangement (see ConTeXt Layout);
1883repeat for multiple options
1885.B \f[C]linkcolor\f[R], \f[C]contrastcolor\f[R]
1886color for links outside and inside a page, e.g.
1887\f[C]red\f[R], \f[C]blue\f[R] (see ConTeXt Color)
1889.B \f[C]linkstyle\f[R]
1890typeface style for links, e.g.
1891\f[C]normal\f[R], \f[C]bold\f[R], \f[C]slanted\f[R],
1892\f[C]boldslanted\f[R], \f[C]type\f[R], \f[C]cap\f[R], \f[C]small\f[R]
1894.B \f[C]lof\f[R], \f[C]lot\f[R]
1895include list of figures, list of tables
1897.B \f[C]mainfont\f[R], \f[C]sansfont\f[R], \f[C]monofont\f[R], \f[C]mathfont\f[R]
1898font families: take the name of any system font (see ConTeXt Font
1901.B \f[C]margin-left\f[R], \f[C]margin-right\f[R], \f[C]margin-top\f[R], \f[C]margin-bottom\f[R]
1902sets margins, if \f[C]layout\f[R] is not used (otherwise
1903\f[C]layout\f[R] overrides these)
1905.B \f[C]pagenumbering\f[R]
1906page number style and location (using \f[C]setuppagenumbering\f[R]);
1907repeat for multiple options
1909.B \f[C]papersize\f[R]
1911\f[C]letter\f[R], \f[C]A4\f[R], \f[C]landscape\f[R] (see ConTeXt Paper
1912Setup); repeat for multiple options
1915adds to the preamble the setup necessary to generate PDF/A-1b:2005.
1916To successfully generate PDF/A the required ICC color profiles have to
1917be available and the content and all included files (such as images)
1918have to be standard conforming.
1919The ICC profiles can be obtained from ConTeXt ICC Profiles.
1920See also ConTeXt PDFA for more details.
1923include table of contents (can also be set using
1924\f[C]--toc/--table-of-contents\f[R])
1926.B \f[C]whitespace\f[R]
1927spacing between paragraphs, e.g.
1928\f[C]none\f[R], \f[C]small\f[R] (using \f[C]setupwhitespace\f[R])
1929.SS Variables for \f[C]wkhtmltopdf\f[R]
1931Pandoc uses these variables when creating a PDF with
1932\f[C]wkhtmltopdf\f[R].
1933The \f[C]--css\f[R] option also affects the output.
1935.B \f[C]footer-html\f[R], \f[C]header-html\f[R]
1936add information to the header and footer
1938.B \f[C]margin-left\f[R], \f[C]margin-right\f[R], \f[C]margin-top\f[R], \f[C]margin-bottom\f[R]
1941.B \f[C]papersize\f[R]
1942sets the PDF paper size
1943.SS Variables for man pages
1945.B \f[C]adjusting\f[R]
1946adjusts text to left (\f[C]l\f[R]), right (\f[C]r\f[R]), center
1947(\f[C]c\f[R]), or both (\f[C]b\f[R]) margins
1955.B \f[C]hyphenate\f[R]
1956if \f[C]true\f[R] (the default), hyphenation will be used
1959section number in man pages
1962.B \f[C]fontfamily\f[R]
1964\f[C]T\f[R] or \f[C]P\f[R])
1967paragraph indent (e.g.
1970.B \f[C]lineheight\f[R]
1974.B \f[C]pointsize\f[R]
1977.SS Structural variables
1979Pandoc sets these variables automatically in response to options or
1980document contents; users can also modify them.
1981These vary depending on the output format, and include the following:
1986.B \f[C]date-meta\f[R]
1987the \f[C]date\f[R] variable converted to ISO 8601 YYYY-MM-DD, included
1988in all HTML based formats (dzslides, epub, html, html4, html5, revealjs,
1989s5, slideous, slidy).
1990The recognized formats for \f[C]date\f[R] are: \f[C]mm/dd/yyyy\f[R],
1991\f[C]mm/dd/yy\f[R], \f[C]yyyy-mm-dd\f[R] (ISO 8601),
1992\f[C]dd MM yyyy\f[R] (e.g.
1993either \f[C]02 Apr 2018\f[R] or \f[C]02 April 2018\f[R]),
1994\f[C]MM dd, yyyy\f[R] (e.g.
1995\f[C]Apr. 02, 2018\f[R] or
1996\f[C]April 02, 2018),\f[R]yyyy[mm[dd]]]\f[C](e.g.\f[R]20180402,
1997\f[C]201804\f[R] or \f[C]2018\f[R]).
1999.B \f[C]header-includes\f[R]
2000contents specified by \f[C]-H/--include-in-header\f[R] (may have
2003.B \f[C]include-before\f[R]
2004contents specified by \f[C]-B/--include-before-body\f[R] (may have
2007.B \f[C]include-after\f[R]
2008contents specified by \f[C]-A/--include-after-body\f[R] (may have
2011.B \f[C]meta-json\f[R]
2012JSON representation of all of the document\[aq]s metadata.
2013Field values are transformed to the selected output format.
2015.B \f[C]numbersections\f[R]
2016non-null value if \f[C]-N/--number-sections\f[R] was specified
2018.B \f[C]sourcefile\f[R], \f[C]outputfile\f[R]
2019source and destination filenames, as given on the command line.
2020\f[C]sourcefile\f[R] can also be a list if input comes from multiple
2021files, or empty if input is from stdin.
2022You can use the following snippet in your template to distinguish them:
2037Similarly, \f[C]outputfile\f[R] can be \f[C]-\f[R] if output goes to the
2042non-null value if \f[C]--toc/--table-of-contents\f[R] was specified
2044.B \f[C]toc-title\f[R]
2045title of table of contents (works only with EPUB, opendocument, odt,
2046docx, pptx, beamer, LaTeX)
2047.SS Using variables in templates
2049Variable names are sequences of alphanumerics, \f[C]-\f[R], and
2050\f[C]_\f[R], starting with a letter.
2051A variable name surrounded by \f[C]$\f[R] signs will be replaced by its
2053For example, the string \f[C]$title$\f[R] in
2057<title>$title$</title>
2061will be replaced by the document title.
2063To write a literal \f[C]$\f[R] in a template, use \f[C]$$\f[R].
2065Templates may contain conditionals.
2066The syntax is as follows:
2078This will include \f[C]X\f[R] in the template if \f[C]variable\f[R] has
2079a truthy value; otherwise it will include \f[C]Y\f[R].
2080Here a truthy value is any of the following:
2082a string that is not entirely white space,
2084a non-empty array where the first value is truthy,
2086any number (including zero),
2090the boolean \f[C]true\f[R] (to specify the boolean \f[C]true\f[R] value
2091using YAML metadata or the \f[C]--metadata\f[R] flag, use
2092\f[C]true\f[R], \f[C]True\f[R], or \f[C]TRUE\f[R]; with the
2093\f[C]--variable\f[R] flag, simply omit a value for the variable, e.g.
2094\f[C]--variable draft\f[R]).
2096\f[C]X\f[R] and \f[C]Y\f[R] are placeholders for any valid template
2097text, and may include interpolated variables or other conditionals.
2098The \f[C]$else$\f[R] section may be omitted.
2100When variables can have multiple values (for example, \f[C]author\f[R]
2101in a multi-author document), you can use the \f[C]$for$\f[R] keyword:
2106<meta name=\[dq]author\[dq] content=\[dq]$author$\[dq] />
2111You can optionally specify a separator to be used between consecutive
2116$for(author)$$author$$sep$, $endfor$
2120Note that the separator needs to be specified immediately before the
2121\f[C]$endfor\f[R] keyword.
2123A dot can be used to select a field of a variable that takes an object
2129$author.name$ ($author.affiliation$)
2133The value of a variable will be indented to the same level as the
2136If you use custom templates, you may need to revise them as pandoc
2138We recommend tracking the changes in the default templates, and
2139modifying your custom templates accordingly.
2140An easy way to do this is to fork the pandoc-templates repository and
2141merge in changes after each pandoc release.
2143Templates may contain comments: anything on a line after \f[C]$--\f[R]
2144will be treated as a comment and ignored.
2147The behavior of some of the readers and writers can be adjusted by
2148enabling or disabling various extensions.
2150An extension can be enabled by adding \f[C]+EXTENSION\f[R] to the format
2151name and disabled by adding \f[C]-EXTENSION\f[R].
2152For example, \f[C]--from markdown_strict+footnotes\f[R] is strict
2153Markdown with footnotes enabled, while
2154\f[C]--from markdown-footnotes-pipe_tables\f[R] is pandoc\[aq]s Markdown
2155without footnotes or pipe tables.
2157The markdown reader and writer make by far the most use of extensions.
2158Extensions only used by them are therefore covered in the section
2159Pandoc\[aq]s Markdown below (See Markdown variants for
2160\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions
2161that also work for other formats are covered.
2163Note that markdown extensions added to the \f[C]ipynb\f[R] format affect
2164Markdown cells in Jupyter notebooks (as do command-line options like
2165\f[C]--atx-headers\f[R]).
2167.SS Extension: \f[C]smart\f[R]
2169Interpret straight quotes as curly quotes, \f[C]---\f[R] as em-dashes,
2170\f[C]--\f[R] as en-dashes, and \f[C]...\f[R] as ellipses.
2171Nonbreaking spaces are inserted after certain abbreviations, such as
2174This extension can be enabled/disabled for the following formats:
2177\f[C]markdown\f[R], \f[C]commonmark\f[R], \f[C]latex\f[R],
2178\f[C]mediawiki\f[R], \f[C]org\f[R], \f[C]rst\f[R], \f[C]twiki\f[R]
2181\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R], \f[C]rst\f[R]
2183.B enabled by default in
2184\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R] (both input and
2187Note: If you are \f[I]writing\f[R] Markdown, then the \f[C]smart\f[R]
2188extension has the reverse effect: what would have been curly quotes
2191In LaTeX, \f[C]smart\f[R] means to use the standard TeX ligatures for
2192quotation marks (\f[C]\[ga]\[ga]\f[R] and \f[C]\[aq]\[aq]\f[R] for
2193double quotes, \f[C]\[ga]\f[R] and \f[C]\[aq]\f[R] for single quotes)
2194and dashes (\f[C]--\f[R] for en-dash and \f[C]---\f[R] for em-dash).
2195If \f[C]smart\f[R] is disabled, then in reading LaTeX pandoc will parse
2196these characters literally.
2197In writing LaTeX, enabling \f[C]smart\f[R] tells pandoc to use the
2198ligatures when possible; if \f[C]smart\f[R] is disabled pandoc will use
2199unicode quotation mark and dash characters.
2200.SS Headings and sections
2201.SS Extension: \f[C]auto_identifiers\f[R]
2203A heading without an explicitly specified identifier will be
2204automatically assigned a unique identifier based on the heading text.
2206This extension can be enabled/disabled for the following formats:
2209\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]rst\f[R], \f[C]mediawiki\f[R],
2213\f[C]markdown\f[R], \f[C]muse\f[R]
2215.B enabled by default in
2216\f[C]markdown\f[R], \f[C]muse\f[R]
2218The default algorithm used to derive the identifier from the heading
2221Remove all formatting, links, etc.
2223Remove all footnotes.
2225Remove all non-alphanumeric characters, except underscores, hyphens, and
2228Replace all spaces and newlines with hyphens.
2230Convert all alphabetic characters to lowercase.
2232Remove everything up to the first letter (identifiers may not begin with
2233a number or punctuation mark).
2235If nothing is left after this, use the identifier \f[C]section\f[R].
2249\f[C]Heading identifiers in HTML\f[R]
2251\f[C]heading-identifiers-in-html\f[R]
2254\f[C]Ma\[^i]tre d\[aq]h\[^o]tel\f[R]
2256\f[C]ma\[^i]tre-dh\[^o]tel\f[R]
2259\f[C]*Dogs*?--in *my* house?\f[R]
2261\f[C]dogs--in-my-house\f[R]
2264\f[C][HTML], [S5], or [RTF]?\f[R]
2266\f[C]html-s5-or-rtf\f[R]
2269\f[C]3. Applications\f[R]
2271\f[C]applications\f[R]
2280These rules should, in most cases, allow one to determine the identifier
2281from the heading text.
2282The exception is when several headings have the same text; in this case,
2283the first will get an identifier as described above; the second will get
2284the same identifier with \f[C]-1\f[R] appended; the third with
2285\f[C]-2\f[R]; and so on.
2287(However, a different algorithm is used if
2288\f[C]gfm_auto_identifiers\f[R] is enabled; see below.)
2290These identifiers are used to provide link targets in the table of
2291contents generated by the \f[C]--toc|--table-of-contents\f[R] option.
2292They also make it easy to provide links from one section of a document
2294A link to this section, for example, might look like this:
2299[heading identifiers](#heading-identifiers-in-html-latex-and-context).
2303Note, however, that this method of providing links to sections works
2304only in HTML, LaTeX, and ConTeXt formats.
2306If the \f[C]--section-divs\f[R] option is specified, then each section
2307will be wrapped in a \f[C]section\f[R] (or a \f[C]div\f[R], if
2308\f[C]html4\f[R] was specified), and the identifier will be attached to
2309the enclosing \f[C]<section>\f[R] (or \f[C]<div>\f[R]) tag rather than
2311This allows entire sections to be manipulated using JavaScript or
2312treated differently in CSS.
2313.SS Extension: \f[C]ascii_identifiers\f[R]
2315Causes the identifiers produced by \f[C]auto_identifiers\f[R] to be pure
2317Accents are stripped off of accented Latin letters, and non-Latin
2319.SS Extension: \f[C]gfm_auto_identifiers\f[R]
2321Changes the algorithm used by \f[C]auto_identifiers\f[R] to conform to
2323Spaces are converted to dashes (\f[C]-\f[R]), uppercase characters to
2324lowercase characters, and punctuation characters other than \f[C]-\f[R]
2325and \f[C]_\f[R] are removed.
2328The extensions \f[C]tex_math_dollars\f[R],
2329\f[C]tex_math_single_backslash\f[R], and
2330\f[C]tex_math_double_backslash\f[R] are described in the section about
2331Pandoc\[aq]s Markdown.
2333However, they can also be used with HTML input.
2334This is handy for reading web pages formatted using MathJax, for
2338The following extensions (especially how they affect Markdown
2339input/output) are also described in more detail in their respective
2340sections of Pandoc\[aq]s Markdown.
2341.SS Extension: \f[C]raw_html\f[R]
2343When converting from HTML, parse elements to raw HTML which are not
2344representable in pandoc\[aq]s AST.
2345By default, this is disabled for HTML input.
2346.SS Extension: \f[C]raw_tex\f[R]
2348Allows raw LaTeX, TeX, and ConTeXt to be included in a document.
2350This extension can be enabled/disabled for the following formats (in
2351addition to \f[C]markdown\f[R]):
2354\f[C]latex\f[R], \f[C]org\f[R], \f[C]textile\f[R], \f[C]html\f[R]
2355(environments, \f[C]\[rs]ref\f[R], and \f[C]\[rs]eqref\f[R] only),
2359\f[C]textile\f[R], \f[C]commonmark\f[R]
2361Note: as applied to \f[C]ipynb\f[R], \f[C]raw_html\f[R] and
2362\f[C]raw_tex\f[R] affect not only raw TeX in markdown cells, but data
2363with mime type \f[C]text/html\f[R] in output cells.
2364Since the \f[C]ipynb\f[R] reader attempts to preserve the richest
2365possible outputs when several options are given, you will get best
2366results if you disable \f[C]raw_html\f[R] and \f[C]raw_tex\f[R] when
2367converting to formats like \f[C]docx\f[R] which don\[aq]t allow raw
2368\f[C]html\f[R] or \f[C]tex\f[R].
2369.SS Extension: \f[C]native_divs\f[R]
2371This extension is enabled by default for HTML input.
2372This means that \f[C]div\f[R]s are parsed to pandoc native elements.
2373(Alternatively, you can parse them to raw HTML using
2374\f[C]-f html-native_divs+raw_html\f[R].)
2376When converting HTML to Markdown, for example, you may want to drop all
2377\f[C]div\f[R]s and \f[C]span\f[R]s:
2381pandoc -f html-native_divs-native_spans -t markdown
2384.SS Extension: \f[C]native_spans\f[R]
2386Analogous to \f[C]native_divs\f[R] above.
2387.SS Literate Haskell support
2388.SS Extension: \f[C]literate_haskell\f[R]
2390Treat the document as literate Haskell source.
2392This extension can be enabled/disabled for the following formats:
2395\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R]
2398\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R], \f[C]html\f[R]
2400If you append \f[C]+lhs\f[R] (or \f[C]+literate_haskell\f[R]) to one of
2401the formats above, pandoc will treat the document as literate Haskell
2405In Markdown input, \[dq]bird track\[dq] sections will be parsed as
2406Haskell code rather than block quotations.
2407Text between \f[C]\[rs]begin{code}\f[R] and \f[C]\[rs]end{code}\f[R]
2408will also be treated as Haskell code.
2409For ATX-style headings the character \[aq]=\[aq] will be used instead of
2412In Markdown output, code blocks with classes \f[C]haskell\f[R] and
2413\f[C]literate\f[R] will be rendered using bird tracks, and block
2414quotations will be indented one space, so they will not be treated as
2416In addition, headings will be rendered setext-style (with underlines)
2417rather than ATX-style (with \[aq]#\[aq] characters).
2418(This is because ghc treats \[aq]#\[aq] characters in column 1 as
2419introducing line numbers.)
2421In restructured text input, \[dq]bird track\[dq] sections will be parsed
2424In restructured text output, code blocks with class \f[C]haskell\f[R]
2425will be rendered using bird tracks.
2427In LaTeX input, text in \f[C]code\f[R] environments will be parsed as
2430In LaTeX output, code blocks with class \f[C]haskell\f[R] will be
2431rendered inside \f[C]code\f[R] environments.
2433In HTML output, code blocks with class \f[C]haskell\f[R] will be
2434rendered with class \f[C]literatehaskell\f[R] and bird tracks.
2440pandoc -f markdown+lhs -t html
2444reads literate Haskell source formatted with Markdown conventions and
2445writes ordinary HTML (without bird tracks).
2449pandoc -f markdown+lhs -t html+lhs
2453writes HTML with the Haskell code in bird tracks, so it can be copied
2454and pasted as literate Haskell source.
2456Note that GHC expects the bird tracks in the first column, so indented
2457literate code blocks (e.g.
2458inside an itemized environment) will not be picked up by the Haskell
2461.SS Extension: \f[C]empty_paragraphs\f[R]
2463Allows empty paragraphs.
2464By default empty paragraphs are omitted.
2466This extension can be enabled/disabled for the following formats:
2469\f[C]docx\f[R], \f[C]html\f[R]
2472\f[C]docx\f[R], \f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]html\f[R]
2473.SS Extension: \f[C]styles\f[R]
2475When converting from docx, read all docx styles as divs (for paragraph
2476styles) and spans (for character styles) regardless of whether pandoc
2477understands the meaning of these styles.
2478This can be used with docx custom styles.
2483.SS Extension: \f[C]amuse\f[R]
2485In the \f[C]muse\f[R] input format, this enables Text::Amuse extensions
2486to Emacs Muse markup.
2487.SS Extension: \f[C]citations\f[R]
2489Some aspects of Pandoc\[aq]s Markdown citation syntax are also accepted
2490in \f[C]org\f[R] input.
2491.SS Extension: \f[C]ntb\f[R]
2493In the \f[C]context\f[R] output format this enables the use of Natural
2494Tables (TABLE) instead of the default Extreme Tables (xtables).
2495Natural tables allow more fine-grained global customization but come at
2496a performance penalty compared to extreme tables.
2497.SH PANDOC\[aq]S MARKDOWN
2499Pandoc understands an extended and slightly revised version of John
2500Gruber\[aq]s Markdown syntax.
2501This document explains the syntax, noting differences from standard
2503Except where noted, these differences can be suppressed by using the
2504\f[C]markdown_strict\f[R] format instead of \f[C]markdown\f[R].
2505Extensions can be enabled or disabled to specify the behavior more
2507They are described in the following.
2508See also Extensions above, for extensions that work also on other
2512Markdown is designed to be easy to write, and, even more importantly,
2516A Markdown-formatted document should be publishable as-is, as plain
2517text, without looking like it\[aq]s been marked up with tags or
2518formatting instructions.
2522This principle has guided pandoc\[aq]s decisions in finding syntax for
2523tables, footnotes, and other extensions.
2525There is, however, one respect in which pandoc\[aq]s aims are different
2526from the original aims of Markdown.
2527Whereas Markdown was originally designed with HTML generation in mind,
2528pandoc is designed for multiple output formats.
2529Thus, while pandoc allows the embedding of raw HTML, it discourages it,
2530and provides other, non-HTMLish ways of representing important document
2531elements like definition lists, tables, mathematics, and footnotes.
2534A paragraph is one or more lines of text followed by one or more blank
2536Newlines are treated as spaces, so you can reflow your paragraphs as you
2538If you need a hard line break, put two or more spaces at the end of a
2540.SS Extension: \f[C]escaped_line_breaks\f[R]
2542A backslash followed by a newline is also a hard line break.
2543Note: in multiline and grid table cells, this is the only way to create
2544a hard line break, since trailing spaces in the cells are ignored.
2547There are two kinds of headings: Setext and ATX.
2548.SS Setext-style headings
2550A setext-style heading is a line of text \[dq]underlined\[dq] with a row
2551of \f[C]=\f[R] signs (for a level-one heading) or \f[C]-\f[R] signs (for
2552a level-two heading):
2564The heading text can contain inline formatting, such as emphasis (see
2565Inline formatting, below).
2566.SS ATX-style headings
2568An ATX-style heading consists of one to six \f[C]#\f[R] signs and a line
2569of text, optionally followed by any number of \f[C]#\f[R] signs.
2570The number of \f[C]#\f[R] signs at the beginning of the line is the
2575## A level-two heading
2577### A level-three heading ###
2581As with setext-style headings, the heading text can contain formatting:
2585# A level-one heading with a [link](/url) and *emphasis*
2588.SS Extension: \f[C]blank_before_header\f[R]
2590Standard Markdown syntax does not require a blank line before a heading.
2591Pandoc does require this (except, of course, at the beginning of the
2593The reason for the requirement is that it is all too easy for a
2594\f[C]#\f[R] to end up at the beginning of a line by accident (perhaps
2595through line wrapping).
2596Consider, for example:
2600I like several of their flavors of ice cream:
2601#22, for example, and #5.
2604.SS Extension: \f[C]space_in_atx_header\f[R]
2606Many Markdown implementations do not require a space between the opening
2607\f[C]#\f[R]s of an ATX heading and the heading text, so that
2608\f[C]#5 bolt\f[R] and \f[C]#hashtag\f[R] count as headings.
2609With this extension, pandoc does require the space.
2610.SS Heading identifiers
2612See also the \f[C]auto_identifiers\f[R] extension above.
2613.SS Extension: \f[C]header_attributes\f[R]
2615Headings can be assigned attributes using this syntax at the end of the
2616line containing the heading text:
2620{#identifier .class .class key=value key=value}
2624Thus, for example, the following headings will all be assigned the
2625identifier \f[C]foo\f[R]:
2631## My heading ## {#foo}
2633My other heading {#foo}
2638(This syntax is compatible with PHP Markdown Extra.)
2640Note that although this syntax allows assignment of classes and
2641key/value attributes, writers generally don\[aq]t use all of this
2643Identifiers, classes, and key/value attributes are used in HTML and
2644HTML-based formats such as EPUB and slidy.
2645Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
2646Textile, and AsciiDoc writers.
2648Headings with the class \f[C]unnumbered\f[R] will not be numbered, even
2649if \f[C]--number-sections\f[R] is specified.
2650A single hyphen (\f[C]-\f[R]) in an attribute context is equivalent to
2651\f[C].unnumbered\f[R], and preferable in non-English documents.
2664# My heading {.unnumbered}
2667.SS Extension: \f[C]implicit_header_references\f[R]
2669Pandoc behaves as if reference links have been defined for each heading.
2670So, to link to a heading
2674# Heading identifiers in HTML
2682[Heading identifiers in HTML]
2690[Heading identifiers in HTML][]
2698[the section on heading identifiers][heading identifiers in
2703instead of giving the identifier explicitly:
2707[Heading identifiers in HTML](#heading-identifiers-in-html)
2711If there are multiple headings with identical text, the corresponding
2712reference will link to the first one only, and you will need to use
2713explicit links to link to the others, as described above.
2715Like regular reference links, these references are case-insensitive.
2717Explicit link reference definitions always take priority over implicit
2719So, in the following example, the link will point to \f[C]bar\f[R], not
2733Markdown uses email conventions for quoting blocks of text.
2734A block quotation is one or more paragraphs or other block elements
2735(such as lists or headings), with each line preceded by a \f[C]>\f[R]
2736character and an optional space.
2737(The \f[C]>\f[R] need not start at the left margin, but it should not be
2738indented more than three spaces.)
2742> This is a block quote. This
2743> paragraph has two lines.
2745> 1. This is a list inside a block quote.
2750A \[dq]lazy\[dq] form, which requires the \f[C]>\f[R] character only on
2751the first line of each block, is also allowed:
2755> This is a block quote. This
2756paragraph has two lines.
2758> 1. This is a list inside a block quote.
2763Among the block elements that can be contained in a block quote are
2765That is, block quotes can be nested:
2769> This is a block quote.
2771> > A block quote within a block quote.
2775If the \f[C]>\f[R] character is followed by an optional space, that
2776space will be considered part of the block quote marker and not part of
2777the indentation of the contents.
2778Thus, to put an indented code block in a block quote, you need five
2779spaces after the \f[C]>\f[R]:
2786.SS Extension: \f[C]blank_before_blockquote\f[R]
2788Standard Markdown syntax does not require a blank line before a block
2790Pandoc does require this (except, of course, at the beginning of the
2792The reason for the requirement is that it is all too easy for a
2793\f[C]>\f[R] to end up at the beginning of a line by accident (perhaps
2794through line wrapping).
2795So, unless the \f[C]markdown_strict\f[R] format is used, the following
2796does not produce a nested block quote in pandoc:
2800> This is a block quote.
2804.SS Verbatim (code) blocks
2805.SS Indented code blocks
2807A block of text indented four spaces (or one tab) is treated as verbatim
2808text: that is, special characters do not trigger special formatting, and
2809all spaces and line breaks are preserved.
2815 moveShip(5 * gravity, DOWN);
2820The initial (four space or one tab) indentation is not considered part
2821of the verbatim text, and is removed in the output.
2823Note: blank lines in the verbatim text need not begin with four spaces.
2824.SS Fenced code blocks
2825.SS Extension: \f[C]fenced_code_blocks\f[R]
2827In addition to standard indented code blocks, pandoc supports
2828\f[I]fenced\f[R] code blocks.
2829These begin with a row of three or more tildes (\f[C]\[ti]\f[R]) and end
2830with a row of tildes that must be at least as long as the starting row.
2831Everything between these lines is treated as code.
2832No indentation is necessary:
2836\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2838 moveShip(5 * gravity, DOWN);
2840\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2844Like regular code blocks, fenced code blocks must be separated from
2845surrounding text by blank lines.
2847If the code itself contains a row of tildes or backticks, just use a
2848longer row of tildes or backticks at the start and end:
2852\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2853\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2854code including tildes
2855\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2856\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2859.SS Extension: \f[C]backtick_code_blocks\f[R]
2861Same as \f[C]fenced_code_blocks\f[R], but uses backticks
2862(\f[C]\[ga]\f[R]) instead of tildes (\f[C]\[ti]\f[R]).
2863.SS Extension: \f[C]fenced_code_attributes\f[R]
2865Optionally, you may attach attributes to fenced or backtick code block
2870\[ti]\[ti]\[ti]\[ti] {#mycode .haskell .numberLines startFrom=\[dq]100\[dq]}
2872qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
2873 qsort (filter (>= x) xs)
2874\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2878Here \f[C]mycode\f[R] is an identifier, \f[C]haskell\f[R] and
2879\f[C]numberLines\f[R] are classes, and \f[C]startFrom\f[R] is an
2880attribute with value \f[C]100\f[R].
2881Some output formats can use this information to do syntax highlighting.
2882Currently, the only output formats that uses this information are HTML,
2883LaTeX, Docx, Ms, and PowerPoint.
2884If highlighting is supported for your output format and language, then
2885the code block above will appear highlighted, with numbered lines.
2886(To see which languages are supported, type
2887\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block
2888above will appear as follows:
2892<pre id=\[dq]mycode\[dq] class=\[dq]haskell numberLines\[dq] startFrom=\[dq]100\[dq]>
2900The \f[C]numberLines\f[R] (or \f[C]number-lines\f[R]) class will cause
2901the lines of the code block to be numbered, starting with \f[C]1\f[R] or
2902the value of the \f[C]startFrom\f[R] attribute.
2903The \f[C]lineAnchors\f[R] (or \f[C]line-anchors\f[R]) class will cause
2904the lines to be clickable anchors in HTML output.
2906A shortcut form can also be used for specifying the language of the code
2911\[ga]\[ga]\[ga]haskell
2917This is equivalent to:
2921\[ga]\[ga]\[ga] {.haskell}
2927If the \f[C]fenced_code_attributes\f[R] extension is disabled, but input
2928contains class attribute(s) for the code block, the first class
2929attribute will be printed after the opening fence as a bare word.
2931To prevent all highlighting, use the \f[C]--no-highlight\f[R] flag.
2932To set the highlighting style, use \f[C]--highlight-style\f[R].
2933For more information on highlighting, see Syntax highlighting, below.
2935.SS Extension: \f[C]line_blocks\f[R]
2937A line block is a sequence of lines beginning with a vertical bar
2938(\f[C]|\f[R]) followed by a space.
2939The division into lines will be preserved in the output, as will any
2940leading spaces; otherwise, the lines will be formatted as Markdown.
2941This is useful for verse and addresses:
2945| The limerick packs laughs anatomical
2946| In space that is quite economical.
2947| But the good ones I\[aq]ve seen
2948| So seldom are clean
2949| And the clean ones so seldom are comical
2956The lines can be hard-wrapped if needed, but the continuation line must
2961| The Right Honorable Most Venerable and Righteous Samuel L.
2968This syntax is borrowed from reStructuredText.
2972A bullet list is a list of bulleted list items.
2973A bulleted list item begins with a bullet (\f[C]*\f[R], \f[C]+\f[R], or
2975Here is a simple example:
2985This will produce a \[dq]compact\[dq] list.
2986If you want a \[dq]loose\[dq] list, in which each item is formatted as a
2987paragraph, put spaces between the items:
2999The bullets need not be flush with the left margin; they may be indented
3000one, two, or three spaces.
3001The bullet must be followed by whitespace.
3003List items look best if subsequent lines are flush with the first line
3014But Markdown also allows a \[dq]lazy\[dq] format:
3023.SS Block content in list items
3025A list item may contain multiple paragraphs and other block-level
3027However, subsequent paragraphs must be preceded by a blank line and
3028indented to line up with the first non-space content after the list
3037 * Second paragraph. With a code block, which must be indented
3044Exception: if the list marker is followed by an indented code block,
3045which must begin 5 spaces after the list marker, then subsequent
3046paragraphs must begin two columns after the last character of the list
3053 continuation paragraph
3057List items may include other lists.
3058In this case the preceding blank line is optional.
3059The nested list must be indented to line up with the first non-space
3060character after the list marker of the containing list item.
3076As noted above, Markdown allows you to write list items
3077\[dq]lazily,\[dq] instead of indenting continuation lines.
3078However, if there are multiple paragraphs or other blocks in a list
3079item, the first line of each must be indented.
3086+ Another one; this looks
3089 Second paragraph of second
3095Ordered lists work just like bulleted lists, except that the items begin
3096with enumerators rather than bullets.
3098In standard Markdown, enumerators are decimal numbers followed by a
3100The numbers themselves are ignored, so there is no difference between
3120.SS Extension: \f[C]fancy_lists\f[R]
3122Unlike standard Markdown, pandoc allows ordered list items to be marked
3123with uppercase and lowercase letters and roman numerals, in addition to
3125List markers may be enclosed in parentheses or followed by a single
3126right-parentheses or period.
3127They must be separated from the text that follows by at least one space,
3128and, if the list marker is a capital letter with a period, by at least
3131The \f[C]fancy_lists\f[R] extension also allows \[aq]\f[C]#\f[R]\[aq] to
3132be used as an ordered list marker in place of a numeral:
3140.SS Extension: \f[C]startnum\f[R]
3142Pandoc also pays attention to the type of list marker used, and to the
3143starting number, and both of these are preserved where possible in the
3145Thus, the following yields a list with numbers followed by a single
3146parenthesis, starting with 9, and a sublist with lowercase roman
3160Pandoc will start a new list each time a different type of list marker
3162So, the following will create three lists:
3173If default list markers are desired, use \f[C]#.\f[R]:
3182.SS Extension: \f[C]task_lists\f[R]
3184Pandoc supports task lists, using the syntax of GitHub-Flavored
3189- [ ] an unchecked task list item
3194.SS Extension: \f[C]definition_lists\f[R]
3196Pandoc supports definition lists, using the syntax of PHP Markdown Extra
3197with some extensions.
3205Term 2 with *inline markup*
3209 { some code, part of Definition 2 }
3211 Third paragraph of definition 2.
3215Each term must fit on one line, which may optionally be followed by a
3216blank line, and must be followed by one or more definitions.
3217A definition begins with a colon or tilde, which may be indented one or
3220A term may have multiple definitions, and each definition may consist of
3221one or more block elements (paragraph, code block, list, etc.), each
3222indented four spaces or one tab stop.
3223The body of the definition (including the first line, aside from the
3224colon or tilde) should be indented four spaces.
3225However, as with other Markdown lists, you can \[dq]lazily\[dq] omit
3226indentation except at the beginning of a paragraph or other block
3234with lazy continuation.
3236 Second paragraph of the definition.
3240If you leave space before the definition (as in the example above), the
3241text of the definition will be treated as a paragraph.
3242In some output formats, this will mean greater spacing between
3243term/definition pairs.
3244For a more compact definition list, omit the space before the
3258Note that space between items in a definition list is required.
3259(A variant that loosens this requirement, but disallows \[dq]lazy\[dq]
3260hard wrapping, can be activated with \f[C]compact_definition_lists\f[R]:
3261see Non-pandoc extensions, below.)
3262.SS Numbered example lists
3263.SS Extension: \f[C]example_lists\f[R]
3265The special list marker \f[C]\[at]\f[R] can be used for sequentially
3267The first list item with a \f[C]\[at]\f[R] marker will be numbered
3268\[aq]1\[aq], the next \[aq]2\[aq], and so on, throughout the document.
3269The numbered examples need not occur in a single list; each new list
3270using \f[C]\[at]\f[R] will take up where the last stopped.
3275(\[at]) My first example will be numbered (1).
3276(\[at]) My second example will be numbered (2).
3278Explanation of examples.
3280(\[at]) My third example will be numbered (3).
3284Numbered examples can be labeled and referred to elsewhere in the
3289(\[at]good) This is a good example.
3291As (\[at]good) illustrates, ...
3295The label can be any string of alphanumeric characters, underscores, or
3298Note: continuation paragraphs in example lists must always be indented
3299four spaces, regardless of the length of the list marker.
3300That is, example lists always behave as if the \f[C]four_space_rule\f[R]
3302This is because example labels tend to be long, and indenting content to
3303the first non-space character after the label would be awkward.
3304.SS Compact and loose lists
3306Pandoc behaves differently from \f[C]Markdown.pl\f[R] on some \[dq]edge
3307cases\[dq] involving lists.
3308Consider this source:
3322Pandoc transforms this into a \[dq]compact list\[dq] (with no
3323\f[C]<p>\f[R] tags around \[dq]First\[dq], \[dq]Second\[dq], or
3324\[dq]Third\[dq]), while Markdown puts \f[C]<p>\f[R] tags around
3325\[dq]Second\[dq] and \[dq]Third\[dq] (but not \[dq]First\[dq]), because
3326of the blank space around \[dq]Third\[dq].
3327Pandoc follows a simple rule: if the text is followed by a blank line,
3328it is treated as a paragraph.
3329Since \[dq]Second\[dq] is followed by a list, and not a blank line, it
3330isn\[aq]t treated as a paragraph.
3331The fact that the list is followed by a blank line is irrelevant.
3332(Note: Pandoc works this way even when the \f[C]markdown_strict\f[R]
3334This behavior is consistent with the official Markdown syntax
3335description, even though it is different from that of
3336\f[C]Markdown.pl\f[R].)
3339What if you want to put an indented code block after a list?
3350Trouble! Here pandoc (like other Markdown implementations) will treat
3351\f[C]{ my code block }\f[R] as the second paragraph of item two, and not
3354To \[dq]cut off\[dq] the list after item two, you can insert some
3355non-indented content, like an HTML comment, which won\[aq]t produce
3356visible output in any format:
3369You can use the same trick if you want two consecutive lists instead of
3387A line containing a row of three or more \f[C]*\f[R], \f[C]-\f[R], or
3388\f[C]_\f[R] characters (optionally separated by spaces) produces a
3400Four kinds of tables may be used.
3401The first three kinds presuppose the use of a fixed-width font, such as
3403The fourth kind can be used with proportionally spaced fonts, as it does
3404not require lining up columns.
3405.SS Extension: \f[C]table_captions\f[R]
3407A caption may optionally be provided with all 4 kinds of tables (as
3408illustrated in the examples below).
3409A caption is a paragraph beginning with the string \f[C]Table:\f[R] (or
3410just \f[C]:\f[R]), which will be stripped off.
3411It may appear either before or after the table.
3412.SS Extension: \f[C]simple_tables\f[R]
3414Simple tables look like this:
3418 Right Left Center Default
3419------- ------ ---------- -------
3424Table: Demonstration of simple table syntax.
3428The header and table rows must each fit on one line.
3429Column alignments are determined by the position of the header text
3430relative to the dashed line below it:
3432If the dashed line is flush with the header text on the right side but
3433extends beyond it on the left, the column is right-aligned.
3435If the dashed line is flush with the header text on the left side but
3436extends beyond it on the right, the column is left-aligned.
3438If the dashed line extends beyond the header text on both sides, the
3441If the dashed line is flush with the header text on both sides, the
3442default alignment is used (in most cases, this will be left).
3444The table must end with a blank line, or a line of dashes followed by a
3447The column header row may be omitted, provided a dashed line is used to
3453------- ------ ---------- -------
3457------- ------ ---------- -------
3461When the header row is omitted, column alignments are determined on the
3462basis of the first line of the table body.
3463So, in the tables above, the columns would be right, left, center, and
3464right aligned, respectively.
3465.SS Extension: \f[C]multiline_tables\f[R]
3467Multiline tables allow header and table rows to span multiple lines of
3468text (but cells that span multiple columns or rows of the table are not
3474-------------------------------------------------------------
3475 Centered Default Right Left
3476 Header Aligned Aligned Aligned
3477----------- ------- --------------- -------------------------
3478 First row 12.0 Example of a row that
3479 spans multiple lines.
3481 Second row 5.0 Here\[aq]s another one. Note
3482 the blank line between
3484-------------------------------------------------------------
3486Table: Here\[aq]s the caption. It, too, may span
3491These work like simple tables, but with the following differences:
3493They must begin with a row of dashes, before the header text (unless the
3494header row is omitted).
3496They must end with a row of dashes, then a blank line.
3498The rows must be separated by blank lines.
3500In multiline tables, the table parser pays attention to the widths of
3501the columns, and the writers try to reproduce these relative widths in
3503So, if you find that one of the columns is too narrow in the output, try
3504widening it in the Markdown source.
3506The header may be omitted in multiline tables as well as simple tables:
3510----------- ------- --------------- -------------------------
3511 First row 12.0 Example of a row that
3512 spans multiple lines.
3514 Second row 5.0 Here\[aq]s another one. Note
3515 the blank line between
3517----------- ------- --------------- -------------------------
3519: Here\[aq]s a multiline table without a header.
3523It is possible for a multiline table to have just one row, but the row
3524should be followed by a blank line (and then the row of dashes that ends
3525the table), or the table may be interpreted as a simple table.
3526.SS Extension: \f[C]grid_tables\f[R]
3528Grid tables look like this:
3534+---------------+---------------+--------------------+
3535| Fruit | Price | Advantages |
3536+===============+===============+====================+
3537| Bananas | $1.34 | - built-in wrapper |
3538| | | - bright color |
3539+---------------+---------------+--------------------+
3540| Oranges | $2.10 | - cures scurvy |
3542+---------------+---------------+--------------------+
3546The row of \f[C]=\f[R]s separates the header from the table body, and
3547can be omitted for a headerless table.
3548The cells of grid tables may contain arbitrary block elements (multiple
3549paragraphs, code blocks, lists, etc.).
3550Cells that span multiple columns or rows are not supported.
3551Grid tables can be created easily using Emacs table mode.
3553Alignments can be specified as with pipe tables, by putting colons at
3554the boundaries of the separator line after the header:
3558+---------------+---------------+--------------------+
3559| Right | Left | Centered |
3560+==============:+:==============+:==================:+
3561| Bananas | $1.34 | built-in wrapper |
3562+---------------+---------------+--------------------+
3566For headerless tables, the colons go on the top line instead:
3570+--------------:+:--------------+:------------------:+
3571| Right | Left | Centered |
3572+---------------+---------------+--------------------+
3575.SS Grid Table Limitations
3577Pandoc does not support grid tables with row spans or column spans.
3578This means that neither variable numbers of columns across rows nor
3579variable numbers of rows across columns are supported by Pandoc.
3580All grid tables must have the same number of columns in each row, and
3581the same number of rows in each column.
3582For example, the Docutils sample grid tables will not render as expected
3584.SS Extension: \f[C]pipe_tables\f[R]
3586Pipe tables look like this:
3590| Right | Left | Default | Center |
3591|------:|:-----|---------|:------:|
3592| 12 | 12 | 12 | 12 |
3593| 123 | 123 | 123 | 123 |
3596 : Demonstration of pipe table syntax.
3600The syntax is identical to PHP Markdown Extra tables.
3601The beginning and ending pipe characters are optional, but pipes are
3602required between all columns.
3603The colons indicate column alignment as shown.
3604The header cannot be omitted.
3605To simulate a headerless table, include a header with blank cells.
3607Since the pipes indicate column boundaries, columns need not be
3608vertically aligned, as they are in the above example.
3609So, this is a perfectly legal (though ugly) pipe table:
3621The cells of pipe tables cannot contain block elements like paragraphs
3622and lists, and cannot span multiple lines.
3623If a pipe table contains a row whose printable content is wider than the
3624column width (see \f[C]--columns\f[R]), then the table will take up the
3625full text width and the cell contents will wrap, with the relative cell
3626widths determined by the number of dashes in the line separating the
3627table header from the table body.
3628(For example \f[C]---|-\f[R] would make the first column 3/4 and the
3629second column 1/4 of the full text width.) On the other hand, if no
3630lines are wider than column width, then cell contents will not be
3631wrapped, and the cells will be sized to their contents.
3633Note: pandoc also recognizes pipe tables of the following form, as can
3634be produced by Emacs\[aq] orgtbl-mode:
3645The difference is that \f[C]+\f[R] is used instead of \f[C]|\f[R].
3646Other orgtbl features are not supported.
3647In particular, to get non-default column alignment, you\[aq]ll need to
3650.SS Extension: \f[C]pandoc_title_block\f[R]
3652If the file begins with a title block
3657% author(s) (separated by semicolons)
3662it will be parsed as bibliographic information, not regular text.
3663(It will be used, for example, in the title of standalone LaTeX or HTML
3664output.) The block may contain just a title, a title and an author, or
3666If you want to include an author but no title, or a title and a date but
3667no author, you need a blank line:
3680The title may occupy multiple lines, but continuation lines must begin
3681with leading space, thus:
3690If a document has multiple authors, the authors may be put on separate
3691lines with leading space, or separated by semicolons, or both.
3692So, all of the following are equivalent:
3699% Author One; Author Two
3706The date must fit on one line.
3708All three metadata fields may contain standard inline formatting
3709(italics, links, footnotes, etc.).
3711Title blocks will always be parsed, but they will affect the output only
3712when the \f[C]--standalone\f[R] (\f[C]-s\f[R]) option is chosen.
3713In HTML output, titles will appear twice: once in the document head --
3714this is the title that will appear at the top of the window in a browser
3715-- and once at the beginning of the document body.
3716The title in the document head can have an optional prefix attached
3717(\f[C]--title-prefix\f[R] or \f[C]-T\f[R] option).
3718The title in the body appears as an H1 element with class
3719\[dq]title\[dq], so it can be suppressed or reformatted with CSS.
3720If a title prefix is specified with \f[C]-T\f[R] and no title block
3721appears in the document, the title prefix will be used by itself as the
3724The man page writer extracts a title, man page section number, and other
3725header and footer information from the title line.
3726The title is assumed to be the first word on the title line, which may
3727optionally end with a (single-digit) section number in parentheses.
3728(There should be no space between the title and the parentheses.)
3729Anything after this is assumed to be additional footer and header text.
3730A single pipe character (\f[C]|\f[R]) should be used to separate the
3731footer text from the header text.
3740will yield a man page with the title \f[C]PANDOC\f[R] and section 1.
3744% PANDOC(1) Pandoc User Manuals
3748will also have \[dq]Pandoc User Manuals\[dq] in the footer.
3752% PANDOC(1) Pandoc User Manuals | Version 4.0
3756will also have \[dq]Version 4.0\[dq] in the header.
3757.SS Extension: \f[C]yaml_metadata_block\f[R]
3759A YAML metadata block is a valid YAML object, delimited by a line of
3760three hyphens (\f[C]---\f[R]) at the top and a line of three hyphens
3761(\f[C]---\f[R]) or three dots (\f[C]...\f[R]) at the bottom.
3762A YAML metadata block may occur anywhere in the document, but if it is
3763not at the beginning, it must be preceded by a blank line.
3764(Note that, because of the way pandoc concatenates input files when
3765several are provided, you may also keep the metadata in a separate YAML
3766file and pass it to pandoc as an argument, along with your Markdown
3771pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
3775Just be sure that the YAML file begins with \f[C]---\f[R] and ends with
3776\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the
3777\f[C]--metadata-file\f[R] option.
3778Using that approach however, you cannot reference content (like
3779footnotes) from the main markdown input document.
3781Metadata will be taken from the fields of the YAML object and added to
3782any existing document metadata.
3783Metadata can contain lists and objects (nested arbitrarily), but all
3784string scalars will be interpreted as Markdown.
3785Fields with names ending in an underscore will be ignored by pandoc.
3786(They may be given a role by external processors.) Field names must not
3787be interpretable as YAML numbers or boolean values (so, for example,
3788\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field
3791A document may contain multiple metadata blocks.
3792The metadata fields will be combined through a \f[I]left-biased
3793union\f[R]: if two metadata blocks attempt to set the same field, the
3794value from the first block will be taken.
3796When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown
3797document, a YAML metadata block will be produced only if the
3798\f[C]-s/--standalone\f[R] option is used.
3799All of the metadata will appear in a single block at the beginning of
3802Note that YAML escaping rules must be followed.
3803Thus, for example, if a title contains a colon, it must be quoted.
3804The pipe character (\f[C]|\f[R]) can be used to begin an indented block
3805that will be interpreted literally, without need for escaping.
3806This form is necessary when the field contains blank lines or
3807block-level formatting:
3812title: \[aq]This is the title: it contains a colon\[aq]
3816keywords: [nothing, nothingness]
3818 This is the abstract.
3820 It consists of two paragraphs.
3825Template variables will be set automatically from the metadata.
3826Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
3827be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
3832<p>This is the abstract.</p>
3833<p>It consists of two paragraphs.</p>
3837Variables can contain arbitrary YAML structures, but the template must
3838match this structure.
3839The \f[C]author\f[R] variable in the default templates expects a simple
3840list or string, but can be changed to support more complicated
3842The following combination, for example, would add an affiliation to the
3843author if one is given:
3848title: The document title
3851 affiliation: University of Somewhere
3853 affiliation: University of Nowhere
3858To use the structured authors in the example above, you would need a
3865$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
3873Raw content to include in the document\[aq]s header may be specified
3874using \f[C]header-includes\f[R]; however, it is important to mark up
3875this content as raw code for a particular output format, using the
3876\f[C]raw_attribute\f[R] extension), or it will be interpreted as
3884 \[ga]\[ga]\[ga]{=latex}
3885 \[rs]let\[rs]oldsection\[rs]section
3886 \[rs]renewcommand{\[rs]section}[1]{\[rs]clearpage\[rs]oldsection{#1}}
3890.SS Backslash escapes
3891.SS Extension: \f[C]all_symbols_escapable\f[R]
3893Except inside a code block or inline code, any punctuation or space
3894character preceded by a backslash will be treated literally, even if it
3895would normally indicate formatting.
3896Thus, for example, if one writes
3916<strong>hello</strong>
3920This rule is easier to remember than standard Markdown\[aq]s rule, which
3921allows only the following characters to be backslash-escaped:
3925\[rs]\[ga]*_{}[]()>#+-.!
3929(However, if the \f[C]markdown_strict\f[R] format is used, the standard
3930Markdown rule will be used.)
3932A backslash-escaped space is parsed as a nonbreaking space.
3933It will appear in TeX output as \f[C]\[ti]\f[R] and in HTML and XML as
3934\f[C]\[rs] \f[R] or \f[C]\[rs] \f[R].
3936A backslash-escaped newline (i.e.
3937a backslash occurring at the end of a line) is parsed as a hard line
3939It will appear in TeX output as \f[C]\[rs]\[rs]\f[R] and in HTML as
3941This is a nice alternative to Markdown\[aq]s \[dq]invisible\[dq] way of
3942indicating hard line breaks using two trailing spaces on a line.
3944Backslash escapes do not work in verbatim contexts.
3945.SS Inline formatting
3948To \f[I]emphasize\f[R] some text, surround it with \f[C]*\f[R]s or
3949\f[C]_\f[R], like this:
3953This text is _emphasized with underscores_, and this
3954is *emphasized with asterisks*.
3958Double \f[C]*\f[R] or \f[C]_\f[R] produces \f[B]strong emphasis\f[R]:
3962This is **strong emphasis** and __with underscores__.
3966A \f[C]*\f[R] or \f[C]_\f[R] character surrounded by spaces, or
3967backslash-escaped, will not trigger emphasis:
3971This is * not emphasized *, and \[rs]*neither is this\[rs]*.
3974.SS Extension: \f[C]intraword_underscores\f[R]
3976Because \f[C]_\f[R] is sometimes used inside words and identifiers,
3977pandoc does not interpret a \f[C]_\f[R] surrounded by alphanumeric
3978characters as an emphasis marker.
3979If you want to emphasize just part of a word, use \f[C]*\f[R]:
3983feas*ible*, not feas*able*.
3987.SS Extension: \f[C]strikeout\f[R]
3989To strikeout a section of text with a horizontal line, begin and end it
3990with \f[C]\[ti]\[ti]\f[R].
3995This \[ti]\[ti]is deleted text.\[ti]\[ti]
3998.SS Superscripts and subscripts
3999.SS Extension: \f[C]superscript\f[R], \f[C]subscript\f[R]
4001Superscripts may be written by surrounding the superscripted text by
4002\f[C]\[ha]\f[R] characters; subscripts may be written by surrounding the
4003subscripted text by \f[C]\[ti]\f[R] characters.
4008H\[ti]2\[ti]O is a liquid. 2\[ha]10\[ha] is 1024.
4012If the superscripted or subscripted text contains spaces, these spaces
4013must be escaped with backslashes.
4014(This is to prevent accidental superscripting and subscripting through
4015the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R].) Thus, if you
4016want the letter P with \[aq]a cat\[aq] in subscripts, use
4017\f[C]P\[ti]a\[rs] cat\[ti]\f[R], not \f[C]P\[ti]a cat\[ti]\f[R].
4020To make a short span of text verbatim, put it inside backticks:
4024What is the difference between \[ga]>>=\[ga] and \[ga]>>\[ga]?
4028If the verbatim text includes a backtick, use double backticks:
4032Here is a literal backtick \[ga]\[ga] \[ga] \[ga]\[ga].
4036(The spaces after the opening backticks and before the closing backticks
4039The general rule is that a verbatim span starts with a string of
4040consecutive backticks (optionally followed by a space) and ends with a
4041string of the same number of backticks (optionally preceded by a space).
4043Note that backslash-escapes (and other Markdown constructs) do not work
4044in verbatim contexts:
4048This is a backslash followed by an asterisk: \[ga]\[rs]*\[ga].
4051.SS Extension: \f[C]inline_code_attributes\f[R]
4053Attributes can be attached to verbatim text, just as with fenced code
4058\[ga]<$>\[ga]{.haskell}
4063To write small caps, use the \f[C]smallcaps\f[R] class:
4067[Small caps]{.smallcaps}
4071Or, without the \f[C]bracketed_spans\f[R] extension:
4075<span class=\[dq]smallcaps\[dq]>Small caps</span>
4079For compatibility with other Markdown flavors, CSS is also supported:
4083<span style=\[dq]font-variant:small-caps;\[dq]>Small caps</span>
4087This will work in all output formats that support small caps.
4089.SS Extension: \f[C]tex_math_dollars\f[R]
4091Anything between two \f[C]$\f[R] characters will be treated as TeX math.
4092The opening \f[C]$\f[R] must have a non-space character immediately to
4093its right, while the closing \f[C]$\f[R] must have a non-space character
4094immediately to its left, and must not be followed immediately by a
4096Thus, \f[C]$20,000 and $30,000\f[R] won\[aq]t parse as math.
4097If for some reason you need to enclose text in literal \f[C]$\f[R]
4098characters, backslash-escape them and they won\[aq]t be treated as math
4101TeX math will be printed in all output formats.
4102How it is rendered depends on the output format:
4105It will appear verbatim surrounded by \f[C]\[rs](...\[rs])\f[R] (for
4106inline math) or \f[C]\[rs][...\[rs]]\f[R] (for display math).
4108.B Markdown, Emacs Org mode, ConTeXt, ZimWiki
4109It will appear verbatim surrounded by \f[C]$...$\f[R] (for inline math)
4110or \f[C]$$...$$\f[R] (for display math).
4113It will appear verbatim surrounded by
4114\f[C]{{formula}}..{{/formula}}\f[R].
4117It will be rendered using an interpreted text role \f[C]:math:\f[R].
4120For AsciiDoc output format (\f[C]-t asciidoc\f[R]) it will appear
4121verbatim surrounded by \f[C]latexmath:[$...$]\f[R] (for inline math) or
4122\f[C][latexmath]++++\[rs][...\[rs]]+++\f[R] (for display math).
4123For AsciiDoctor output format (\f[C]-t asciidoctor\f[R]) the LaTex
4124delimiters (\f[C]$..$\f[R] and \f[C]\[rs][..\[rs]]\f[R]) are omitted.
4127It will be rendered inside a \f[C]\[at]math\f[R] command.
4130It will be rendered verbatim without \f[C]$\f[R]\[aq]s.
4132.B MediaWiki, DokuWiki
4133It will be rendered inside \f[C]<math>\f[R] tags.
4136It will be rendered inside \f[C]<span class=\[dq]math\[dq]>\f[R] tags.
4139It will be rendered, if possible, using Unicode characters, and will
4140otherwise appear verbatim.
4143It will be rendered, if possible, using MathML.
4146If the \f[C]--mathml\f[R] flag is used, it will be rendered using MathML
4147in an \f[C]inlineequation\f[R] or \f[C]informalequation\f[R] tag.
4148Otherwise it will be rendered, if possible, using Unicode characters.
4151It will be rendered using OMML math markup.
4154If the \f[C]--webtex\f[R] option is used, formulas are rendered as
4155images using CodeCogs or other compatible web service, downloaded and
4156embedded in the e-book.
4157Otherwise, they will appear verbatim.
4159.B HTML, Slidy, DZSlides, S5, EPUB
4160The way math is rendered in HTML will depend on the command-line options
4162Therefore see Math rendering in HTML above.
4164.SS Extension: \f[C]raw_html\f[R]
4166Markdown allows you to insert raw HTML (or DocBook) anywhere in a
4167document (except verbatim contexts, where \f[C]<\f[R], \f[C]>\f[R], and
4168\f[C]&\f[R] are interpreted literally).
4169(Technically this is not an extension, since standard Markdown allows
4170it, but it has been made an extension so that it can be disabled if
4173The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
4174DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile
4175output, and suppressed in other formats.
4177For a more explicit way of including raw HTML in a Markdown document,
4178see the \f[C]raw_attribute\f[R] extension.
4180In the CommonMark format, if \f[C]raw_html\f[R] is enabled,
4181superscripts, subscripts, strikeouts and small capitals will be
4183Otherwise, plain-text fallbacks will be used.
4184Note that even if \f[C]raw_html\f[R] is disabled, tables will be
4185rendered with HTML syntax if they cannot use pipe syntax.
4186.SS Extension: \f[C]markdown_in_html_blocks\f[R]
4188Standard Markdown allows you to include HTML \[dq]blocks\[dq]: blocks of
4189HTML between balanced tags that are separated from the surrounding text
4190with blank lines, and start and end at the left margin.
4191Within these blocks, everything is interpreted as HTML, not Markdown; so
4192(for example), \f[C]*\f[R] does not signify emphasis.
4194Pandoc behaves this way when the \f[C]markdown_strict\f[R] format is
4195used; but by default, pandoc interprets material between HTML block tags
4197Thus, for example, pandoc will turn
4204<td>[a link](http://google.com)</td>
4216<td><em>one</em></td>
4217<td><a href=\[dq]http://google.com\[dq]>a link</a></td>
4223whereas \f[C]Markdown.pl\f[R] will preserve it as is.
4225There is one exception to this rule: text between \f[C]<script>\f[R] and
4226\f[C]<style>\f[R] tags is not interpreted as Markdown.
4228This departure from standard Markdown should make it easier to mix
4229Markdown with HTML block elements.
4230For example, one can surround a block of Markdown text with
4231\f[C]<div>\f[R] tags without preventing it from being interpreted as
4233.SS Extension: \f[C]native_divs\f[R]
4235Use native pandoc \f[C]Div\f[R] blocks for content inside
4236\f[C]<div>\f[R] tags.
4237For the most part this should give the same output as
4238\f[C]markdown_in_html_blocks\f[R], but it makes it easier to write
4239pandoc filters to manipulate groups of blocks.
4240.SS Extension: \f[C]native_spans\f[R]
4242Use native pandoc \f[C]Span\f[R] blocks for content inside
4243\f[C]<span>\f[R] tags.
4244For the most part this should give the same output as
4245\f[C]raw_html\f[R], but it makes it easier to write pandoc filters to
4246manipulate groups of inlines.
4247.SS Extension: \f[C]raw_tex\f[R]
4249In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
4250included in a document.
4251Inline TeX commands will be preserved and passed unchanged to the LaTeX
4253Thus, for example, you can use LaTeX to include BibTeX citations:
4257This result was proved in \[rs]cite{jones.1967}.
4261Note that in LaTeX environments, like
4265\[rs]begin{tabular}{|l|l|}\[rs]hline
4266Age & Frequency \[rs]\[rs] \[rs]hline
426718--25 & 15 \[rs]\[rs]
426826--35 & 33 \[rs]\[rs]
426936--45 & 22 \[rs]\[rs] \[rs]hline
4274the material between the begin and end tags will be interpreted as raw
4275LaTeX, not as Markdown.
4277For a more explicit and flexible way of including raw TeX in a Markdown
4278document, see the \f[C]raw_attribute\f[R] extension.
4280Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
4281Emacs Org mode, and ConTeXt.
4282.SS Generic raw attribute
4283.SS Extension: \f[C]raw_attribute\f[R]
4285Inline spans and fenced code blocks with a special kind of attribute
4286will be parsed as raw content with the designated format.
4287For example, the following produces a raw roff \f[C]ms\f[R] block:
4298And the following produces a raw \f[C]html\f[R] inline element:
4302This is \[ga]<a>html</a>\[ga]{=html}
4306This can be useful to insert raw xml into \f[C]docx\f[R] documents, e.g.
4311\[ga]\[ga]\[ga]{=openxml}
4314 <w:br w:type=\[dq]page\[dq]/>
4321The format name should match the target format name (see
4322\f[C]-t/--to\f[R], above, for a list, or use
4323\f[C]pandoc --list-output-formats\f[R]).
4324Use \f[C]openxml\f[R] for \f[C]docx\f[R] output, \f[C]opendocument\f[R]
4325for \f[C]odt\f[R] output, \f[C]html5\f[R] for \f[C]epub3\f[R] output,
4326\f[C]html4\f[R] for \f[C]epub2\f[R] output, and \f[C]latex\f[R],
4327\f[C]beamer\f[R], \f[C]ms\f[R], or \f[C]html5\f[R] for \f[C]pdf\f[R]
4328output (depending on what you use for \f[C]--pdf-engine\f[R]).
4330This extension presupposes that the relevant kind of inline code or
4331fenced code block is enabled.
4332Thus, for example, to use a raw attribute with a backtick code block,
4333\f[C]backtick_code_blocks\f[R] must be enabled.
4335The raw attribute cannot be combined with regular attributes.
4337.SS Extension: \f[C]latex_macros\f[R]
4339When this extension is enabled, pandoc will parse LaTeX macro
4340definitions and apply the resulting macros to all LaTeX math and raw
4342So, for example, the following will work in all output formats, not just
4347\[rs]newcommand{\[rs]tuple}[1]{\[rs]langle #1 \[rs]rangle}
4349$\[rs]tuple{a, b, c}$
4353Note that LaTeX macros will not be applied if they occur inside inside a
4354raw span or block marked with the \f[C]raw_attribute\f[R] extension.
4356When \f[C]latex_macros\f[R] is disabled, the raw LaTeX and math will not
4358This is usually a better approach when you are targeting LaTeX or PDF.
4360Whether or not \f[C]latex_macros\f[R] is enabled, the macro definitions
4361will still be passed through as raw LaTeX.
4364Markdown allows links to be specified in several ways.
4367If you enclose a URL or email address in pointy brackets, it will become
4373<sam\[at]green.eggs.ham>
4378An inline link consists of the link text in square brackets, followed by
4379the URL in parentheses.
4380(Optionally, the URL can be followed by a link title, in quotes.)
4384This is an [inline link](/url), and here\[aq]s [one with
4385a title](http://fsf.org \[dq]click here for a good time!\[dq]).
4389There can be no space between the bracketed part and the parenthesized
4391The link text can contain formatting (such as emphasis), but the title
4394Email addresses in inline links are not autodetected, so they have to be
4395prefixed with \f[C]mailto\f[R]:
4399[Write me!](mailto:sam\[at]green.eggs.ham)
4404An \f[I]explicit\f[R] reference link has two parts, the link itself and
4405the link definition, which may occur elsewhere in the document (either
4406before or after the link).
4408The link consists of link text in square brackets, followed by a label
4410(There cannot be space between the two unless the
4411\f[C]spaced_reference_links\f[R] extension is enabled.) The link
4412definition consists of the bracketed label, followed by a colon and a
4413space, followed by the URL, and optionally (after a space) a link title
4414either in quotes or in parentheses.
4415The label must not be parseable as a citation (assuming the
4416\f[C]citations\f[R] extension is enabled): citations take precedence
4419Here are some examples:
4423[my label 1]: /foo/bar.html \[dq]My title, optional\[dq]
4425[my label 3]: http://fsf.org (The free software foundation)
4426[my label 4]: /bar#special \[aq]A title in single quotes\[aq]
4430The URL may optionally be surrounded by angle brackets:
4434[my label 5]: <http://foo.bar.baz>
4438The title may go on the next line:
4442[my label 3]: http://fsf.org
4443 \[dq]The free software foundation\[dq]
4447Note that link labels are not case sensitive.
4452Here is [my link][FOO]
4458In an \f[I]implicit\f[R] reference link, the second pair of brackets is
4465[my website]: http://foo.bar.baz
4469Note: In \f[C]Markdown.pl\f[R] and most other Markdown implementations,
4470reference link definitions cannot occur in nested constructions such as
4471list items or block quotes.
4472Pandoc lifts this arbitrary seeming restriction.
4473So the following is fine in pandoc, though not in most other
4483.SS Extension: \f[C]shortcut_reference_links\f[R]
4485In a \f[I]shortcut\f[R] reference link, the second pair of brackets may
4492[my website]: http://foo.bar.baz
4497To link to another section of the same document, use the automatically
4498generated identifier (see Heading identifiers).
4503See the [Introduction](#introduction).
4511See the [Introduction].
4513[Introduction]: #introduction
4517Internal links are currently supported for HTML formats (including HTML
4518slide shows and EPUB), LaTeX, and ConTeXt.
4521A link immediately preceded by a \f[C]!\f[R] will be treated as an
4523The link text will be used as the image\[aq]s alt text:
4527
4531[movie reel]: movie.gif
4534.SS Extension: \f[C]implicit_figures\f[R]
4536An image with nonempty alt text, occurring by itself in a paragraph,
4537will be rendered as a figure with a caption.
4538The image\[aq]s alt text will be used as the caption.
4542
4546How this is rendered depends on the output format.
4547Some output formats (e.g.
4548RTF) do not yet support figures.
4549In those formats, you\[aq]ll just get an image in a paragraph by itself,
4552If you just want a regular inline image, just make sure it is not the
4553only thing in the paragraph.
4554One way to do this is to insert a nonbreaking space after the image:
4558![This image won\[aq]t be a figure](/url/of/image.png)\[rs]
4562Note that in reveal.js slide shows, an image in a paragraph by itself
4563that has the \f[C]stretch\f[R] class will fill the screen, and the
4564caption and figure tags will be omitted.
4565.SS Extension: \f[C]link_attributes\f[R]
4567Attributes can be set on links and images:
4571An inline {#id .class width=30 height=20px}
4572and a reference ![image][ref] with attributes.
4574[ref]: foo.jpg \[dq]optional title\[dq] {#id .class key=val key2=\[dq]val 2\[dq]}
4578(This syntax is compatible with PHP Markdown Extra when only
4579\f[C]#id\f[R] and \f[C].class\f[R] are used.)
4581For HTML and EPUB, all attributes except \f[C]width\f[R] and
4582\f[C]height\f[R] (but including \f[C]srcset\f[R] and \f[C]sizes\f[R])
4583are passed through as is.
4584The other writers ignore attributes that are not supported by their
4587The \f[C]width\f[R] and \f[C]height\f[R] attributes on images are
4589When used without a unit, the unit is assumed to be pixels.
4590However, any of the following unit identifiers can be used:
4591\f[C]px\f[R], \f[C]cm\f[R], \f[C]mm\f[R], \f[C]in\f[R], \f[C]inch\f[R]
4593There must not be any spaces between the number and the unit.
4598{ width=50% }
4602Dimensions are converted to inches for output in page-based formats like
4604Dimensions are converted to pixels for output in HTML-like formats.
4605Use the \f[C]--dpi\f[R] option to specify the number of pixels per inch.
4606The default is 96dpi.
4608The \f[C]%\f[R] unit is generally relative to some available space.
4609For example the above example will render to the following.
4613\f[C]<img href=\[dq]file.jpg\[dq] style=\[dq]width: 50%;\[dq] />\f[R]
4616\f[C]\[rs]includegraphics[width=0.5\[rs]textwidth,height=\[rs]textheight]{file.jpg}\f[R]
4617(If you\[aq]re using a custom template, you need to configure
4618\f[C]graphicx\f[R] as in the default template.)
4621\f[C]\[rs]externalfigure[file.jpg][width=0.5\[rs]textwidth]\f[R]
4624Some output formats have a notion of a class (ConTeXt) or a unique
4625identifier (LaTeX \f[C]\[rs]caption\f[R]), or both (HTML).
4627When no \f[C]width\f[R] or \f[C]height\f[R] attributes are specified,
4628the fallback is to look at the image resolution and the dpi metadata
4629embedded in the image file.
4632Using the \f[C]native_divs\f[R] and \f[C]native_spans\f[R] extensions
4633(see above), HTML syntax can be used as part of markdown to create
4634native \f[C]Div\f[R] and \f[C]Span\f[R] elements in the pandoc AST (as
4635opposed to raw HTML).
4636However, there is also nicer syntax available:
4637.SS Extension: \f[C]fenced_divs\f[R]
4639Allow special fenced syntax for native \f[C]Div\f[R] blocks.
4640A Div starts with a fence containing at least three consecutive colons
4641plus some attributes.
4642The attributes may optionally be followed by another string of
4644The attribute syntax is exactly as in fenced code blocks (see Extension:
4645\f[C]fenced_code_attributes\f[R]).
4646As with fenced code blocks, one can use either attributes in curly
4647braces or a single unbraced word, which will be treated as a class name.
4648The Div ends with another line containing a string of at least three
4650The fenced Div should be separated by blank lines from preceding and
4657::::: {#special .sidebar}
4665Fenced divs can be nested.
4666Opening fences are distinguished because they \f[I]must\f[R] have
4675This is a warning within a warning.
4681Fences without attributes are always closing fences.
4682Unlike with fenced code blocks, the number of colons in the closing
4683fence need not match the number in the opening fence.
4684However, it can be helpful for visual clarity to use fences of different
4685lengths to distinguish nested divs from their parents.
4686.SS Extension: \f[C]bracketed_spans\f[R]
4688A bracketed sequence of inlines, as one would use to begin a link, will
4689be treated as a \f[C]Span\f[R] with attributes if it is followed
4690immediately by attributes:
4694[This is *some text*]{.class key=\[dq]val\[dq]}
4698.SS Extension: \f[C]footnotes\f[R]
4700Pandoc\[aq]s Markdown allows footnotes, using the following syntax:
4704Here is a footnote reference,[\[ha]1] and another.[\[ha]longnote]
4706[\[ha]1]: Here is the footnote.
4708[\[ha]longnote]: Here\[aq]s one with multiple blocks.
4710 Subsequent paragraphs are indented to show that they
4711belong to the previous footnote.
4715 The whole paragraph can be indented, or just the first
4716 line. In this way, multi-paragraph footnotes work like
4717 multi-paragraph list items.
4719This paragraph won\[aq]t be part of the note, because it
4724The identifiers in footnote references may not contain spaces, tabs, or
4726These identifiers are used only to correlate the footnote reference with
4727the note itself; in the output, footnotes will be numbered sequentially.
4729The footnotes themselves need not be placed at the end of the document.
4730They may appear anywhere except inside other block elements (lists,
4731block quotes, tables, etc.).
4732Each footnote should be separated from surrounding content (including
4733other footnotes) by blank lines.
4734.SS Extension: \f[C]inline_notes\f[R]
4736Inline footnotes are also allowed (though, unlike regular notes, they
4737cannot contain multiple paragraphs).
4738The syntax is as follows:
4742Here is an inline note.\[ha][Inlines notes are easier to write, since
4743you don\[aq]t have to pick an identifier and move down to type the
4748Inline and regular footnotes may be mixed freely.
4750.SS Extension: \f[C]citations\f[R]
4752Using an external filter, \f[C]pandoc-citeproc\f[R], pandoc can
4753automatically generate citations and a bibliography in a number of
4759pandoc --filter pandoc-citeproc myinput.txt
4763In order to use this feature, you will need to specify a bibliography
4764file using the \f[C]bibliography\f[R] metadata field in a YAML metadata
4765section, or \f[C]--bibliography\f[R] command line argument.
4766You can supply multiple \f[C]--bibliography\f[R] arguments or set
4767\f[C]bibliography\f[R] metadata field to YAML array, if you want to use
4768multiple bibliography files.
4769The bibliography may have any of these formats:
4837Note that \f[C].bib\f[R] can be used with both BibTeX and BibLaTeX
4838files; use \f[C].bibtex\f[R] to force BibTeX.
4840Note that \f[C]pandoc-citeproc --bib2json\f[R] and
4841\f[C]pandoc-citeproc --bib2yaml\f[R] can produce \f[C].json\f[R] and
4842\f[C].yaml\f[R] files from any of the supported formats.
4844In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc
4845parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown;
4846and in CSL JSON databases, an HTML-like markup:
4848.B \f[C]<i>...</i>\f[R]
4851.B \f[C]<b>...</b>\f[R]
4854.B \f[C]<span style=\[dq]font-variant:small-caps;\[dq]>...</span>\f[R] or \f[C]<sc>...</sc>\f[R]
4857.B \f[C]<sub>...</sub>\f[R]
4860.B \f[C]<sup>...</sup>\f[R]
4863.B \f[C]<span class=\[dq]nocase\[dq]>...</span>\f[R]
4864prevent a phrase from being capitalized as title case
4866\f[C]pandoc-citeproc -j\f[R] and \f[C]-y\f[R] interconvert the CSL JSON
4867and CSL YAML formats as far as possible.
4869As an alternative to specifying a bibliography file using
4870\f[C]--bibliography\f[R] or the YAML metadata field
4871\f[C]bibliography\f[R], you can include the citation data directly in
4872the \f[C]references\f[R] field of the document\[aq]s YAML metadata.
4873The field should contain an array of YAML-encoded references, for
4880- type: article-journal
4892 title: \[aq]Molecular structure of nucleic acids: a structure for deoxyribose
4894 title-short: Molecular structure of nucleic acids
4895 container-title: Nature
4899 DOI: 10.1038/171737a0
4900 URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
4906(\f[C]pandoc-citeproc --bib2yaml\f[R] can produce these from a
4907bibliography file in one of the supported formats.)
4909Citations and references can be formatted using any style supported by
4910the Citation Style Language, listed in the Zotero Style Repository.
4911These files are specified using the \f[C]--csl\f[R] option or the
4912\f[C]csl\f[R] metadata field.
4913By default, \f[C]pandoc-citeproc\f[R] will use the Chicago Manual of
4914Style author-date format.
4915The CSL project provides further information on finding and editing
4918To make your citations hyperlinks to the corresponding bibliography
4919entries, add \f[C]link-citations: true\f[R] to your YAML metadata.
4921Citations go inside square brackets and are separated by semicolons.
4922Each citation must have a key, composed of \[aq]\[at]\[aq] + the
4923citation identifier from the database, and may optionally have a prefix,
4924a locator, and a suffix.
4925The citation key must begin with a letter, digit, or \f[C]_\f[R], and
4926may contain alphanumerics, \f[C]_\f[R], and internal punctuation
4927characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]).
4928Here are some examples:
4932Blah blah [see \[at]doe99, pp. 33-35; also \[at]smith04, chap. 1].
4934Blah blah [\[at]doe99, pp. 33-35, 38-39 and *passim*].
4936Blah blah [\[at]smith04; \[at]doe99].
4940\f[C]pandoc-citeproc\f[R] detects locator terms in the CSL locale files.
4941Either abbreviated or unabbreviated forms are accepted.
4942In the \f[C]en-US\f[R] locale, locator terms can be written in either
4943singular or plural forms, as \f[C]book\f[R],
4944\f[C]bk.\f[R]/\f[C]bks.\f[R]; \f[C]chapter\f[R],
4945\f[C]chap.\f[R]/\f[C]chaps.\f[R]; \f[C]column\f[R],
4946\f[C]col.\f[R]/\f[C]cols.\f[R]; \f[C]figure\f[R],
4947\f[C]fig.\f[R]/\f[C]figs.\f[R]; \f[C]folio\f[R],
4948\f[C]fol.\f[R]/\f[C]fols.\f[R]; \f[C]number\f[R],
4949\f[C]no.\f[R]/\f[C]nos.\f[R]; \f[C]line\f[R],
4950\f[C]l.\f[R]/\f[C]ll.\f[R]; \f[C]note\f[R], \f[C]n.\f[R]/\f[C]nn.\f[R];
4951\f[C]opus\f[R], \f[C]op.\f[R]/\f[C]opp.\f[R]; \f[C]page\f[R],
4952\f[C]p.\f[R]/\f[C]pp.\f[R]; \f[C]paragraph\f[R],
4953\f[C]para.\f[R]/\f[C]paras.\f[R]; \f[C]part\f[R],
4954\f[C]pt.\f[R]/\f[C]pts.\f[R]; \f[C]section\f[R],
4955\f[C]sec.\f[R]/\f[C]secs.\f[R]; \f[C]sub verbo\f[R],
4956\f[C]s.v.\f[R]/\f[C]s.vv.\f[R]; \f[C]verse\f[R],
4957\f[C]v.\f[R]/\f[C]vv.\f[R]; \f[C]volume\f[R],
4958\f[C]vol.\f[R]/\f[C]vols.\f[R]; \f[C]\[ps]\f[R]/\f[C]\[ps]\[ps]\f[R];
4959\f[C]\[sc]\f[R]/\f[C]\[sc]\[sc]\f[R].
4960If no locator term is used, \[dq]page\[dq] is assumed.
4962\f[C]pandoc-citeproc\f[R] will use heuristics to distinguish the locator
4964In complex cases, the locator can be enclosed in curly braces (using
4965\f[C]pandoc-citeproc\f[R] 0.15 and higher only):
4969[\[at]smith{ii, A, D-Z}, with a suffix]
4970[\[at]smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
4974A minus sign (\f[C]-\f[R]) before the \f[C]\[at]\f[R] will suppress
4975mention of the author in the citation.
4976This can be useful when the author is already mentioned in the text:
4980Smith says blah [-\[at]smith04].
4984You can also write an in-text citation, as follows:
4988\[at]smith04 says blah.
4990\[at]smith04 [p. 33] says blah.
4994If the style calls for a list of works cited, it will be placed in a div
4995with id \f[C]refs\f[R], if one exists:
5004Otherwise, it will be placed at the end of the document.
5005Generation of the bibliography can be suppressed by setting
5006\f[C]suppress-bibliography: true\f[R] in the YAML metadata.
5008If you wish the bibliography to have a section heading, you can set
5009\f[C]reference-section-title\f[R] in the metadata, or put the heading at
5010the beginning of the div with id \f[C]refs\f[R] (if you are using it) or
5011at the end of your document:
5021The bibliography will be inserted after this heading.
5022Note that the \f[C]unnumbered\f[R] class will be added to this heading,
5023so that the section will not be numbered.
5025If you want to include items in the bibliography without actually citing
5026them in the body text, you can define a dummy \f[C]nocite\f[R] metadata
5027field and put the citations there:
5033 \[at]item1, \[at]item2
5040In this example, the document will contain a citation for
5041\f[C]item3\f[R] only, but the bibliography will contain entries for
5042\f[C]item1\f[R], \f[C]item2\f[R], and \f[C]item3\f[R].
5044It is possible to create a bibliography with all the citations, whether
5045or not they appear in the document, by using a wildcard:
5056For LaTeX output, you can also use \f[C]natbib\f[R] or
5057\f[C]biblatex\f[R] to render the bibliography.
5058In order to do so, specify bibliography files as outlined above, and add
5059\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] argument to \f[C]pandoc\f[R]
5061Bear in mind that bibliography files have to be in respective format
5062(either BibTeX or BibLaTeX).
5064For more information, see the pandoc-citeproc man page.
5065.SS Non-pandoc extensions
5067The following Markdown syntax extensions are not enabled by default in
5068pandoc, but may be enabled by adding \f[C]+EXTENSION\f[R] to the format
5069name, where \f[C]EXTENSION\f[R] is the name of the extension.
5070Thus, for example, \f[C]markdown+hard_line_breaks\f[R] is Markdown with
5072.SS Extension: \f[C]old_dashes\f[R]
5074Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
5075\f[C]-\f[R] before a numeral is an en-dash, and \f[C]--\f[R] is an
5077This option only has an effect if \f[C]smart\f[R] is enabled.
5078It is selected automatically for \f[C]textile\f[R] input.
5079.SS Extension: \f[C]angle_brackets_escapable\f[R]
5081Allow \f[C]<\f[R] and \f[C]>\f[R] to be backslash-escaped, as they can
5082be in GitHub flavored Markdown but not original Markdown.
5083This is implied by pandoc\[aq]s default \f[C]all_symbols_escapable\f[R].
5084.SS Extension: \f[C]lists_without_preceding_blankline\f[R]
5086Allow a list to occur right after a paragraph, with no intervening blank
5088.SS Extension: \f[C]four_space_rule\f[R]
5090Selects the pandoc <= 2.0 behavior for parsing lists, so that four
5091spaces indent are needed for list item continuation paragraphs.
5092.SS Extension: \f[C]spaced_reference_links\f[R]
5094Allow whitespace between the two components of a reference link, for
5102.SS Extension: \f[C]hard_line_breaks\f[R]
5104Causes all newlines within a paragraph to be interpreted as hard line
5105breaks instead of spaces.
5106.SS Extension: \f[C]ignore_line_breaks\f[R]
5108Causes newlines within a paragraph to be ignored, rather than being
5109treated as spaces or as hard line breaks.
5110This option is intended for use with East Asian languages where spaces
5111are not used between words, but text is divided into lines for
5113.SS Extension: \f[C]east_asian_line_breaks\f[R]
5115Causes newlines within a paragraph to be ignored, rather than being
5116treated as spaces or as hard line breaks, when they occur between two
5117East Asian wide characters.
5118This is a better choice than \f[C]ignore_line_breaks\f[R] for texts that
5119include a mix of East Asian wide characters and other characters.
5120.SS Extension: \f[C]emoji\f[R]
5122Parses textual emojis like \f[C]:smile:\f[R] as Unicode emoticons.
5123.SS Extension: \f[C]tex_math_single_backslash\f[R]
5125Causes anything between \f[C]\[rs](\f[R] and \f[C]\[rs])\f[R] to be
5126interpreted as inline TeX math, and anything between \f[C]\[rs][\f[R]
5127and \f[C]\[rs]]\f[R] to be interpreted as display TeX math.
5128Note: a drawback of this extension is that it precludes escaping
5129\f[C](\f[R] and \f[C][\f[R].
5130.SS Extension: \f[C]tex_math_double_backslash\f[R]
5132Causes anything between \f[C]\[rs]\[rs](\f[R] and \f[C]\[rs]\[rs])\f[R]
5133to be interpreted as inline TeX math, and anything between
5134\f[C]\[rs]\[rs][\f[R] and \f[C]\[rs]\[rs]]\f[R] to be interpreted as
5136.SS Extension: \f[C]markdown_attribute\f[R]
5138By default, pandoc interprets material inside block-level tags as
5140This extension changes the behavior so that Markdown is only parsed
5141inside block-level tags if the tags have the attribute
5142\f[C]markdown=1\f[R].
5143.SS Extension: \f[C]mmd_title_block\f[R]
5145Enables a MultiMarkdown style title block at the top of the document,
5152Date: September 1, 2008
5153Comment: This is a sample mmd title block, with
5154 a field spanning multiple lines.
5158See the MultiMarkdown documentation for details.
5159If \f[C]pandoc_title_block\f[R] or \f[C]yaml_metadata_block\f[R] is
5160enabled, it will take precedence over \f[C]mmd_title_block\f[R].
5161.SS Extension: \f[C]abbreviations\f[R]
5163Parses PHP Markdown Extra abbreviation keys, like
5167*[HTML]: Hypertext Markup Language
5171Note that the pandoc document model does not support abbreviations, so
5172if this extension is enabled, abbreviation keys are simply skipped (as
5173opposed to being parsed as paragraphs).
5174.SS Extension: \f[C]autolink_bare_uris\f[R]
5176Makes all absolute URIs into links, even when not surrounded by pointy
5177braces \f[C]<...>\f[R].
5178.SS Extension: \f[C]mmd_link_attributes\f[R]
5180Parses multimarkdown style key-value attributes on link and image
5182This extension should not be confused with the \f[C]link_attributes\f[R]
5187This is a reference ![image][ref] with multimarkdown attributes.
5189[ref]: http://path.to/image \[dq]Image title\[dq] width=20px height=30px
5190 id=myId class=\[dq]myClass1 myClass2\[dq]
5193.SS Extension: \f[C]mmd_header_identifiers\f[R]
5195Parses multimarkdown style heading identifiers (in square brackets,
5196after the heading but before any trailing \f[C]#\f[R]s in an ATX
5198.SS Extension: \f[C]compact_definition_lists\f[R]
5200Activates the definition list syntax of pandoc 1.12.x and earlier.
5201This syntax differs from the one described above under Definition lists
5204No blank line is required between consecutive items of the definition
5207To get a \[dq]tight\[dq] or \[dq]compact\[dq] list, omit space between
5208consecutive items; the space between a term and its definition does not
5211Lazy wrapping of paragraphs is not allowed: the entire definition must
5212be indented four spaces.
5213.SS Markdown variants
5215In addition to pandoc\[aq]s extended Markdown, the following Markdown
5216variants are supported:
5218.B \f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
5219\f[C]footnotes\f[R], \f[C]pipe_tables\f[R], \f[C]raw_html\f[R],
5220\f[C]markdown_attribute\f[R], \f[C]fenced_code_blocks\f[R],
5221\f[C]definition_lists\f[R], \f[C]intraword_underscores\f[R],
5222\f[C]header_attributes\f[R], \f[C]link_attributes\f[R],
5223\f[C]abbreviations\f[R], \f[C]shortcut_reference_links\f[R],
5224\f[C]spaced_reference_links\f[R].
5226.B \f[C]markdown_github\f[R] (deprecated GitHub-Flavored Markdown)
5227\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
5228\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
5229\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
5230\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
5231\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
5232\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
5233\f[C]lists_without_preceding_blankline\f[R].
5235.B \f[C]markdown_mmd\f[R] (MultiMarkdown)
5236\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]markdown_attribute\f[R],
5237\f[C]mmd_link_attributes\f[R], \f[C]tex_math_double_backslash\f[R],
5238\f[C]intraword_underscores\f[R], \f[C]mmd_title_block\f[R],
5239\f[C]footnotes\f[R], \f[C]definition_lists\f[R],
5240\f[C]all_symbols_escapable\f[R], \f[C]implicit_header_references\f[R],
5241\f[C]auto_identifiers\f[R], \f[C]mmd_header_identifiers\f[R],
5242\f[C]shortcut_reference_links\f[R], \f[C]implicit_figures\f[R],
5243\f[C]superscript\f[R], \f[C]subscript\f[R],
5244\f[C]backtick_code_blocks\f[R], \f[C]spaced_reference_links\f[R],
5245\f[C]raw_attribute\f[R].
5247.B \f[C]markdown_strict\f[R] (Markdown.pl)
5248\f[C]raw_html\f[R], \f[C]shortcut_reference_links\f[R],
5249\f[C]spaced_reference_links\f[R].
5251We also support \f[C]commonmark\f[R] and \f[C]gfm\f[R] (GitHub-Flavored
5252Markdown, which is implemented as a set of extensions on
5253\f[C]commonmark\f[R]).
5255Note, however, that \f[C]commonmark\f[R] and \f[C]gfm\f[R] have limited
5256support for extensions.
5257Only those listed below (and \f[C]smart\f[R], \f[C]raw_tex\f[R], and
5258\f[C]hard_line_breaks\f[R]) will work.
5259The extensions can, however, all be individually disabled.
5260Also, \f[C]raw_tex\f[R] only affects \f[C]gfm\f[R] output, not input.
5262.B \f[C]gfm\f[R] (GitHub-Flavored Markdown)
5263\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
5264\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
5265\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
5266\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
5267\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
5268\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
5269\f[C]lists_without_preceding_blankline\f[R].
5270.SH PRODUCING SLIDE SHOWS WITH PANDOC
5272You can use pandoc to produce an HTML + JavaScript slide presentation
5273that can be viewed via a web browser.
5274There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
5276You can also produce a PDF slide show using LaTeX \f[C]beamer\f[R], or
5277slides shows in Microsoft PowerPoint format.
5279Here\[aq]s the Markdown source for a simple slide show,
5280\f[C]habits.txt\f[R]:
5309
5318To produce an HTML/JavaScript slide show, simply type
5322pandoc -t FORMAT -s habits.txt -o habits.html
5326where \f[C]FORMAT\f[R] is either \f[C]s5\f[R], \f[C]slidy\f[R],
5327\f[C]slideous\f[R], \f[C]dzslides\f[R], or \f[C]revealjs\f[R].
5329For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
5330the \f[C]-s/--standalone\f[R] option embeds a link to JavaScript and CSS
5331files, which are assumed to be available at the relative path
5332\f[C]s5/default\f[R] (for S5), \f[C]slideous\f[R] (for Slideous),
5333\f[C]reveal.js\f[R] (for reveal.js), or at the Slidy website at
5334\f[C]w3.org\f[R] (for Slidy).
5335(These paths can be changed by setting the \f[C]slidy-url\f[R],
5336\f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R]
5337variables; see Variables for HTML slides, above.) For DZSlides, the
5338(relatively short) JavaScript and CSS are included in the file by
5341With all HTML slide formats, the \f[C]--self-contained\f[R] option can
5342be used to produce a single file that contains all of the data necessary
5343to display the slide show, including linked scripts, stylesheets,
5346To produce a PDF slide show using beamer, type
5350pandoc -t beamer habits.txt -o habits.pdf
5354Note that a reveal.js slide show can also be converted to a PDF by
5355printing it to a file from the browser.
5357To produce a Powerpoint slide show, type
5361pandoc habits.txt -o habits.pptx
5364.SS Structuring the slide show
5366By default, the \f[I]slide level\f[R] is the highest heading level in
5367the hierarchy that is followed immediately by content, and not another
5368heading, somewhere in the document.
5369In the example above, level-1 headings are always followed by level-2
5370headings, which are followed by content, so the slide level is 2.
5371This default can be overridden using the \f[C]--slide-level\f[R] option.
5373The document is carved up into slides according to the following rules:
5375A horizontal rule always starts a new slide.
5377A heading at the slide level always starts a new slide.
5379Headings \f[I]below\f[R] the slide level in the hierarchy create
5380headings \f[I]within\f[R] a slide.
5382Headings \f[I]above\f[R] the slide level in the hierarchy create
5383\[dq]title slides,\[dq] which just contain the section title and help to
5384break the slide show into sections.
5385Non-slide content under these headings will be included on the title
5386slide (for HTML slide shows) or in a subsequent slide with the same
5389A title page is constructed automatically from the document\[aq]s title
5391(In the case of beamer, this can be disabled by commenting out some
5392lines in the default template.)
5394These rules are designed to support many different styles of slide show.
5395If you don\[aq]t care about structuring your slides into sections and
5396subsections, you can just use level-1 headings for all each slide.
5397(In that case, level-1 will be the slide level.) But you can also
5398structure the slide show into sections, as in the example above.
5400Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
5401layout will be produced, with level-1 headings building horizontally and
5402level-2 headings building vertically.
5403It is not recommended that you use deeper nesting of section levels with
5405.SS Incremental lists
5407By default, these writers produce lists that display \[dq]all at
5408once.\[dq] If you want your lists to display incrementally (one item at
5409a time), use the \f[C]-i\f[R] option.
5410If you want a particular list to depart from the default, put it in a
5411\f[C]div\f[R] block with class \f[C]incremental\f[R] or
5412\f[C]nonincremental\f[R].
5413So, for example, using the \f[C]fenced div\f[R] syntax, the following
5414would be incremental regardless of the document default:
5440While using \f[C]incremental\f[R] and \f[C]nonincremental\f[R] divs are
5441the recommended method of setting incremental lists on a per-case basis,
5442an older method is also supported: putting lists inside a blockquote
5443will depart from the document default (that is, it will display
5444incrementally without the \f[C]-i\f[R] option and all at once with the
5445\f[C]-i\f[R] option):
5454Both methods allow incremental and nonincremental lists to be mixed in a
5458You can add \[dq]pauses\[dq] within a slide by including a paragraph
5459containing three dots, separated by spaces:
5465content before the pause
5469content after the pause
5472.SS Styling the slides
5474You can change the style of HTML slides by putting customized CSS files
5475in \f[C]$DATADIR/s5/default\f[R] (for S5), \f[C]$DATADIR/slidy\f[R] (for
5476Slidy), or \f[C]$DATADIR/slideous\f[R] (for Slideous), where
5477\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
5479The originals may be found in pandoc\[aq]s system data directory
5480(generally \f[C]$CABALDIR/pandoc-VERSION/s5/default\f[R]).
5481Pandoc will look there for any files it does not find in the user data
5484For dzslides, the CSS is included in the HTML file itself, and may be
5487All reveal.js configuration options can be set through variables.
5488For example, themes can be used by setting the \f[C]theme\f[R] variable:
5496Or you can specify a custom stylesheet using the \f[C]--css\f[R] option.
5498To style beamer slides, you can specify a \f[C]theme\f[R],
5499\f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], and
5500\f[C]outertheme\f[R], using the \f[C]-V\f[R] option:
5504pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
5508Note that heading attributes will turn into slide attributes (on a
5509\f[C]<div>\f[R] or \f[C]<section>\f[R]) in HTML slide formats, allowing
5510you to style individual slides.
5511In beamer, the only heading attribute that affects slides is the
5512\f[C]allowframebreaks\f[R] class, which sets the
5513\f[C]allowframebreaks\f[R] option, causing multiple slides to be created
5514if the content overfills the frame.
5515This is recommended especially for bibliographies:
5519# References {.allowframebreaks}
5524Speaker notes are supported in reveal.js and PowerPoint (pptx) output.
5525You can add notes to your Markdown document thus:
5533- It can contain Markdown
5540To show the notes window in reveal.js, press \f[C]s\f[R] while viewing
5542Speaker notes in PowerPoint will be available, as usual, in handouts and
5545Notes are not yet supported for other slide formats, but the notes will
5546not appear on the slides themselves.
5549To put material in side by side columns, you can use a native div
5550container with class \f[C]columns\f[R], containing two or more div
5551containers with class \f[C]column\f[R] and a \f[C]width\f[R] attribute:
5555:::::::::::::: {.columns}
5556::: {.column width=\[dq]40%\[dq]}
5559::: {.column width=\[dq]60%\[dq]}
5565.SS Frame attributes in beamer
5567Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[R] option to
5568a frame in beamer (for example, when using the \f[C]minted\f[R]
5570This can be forced by adding the \f[C]fragile\f[R] class to the heading
5571introducing the slide:
5575# Fragile slide {.fragile}
5579All of the other frame attributes described in Section 8.1 of the Beamer
5580User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R],
5581\f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R],
5582\f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R],
5583\f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R].
5584.SS Background in reveal.js and beamer
5586Background images can be added to self-contained reveal.js slideshows
5587and to beamer slideshows.
5589For the same image on every slide, use the configuration option
5590\f[C]background-image\f[R] either in the YAML metadata block or as a
5591command-line variable.
5592(There are no other options in beamer and the rest of this section
5593concerns reveal.js slideshows.)
5595For reveal.js, you can instead use the reveal.js-native option
5596\f[C]parallaxBackgroundImage\f[R].
5597You can also set \f[C]parallaxBackgroundHorizontal\f[R] and
5598\f[C]parallaxBackgroundVertical\f[R] the same way and must also set
5599\f[C]parallaxBackgroundSize\f[R] to have your values take effect.
5601To set an image for a particular reveal.js slide, add
5602\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first
5603slide-level heading on the slide (which may even be empty).
5605In reveal.js\[aq]s overview mode, the parallaxBackgroundImage will show
5606up only on the first slide.
5608Other reveal.js background settings also work on individual slides,
5609including \f[C]data-background-size\f[R],
5610\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R],
5611\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R].
5613See the reveal.js documentation for more details.
5615For example in reveal.js:
5621parallaxBackgroundImage: /path/to/my/background_image.png
5626Slide 1 has background_image.png as its background.
5628## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]}
5630Slide 2 has a special image for its background, even though the heading has no content.
5633.SH CREATING EPUBS WITH PANDOC
5636EPUB metadata may be specified using the \f[C]--epub-metadata\f[R]
5637option, but if the source document is Markdown, it is better to use a
5648 text: An investigation of metadata
5656 text: doi:10.234234.234/33
5658rights: \[co] 2007 John Smith, CC BY-NC
5665The following fields are recognized:
5667.B \f[C]identifier\f[R]
5668Either a string value or an object with fields \f[C]text\f[R] and
5670Valid values for \f[C]scheme\f[R] are \f[C]ISBN-10\f[R],
5671\f[C]GTIN-13\f[R], \f[C]UPC\f[R], \f[C]ISMN-10\f[R], \f[C]DOI\f[R],
5672\f[C]LCCN\f[R], \f[C]GTIN-14\f[R], \f[C]ISBN-13\f[R],
5673\f[C]Legal deposit number\f[R], \f[C]URN\f[R], \f[C]OCLC\f[R],
5674\f[C]ISMN-13\f[R], \f[C]ISBN-A\f[R], \f[C]JP\f[R], \f[C]OLCC\f[R].
5677Either a string value, or an object with fields \f[C]file-as\f[R] and
5678\f[C]type\f[R], or a list of such objects.
5679Valid values for \f[C]type\f[R] are \f[C]main\f[R], \f[C]subtitle\f[R],
5680\f[C]short\f[R], \f[C]collection\f[R], \f[C]edition\f[R],
5684Either a string value, or an object with fields \f[C]role\f[R],
5685\f[C]file-as\f[R], and \f[C]text\f[R], or a list of such objects.
5686Valid values for \f[C]role\f[R] are MARC relators, but pandoc will
5687attempt to translate the human-readable versions (like \[dq]author\[dq]
5688and \[dq]editor\[dq]) to the appropriate marc relators.
5690.B \f[C]contributor\f[R]
5691Same format as \f[C]creator\f[R].
5694A string value in \f[C]YYYY-MM-DD\f[R] format.
5695(Only the year is necessary.) Pandoc will attempt to convert other
5698.B \f[C]lang\f[R] (or legacy: \f[C]language\f[R])
5699A string value in BCP 47 format.
5700Pandoc will default to the local language if nothing is specified.
5703A string value or a list of such values.
5705.B \f[C]description\f[R]
5714.B \f[C]relation\f[R]
5717.B \f[C]coverage\f[R]
5723.B \f[C]cover-image\f[R]
5724A string value (path to cover image).
5726.B \f[C]css\f[R] (or legacy: \f[C]stylesheet\f[R])
5727A string value (path to CSS stylesheet).
5729.B \f[C]page-progression-direction\f[R]
5730Either \f[C]ltr\f[R] or \f[C]rtl\f[R].
5731Specifies the \f[C]page-progression-direction\f[R] attribute for the
5732\f[C]spine\f[R] element.
5735iBooks-specific metadata, with the following fields:
5738\f[C]version\f[R]: (string)
5740\f[C]specified-fonts\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
5743\f[C]ipad-orientation-lock\f[R]:
5744\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
5746\f[C]iphone-orientation-lock\f[R]:
5747\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
5749\f[C]binding\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
5752\f[C]scroll-axis\f[R]:
5753\f[C]vertical\f[R]|\f[C]horizontal\f[R]|\f[C]default\f[R]
5755.SS The \f[C]epub:type\f[R] attribute
5757For \f[C]epub3\f[R] output, you can mark up the heading that corresponds
5758to an EPUB chapter using the \f[C]epub:type\f[R] attribute.
5759For example, to set the attribute to the value \f[C]prologue\f[R], use
5764# My chapter {epub:type=prologue}
5768Which will result in:
5772<body epub:type=\[dq]frontmatter\[dq]>
5773 <section epub:type=\[dq]prologue\[dq]>
5778Pandoc will output \f[C]<body epub:type=\[dq]bodymatter\[dq]>\f[R],
5779unless you use one of the following values, in which case either
5780\f[C]frontmatter\f[R] or \f[C]backmatter\f[R] will be output.
5786\f[C]epub:type\f[R] of first section
5788\f[C]epub:type\f[R] of body
5874By default, pandoc will download media referenced from any
5875\f[C]<img>\f[R], \f[C]<audio>\f[R], \f[C]<video>\f[R] or
5876\f[C]<source>\f[R] element present in the generated EPUB, and include it
5877in the EPUB container, yielding a completely self-contained EPUB.
5878If you want to link to external media resources instead, use raw HTML in
5879your source and add \f[C]data-external=\[dq]1\[dq]\f[R] to the tag with
5880the \f[C]src\f[R] attribute.
5885<audio controls=\[dq]1\[dq]>
5886 <source src=\[dq]http://example.com/music/toccata.mp3\[dq]
5887 data-external=\[dq]1\[dq] type=\[dq]audio/mpeg\[dq]>
5892.SH CREATING JUPYTER NOTEBOOKS WITH PANDOC
5894When creating a Jupyter notebook, pandoc will try to infer the notebook
5896Code blocks with the class \f[C]code\f[R] will be taken as code cells,
5897and intervening content will be taken as Markdown cells.
5898Attachments will automatically be created for images in Markdown cells.
5899Metadata will be taken from the \f[C]jupyter\f[R] metadata field.
5910 display_name: Python 2
5917 file_extension: \[dq].py\[dq]
5918 mimetype: \[dq]text/x-python\[dq]
5919 name: \[dq]python\[dq]
5920 nbconvert_exporter: \[dq]python\[dq]
5921 pygments_lexer: \[dq]ipython2\[dq]
5922 version: \[dq]2.7.15\[dq]
5927**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
5928bibendum felis dictum sodales.
5931print(\[dq]hello\[dq])
5937from IPython.display import HTML
5940console.log(\[dq]hello\[dq]);
5948This image  will be
5949included as a cell attachment.
5953If you want to add cell attributes, group cells differently, or add
5954output to code cells, then you need to include divs to indicate the
5956You can use either fenced divs or native divs for this.
5961:::::: {.cell .markdown}
5964**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
5965bibendum felis dictum sodales.
5968:::::: {.cell .code execution_count=1}
5969\[ga]\[ga]\[ga] {.python}
5970print(\[dq]hello\[dq])
5973::: {.output .stream .stdout}
5980:::::: {.cell .code execution_count=2}
5981\[ga]\[ga]\[ga] {.python}
5982from IPython.display import HTML
5985console.log(\[dq]hello\[dq]);
5991::: {.output .execute_result execution_count=2}
5992\[ga]\[ga]\[ga]{=html}
5994console.log(\[dq]hello\[dq]);
6004If you include raw HTML or TeX in an output cell, use the [raw
6005attribute][Extension: \f[C]fenced_attribute\f[R]], as shown in the last
6006cell of the example above.
6007Although pandoc can process \[dq]bare\[dq] raw HTML and TeX, the result
6008is often interspersed raw elements and normal textual elements, and in
6009an output cell pandoc expects a single, connected raw block.
6010To avoid using raw HTML or TeX except when marked explicitly using raw
6011attributes, we recommend specifying the extensions
6012\f[C]-raw_html-raw_tex+raw_attribute\f[R] when translating between
6013Markdown and ipynb notebooks.
6015Note that options and extensions that affect reading and writing of
6016Markdown will also affect Markdown cells in ipynb notebooks.
6017For example, \f[C]--wrap=preserve\f[R] will preserve soft line breaks in
6018Markdown cells; \f[C]--atx-headers\f[R] will cause ATX-style headings to
6019be used; and \f[C]--preserve-tabs\f[R] will prevent tabs from being
6021.SH SYNTAX HIGHLIGHTING
6023Pandoc will automatically highlight syntax in fenced code blocks that
6024are marked with a language name.
6025The Haskell library skylighting is used for highlighting.
6026Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and
6028To see a list of language names that pandoc will recognize, type
6029\f[C]pandoc --list-highlight-languages\f[R].
6031The color scheme can be selected using the \f[C]--highlight-style\f[R]
6033The default color scheme is \f[C]pygments\f[R], which imitates the
6034default color scheme used by the Python library pygments (though
6035pygments is not actually used to do the highlighting).
6036To see a list of highlight styles, type
6037\f[C]pandoc --list-highlight-styles\f[R].
6039If you are not satisfied with the predefined styles, you can use
6040\f[C]--print-highlight-style\f[R] to generate a JSON \f[C].theme\f[R]
6041file which can be modified and used as the argument to
6042\f[C]--highlight-style\f[R].
6043To get a JSON version of the \f[C]pygments\f[R] style, for example:
6047pandoc --print-highlight-style pygments > my.theme
6051Then edit \f[C]my.theme\f[R] and use it like this:
6055pandoc --highlight-style my.theme
6059If you are not satisfied with the built-in highlighting, or you want
6060highlight a language that isn\[aq]t supported, you can use the
6061\f[C]--syntax-definition\f[R] option to load a KDE-style XML syntax
6063Before writing your own, have a look at KDE\[aq]s repository of syntax
6066To disable highlighting, use the \f[C]--no-highlight\f[R] option.
6069Custom styles can be used in the docx and ICML formats.
6072By default, pandoc\[aq]s docx and ICML output applies a predefined set
6073of styles for blocks such as paragraphs and block quotes, and uses
6074largely default formatting (italics, bold) for inlines.
6075This will work for most purposes, especially alongside a
6076\f[C]reference.docx\f[R] file.
6077However, if you need to apply your own styles to blocks, or match a
6078preexisting set of styles, pandoc allows you to define custom styles for
6079blocks and text using \f[C]div\f[R]s and \f[C]span\f[R]s, respectively.
6081If you define a \f[C]div\f[R] or \f[C]span\f[R] with the attribute
6082\f[C]custom-style\f[R], pandoc will apply your specified style to the
6084So, for example using the \f[C]bracketed_spans\f[R] syntax,
6088[Get out]{custom-style=\[dq]Emphatically\[dq]}, he said.
6092would produce a docx file with \[dq]Get out\[dq] styled with character
6093style \f[C]Emphatically\f[R].
6094Similarly, using the \f[C]fenced_divs\f[R] syntax,
6098Dickinson starts the poem simply:
6100::: {custom-style=\[dq]Poetry\[dq]}
6101| A Bird came down the Walk---
6102| He did not know I saw---
6107would style the two contained lines with the \f[C]Poetry\f[R] paragraph
6110For docx output, styles will be defined in the output file as inheriting
6111from normal text, if the styles are not yet in your reference.docx.
6112If they are already defined, pandoc will not alter the definition.
6114This feature allows for greatest customization in conjunction with
6116If you want all paragraphs after block quotes to be indented, you can
6117write a filter to apply the styles necessary.
6118If you want all italics to be transformed to the \f[C]Emphasis\f[R]
6119character style (perhaps to change their color), you can write a filter
6120which will transform all italicized inlines to inlines within an
6121\f[C]Emphasis\f[R] custom-style \f[C]span\f[R].
6123For docx output, you don\[aq]t need to enable any extensions for custom
6127The docx reader, by default, only reads those styles that it can convert
6128into pandoc elements, either by direct conversion or interpreting the
6129derivation of the input document\[aq]s styles.
6131By enabling the \f[C]styles\f[R] extension in the docx reader
6132(\f[C]-f docx+styles\f[R]), you can produce output that maintains the
6133styles of the input document, using the \f[C]custom-style\f[R] class.
6134Paragraph styles are interpreted as divs, while character styles are
6135interpreted as spans.
6137For example, using the \f[C]custom-style-reference.docx\f[R] file in the
6138test directory, we have the following different outputs:
6140Without the \f[C]+styles\f[R] extension:
6144$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
6147This is text with an *emphasized* text style. And this is text with a
6148**strengthened** text style.
6150> Here is a styled paragraph that inherits from Block Text.
6154And with the extension:
6158$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
6160::: {custom-style=\[dq]FirstParagraph\[dq]}
6164::: {custom-style=\[dq]BodyText\[dq]}
6165This is text with an [emphasized]{custom-style=\[dq]Emphatic\[dq]} text style.
6166And this is text with a [strengthened]{custom-style=\[dq]Strengthened\[dq]}
6170::: {custom-style=\[dq]MyBlockStyle\[dq]}
6171> Here is a styled paragraph that inherits from Block Text.
6176With these custom styles, you can use your input document as a
6177reference-doc while creating docx output (see below), and maintain the
6178same styles in your input and output files.
6181Pandoc can be extended with custom writers written in lua.
6182(Pandoc includes a lua interpreter, so lua need not be installed
6185To use a custom writer, simply specify the path to the lua script in
6186place of the output format.
6191pandoc -t data/sample.lua
6195Creating a custom writer requires writing a lua function for each
6196possible element in a pandoc document.
6197To get a documented example which you can modify according to your
6202pandoc --print-default-data-file sample.lua
6205.SH A NOTE ON SECURITY
6207If you use pandoc to convert user-contributed content in a web
6208application, here are some things to keep in mind:
6210Although pandoc itself will not create or modify any files other than
6211those you explicitly ask it create (with the exception of temporary
6212files used in producing PDFs), a filter or custom writer could in
6213principle do anything on your file system.
6214Please audit filters and custom writers very carefully before using
6217If your application uses pandoc as a Haskell library (rather than
6218shelling out to the executable), it is possible to use it in a mode that
6219fully isolates pandoc from your file system, by running the pandoc
6220operations in the \f[C]PandocPure\f[R] monad.
6221See the document Using the pandoc API for more details.
6223Pandoc\[aq]s parsers can exhibit pathological performance on some corner
6225It is wise to put any pandoc operations under a timeout, to avoid DOS
6226attacks that exploit these issues.
6227If you are using the pandoc executable, you can add the command line
6228options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size
6231The HTML generated by pandoc is not guaranteed to be safe.
6232If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
6233inject arbitrary HTML.
6234Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
6235content in attributes for headings, spans, and code blocks.
6236To be safe, you should run all the generated HTML through an HTML
6240Copyright 2006--2019 John MacFarlane (jgm\[at]berkeley.edu).
6241Released under the GPL, version 2 or greater.
6242This software carries no warranty of any kind.
6243(See COPYRIGHT for full copyright and warranty notices.) For a full list
6244of contributors, see the file AUTHORS.md in the pandoc source code.
6246The Pandoc source code and all documentation may be downloaded
6247from <http://pandoc.org>.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list