2.TH PANDOC 1 "January 30, 2019" "pandoc 2.6"
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)
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]zimwiki\f[R] (ZimWiki markup)
398the path of a custom lua writer, see Custom writers below
400Note that \f[C]odt\f[R], \f[C]docx\f[R], and \f[C]epub\f[R] output will
401not be directed to \f[I]stdout\f[R] unless forced with \f[C]-o -\f[R].
403Extensions can be individually enabled or disabled by appending
404\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
405See Extensions below, for a list of extensions and their names.
406See \f[C]--list-output-formats\f[R] and \f[C]--list-extensions\f[R],
410.B \f[C]-o\f[R] \f[I]FILE\f[R], \f[C]--output=\f[R]\f[I]FILE\f[R]
411Write output to \f[I]FILE\f[R] instead of \f[I]stdout\f[R].
412If \f[I]FILE\f[R] is \f[C]-\f[R], output will go to \f[I]stdout\f[R],
413even if a non-textual format (\f[C]docx\f[R], \f[C]odt\f[R],
414\f[C]epub2\f[R], \f[C]epub3\f[R]) is specified.
416.B \f[C]--data-dir=\f[R]\f[I]DIRECTORY\f[R]
417Specify the user data directory to search for pandoc data files.
418If this option is not specified, the default user data directory will be
433C:\[rs]Documents And Settings\[rs]USERNAME\[rs]Application Data\[rs]pandoc
437and in Windows Vista or later:
441C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]pandoc
445You can find the default user data directory on your system by looking
446at the output of \f[C]pandoc --version\f[R].
447A \f[C]reference.odt\f[R], \f[C]reference.docx\f[R], \f[C]epub.css\f[R],
448\f[C]templates\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R], or
449\f[C]s5\f[R] directory placed in this directory will override
450pandoc\[aq]s normal defaults.
453.B \f[C]--bash-completion\f[R]
454Generate a bash completion script.
455To enable bash completion with pandoc, add this to your
461eval \[dq]$(pandoc --bash-completion)\[dq]
466.B \f[C]--verbose\f[R]
467Give verbose debugging output.
468Currently this only has an effect with PDF output.
471Suppress warning messages.
473.B \f[C]--fail-if-warnings\f[R]
474Exit with error status if there are any warnings.
476.B \f[C]--log=\f[R]\f[I]FILE\f[R]
477Write log messages in machine-readable JSON format to \f[I]FILE\f[R].
478All messages above DEBUG level will be written, regardless of verbosity
479settings (\f[C]--verbose\f[R], \f[C]--quiet\f[R]).
481.B \f[C]--list-input-formats\f[R]
482List supported input formats, one per line.
484.B \f[C]--list-output-formats\f[R]
485List supported output formats, one per line.
487.B \f[C]--list-extensions\f[R][\f[C]=\f[R]\f[I]FORMAT\f[R]]
488List supported extensions, one per line, preceded by a \f[C]+\f[R] or
489\f[C]-\f[R] indicating whether it is enabled by default in
491If \f[I]FORMAT\f[R] is not specified, defaults for pandoc\[aq]s Markdown
494.B \f[C]--list-highlight-languages\f[R]
495List supported languages for syntax highlighting, one per line.
497.B \f[C]--list-highlight-styles\f[R]
498List supported styles for syntax highlighting, one per line.
499See \f[C]--highlight-style\f[R].
501.B \f[C]-v\f[R], \f[C]--version\f[R]
504.B \f[C]-h\f[R], \f[C]--help\f[R]
508.B \f[C]--base-header-level=\f[R]\f[I]NUMBER\f[R]
509Specify the base level for headers (defaults to 1).
511.B \f[C]--strip-empty-paragraphs\f[R]
512\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension
513instead.\f[R] Ignore paragraphs with no content.
514This option is useful for converting word processing documents where
515users have used empty paragraphs to create inter-paragraph space.
517.B \f[C]--indented-code-classes=\f[R]\f[I]CLASSES\f[R]
518Specify classes to use for indented code blocks--for example,
519\f[C]perl,numberLines\f[R] or \f[C]haskell\f[R].
520Multiple classes may be separated by spaces or commas.
522.B \f[C]--default-image-extension=\f[R]\f[I]EXTENSION\f[R]
523Specify a default extension to use when image paths/URLs have no
525This allows you to use the same source for formats that require
526different kinds of images.
527Currently this option only affects the Markdown and LaTeX readers.
529.B \f[C]--file-scope\f[R]
530Parse each file individually before combining for multifile documents.
531This will allow footnotes in different files with the same identifiers
533If this option is set, footnotes and links will not work across files.
534Reading binary files (docx, odt, epub) implies \f[C]--file-scope\f[R].
536.B \f[C]-F\f[R] \f[I]PROGRAM\f[R], \f[C]--filter=\f[R]\f[I]PROGRAM\f[R]
537Specify an executable to be used as a filter transforming the pandoc AST
538after the input is parsed and before the output is written.
539The executable should read JSON from stdin and write JSON to stdout.
540The JSON must be formatted like pandoc\[aq]s own JSON input and output.
541The name of the output format will be passed to the filter as the first
548pandoc --filter ./caps.py -t latex
556pandoc -t json | ./caps.py latex | pandoc -f json -t latex
560The latter form may be useful for debugging filters.
562Filters may be written in any language.
563\f[C]Text.Pandoc.JSON\f[R] exports \f[C]toJSONFilter\f[R] to facilitate
564writing filters in Haskell.
565Those who would prefer to write filters in python can use the module
566\f[C]pandocfilters\f[R], installable from PyPI.
567There are also pandoc filter libraries in PHP, perl, and
570In order of preference, pandoc will look for filters in
572a specified full or relative path (executable or non-executable)
574\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
575\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
578\f[C]$PATH\f[R] (executable only)
580Filters and lua-filters are applied in the order specified on the
584.B \f[C]--lua-filter=\f[R]\f[I]SCRIPT\f[R]
585Transform the document in a similar fashion as JSON filters (see
586\f[C]--filter\f[R]), but use pandoc\[aq]s build-in lua filtering system.
587The given lua script is expected to return a list of lua filters which
588will be applied in order.
589Each lua filter must contain element-transforming functions indexed by
590the name of the AST element on which the filter function should be
594The \f[C]pandoc\f[R] lua module provides helper functions for element
596It is always loaded into the script\[aq]s lua environment.
598The following is an example lua script for macro-expansion:
602function expand_hello_world(inline)
603 if inline.c == \[aq]{{helloworld}}\[aq] then
604 return pandoc.Emph{ pandoc.Str \[dq]Hello, World\[dq] }
610return {{Str = expand_hello_world}}
614In order of preference, pandoc will look for lua filters in
616a specified full or relative path (executable or non-executable)
618\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
619\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
623.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]]
624Set the metadata field \f[I]KEY\f[R] to the value \f[I]VAL\f[R].
625A value specified on the command line overrides a value specified in the
626document using YAML metadata blocks.
627Values will be parsed as YAML boolean or string values.
628If no value is specified, the value will be treated as Boolean true.
629Like \f[C]--variable\f[R], \f[C]--metadata\f[R] causes template
631But unlike \f[C]--variable\f[R], \f[C]--metadata\f[R] affects the
632metadata of the underlying document (which is accessible from filters
633and may be printed in some output formats) and metadata values will be
634escaped when inserted into the template.
636.B \f[C]--metadata-file=\f[R]\f[I]FILE\f[R]
637Read metadata from the supplied YAML (or JSON) file.
638This option can be used with every input format, but string scalars in
639the YAML file will always be parsed as Markdown.
640Generally, the input will be handled the same as in YAML metadata
642Metadata values specified inside the document, or by using \f[C]-M\f[R],
643overwrite values specified with this option.
645.B \f[C]-p\f[R], \f[C]--preserve-tabs\f[R]
646Preserve tabs instead of converting them to spaces (the default).
647Note that this will only affect tabs in literal code spans and code
648blocks; tabs in regular text will be treated as spaces.
650.B \f[C]--tab-stop=\f[R]\f[I]NUMBER\f[R]
651Specify the number of spaces per tab (default is 4).
653.B \f[C]--track-changes=accept\f[R]|\f[C]reject\f[R]|\f[C]all\f[R]
654Specifies what to do with insertions, deletions, and comments produced
655by the MS Word \[dq]Track Changes\[dq] feature.
656\f[C]accept\f[R] (the default), inserts all insertions, and ignores all
658\f[C]reject\f[R] inserts all deletions and ignores insertions.
659Both \f[C]accept\f[R] and \f[C]reject\f[R] ignore comments.
660\f[C]all\f[R] puts in insertions, deletions, and comments, wrapped in
661spans with \f[C]insertion\f[R], \f[C]deletion\f[R],
662\f[C]comment-start\f[R], and \f[C]comment-end\f[R] classes,
664The author and time of change is included.
665\f[C]all\f[R] is useful for scripting: only accepting changes from a
666certain reviewer, say, or before a certain date.
667If a paragraph is inserted or deleted, \f[C]track-changes=all\f[R]
668produces a span with the class
669\f[C]paragraph-insertion\f[R]/\f[C]paragraph-deletion\f[R] before the
670affected paragraph break.
671This option only affects the docx reader.
673.B \f[C]--extract-media=\f[R]\f[I]DIR\f[R]
674Extract images and other media contained in or linked from the source
675document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
676the images references in the document so they point to the extracted
678If the source format is a binary container (docx, epub, or odt), the
679media is extracted from the container and the original filenames are
681Otherwise the media is read from the file system or downloaded, and new
682filenames are constructed based on SHA1 hashes of the contents.
684.B \f[C]--abbreviations=\f[R]\f[I]FILE\f[R]
685Specifies a custom abbreviations file, with abbreviations one to a line.
686If this option is not specified, pandoc will read the data file
687\f[C]abbreviations\f[R] from the user data directory or fall back on a
689To see the system default, use
690\f[C]pandoc --print-default-data-file=abbreviations\f[R].
691The only use pandoc makes of this list is in the Markdown reader.
692Strings ending in a period that are found in this list will be followed
693by a nonbreaking space, so that the period will not produce
694sentence-ending space in formats like LaTeX.
695.SS General writer options
697.B \f[C]-s\f[R], \f[C]--standalone\f[R]
698Produce output with an appropriate header and footer (e.g.
699a standalone HTML, LaTeX, TEI, or RTF file, not a fragment).
700This option is set automatically for \f[C]pdf\f[R], \f[C]epub\f[R],
701\f[C]epub3\f[R], \f[C]fb2\f[R], \f[C]docx\f[R], and \f[C]odt\f[R]
703For \f[C]native\f[R] output, this option causes metadata to be included;
704otherwise, metadata is suppressed.
706.B \f[C]--template=\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
707Use the specified file as a custom template for the generated document.
708Implies \f[C]--standalone\f[R].
709See Templates, below, for a description of template syntax.
710If no extension is specified, an extension corresponding to the writer
711will be added, so that \f[C]--template=special\f[R] looks for
712\f[C]special.html\f[R] for HTML output.
713If the template is not found, pandoc will search for it in the
714\f[C]templates\f[R] subdirectory of the user data directory (see
715\f[C]--data-dir\f[R]).
716If this option is not used, a default template appropriate for the
717output format will be used (see \f[C]-D/--print-default-template\f[R]).
719.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]]
720Set the template variable \f[I]KEY\f[R] to the value \f[I]VAL\f[R] when
721rendering the document in standalone mode.
722This is generally only useful when the \f[C]--template\f[R] option is
723used to specify a custom template, since pandoc automatically sets the
724variables used in the default templates.
725If no \f[I]VAL\f[R] is specified, the key will be given the value
728.B \f[C]-D\f[R] \f[I]FORMAT\f[R], \f[C]--print-default-template=\f[R]\f[I]FORMAT\f[R]
729Print the system default template for an output \f[I]FORMAT\f[R].
730(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates
731in the user data directory are ignored.
733.B \f[C]--print-default-data-file=\f[R]\f[I]FILE\f[R]
734Print a system default data file.
735Files in the user data directory are ignored.
737.B \f[C]--eol=crlf\f[R]|\f[C]lf\f[R]|\f[C]native\f[R]
738Manually specify line endings: \f[C]crlf\f[R] (Windows), \f[C]lf\f[R]
739(macOS/Linux/UNIX), or \f[C]native\f[R] (line endings appropriate to the
740OS on which pandoc is being run).
741The default is \f[C]native\f[R].
743.B \f[C]--dpi\f[R]=\f[I]NUMBER\f[R]
744Specify the dpi (dots per inch) value for conversion from pixels to
745inch/centimeters and vice versa.
747Technically, the correct term would be ppi (pixels per inch).
749.B \f[C]--wrap=auto\f[R]|\f[C]none\f[R]|\f[C]preserve\f[R]
750Determine how text is wrapped in the output (the source code, not the
752With \f[C]auto\f[R] (the default), pandoc will attempt to wrap lines to
753the column width specified by \f[C]--columns\f[R] (default 72).
754With \f[C]none\f[R], pandoc will not wrap lines at all.
755With \f[C]preserve\f[R], pandoc will attempt to preserve the wrapping
756from the source document (that is, where there are nonsemantic newlines
757in the source, there will be nonsemantic newlines in the output as
759Automatic wrapping does not currently work in HTML output.
760In \f[C]ipynb\f[R] output, this option affects wrapping of the contents
763.B \f[C]--columns=\f[R]\f[I]NUMBER\f[R]
764Specify length of lines in characters.
765This affects text wrapping in the generated source code (see
767It also affects calculation of column widths for plain text tables (see
770.B \f[C]--toc\f[R], \f[C]--table-of-contents\f[R]
771Include an automatically generated table of contents (or, in the case of
772\f[C]latex\f[R], \f[C]context\f[R], \f[C]docx\f[R], \f[C]odt\f[R],
773\f[C]opendocument\f[R], \f[C]rst\f[R], or \f[C]ms\f[R], an instruction
774to create one) in the output document.
775This option has no effect unless \f[C]-s/--standalone\f[R] is used, and
776it has no effect on \f[C]man\f[R], \f[C]docbook4\f[R],
777\f[C]docbook5\f[R], or \f[C]jats\f[R] output.
779.B \f[C]--toc-depth=\f[R]\f[I]NUMBER\f[R]
780Specify the number of section levels to include in the table of
782The default is 3 (which means that level 1, 2, and 3 headers will be
783listed in the contents).
785.B \f[C]--strip-comments\f[R]
786Strip out HTML comments in the Markdown or Textile source, rather than
787passing them on to Markdown, Textile or HTML output as raw HTML.
788This does not apply to HTML comments inside raw HTML blocks when the
789\f[C]markdown_in_html_blocks\f[R] extension is not set.
791.B \f[C]--no-highlight\f[R]
792Disables syntax highlighting for code blocks and inlines, even when a
793language attribute is given.
795.B \f[C]--highlight-style=\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
796Specifies the coloring style to be used in highlighted source code.
797Options are \f[C]pygments\f[R] (the default), \f[C]kate\f[R],
798\f[C]monochrome\f[R], \f[C]breezeDark\f[R], \f[C]espresso\f[R],
799\f[C]zenburn\f[R], \f[C]haddock\f[R], and \f[C]tango\f[R].
800For more information on syntax highlighting in pandoc, see Syntax
802See also \f[C]--list-highlight-styles\f[R].
805Instead of a \f[I]STYLE\f[R] name, a JSON file with extension
806\f[C].theme\f[R] may be supplied.
807This will be parsed as a KDE syntax highlighting theme and (if valid)
808used as the highlighting style.
810To generate the JSON version of an existing style, use
811\f[C]--print-highlight-style\f[R].
814.B \f[C]--print-highlight-style=\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
815Prints a JSON version of a highlighting style, which can be modified,
816saved with a \f[C].theme\f[R] extension, and used with
817\f[C]--highlight-style\f[R].
819.B \f[C]--syntax-definition=\f[R]\f[I]FILE\f[R]
820Instructs pandoc to load a KDE XML syntax definition file, which will be
821used for syntax highlighting of appropriately marked code blocks.
822This can be used to add support for new languages or to use altered
823syntax definitions for existing languages.
825.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]
826Include contents of \f[I]FILE\f[R], verbatim, at the end of the header.
827This can be used, for example, to include special CSS or JavaScript in
829This option can be used repeatedly to include multiple files in the
831They will be included in the order specified.
832Implies \f[C]--standalone\f[R].
834.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]
835Include contents of \f[I]FILE\f[R], verbatim, at the beginning of the
837after the \f[C]<body>\f[R] tag in HTML, or the
838\f[C]\[rs]begin{document}\f[R] command in LaTeX).
839This can be used to include navigation bars or banners in HTML
841This option can be used repeatedly to include multiple files.
842They will be included in the order specified.
843Implies \f[C]--standalone\f[R].
845.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]
846Include contents of \f[I]FILE\f[R], verbatim, at the end of the document
847body (before the \f[C]</body>\f[R] tag in HTML, or the
848\f[C]\[rs]end{document}\f[R] command in LaTeX).
849This option can be used repeatedly to include multiple files.
850They will be included in the order specified.
851Implies \f[C]--standalone\f[R].
853.B \f[C]--resource-path=\f[R]\f[I]SEARCHPATH\f[R]
854List of paths to search for images and other resources.
855The paths should be separated by \f[C]:\f[R] on Linux, UNIX, and macOS
856systems, and by \f[C];\f[R] on Windows.
857If \f[C]--resource-path\f[R] is not specified, the default resource path
858is the working directory.
859Note that, if \f[C]--resource-path\f[R] is specified, the working
860directory must be explicitly listed or it will not be searched.
861For example: \f[C]--resource-path=.:test\f[R] will search the working
862directory and the \f[C]test\f[R] subdirectory, in that order.
865\f[C]--resource-path\f[R] only has an effect if (a) the output format
866embeds images (for example, \f[C]docx\f[R], \f[C]pdf\f[R], or
867\f[C]html\f[R] with \f[C]--self-contained\f[R]) or (b) it is used
868together with \f[C]--extract-media\f[R].
871.B \f[C]--request-header=\f[R]\f[I]NAME\f[R]\f[C]:\f[R]\f[I]VAL\f[R]
872Set the request header \f[I]NAME\f[R] to the value \f[I]VAL\f[R] when
873making HTTP requests (for example, when a URL is given on the command
874line, or when resources used in a document must be downloaded).
875If you\[aq]re behind a proxy, you also need to set the environment
876variable \f[C]http_proxy\f[R] to \f[C]http://...\f[R].
877.SS Options affecting specific writers
879.B \f[C]--self-contained\f[R]
880Produce a standalone HTML file with no external dependencies, using
881\f[C]data:\f[R] URIs to incorporate the contents of linked scripts,
882stylesheets, images, and videos.
883Implies \f[C]--standalone\f[R].
884The resulting file should be \[dq]self-contained,\[dq] in the sense that
885it needs no external files and no net access to be displayed properly by
887This option works only with HTML output formats, including
888\f[C]html4\f[R], \f[C]html5\f[R], \f[C]html+lhs\f[R],
889\f[C]html5+lhs\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
890\f[C]dzslides\f[R], and \f[C]revealjs\f[R].
891Scripts, images, and stylesheets at absolute URLs will be downloaded;
892those at relative URLs will be sought relative to the working directory
893(if the first source file is local) or relative to the base URL (if the
894first source file is remote).
895Elements with the attribute \f[C]data-external=\[dq]1\[dq]\f[R] will be
896left alone; the documents they link to will not be incorporated in the
898Limitation: resources that are loaded dynamically through JavaScript
899cannot be incorporated; as a result, \f[C]--self-contained\f[R] does not
900work with \f[C]--mathjax\f[R], and some advanced features (e.g.
901zoom or speaker notes) may not work in an offline
902\[dq]self-contained\[dq] \f[C]reveal.js\f[R] slide show.
904.B \f[C]--html-q-tags\f[R]
905Use \f[C]<q>\f[R] tags for quotes in HTML.
908Use only ASCII characters in output.
909Currently supported for XML and HTML formats (which use entities instead
910of UTF-8 when this option is selected), CommonMark, gfm, and Markdown
911(which use entities), roff ms (which use hexadecimal escapes), and to a
912limited degree LaTeX (which uses standard commands for accented
913characters when possible).
914roff man output uses ASCII by default.
916.B \f[C]--reference-links\f[R]
917Use reference-style links, rather than inline links, in writing Markdown
919By default inline links are used.
920The placement of link references is affected by the
921\f[C]--reference-location\f[R] option.
923.B \f[C]--reference-location = block\f[R]|\f[C]section\f[R]|\f[C]document\f[R]
924Specify whether footnotes (and references, if \f[C]reference-links\f[R]
925is set) are placed at the end of the current (top-level) block, the
926current section, or the document.
927The default is \f[C]document\f[R].
928Currently only affects the markdown writer.
930.B \f[C]--atx-headers\f[R]
931Use ATX-style headers in Markdown output.
932The default is to use setext-style headers for levels 1-2, and then ATX
934(Note: for \f[C]gfm\f[R] output, ATX headers are always used.) This
935option also affects markdown cells in \f[C]ipynb\f[R] output.
937.B \f[C]--top-level-division=[default|section|chapter|part]\f[R]
938Treat top-level headers as the given division type in LaTeX, ConTeXt,
939DocBook, and TEI output.
940The hierarchy order is part, chapter, then section; all headers are
941shifted such that the top-level header becomes the specified type.
942The default behavior is to determine the best division type via
943heuristics: unless other conditions apply, \f[C]section\f[R] is chosen.
944When the LaTeX document class is set to \f[C]report\f[R],
945\f[C]book\f[R], or \f[C]memoir\f[R] (unless the \f[C]article\f[R] option
946is specified), \f[C]chapter\f[R] is implied as the setting for this
948If \f[C]beamer\f[R] is the output format, specifying either
949\f[C]chapter\f[R] or \f[C]part\f[R] will cause top-level headers to
950become \f[C]\[rs]part{..}\f[R], while second-level headers remain as
953.B \f[C]-N\f[R], \f[C]--number-sections\f[R]
954Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
955By default, sections are not numbered.
956Sections with class \f[C]unnumbered\f[R] will never be numbered, even if
957\f[C]--number-sections\f[R] is specified.
959.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]]
960Offset for section headings in HTML output (ignored in other output
962The first number is added to the section number for top-level headers,
963the second for second-level headers, and so on.
964So, for example, if you want the first top-level header in your document
965to be numbered \[dq]6\[dq], specify \f[C]--number-offset=5\f[R].
966If your document starts with a level-2 header which you want to be
967numbered \[dq]1.5\[dq], specify \f[C]--number-offset=1,4\f[R].
968Offsets are 0 by default.
969Implies \f[C]--number-sections\f[R].
971.B \f[C]--listings\f[R]
972Use the \f[C]listings\f[R] package for LaTeX code blocks.
973The package does not support multi-byte encoding for source code.
974To handle UTF-8 you would need to use a custom template.
975This issue is fully documented here: Encoding issue with the listings
978.B \f[C]-i\f[R], \f[C]--incremental\f[R]
979Make list items in slide shows display incrementally (one by one).
980The default is for lists to be displayed all at once.
982.B \f[C]--slide-level=\f[R]\f[I]NUMBER\f[R]
983Specifies that headers with the specified level create slides (for
984\f[C]beamer\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
986Headers above this level in the hierarchy are used to divide the slide
987show into sections; headers below this level create subheads within a
989Note that content that is not contained under slide-level headers will
990not appear in the slide show.
991The default is to set the slide level based on the contents of the
992document; see Structuring the slide show.
994.B \f[C]--section-divs\f[R]
995Wrap sections in \f[C]<section>\f[R] tags (or \f[C]<div>\f[R] tags for
996\f[C]html4\f[R]), and attach identifiers to the enclosing
997\f[C]<section>\f[R] (or \f[C]<div>\f[R]) rather than the header itself.
998See Header identifiers, below.
1000.B \f[C]--email-obfuscation=none\f[R]|\f[C]javascript\f[R]|\f[C]references\f[R]
1001Specify a method for obfuscating \f[C]mailto:\f[R] links in HTML
1003\f[C]none\f[R] leaves \f[C]mailto:\f[R] links as they are.
1004\f[C]javascript\f[R] obfuscates them using JavaScript.
1005\f[C]references\f[R] obfuscates them by printing their letters as
1006decimal or hexadecimal character references.
1007The default is \f[C]none\f[R].
1009.B \f[C]--id-prefix=\f[R]\f[I]STRING\f[R]
1010Specify a prefix to be added to all identifiers and internal links in
1011HTML and DocBook output, and to footnote numbers in Markdown and Haddock
1013This is useful for preventing duplicate identifiers when generating
1014fragments to be included in other pages.
1016.B \f[C]-T\f[R] \f[I]STRING\f[R], \f[C]--title-prefix=\f[R]\f[I]STRING\f[R]
1017Specify \f[I]STRING\f[R] as a prefix at the beginning of the title that
1018appears in the HTML header (but not in the title as it appears at the
1019beginning of the HTML body).
1020Implies \f[C]--standalone\f[R].
1022.B \f[C]-c\f[R] \f[I]URL\f[R], \f[C]--css=\f[R]\f[I]URL\f[R]
1023Link to a CSS style sheet.
1024This option can be used repeatedly to include multiple files.
1025They will be included in the order specified.
1028A stylesheet is required for generating EPUB.
1029If none is provided using this option (or the \f[C]css\f[R] or
1030\f[C]stylesheet\f[R] metadata fields), pandoc will look for a file
1031\f[C]epub.css\f[R] in the user data directory (see
1032\f[C]--data-dir\f[R]).
1033If it is not found there, sensible defaults will be used.
1036.B \f[C]--reference-doc=\f[R]\f[I]FILE\f[R]
1037Use the specified file as a style reference in producing a docx or ODT
1042For best results, the reference docx should be a modified version of a
1043docx file produced using pandoc.
1044The contents of the reference docx are ignored, but its stylesheets and
1045document properties (including margins, page size, header, and footer)
1046are used in the new docx.
1047If no reference docx is specified on the command line, pandoc will look
1048for a file \f[C]reference.docx\f[R] in the user data directory (see
1049\f[C]--data-dir\f[R]).
1050If this is not found either, sensible defaults will be used.
1053To produce a custom \f[C]reference.docx\f[R], first get a copy of the
1054default \f[C]reference.docx\f[R]:
1055\f[C]pandoc --print-default-data-file reference.docx > custom-reference.docx\f[R].
1056Then open \f[C]custom-reference.docx\f[R] in Word, modify the styles as
1057you wish, and save the file.
1058For best results, do not make changes to this file other than modifying
1059the styles used by pandoc:
1123Default Paragraph Font
1139For best results, the reference ODT should be a modified version of an
1140ODT produced using pandoc.
1141The contents of the reference ODT are ignored, but its stylesheets are
1143If no reference ODT is specified on the command line, pandoc will look
1144for a file \f[C]reference.odt\f[R] in the user data directory (see
1145\f[C]--data-dir\f[R]).
1146If this is not found either, sensible defaults will be used.
1149To produce a custom \f[C]reference.odt\f[R], first get a copy of the
1150default \f[C]reference.odt\f[R]:
1151\f[C]pandoc --print-default-data-file reference.odt > custom-reference.odt\f[R].
1152Then open \f[C]custom-reference.odt\f[R] in LibreOffice, modify the
1153styles as you wish, and save the file.
1157Any template included with a recent install of Microsoft PowerPoint
1158(either with \f[C].pptx\f[R] or \f[C].potx\f[R] extension) should work,
1159as will most templates derived from these.
1162The specific requirement is that the template should contain the
1163following four layouts as its first four layouts:
1173All templates included with a recent version of MS PowerPoint will fit
1175(You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to
1178You can also modify the default \f[C]reference.pptx\f[R]: first run
1179\f[C]pandoc --print-default-data-file reference.pptx > custom-reference.pptx\f[R],
1180and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc
1181will use the first four layout slides, as mentioned above).
1185.B \f[C]--epub-cover-image=\f[R]\f[I]FILE\f[R]
1186Use the specified image as the EPUB cover.
1187It is recommended that the image be less than 1000px in width and
1189Note that in a Markdown source document you can also specify
1190\f[C]cover-image\f[R] in a YAML metadata block (see EPUB Metadata,
1193.B \f[C]--epub-metadata=\f[R]\f[I]FILE\f[R]
1194Look in the specified XML file for metadata for the EPUB.
1195The file should contain a series of Dublin Core elements.
1201 <dc:rights>Creative Commons</dc:rights>
1202 <dc:language>es-AR</dc:language>
1206By default, pandoc will include the following metadata elements:
1207\f[C]<dc:title>\f[R] (from the document title), \f[C]<dc:creator>\f[R]
1208(from the document authors), \f[C]<dc:date>\f[R] (from the document
1209date, which should be in ISO 8601 format), \f[C]<dc:language>\f[R] (from
1210the \f[C]lang\f[R] variable, or, if is not set, the locale), and
1211\f[C]<dc:identifier id=\[dq]BookId\[dq]>\f[R] (a randomly generated
1213Any of these may be overridden by elements in the metadata file.
1215Note: if the source document is Markdown, a YAML metadata block in the
1216document can be used instead.
1217See below under EPUB Metadata.
1220.B \f[C]--epub-embed-font=\f[R]\f[I]FILE\f[R]
1221Embed the specified font in the EPUB.
1222This option can be repeated to embed multiple fonts.
1223Wildcards can also be used: for example, \f[C]DejaVuSans-*.ttf\f[R].
1224However, if you use wildcards on the command line, be sure to escape
1225them or put the whole filename in single quotes, to prevent them from
1226being interpreted by the shell.
1227To use the embedded fonts, you will need to add declarations like the
1228following to your CSS (see \f[C]--css\f[R]):
1234font-family: DejaVuSans;
1237src:url(\[dq]DejaVuSans-Regular.ttf\[dq]);
1240font-family: DejaVuSans;
1243src:url(\[dq]DejaVuSans-Bold.ttf\[dq]);
1246font-family: DejaVuSans;
1249src:url(\[dq]DejaVuSans-Oblique.ttf\[dq]);
1252font-family: DejaVuSans;
1255src:url(\[dq]DejaVuSans-BoldOblique.ttf\[dq]);
1257body { font-family: \[dq]DejaVuSans\[dq]; }
1262.B \f[C]--epub-chapter-level=\f[R]\f[I]NUMBER\f[R]
1263Specify the header level at which to split the EPUB into separate
1264\[dq]chapter\[dq] files.
1265The default is to split into chapters at level 1 headers.
1266This option only affects the internal composition of the EPUB, not the
1267way chapters and sections are displayed to users.
1268Some readers may be slow if the chapter files are too large, so for
1269large documents with few level 1 headers, one might want to use a
1270chapter level of 2 or 3.
1272.B \f[C]--epub-subdirectory=\f[R]\f[I]DIRNAME\f[R]
1273Specify the subdirectory in the OCF container that is to hold the
1274EPUB-specific contents.
1275The default is \f[C]EPUB\f[R].
1276To put the EPUB contents in the top level, use an empty string.
1278.B \f[C]--pdf-engine=pdflatex\f[R]|\f[C]lualatex\f[R]|\f[C]xelatex\f[R]|\f[C]wkhtmltopdf\f[R]|\f[C]weasyprint\f[R]|\f[C]prince\f[R]|\f[C]context\f[R]|\f[C]pdfroff\f[R]
1279Use the specified engine when producing PDF output.
1280The default is \f[C]pdflatex\f[R].
1281If the engine is not in your PATH, the full path of the engine may be
1284.B \f[C]--pdf-engine-opt=\f[R]\f[I]STRING\f[R]
1285Use the given string as a command-line argument to the
1286\f[C]pdf-engine\f[R].
1287If used multiple times, the arguments are provided with spaces between
1289Note that no check for duplicate options is done.
1290.SS Citation rendering
1292.B \f[C]--bibliography=\f[R]\f[I]FILE\f[R]
1293Set the \f[C]bibliography\f[R] field in the document\[aq]s metadata to
1294\f[I]FILE\f[R], overriding any value set in the metadata, and process
1295citations using \f[C]pandoc-citeproc\f[R].
1296(This is equivalent to
1297\f[C]--metadata bibliography=FILE --filter pandoc-citeproc\f[R].) If
1298\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] is also supplied,
1299\f[C]pandoc-citeproc\f[R] is not used, making this equivalent to
1300\f[C]--metadata bibliography=FILE\f[R].
1301If you supply this argument multiple times, each \f[I]FILE\f[R] will be
1302added to bibliography.
1304.B \f[C]--csl=\f[R]\f[I]FILE\f[R]
1305Set the \f[C]csl\f[R] field in the document\[aq]s metadata to
1306\f[I]FILE\f[R], overriding any value set in the metadata.
1307(This is equivalent to \f[C]--metadata csl=FILE\f[R].) This option is
1308only relevant with \f[C]pandoc-citeproc\f[R].
1310.B \f[C]--citation-abbreviations=\f[R]\f[I]FILE\f[R]
1311Set the \f[C]citation-abbreviations\f[R] field in the document\[aq]s
1312metadata to \f[I]FILE\f[R], overriding any value set in the metadata.
1313(This is equivalent to
1314\f[C]--metadata citation-abbreviations=FILE\f[R].) This option is only
1315relevant with \f[C]pandoc-citeproc\f[R].
1317.B \f[C]--natbib\f[R]
1318Use \f[C]natbib\f[R] for citations in LaTeX output.
1319This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
1321It is intended for use in producing a LaTeX file that can be processed
1322with \f[C]bibtex\f[R].
1324.B \f[C]--biblatex\f[R]
1325Use \f[C]biblatex\f[R] for citations in LaTeX output.
1326This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
1328It is intended for use in producing a LaTeX file that can be processed
1329with \f[C]bibtex\f[R] or \f[C]biber\f[R].
1330.SS Math rendering in HTML
1332The default is to render TeX math as far as possible using Unicode
1334Formulas are put inside a \f[C]span\f[R] with
1335\f[C]class=\[dq]math\[dq]\f[R], so that they may be styled differently
1336from the surrounding text if needed.
1337However, this gives acceptable results only for basic math, usually you
1338will want to use \f[C]--mathjax\f[R] or another of the following
1341.B \f[C]--mathjax\f[R][\f[C]=\f[R]\f[I]URL\f[R]]
1342Use MathJax to display embedded TeX math in HTML output.
1343TeX math will be put between \f[C]\[rs](...\[rs])\f[R] (for inline math)
1344or \f[C]\[rs][...\[rs]]\f[R] (for display math) and wrapped in
1345\f[C]<span>\f[R] tags with class \f[C]math\f[R].
1346Then the MathJax JavaScript will render it.
1347The \f[I]URL\f[R] should point to the \f[C]MathJax.js\f[R] load script.
1348If a \f[I]URL\f[R] is not provided, a link to the Cloudflare CDN will be
1351.B \f[C]--mathml\f[R]
1352Convert TeX math to MathML (in \f[C]epub3\f[R], \f[C]docbook4\f[R],
1353\f[C]docbook5\f[R], \f[C]jats\f[R], \f[C]html4\f[R] and
1355This is the default in \f[C]odt\f[R] output.
1356Note that currently only Firefox and Safari (and select e-book readers)
1357natively support MathML.
1359.B \f[C]--webtex\f[R][\f[C]=\f[R]\f[I]URL\f[R]]
1360Convert TeX formulas to \f[C]<img>\f[R] tags that link to an external
1361script that converts formulas to images.
1362The formula will be URL-encoded and concatenated with the URL provided.
1363For SVG images you can for example use
1364\f[C]--webtex https://latex.codecogs.com/svg.latex?\f[R].
1365If no URL is specified, the CodeCogs URL generating PNGs will be used
1366(\f[C]https://latex.codecogs.com/png.latex?\f[R]).
1367Note: the \f[C]--webtex\f[R] option will affect Markdown output as well
1368as HTML, which is useful if you\[aq]re targeting a version of Markdown
1369without native math support.
1371.B \f[C]--katex\f[R][\f[C]=\f[R]\f[I]URL\f[R]]
1372Use KaTeX to display embedded TeX math in HTML output.
1373The \f[I]URL\f[R] is the base URL for the KaTeX library.
1374That directory should contain a \f[C]katex.min.js\f[R] and a
1375\f[C]katex.min.css\f[R] file.
1376If a \f[I]URL\f[R] is not provided, a link to the KaTeX CDN will be
1379.B \f[C]--gladtex\f[R]
1380Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
1381The resulting HTML can then be processed by GladTeX to produce images of
1382the typeset formulas and an HTML file with links to these images.
1383So, the procedure is:
1388pandoc -s --gladtex input.md -o myfile.htex
1389gladtex -d myfile-images myfile.htex
1390# produces myfile.html and images in myfile-images
1394.SS Options for wrapper scripts
1396.B \f[C]--dump-args\f[R]
1397Print information about command-line arguments to \f[I]stdout\f[R], then
1399This option is intended primarily for use in wrapper scripts.
1400The first line of output contains the name of the output file specified
1401with the \f[C]-o\f[R] option, or \f[C]-\f[R] (for \f[I]stdout\f[R]) if
1402no output file was specified.
1403The remaining lines contain the command-line arguments, one per line, in
1404the order they appear.
1405These do not include regular pandoc options and their arguments, but do
1406include any options appearing after a \f[C]--\f[R] separator at the end
1409.B \f[C]--ignore-args\f[R]
1410Ignore command-line arguments (for use in wrapper scripts).
1411Regular pandoc options are not ignored.
1417pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
1425pandoc -o foo.html -s
1431When the \f[C]-s/--standalone\f[R] option is used, pandoc uses a
1432template to add header and footer material that is needed for a
1433self-standing document.
1434To see the default template that is used, just type
1442where \f[I]FORMAT\f[R] is the name of the output format.
1443A custom template can be specified using the \f[C]--template\f[R]
1445You can also override the system default templates for a given output
1446format \f[I]FORMAT\f[R] by putting a file
1447\f[C]templates/default.*FORMAT*\f[R] in the user data directory (see
1448\f[C]--data-dir\f[R], above).
1449\f[I]Exceptions:\f[R]
1451For \f[C]odt\f[R] output, customize the \f[C]default.opendocument\f[R]
1454For \f[C]pdf\f[R] output, customize the \f[C]default.latex\f[R] template
1455(or the \f[C]default.context\f[R] template, if you use
1456\f[C]-t context\f[R], or the \f[C]default.ms\f[R] template, if you use
1457\f[C]-t ms\f[R], or the \f[C]default.html\f[R] template, if you use
1460\f[C]docx\f[R] and \f[C]pptx\f[R] have no template (however, you can use
1461\f[C]--reference-doc\f[R] to customize the output).
1463Templates contain \f[I]variables\f[R], which allow for the inclusion of
1464arbitrary information at any point in the file.
1465They may be set at the command line using the \f[C]-V/--variable\f[R]
1467If a variable is not set, pandoc will look for the key in the
1468document\[aq]s metadata \[en] which can be set using either YAML
1469metadata blocks or with the \f[C]-M/--metadata\f[R] option.
1470.SS Metadata variables
1472.B \f[C]title\f[R], \f[C]author\f[R], \f[C]date\f[R]
1473allow identification of basic aspects of the document.
1474Included in PDF metadata through LaTeX and ConTeXt.
1475These can be set through a pandoc title block, which allows for multiple
1476authors, or through a YAML metadata block:
1490.B \f[C]subtitle\f[R]
1491document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
1494.B \f[C]abstract\f[R]
1495document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx
1498.B \f[C]keywords\f[R]
1499list of keywords to be included in HTML, PDF, ODT, pptx, docx and
1500AsciiDoc metadata; repeat as for \f[C]author\f[R], above
1503document subject, included in ODT, docx and pptx metadata
1505.B \f[C]description\f[R]
1506document description, included in ODT, docx and pptx metadata.
1507Some applications show this as \f[C]Comments\f[R] metadata.
1509.B \f[C]category\f[R]
1510document category, included in docx and pptx metadata
1512Additionally, any root-level string metadata, not included in ODT, docx
1513or pptx metadata is added as a \f[I]custom property\f[R].
1514The following YAML metadata block for instance:
1519title: \[aq]This is the title\[aq]
1520subtitle: \[dq]This is the subtitle\[dq]
1528 It consists of two paragraphs
1533will include \f[C]title\f[R], \f[C]author\f[R] and \f[C]description\f[R]
1534as standard document properties and \f[C]subtitle\f[R] as a custom
1535property when converting to docx, ODT or pptx.
1536.SS Language variables
1539identifies the main language of the document using IETF language tags
1540(following the BCP 47 standard), such as \f[C]en\f[R] or
1542The Language subtag lookup tool can look up or verify these tags.
1543This affects most formats, and controls hyphenation in PDF output when
1544using LaTeX (through \f[C]babel\f[R] and \f[C]polyglossia\f[R]) or
1548Use native pandoc Divs and Spans with the \f[C]lang\f[R] attribute to
1557Text in the main document language (British English).
1560> Cette citation est \['e]crite en fran\[,c]ais canadien.
1563More text in English. [\[aq]Zitat auf Deutsch.\[aq]]{lang=de}
1569the base script direction, either \f[C]rtl\f[R] (right-to-left) or
1570\f[C]ltr\f[R] (left-to-right).
1573For bidirectional documents, native pandoc \f[C]span\f[R]s and
1574\f[C]div\f[R]s with the \f[C]dir\f[R] attribute (value \f[C]rtl\f[R] or
1575\f[C]ltr\f[R]) can be used to override the base direction in some output
1577This may not always be necessary if the final renderer (e.g.
1578the browser, when generating HTML) supports the Unicode Bidirectional
1581When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[R]
1582engine is fully supported (use \f[C]--pdf-engine=xelatex\f[R]).
1584.SS Variables for HTML slides
1586These affect HTML output when producing slide shows with pandoc.
1587All reveal.js configuration options are available as variables.
1589.B \f[C]revealjs-url\f[R]
1590base URL for reveal.js documents (defaults to \f[C]reveal.js\f[R])
1593base URL for S5 documents (defaults to \f[C]s5/default\f[R])
1595.B \f[C]slidy-url\f[R]
1596base URL for Slidy documents (defaults to
1597\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[R])
1599.B \f[C]slideous-url\f[R]
1600base URL for Slideous documents (defaults to \f[C]slideous\f[R])
1601.SS Variables for Beamer slides
1603These variables change the appearance of PDF slides using
1606.B \f[C]aspectratio\f[R]
1607slide aspect ratio (\f[C]43\f[R] for 4:3 [default], \f[C]169\f[R] for
160816:9, \f[C]1610\f[R] for 16:10, \f[C]149\f[R] for 14:9, \f[C]141\f[R]
1609for 1.41:1, \f[C]54\f[R] for 5:4, \f[C]32\f[R] for 3:2)
1611.B \f[C]beamerarticle\f[R]
1612produce an article from Beamer slides
1614.B \f[C]beameroption\f[R]
1615add extra beamer option with \f[C]\[rs]setbeameroption{}\f[R]
1617.B \f[C]institute\f[R]
1618author affiliations: can be a list when there are multiple authors
1621logo image for slides
1623.B \f[C]navigation\f[R]
1624controls navigation symbols (default is \f[C]empty\f[R] for no
1625navigation symbols; other valid values are \f[C]frame\f[R],
1626\f[C]vertical\f[R], and \f[C]horizontal\f[R])
1628.B \f[C]section-titles\f[R]
1629enables \[dq]title pages\[dq] for new sections (default is true)
1631.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]
1634.B \f[C]themeoptions\f[R]
1635options for LaTeX beamer themes (a list).
1637.B \f[C]titlegraphic\f[R]
1638image for title slide
1639.SS Variables for LaTeX
1641Pandoc uses these variables when creating a PDF with a LaTeX engine.
1644.B \f[C]classoption\f[R]
1645option for document class, e.g.
1646\f[C]oneside\f[R]; repeat for multiple options
1648.B \f[C]documentclass\f[R]
1649document class: usually one of the standard classes, \f[C]article\f[R],
1650\f[C]report\f[R], and \f[C]book\f[R]; the KOMA-Script equivalents,
1651\f[C]scrartcl\f[R], \f[C]scrreprt\f[R], and \f[C]scrbook\f[R], which
1652default to smaller margins; or \f[C]memoir\f[R]
1654.B \f[C]geometry\f[R]
1655option for \f[C]geometry\f[R] package, e.g.
1656\f[C]margin=1in\f[R]; repeat for multiple options
1659uses document class settings for indentation (the default LaTeX template
1660otherwise removes indentation and adds space between paragraphs)
1662.B \f[C]linestretch\f[R]
1663adjusts line spacing using the \f[C]setspace\f[R] package, e.g.
1664\f[C]1.25\f[R], \f[C]1.5\f[R]
1666.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]
1667sets margins if \f[C]geometry\f[R] is not used (otherwise
1668\f[C]geometry\f[R] overrides these)
1670.B \f[C]pagestyle\f[R]
1671control \f[C]\[rs]pagestyle{}\f[R]: the default article class supports
1672\f[C]plain\f[R] (default), \f[C]empty\f[R] (no running heads or page
1673numbers), and \f[C]headings\f[R] (section titles in running heads)
1675.B \f[C]papersize\f[R]
1677\f[C]letter\f[R], \f[C]a4\f[R]
1679.B \f[C]secnumdepth\f[R]
1680numbering depth for sections (with \f[C]--number-sections\f[R] option or
1681\f[C]numbersections\f[R] variable)
1683.B \f[C]subparagraph\f[R]
1684disables default behavior of LaTeX template that redefines
1685(sub)paragraphs as sections, changing the appearance of nested headings
1690allows font encoding to be specified through \f[C]fontenc\f[R] package
1691(with \f[C]pdflatex\f[R]); default is \f[C]T1\f[R] (see LaTeX font
1694.B \f[C]fontfamily\f[R]
1695font package for use with \f[C]pdflatex\f[R]: TeX Live includes many
1696options, documented in the LaTeX Font Catalogue.
1697The default is Latin Modern.
1699.B \f[C]fontfamilyoptions\f[R]
1700options for package used as \f[C]fontfamily\f[R]; repeat for multiple
1702For example, to use the Libertine font with proportional lowercase
1703(old-style) figures through the \f[C]libertinus\f[R] package:
1709fontfamily: libertinus
1718.B \f[C]fontsize\f[R]
1719font size for body text.
1720The standard classes allow 10pt, 11pt, and 12pt.
1721To use another size, set \f[C]documentclass\f[R] to one of the
1722KOMA-Script classes, such as \f[C]scrartcl\f[R] or \f[C]scrbook\f[R].
1724.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]
1725font families for use with \f[C]xelatex\f[R] or \f[C]lualatex\f[R]: take
1726the name of any system font, using the \f[C]fontspec\f[R] package.
1727\f[C]CJKmainfont\f[R] uses the \f[C]xecjk\f[R] package.
1729.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]
1730options to use with \f[C]mainfont\f[R], \f[C]sansfont\f[R],
1731\f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R] in
1732\f[C]xelatex\f[R] and \f[C]lualatex\f[R].
1733Allow for any choices available through \f[C]fontspec\f[R]; repeat for
1735For example, to use the TeX Gyre version of Palatino with lowercase
1742mainfont: TeX Gyre Pagella
1745- Numbers=Proportional
1751.B \f[C]microtypeoptions\f[R]
1752options to pass to the microtype package
1755.B \f[C]colorlinks\f[R]
1756add color to link text; automatically enabled if any of
1757\f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R],
1758\f[C]urlcolor\f[R], or \f[C]toccolor\f[R] are set
1760.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]
1761color for internal links, external links, citation links, linked URLs,
1762and links in table of contents, respectively: uses options allowed by
1763\f[C]xcolor\f[R], including the \f[C]dvipsnames\f[R],
1764\f[C]svgnames\f[R], and \f[C]x11names\f[R] lists
1766.B \f[C]links-as-notes\f[R]
1767causes links to be printed as footnotes
1770.B \f[C]lof\f[R], \f[C]lot\f[R]
1771include list of figures, list of tables
1774contents of acknowledgments footnote after document title
1777include table of contents (can also be set using
1778\f[C]--toc/--table-of-contents\f[R])
1780.B \f[C]toc-depth\f[R]
1781level of section to include in table of contents
1782.SS BibLaTeX Bibliographies
1784These variables function when using BibLaTeX for citation rendering.
1786.B \f[C]biblatexoptions\f[R]
1787list of options for biblatex
1789.B \f[C]biblio-style\f[R]
1790bibliography style, when used with \f[C]--natbib\f[R] and
1791\f[C]--biblatex\f[R].
1793.B \f[C]biblio-title\f[R]
1794bibliography title, when used with \f[C]--natbib\f[R] and
1795\f[C]--biblatex\f[R].
1797.B \f[C]bibliography\f[R]
1798bibliography to use for resolving references
1800.B \f[C]natbiboptions\f[R]
1801list of options for natbib
1802.SS Variables for ConTeXt
1804Pandoc uses these variables when creating a PDF with ConTeXt.
1806.B \f[C]fontsize\f[R]
1807font size for body text (e.g.
1808\f[C]10pt\f[R], \f[C]12pt\f[R])
1810.B \f[C]headertext\f[R], \f[C]footertext\f[R]
1811text to be placed in running header or footer (see ConTeXt Headers and
1812Footers); repeat up to four times for different placement
1814.B \f[C]indenting\f[R]
1815controls indentation of paragraphs, e.g.
1816\f[C]yes,small,next\f[R] (see ConTeXt Indentation); repeat for multiple
1819.B \f[C]interlinespace\f[R]
1820adjusts line spacing, e.g.
1821\f[C]4ex\f[R] (using \f[C]setupinterlinespace\f[R]); repeat for multiple
1825options for page margins and text arrangement (see ConTeXt Layout);
1826repeat for multiple options
1828.B \f[C]linkcolor\f[R], \f[C]contrastcolor\f[R]
1829color for links outside and inside a page, e.g.
1830\f[C]red\f[R], \f[C]blue\f[R] (see ConTeXt Color)
1832.B \f[C]linkstyle\f[R]
1833typeface style for links, e.g.
1834\f[C]normal\f[R], \f[C]bold\f[R], \f[C]slanted\f[R],
1835\f[C]boldslanted\f[R], \f[C]type\f[R], \f[C]cap\f[R], \f[C]small\f[R]
1837.B \f[C]lof\f[R], \f[C]lot\f[R]
1838include list of figures, list of tables
1840.B \f[C]mainfont\f[R], \f[C]sansfont\f[R], \f[C]monofont\f[R], \f[C]mathfont\f[R]
1841font families: take the name of any system font (see ConTeXt Font
1844.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]
1845sets margins, if \f[C]layout\f[R] is not used (otherwise
1846\f[C]layout\f[R] overrides these)
1848.B \f[C]pagenumbering\f[R]
1849page number style and location (using \f[C]setuppagenumbering\f[R]);
1850repeat for multiple options
1852.B \f[C]papersize\f[R]
1854\f[C]letter\f[R], \f[C]A4\f[R], \f[C]landscape\f[R] (see ConTeXt Paper
1855Setup); repeat for multiple options
1858adds to the preamble the setup necessary to generate PDF/A-1b:2005.
1859To successfully generate PDF/A the required ICC color profiles have to
1860be available and the content and all included files (such as images)
1861have to be standard conforming.
1862The ICC profiles can be obtained from ConTeXt ICC Profiles.
1863See also ConTeXt PDFA for more details.
1866include table of contents (can also be set using
1867\f[C]--toc/--table-of-contents\f[R])
1869.B \f[C]whitespace\f[R]
1870spacing between paragraphs, e.g.
1871\f[C]none\f[R], \f[C]small\f[R] (using \f[C]setupwhitespace\f[R])
1872.SS Variables for \f[C]wkhtmltopdf\f[R]
1874Pandoc uses these variables when creating a PDF with
1875\f[C]wkhtmltopdf\f[R].
1876The \f[C]--css\f[R] option also affects the output.
1878.B \f[C]footer-html\f[R], \f[C]header-html\f[R]
1879add information to the header and footer
1881.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]
1884.B \f[C]papersize\f[R]
1885sets the PDF paper size
1886.SS Variables for man pages
1888.B \f[C]adjusting\f[R]
1889adjusts text to left (\f[C]l\f[R]), right (\f[C]r\f[R]), center
1890(\f[C]c\f[R]), or both (\f[C]b\f[R]) margins
1898.B \f[C]hyphenate\f[R]
1899if \f[C]true\f[R] (the default), hyphenation will be used
1902section number in man pages
1905.B \f[C]fontfamily\f[R]
1907\f[C]T\f[R] or \f[C]P\f[R])
1910paragraph indent (e.g.
1913.B \f[C]lineheight\f[R]
1917.B \f[C]pointsize\f[R]
1920.SS Structural variables
1922Pandoc sets these variables automatically in response to options or
1923document contents; users can also modify them.
1924These vary depending on the output format, and include the following:
1929.B \f[C]date-meta\f[R]
1930the \f[C]date\f[R] variable converted to ISO 8601 YYYY-MM-DD, included
1931in all HTML based formats (dzslides, epub, html, html4, html5, revealjs,
1932s5, slideous, slidy).
1933The recognized formats for \f[C]date\f[R] are: \f[C]mm/dd/yyyy\f[R],
1934\f[C]mm/dd/yy\f[R], \f[C]yyyy-mm-dd\f[R] (ISO 8601),
1935\f[C]dd MM yyyy\f[R] (e.g.
1936either \f[C]02 Apr 2018\f[R] or \f[C]02 April 2018\f[R]),
1937\f[C]MM dd, yyyy\f[R] (e.g.
1938\f[C]Apr. 02, 2018\f[R] or
1939\f[C]April 02, 2018),\f[R]yyyy[mm[dd]]]\f[C](e.g.\f[R]20180402,
1940\f[C]201804\f[R] or \f[C]2018\f[R]).
1942.B \f[C]header-includes\f[R]
1943contents specified by \f[C]-H/--include-in-header\f[R] (may have
1946.B \f[C]include-before\f[R]
1947contents specified by \f[C]-B/--include-before-body\f[R] (may have
1950.B \f[C]include-after\f[R]
1951contents specified by \f[C]-A/--include-after-body\f[R] (may have
1954.B \f[C]meta-json\f[R]
1955JSON representation of all of the document\[aq]s metadata.
1956Field values are transformed to the selected output format.
1958.B \f[C]numbersections\f[R]
1959non-null value if \f[C]-N/--number-sections\f[R] was specified
1961.B \f[C]sourcefile\f[R], \f[C]outputfile\f[R]
1962source and destination filenames, as given on the command line.
1963\f[C]sourcefile\f[R] can also be a list if input comes from multiple
1964files, or empty if input is from stdin.
1965You can use the following snippet in your template to distinguish them:
1980Similarly, \f[C]outputfile\f[R] can be \f[C]-\f[R] if output goes to the
1985non-null value if \f[C]--toc/--table-of-contents\f[R] was specified
1987.B \f[C]toc-title\f[R]
1988title of table of contents (works only with EPUB, opendocument, odt,
1989docx, pptx, beamer, LaTeX)
1990.SS Using variables in templates
1992Variable names are sequences of alphanumerics, \f[C]-\f[R], and
1993\f[C]_\f[R], starting with a letter.
1994A variable name surrounded by \f[C]$\f[R] signs will be replaced by its
1996For example, the string \f[C]$title$\f[R] in
2000<title>$title$</title>
2004will be replaced by the document title.
2006To write a literal \f[C]$\f[R] in a template, use \f[C]$$\f[R].
2008Templates may contain conditionals.
2009The syntax is as follows:
2021This will include \f[C]X\f[R] in the template if \f[C]variable\f[R] has
2022a truthy value; otherwise it will include \f[C]Y\f[R].
2023Here a truthy value is any of the following:
2025a string that is not entirely white space,
2027a non-empty array where the first value is truthy,
2029any number (including zero),
2033the boolean \f[C]true\f[R] (to specify the boolean \f[C]true\f[R] value
2034using YAML metadata or the \f[C]--metadata\f[R] flag, use
2035\f[C]true\f[R], \f[C]True\f[R], or \f[C]TRUE\f[R]; with the
2036\f[C]--variable\f[R] flag, simply omit a value for the variable, e.g.
2037\f[C]--variable draft\f[R]).
2039\f[C]X\f[R] and \f[C]Y\f[R] are placeholders for any valid template
2040text, and may include interpolated variables or other conditionals.
2041The \f[C]$else$\f[R] section may be omitted.
2043When variables can have multiple values (for example, \f[C]author\f[R]
2044in a multi-author document), you can use the \f[C]$for$\f[R] keyword:
2049<meta name=\[dq]author\[dq] content=\[dq]$author$\[dq] />
2054You can optionally specify a separator to be used between consecutive
2059$for(author)$$author$$sep$, $endfor$
2063Note that the separator needs to be specified immediately before the
2064\f[C]$endfor\f[R] keyword.
2066A dot can be used to select a field of a variable that takes an object
2072$author.name$ ($author.affiliation$)
2076If you use custom templates, you may need to revise them as pandoc
2078We recommend tracking the changes in the default templates, and
2079modifying your custom templates accordingly.
2080An easy way to do this is to fork the pandoc-templates repository and
2081merge in changes after each pandoc release.
2083Templates may contain comments: anything on a line after \f[C]$--\f[R]
2084will be treated as a comment and ignored.
2087The behavior of some of the readers and writers can be adjusted by
2088enabling or disabling various extensions.
2090An extension can be enabled by adding \f[C]+EXTENSION\f[R] to the format
2091name and disabled by adding \f[C]-EXTENSION\f[R].
2092For example, \f[C]--from markdown_strict+footnotes\f[R] is strict
2093Markdown with footnotes enabled, while
2094\f[C]--from markdown-footnotes-pipe_tables\f[R] is pandoc\[aq]s Markdown
2095without footnotes or pipe tables.
2097The markdown reader and writer make by far the most use of extensions.
2098Extensions only used by them are therefore covered in the section
2099Pandoc\[aq]s Markdown below (See Markdown variants for
2100\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions
2101that also work for other formats are covered.
2103Note that markdown extensions added to the \f[C]ipynb\f[R] format affect
2104Markdown cells in Jupyter notebooks (as do command-line options like
2105\f[C]--atx-headers\f[R]).
2107.SS Extension: \f[C]smart\f[R]
2109Interpret straight quotes as curly quotes, \f[C]---\f[R] as em-dashes,
2110\f[C]--\f[R] as en-dashes, and \f[C]...\f[R] as ellipses.
2111Nonbreaking spaces are inserted after certain abbreviations, such as
2114This extension can be enabled/disabled for the following formats:
2117\f[C]markdown\f[R], \f[C]commonmark\f[R], \f[C]latex\f[R],
2118\f[C]mediawiki\f[R], \f[C]org\f[R], \f[C]rst\f[R], \f[C]twiki\f[R]
2121\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R], \f[C]rst\f[R]
2123.B enabled by default in
2124\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R] (both input and
2127Note: If you are \f[I]writing\f[R] Markdown, then the \f[C]smart\f[R]
2128extension has the reverse effect: what would have been curly quotes
2131In LaTeX, \f[C]smart\f[R] means to use the standard TeX ligatures for
2132quotation marks (\f[C]\[ga]\[ga]\f[R] and \f[C]\[aq]\[aq]\f[R] for
2133double quotes, \f[C]\[ga]\f[R] and \f[C]\[aq]\f[R] for single quotes)
2134and dashes (\f[C]--\f[R] for en-dash and \f[C]---\f[R] for em-dash).
2135If \f[C]smart\f[R] is disabled, then in reading LaTeX pandoc will parse
2136these characters literally.
2137In writing LaTeX, enabling \f[C]smart\f[R] tells pandoc to use the
2138ligatures when possible; if \f[C]smart\f[R] is disabled pandoc will use
2139unicode quotation mark and dash characters.
2140.SS Headers and sections
2141.SS Extension: \f[C]auto_identifiers\f[R]
2143A header without an explicitly specified identifier will be
2144automatically assigned a unique identifier based on the header text.
2146This extension can be enabled/disabled for the following formats:
2149\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]rst\f[R], \f[C]mediawiki\f[R],
2153\f[C]markdown\f[R], \f[C]muse\f[R]
2155.B enabled by default in
2156\f[C]markdown\f[R], \f[C]muse\f[R]
2158The default algorithm used to derive the identifier from the header text
2161Remove all formatting, links, etc.
2163Remove all footnotes.
2165Remove all non-alphanumeric characters, except underscores, hyphens, and
2168Replace all spaces and newlines with hyphens.
2170Convert all alphabetic characters to lowercase.
2172Remove everything up to the first letter (identifiers may not begin with
2173a number or punctuation mark).
2175If nothing is left after this, use the identifier \f[C]section\f[R].
2189\f[C]Header identifiers in HTML\f[R]
2191\f[C]header-identifiers-in-html\f[R]
2194\f[C]Ma\[^i]tre d\[aq]h\[^o]tel\f[R]
2196\f[C]ma\[^i]tre-dh\[^o]tel\f[R]
2199\f[C]*Dogs*?--in *my* house?\f[R]
2201\f[C]dogs--in-my-house\f[R]
2204\f[C][HTML], [S5], or [RTF]?\f[R]
2206\f[C]html-s5-or-rtf\f[R]
2209\f[C]3. Applications\f[R]
2211\f[C]applications\f[R]
2220These rules should, in most cases, allow one to determine the identifier
2221from the header text.
2222The exception is when several headers have the same text; in this case,
2223the first will get an identifier as described above; the second will get
2224the same identifier with \f[C]-1\f[R] appended; the third with
2225\f[C]-2\f[R]; and so on.
2227(However, a different algorithm is used if
2228\f[C]gfm_auto_identifiers\f[R] is enabled; see below.)
2230These identifiers are used to provide link targets in the table of
2231contents generated by the \f[C]--toc|--table-of-contents\f[R] option.
2232They also make it easy to provide links from one section of a document
2234A link to this section, for example, might look like this:
2239[header identifiers](#header-identifiers-in-html-latex-and-context).
2243Note, however, that this method of providing links to sections works
2244only in HTML, LaTeX, and ConTeXt formats.
2246If the \f[C]--section-divs\f[R] option is specified, then each section
2247will be wrapped in a \f[C]section\f[R] (or a \f[C]div\f[R], if
2248\f[C]html4\f[R] was specified), and the identifier will be attached to
2249the enclosing \f[C]<section>\f[R] (or \f[C]<div>\f[R]) tag rather than
2251This allows entire sections to be manipulated using JavaScript or
2252treated differently in CSS.
2253.SS Extension: \f[C]ascii_identifiers\f[R]
2255Causes the identifiers produced by \f[C]auto_identifiers\f[R] to be pure
2257Accents are stripped off of accented Latin letters, and non-Latin
2259.SS Extension: \f[C]gfm_auto_identifiers\f[R]
2261Changes the algorithm used by \f[C]auto_identifiers\f[R] to conform to
2263Spaces are converted to dashes (\f[C]-\f[R]), uppercase characters to
2264lowercase characters, and punctuation characters other than \f[C]-\f[R]
2265and \f[C]_\f[R] are removed.
2268The extensions \f[C]tex_math_dollars\f[R],
2269\f[C]tex_math_single_backslash\f[R], and
2270\f[C]tex_math_double_backslash\f[R] are described in the section about
2271Pandoc\[aq]s Markdown.
2273However, they can also be used with HTML input.
2274This is handy for reading web pages formatted using MathJax, for
2278The following extensions (especially how they affect Markdown
2279input/output) are also described in more detail in their respective
2280sections of Pandoc\[aq]s Markdown.
2281.SS Extension: \f[C]raw_html\f[R]
2283When converting from HTML, parse elements to raw HTML which are not
2284representable in pandoc\[aq]s AST.
2285By default, this is disabled for HTML input.
2286.SS Extension: \f[C]raw_tex\f[R]
2288Allows raw LaTeX, TeX, and ConTeXt to be included in a document.
2290This extension can be enabled/disabled for the following formats (in
2291addition to \f[C]markdown\f[R]):
2294\f[C]latex\f[R], \f[C]org\f[R], \f[C]textile\f[R], \f[C]html\f[R]
2295(environments, \f[C]\[rs]ref\f[R], and \f[C]\[rs]eqref\f[R] only),
2299\f[C]textile\f[R], \f[C]commonmark\f[R]
2301Note: as applied to \f[C]ipynb\f[R], \f[C]raw_html\f[R] and
2302\f[C]raw_tex\f[R] affect not only raw TeX in markdown cells, but data
2303with mime type \f[C]text/html\f[R] in output cells.
2304Since the \f[C]ipynb\f[R] reader attempts to preserve the richest
2305possible outputs when several options are given, you will get best
2306results if you disable \f[C]raw_html\f[R] and \f[C]raw_tex\f[R] when
2307converting to formats like \f[C]docx\f[R] which don\[aq]t allow raw
2308\f[C]html\f[R] or \f[C]tex\f[R].
2309.SS Extension: \f[C]native_divs\f[R]
2311This extension is enabled by default for HTML input.
2312This means that \f[C]div\f[R]s are parsed to pandoc native elements.
2313(Alternatively, you can parse them to raw HTML using
2314\f[C]-f html-native_divs+raw_html\f[R].)
2316When converting HTML to Markdown, for example, you may want to drop all
2317\f[C]div\f[R]s and \f[C]span\f[R]s:
2321pandoc -f html-native_divs-native_spans -t markdown
2324.SS Extension: \f[C]native_spans\f[R]
2326Analogous to \f[C]native_divs\f[R] above.
2327.SS Literate Haskell support
2328.SS Extension: \f[C]literate_haskell\f[R]
2330Treat the document as literate Haskell source.
2332This extension can be enabled/disabled for the following formats:
2335\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R]
2338\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R], \f[C]html\f[R]
2340If you append \f[C]+lhs\f[R] (or \f[C]+literate_haskell\f[R]) to one of
2341the formats above, pandoc will treat the document as literate Haskell
2345In Markdown input, \[dq]bird track\[dq] sections will be parsed as
2346Haskell code rather than block quotations.
2347Text between \f[C]\[rs]begin{code}\f[R] and \f[C]\[rs]end{code}\f[R]
2348will also be treated as Haskell code.
2349For ATX-style headers the character \[aq]=\[aq] will be used instead of
2352In Markdown output, code blocks with classes \f[C]haskell\f[R] and
2353\f[C]literate\f[R] will be rendered using bird tracks, and block
2354quotations will be indented one space, so they will not be treated as
2356In addition, headers will be rendered setext-style (with underlines)
2357rather than ATX-style (with \[aq]#\[aq] characters).
2358(This is because ghc treats \[aq]#\[aq] characters in column 1 as
2359introducing line numbers.)
2361In restructured text input, \[dq]bird track\[dq] sections will be parsed
2364In restructured text output, code blocks with class \f[C]haskell\f[R]
2365will be rendered using bird tracks.
2367In LaTeX input, text in \f[C]code\f[R] environments will be parsed as
2370In LaTeX output, code blocks with class \f[C]haskell\f[R] will be
2371rendered inside \f[C]code\f[R] environments.
2373In HTML output, code blocks with class \f[C]haskell\f[R] will be
2374rendered with class \f[C]literatehaskell\f[R] and bird tracks.
2380pandoc -f markdown+lhs -t html
2384reads literate Haskell source formatted with Markdown conventions and
2385writes ordinary HTML (without bird tracks).
2389pandoc -f markdown+lhs -t html+lhs
2393writes HTML with the Haskell code in bird tracks, so it can be copied
2394and pasted as literate Haskell source.
2396Note that GHC expects the bird tracks in the first column, so indented
2397literate code blocks (e.g.
2398inside an itemized environment) will not be picked up by the Haskell
2401.SS Extension: \f[C]empty_paragraphs\f[R]
2403Allows empty paragraphs.
2404By default empty paragraphs are omitted.
2406This extension can be enabled/disabled for the following formats:
2409\f[C]docx\f[R], \f[C]html\f[R]
2412\f[C]docx\f[R], \f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]html\f[R]
2413.SS Extension: \f[C]styles\f[R]
2415Read all docx styles as divs (for paragraph styles) and spans (for
2416character styles) regardless of whether pandoc understands the meaning
2418This can be used with docx custom styles.
2423.SS Extension: \f[C]amuse\f[R]
2425In the \f[C]muse\f[R] input format, this enables Text::Amuse extensions
2426to Emacs Muse markup.
2427.SS Extension: \f[C]citations\f[R]
2429Some aspects of Pandoc\[aq]s Markdown citation syntax are also accepted
2430in \f[C]org\f[R] input.
2431.SS Extension: \f[C]ntb\f[R]
2433In the \f[C]context\f[R] output format this enables the use of Natural
2434Tables (TABLE) instead of the default Extreme Tables (xtables).
2435Natural tables allow more fine-grained global customization but come at
2436a performance penalty compared to extreme tables.
2437.SH PANDOC\[aq]S MARKDOWN
2439Pandoc understands an extended and slightly revised version of John
2440Gruber\[aq]s Markdown syntax.
2441This document explains the syntax, noting differences from standard
2443Except where noted, these differences can be suppressed by using the
2444\f[C]markdown_strict\f[R] format instead of \f[C]markdown\f[R].
2445Extensions can be enabled or disabled to specify the behavior more
2447They are described in the following.
2448See also Extensions above, for extensions that work also on other
2452Markdown is designed to be easy to write, and, even more importantly,
2456A Markdown-formatted document should be publishable as-is, as plain
2457text, without looking like it\[aq]s been marked up with tags or
2458formatting instructions.
2462This principle has guided pandoc\[aq]s decisions in finding syntax for
2463tables, footnotes, and other extensions.
2465There is, however, one respect in which pandoc\[aq]s aims are different
2466from the original aims of Markdown.
2467Whereas Markdown was originally designed with HTML generation in mind,
2468pandoc is designed for multiple output formats.
2469Thus, while pandoc allows the embedding of raw HTML, it discourages it,
2470and provides other, non-HTMLish ways of representing important document
2471elements like definition lists, tables, mathematics, and footnotes.
2474A paragraph is one or more lines of text followed by one or more blank
2476Newlines are treated as spaces, so you can reflow your paragraphs as you
2478If you need a hard line break, put two or more spaces at the end of a
2480.SS Extension: \f[C]escaped_line_breaks\f[R]
2482A backslash followed by a newline is also a hard line break.
2483Note: in multiline and grid table cells, this is the only way to create
2484a hard line break, since trailing spaces in the cells are ignored.
2487There are two kinds of headers: Setext and ATX.
2488.SS Setext-style headers
2490A setext-style header is a line of text \[dq]underlined\[dq] with a row
2491of \f[C]=\f[R] signs (for a level one header) or \f[C]-\f[R] signs (for
2504The header text can contain inline formatting, such as emphasis (see
2505Inline formatting, below).
2506.SS ATX-style headers
2508An ATX-style header consists of one to six \f[C]#\f[R] signs and a line
2509of text, optionally followed by any number of \f[C]#\f[R] signs.
2510The number of \f[C]#\f[R] signs at the beginning of the line is the
2515## A level-two header
2517### A level-three header ###
2521As with setext-style headers, the header text can contain formatting:
2525# A level-one header with a [link](/url) and *emphasis*
2528.SS Extension: \f[C]blank_before_header\f[R]
2530Standard Markdown syntax does not require a blank line before a header.
2531Pandoc does require this (except, of course, at the beginning of the
2533The reason for the requirement is that it is all too easy for a
2534\f[C]#\f[R] to end up at the beginning of a line by accident (perhaps
2535through line wrapping).
2536Consider, for example:
2540I like several of their flavors of ice cream:
2541#22, for example, and #5.
2544.SS Extension: \f[C]space_in_atx_header\f[R]
2546Many Markdown implementations do not require a space between the opening
2547\f[C]#\f[R]s of an ATX header and the header text, so that
2548\f[C]#5 bolt\f[R] and \f[C]#hashtag\f[R] count as headers.
2549With this extension, pandoc does require the space.
2550.SS Header identifiers
2552See also the \f[C]auto_identifiers\f[R] extension above.
2553.SS Extension: \f[C]header_attributes\f[R]
2555Headers can be assigned attributes using this syntax at the end of the
2556line containing the header text:
2560{#identifier .class .class key=value key=value}
2564Thus, for example, the following headers will all be assigned the
2565identifier \f[C]foo\f[R]:
2571## My header ## {#foo}
2573My other header {#foo}
2578(This syntax is compatible with PHP Markdown Extra.)
2580Note that although this syntax allows assignment of classes and
2581key/value attributes, writers generally don\[aq]t use all of this
2583Identifiers, classes, and key/value attributes are used in HTML and
2584HTML-based formats such as EPUB and slidy.
2585Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
2586Textile, and AsciiDoc writers.
2588Headers with the class \f[C]unnumbered\f[R] will not be numbered, even
2589if \f[C]--number-sections\f[R] is specified.
2590A single hyphen (\f[C]-\f[R]) in an attribute context is equivalent to
2591\f[C].unnumbered\f[R], and preferable in non-English documents.
2604# My header {.unnumbered}
2607.SS Extension: \f[C]implicit_header_references\f[R]
2609Pandoc behaves as if reference links have been defined for each header.
2610So, to link to a header
2614# Header identifiers in HTML
2622[Header identifiers in HTML]
2630[Header identifiers in HTML][]
2638[the section on header identifiers][header identifiers in
2643instead of giving the identifier explicitly:
2647[Header identifiers in HTML](#header-identifiers-in-html)
2651If there are multiple headers with identical text, the corresponding
2652reference will link to the first one only, and you will need to use
2653explicit links to link to the others, as described above.
2655Like regular reference links, these references are case-insensitive.
2657Explicit link reference definitions always take priority over implicit
2659So, in the following example, the link will point to \f[C]bar\f[R], not
2673Markdown uses email conventions for quoting blocks of text.
2674A block quotation is one or more paragraphs or other block elements
2675(such as lists or headers), with each line preceded by a \f[C]>\f[R]
2676character and an optional space.
2677(The \f[C]>\f[R] need not start at the left margin, but it should not be
2678indented more than three spaces.)
2682> This is a block quote. This
2683> paragraph has two lines.
2685> 1. This is a list inside a block quote.
2690A \[dq]lazy\[dq] form, which requires the \f[C]>\f[R] character only on
2691the first line of each block, is also allowed:
2695> This is a block quote. This
2696paragraph has two lines.
2698> 1. This is a list inside a block quote.
2703Among the block elements that can be contained in a block quote are
2705That is, block quotes can be nested:
2709> This is a block quote.
2711> > A block quote within a block quote.
2715If the \f[C]>\f[R] character is followed by an optional space, that
2716space will be considered part of the block quote marker and not part of
2717the indentation of the contents.
2718Thus, to put an indented code block in a block quote, you need five
2719spaces after the \f[C]>\f[R]:
2726.SS Extension: \f[C]blank_before_blockquote\f[R]
2728Standard Markdown syntax does not require a blank line before a block
2730Pandoc does require this (except, of course, at the beginning of the
2732The reason for the requirement is that it is all too easy for a
2733\f[C]>\f[R] to end up at the beginning of a line by accident (perhaps
2734through line wrapping).
2735So, unless the \f[C]markdown_strict\f[R] format is used, the following
2736does not produce a nested block quote in pandoc:
2740> This is a block quote.
2744.SS Verbatim (code) blocks
2745.SS Indented code blocks
2747A block of text indented four spaces (or one tab) is treated as verbatim
2748text: that is, special characters do not trigger special formatting, and
2749all spaces and line breaks are preserved.
2755 moveShip(5 * gravity, DOWN);
2760The initial (four space or one tab) indentation is not considered part
2761of the verbatim text, and is removed in the output.
2763Note: blank lines in the verbatim text need not begin with four spaces.
2764.SS Fenced code blocks
2765.SS Extension: \f[C]fenced_code_blocks\f[R]
2767In addition to standard indented code blocks, pandoc supports
2768\f[I]fenced\f[R] code blocks.
2769These begin with a row of three or more tildes (\f[C]\[ti]\f[R]) and end
2770with a row of tildes that must be at least as long as the starting row.
2771Everything between these lines is treated as code.
2772No indentation is necessary:
2776\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2778 moveShip(5 * gravity, DOWN);
2780\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2784Like regular code blocks, fenced code blocks must be separated from
2785surrounding text by blank lines.
2787If the code itself contains a row of tildes or backticks, just use a
2788longer row of tildes or backticks at the start and end:
2792\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2793\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2794code including tildes
2795\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2796\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
2799.SS Extension: \f[C]backtick_code_blocks\f[R]
2801Same as \f[C]fenced_code_blocks\f[R], but uses backticks
2802(\f[C]\[ga]\f[R]) instead of tildes (\f[C]\[ti]\f[R]).
2803.SS Extension: \f[C]fenced_code_attributes\f[R]
2805Optionally, you may attach attributes to fenced or backtick code block
2810\[ti]\[ti]\[ti]\[ti] {#mycode .haskell .numberLines startFrom=\[dq]100\[dq]}
2812qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
2813 qsort (filter (>= x) xs)
2814\[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]
2818Here \f[C]mycode\f[R] is an identifier, \f[C]haskell\f[R] and
2819\f[C]numberLines\f[R] are classes, and \f[C]startFrom\f[R] is an
2820attribute with value \f[C]100\f[R].
2821Some output formats can use this information to do syntax highlighting.
2822Currently, the only output formats that uses this information are HTML,
2823LaTeX, Docx, Ms, and PowerPoint.
2824If highlighting is supported for your output format and language, then
2825the code block above will appear highlighted, with numbered lines.
2826(To see which languages are supported, type
2827\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block
2828above will appear as follows:
2832<pre id=\[dq]mycode\[dq] class=\[dq]haskell numberLines\[dq] startFrom=\[dq]100\[dq]>
2840The \f[C]numberLines\f[R] (or \f[C]number-lines\f[R]) class will cause
2841the lines of the code block to be numbered, starting with \f[C]1\f[R] or
2842the value of the \f[C]startFrom\f[R] attribute.
2843The \f[C]lineAnchors\f[R] (or \f[C]line-anchors\f[R]) class will cause
2844the lines to be clickable anchors in HTML output.
2846A shortcut form can also be used for specifying the language of the code
2851\[ga]\[ga]\[ga]haskell
2857This is equivalent to:
2861\[ga]\[ga]\[ga] {.haskell}
2867If the \f[C]fenced_code_attributes\f[R] extension is disabled, but input
2868contains class attribute(s) for the code block, the first class
2869attribute will be printed after the opening fence as a bare word.
2871To prevent all highlighting, use the \f[C]--no-highlight\f[R] flag.
2872To set the highlighting style, use \f[C]--highlight-style\f[R].
2873For more information on highlighting, see Syntax highlighting, below.
2875.SS Extension: \f[C]line_blocks\f[R]
2877A line block is a sequence of lines beginning with a vertical bar
2878(\f[C]|\f[R]) followed by a space.
2879The division into lines will be preserved in the output, as will any
2880leading spaces; otherwise, the lines will be formatted as Markdown.
2881This is useful for verse and addresses:
2885| The limerick packs laughs anatomical
2886| In space that is quite economical.
2887| But the good ones I\[aq]ve seen
2888| So seldom are clean
2889| And the clean ones so seldom are comical
2896The lines can be hard-wrapped if needed, but the continuation line must
2901| The Right Honorable Most Venerable and Righteous Samuel L.
2908This syntax is borrowed from reStructuredText.
2912A bullet list is a list of bulleted list items.
2913A bulleted list item begins with a bullet (\f[C]*\f[R], \f[C]+\f[R], or
2915Here is a simple example:
2925This will produce a \[dq]compact\[dq] list.
2926If you want a \[dq]loose\[dq] list, in which each item is formatted as a
2927paragraph, put spaces between the items:
2939The bullets need not be flush with the left margin; they may be indented
2940one, two, or three spaces.
2941The bullet must be followed by whitespace.
2943List items look best if subsequent lines are flush with the first line
2954But Markdown also allows a \[dq]lazy\[dq] format:
2963.SS Block content in list items
2965A list item may contain multiple paragraphs and other block-level
2967However, subsequent paragraphs must be preceded by a blank line and
2968indented to line up with the first non-space content after the list
2977 * Second paragraph. With a code block, which must be indented
2984Exception: if the list marker is followed by an indented code block,
2985which must begin 5 spaces after the list marker, then subsequent
2986paragraphs must begin two columns after the last character of the list
2993 continuation paragraph
2997List items may include other lists.
2998In this case the preceding blank line is optional.
2999The nested list must be indented to line up with the first non-space
3000character after the list marker of the containing list item.
3016As noted above, Markdown allows you to write list items
3017\[dq]lazily,\[dq] instead of indenting continuation lines.
3018However, if there are multiple paragraphs or other blocks in a list
3019item, the first line of each must be indented.
3026+ Another one; this looks
3029 Second paragraph of second
3035Ordered lists work just like bulleted lists, except that the items begin
3036with enumerators rather than bullets.
3038In standard Markdown, enumerators are decimal numbers followed by a
3040The numbers themselves are ignored, so there is no difference between
3060.SS Extension: \f[C]fancy_lists\f[R]
3062Unlike standard Markdown, pandoc allows ordered list items to be marked
3063with uppercase and lowercase letters and roman numerals, in addition to
3065List markers may be enclosed in parentheses or followed by a single
3066right-parentheses or period.
3067They must be separated from the text that follows by at least one space,
3068and, if the list marker is a capital letter with a period, by at least
3071The \f[C]fancy_lists\f[R] extension also allows \[aq]\f[C]#\f[R]\[aq] to
3072be used as an ordered list marker in place of a numeral:
3080.SS Extension: \f[C]startnum\f[R]
3082Pandoc also pays attention to the type of list marker used, and to the
3083starting number, and both of these are preserved where possible in the
3085Thus, the following yields a list with numbers followed by a single
3086parenthesis, starting with 9, and a sublist with lowercase roman
3100Pandoc will start a new list each time a different type of list marker
3102So, the following will create three lists:
3113If default list markers are desired, use \f[C]#.\f[R]:
3122.SS Extension: \f[C]task_lists\f[R]
3124Pandoc supports task lists, using the syntax of GitHub-Flavored
3129- [ ] an unchecked task list item
3134.SS Extension: \f[C]definition_lists\f[R]
3136Pandoc supports definition lists, using the syntax of PHP Markdown Extra
3137with some extensions.
3145Term 2 with *inline markup*
3149 { some code, part of Definition 2 }
3151 Third paragraph of definition 2.
3155Each term must fit on one line, which may optionally be followed by a
3156blank line, and must be followed by one or more definitions.
3157A definition begins with a colon or tilde, which may be indented one or
3160A term may have multiple definitions, and each definition may consist of
3161one or more block elements (paragraph, code block, list, etc.), each
3162indented four spaces or one tab stop.
3163The body of the definition (including the first line, aside from the
3164colon or tilde) should be indented four spaces.
3165However, as with other Markdown lists, you can \[dq]lazily\[dq] omit
3166indentation except at the beginning of a paragraph or other block
3174with lazy continuation.
3176 Second paragraph of the definition.
3180If you leave space before the definition (as in the example above), the
3181text of the definition will be treated as a paragraph.
3182In some output formats, this will mean greater spacing between
3183term/definition pairs.
3184For a more compact definition list, omit the space before the
3198Note that space between items in a definition list is required.
3199(A variant that loosens this requirement, but disallows \[dq]lazy\[dq]
3200hard wrapping, can be activated with \f[C]compact_definition_lists\f[R]:
3201see Non-pandoc extensions, below.)
3202.SS Numbered example lists
3203.SS Extension: \f[C]example_lists\f[R]
3205The special list marker \f[C]\[at]\f[R] can be used for sequentially
3207The first list item with a \f[C]\[at]\f[R] marker will be numbered
3208\[aq]1\[aq], the next \[aq]2\[aq], and so on, throughout the document.
3209The numbered examples need not occur in a single list; each new list
3210using \f[C]\[at]\f[R] will take up where the last stopped.
3215(\[at]) My first example will be numbered (1).
3216(\[at]) My second example will be numbered (2).
3218Explanation of examples.
3220(\[at]) My third example will be numbered (3).
3224Numbered examples can be labeled and referred to elsewhere in the
3229(\[at]good) This is a good example.
3231As (\[at]good) illustrates, ...
3235The label can be any string of alphanumeric characters, underscores, or
3238Note: continuation paragraphs in example lists must always be indented
3239four spaces, regardless of the length of the list marker.
3240That is, example lists always behave as if the \f[C]four_space_rule\f[R]
3242This is because example labels tend to be long, and indenting content to
3243the first non-space character after the label would be awkward.
3244.SS Compact and loose lists
3246Pandoc behaves differently from \f[C]Markdown.pl\f[R] on some \[dq]edge
3247cases\[dq] involving lists.
3248Consider this source:
3262Pandoc transforms this into a \[dq]compact list\[dq] (with no
3263\f[C]<p>\f[R] tags around \[dq]First\[dq], \[dq]Second\[dq], or
3264\[dq]Third\[dq]), while Markdown puts \f[C]<p>\f[R] tags around
3265\[dq]Second\[dq] and \[dq]Third\[dq] (but not \[dq]First\[dq]), because
3266of the blank space around \[dq]Third\[dq].
3267Pandoc follows a simple rule: if the text is followed by a blank line,
3268it is treated as a paragraph.
3269Since \[dq]Second\[dq] is followed by a list, and not a blank line, it
3270isn\[aq]t treated as a paragraph.
3271The fact that the list is followed by a blank line is irrelevant.
3272(Note: Pandoc works this way even when the \f[C]markdown_strict\f[R]
3274This behavior is consistent with the official Markdown syntax
3275description, even though it is different from that of
3276\f[C]Markdown.pl\f[R].)
3279What if you want to put an indented code block after a list?
3290Trouble! Here pandoc (like other Markdown implementations) will treat
3291\f[C]{ my code block }\f[R] as the second paragraph of item two, and not
3294To \[dq]cut off\[dq] the list after item two, you can insert some
3295non-indented content, like an HTML comment, which won\[aq]t produce
3296visible output in any format:
3309You can use the same trick if you want two consecutive lists instead of
3327A line containing a row of three or more \f[C]*\f[R], \f[C]-\f[R], or
3328\f[C]_\f[R] characters (optionally separated by spaces) produces a
3340Four kinds of tables may be used.
3341The first three kinds presuppose the use of a fixed-width font, such as
3343The fourth kind can be used with proportionally spaced fonts, as it does
3344not require lining up columns.
3345.SS Extension: \f[C]table_captions\f[R]
3347A caption may optionally be provided with all 4 kinds of tables (as
3348illustrated in the examples below).
3349A caption is a paragraph beginning with the string \f[C]Table:\f[R] (or
3350just \f[C]:\f[R]), which will be stripped off.
3351It may appear either before or after the table.
3352.SS Extension: \f[C]simple_tables\f[R]
3354Simple tables look like this:
3358 Right Left Center Default
3359------- ------ ---------- -------
3364Table: Demonstration of simple table syntax.
3368The headers and table rows must each fit on one line.
3369Column alignments are determined by the position of the header text
3370relative to the dashed line below it:
3372If the dashed line is flush with the header text on the right side but
3373extends beyond it on the left, the column is right-aligned.
3375If the dashed line is flush with the header text on the left side but
3376extends beyond it on the right, the column is left-aligned.
3378If the dashed line extends beyond the header text on both sides, the
3381If the dashed line is flush with the header text on both sides, the
3382default alignment is used (in most cases, this will be left).
3384The table must end with a blank line, or a line of dashes followed by a
3387The column headers may be omitted, provided a dashed line is used to end
3393------- ------ ---------- -------
3397------- ------ ---------- -------
3401When headers are omitted, column alignments are determined on the basis
3402of the first line of the table body.
3403So, in the tables above, the columns would be right, left, center, and
3404right aligned, respectively.
3405.SS Extension: \f[C]multiline_tables\f[R]
3407Multiline tables allow headers and table rows to span multiple lines of
3408text (but cells that span multiple columns or rows of the table are not
3414-------------------------------------------------------------
3415 Centered Default Right Left
3416 Header Aligned Aligned Aligned
3417----------- ------- --------------- -------------------------
3418 First row 12.0 Example of a row that
3419 spans multiple lines.
3421 Second row 5.0 Here\[aq]s another one. Note
3422 the blank line between
3424-------------------------------------------------------------
3426Table: Here\[aq]s the caption. It, too, may span
3431These work like simple tables, but with the following differences:
3433They must begin with a row of dashes, before the header text (unless the
3434headers are omitted).
3436They must end with a row of dashes, then a blank line.
3438The rows must be separated by blank lines.
3440In multiline tables, the table parser pays attention to the widths of
3441the columns, and the writers try to reproduce these relative widths in
3443So, if you find that one of the columns is too narrow in the output, try
3444widening it in the Markdown source.
3446Headers may be omitted in multiline tables as well as simple tables:
3450----------- ------- --------------- -------------------------
3451 First row 12.0 Example of a row that
3452 spans multiple lines.
3454 Second row 5.0 Here\[aq]s another one. Note
3455 the blank line between
3457----------- ------- --------------- -------------------------
3459: Here\[aq]s a multiline table without headers.
3463It is possible for a multiline table to have just one row, but the row
3464should be followed by a blank line (and then the row of dashes that ends
3465the table), or the table may be interpreted as a simple table.
3466.SS Extension: \f[C]grid_tables\f[R]
3468Grid tables look like this:
3474+---------------+---------------+--------------------+
3475| Fruit | Price | Advantages |
3476+===============+===============+====================+
3477| Bananas | $1.34 | - built-in wrapper |
3478| | | - bright color |
3479+---------------+---------------+--------------------+
3480| Oranges | $2.10 | - cures scurvy |
3482+---------------+---------------+--------------------+
3486The row of \f[C]=\f[R]s separates the header from the table body, and
3487can be omitted for a headerless table.
3488The cells of grid tables may contain arbitrary block elements (multiple
3489paragraphs, code blocks, lists, etc.).
3490Cells that span multiple columns or rows are not supported.
3491Grid tables can be created easily using Emacs table mode.
3493Alignments can be specified as with pipe tables, by putting colons at
3494the boundaries of the separator line after the header:
3498+---------------+---------------+--------------------+
3499| Right | Left | Centered |
3500+==============:+:==============+:==================:+
3501| Bananas | $1.34 | built-in wrapper |
3502+---------------+---------------+--------------------+
3506For headerless tables, the colons go on the top line instead:
3510+--------------:+:--------------+:------------------:+
3511| Right | Left | Centered |
3512+---------------+---------------+--------------------+
3515.SS Grid Table Limitations
3517Pandoc does not support grid tables with row spans or column spans.
3518This means that neither variable numbers of columns across rows nor
3519variable numbers of rows across columns are supported by Pandoc.
3520All grid tables must have the same number of columns in each row, and
3521the same number of rows in each column.
3522For example, the Docutils sample grid tables will not render as expected
3524.SS Extension: \f[C]pipe_tables\f[R]
3526Pipe tables look like this:
3530| Right | Left | Default | Center |
3531|------:|:-----|---------|:------:|
3532| 12 | 12 | 12 | 12 |
3533| 123 | 123 | 123 | 123 |
3536 : Demonstration of pipe table syntax.
3540The syntax is identical to PHP Markdown Extra tables.
3541The beginning and ending pipe characters are optional, but pipes are
3542required between all columns.
3543The colons indicate column alignment as shown.
3544The header cannot be omitted.
3545To simulate a headerless table, include a header with blank cells.
3547Since the pipes indicate column boundaries, columns need not be
3548vertically aligned, as they are in the above example.
3549So, this is a perfectly legal (though ugly) pipe table:
3561The cells of pipe tables cannot contain block elements like paragraphs
3562and lists, and cannot span multiple lines.
3563If a pipe table contains a row whose printable content is wider than the
3564column width (see \f[C]--columns\f[R]), then the table will take up the
3565full text width and the cell contents will wrap, with the relative cell
3566widths determined by the number of dashes in the line separating the
3567table header from the table body.
3568(For example \f[C]---|-\f[R] would make the first column 3/4 and the
3569second column 1/4 of the full text width.) On the other hand, if no
3570lines are wider than column width, then cell contents will not be
3571wrapped, and the cells will be sized to their contents.
3573Note: pandoc also recognizes pipe tables of the following form, as can
3574be produced by Emacs\[aq] orgtbl-mode:
3585The difference is that \f[C]+\f[R] is used instead of \f[C]|\f[R].
3586Other orgtbl features are not supported.
3587In particular, to get non-default column alignment, you\[aq]ll need to
3590.SS Extension: \f[C]pandoc_title_block\f[R]
3592If the file begins with a title block
3597% author(s) (separated by semicolons)
3602it will be parsed as bibliographic information, not regular text.
3603(It will be used, for example, in the title of standalone LaTeX or HTML
3604output.) The block may contain just a title, a title and an author, or
3606If you want to include an author but no title, or a title and a date but
3607no author, you need a blank line:
3620The title may occupy multiple lines, but continuation lines must begin
3621with leading space, thus:
3630If a document has multiple authors, the authors may be put on separate
3631lines with leading space, or separated by semicolons, or both.
3632So, all of the following are equivalent:
3639% Author One; Author Two
3646The date must fit on one line.
3648All three metadata fields may contain standard inline formatting
3649(italics, links, footnotes, etc.).
3651Title blocks will always be parsed, but they will affect the output only
3652when the \f[C]--standalone\f[R] (\f[C]-s\f[R]) option is chosen.
3653In HTML output, titles will appear twice: once in the document head --
3654this is the title that will appear at the top of the window in a browser
3655-- and once at the beginning of the document body.
3656The title in the document head can have an optional prefix attached
3657(\f[C]--title-prefix\f[R] or \f[C]-T\f[R] option).
3658The title in the body appears as an H1 element with class
3659\[dq]title\[dq], so it can be suppressed or reformatted with CSS.
3660If a title prefix is specified with \f[C]-T\f[R] and no title block
3661appears in the document, the title prefix will be used by itself as the
3664The man page writer extracts a title, man page section number, and other
3665header and footer information from the title line.
3666The title is assumed to be the first word on the title line, which may
3667optionally end with a (single-digit) section number in parentheses.
3668(There should be no space between the title and the parentheses.)
3669Anything after this is assumed to be additional footer and header text.
3670A single pipe character (\f[C]|\f[R]) should be used to separate the
3671footer text from the header text.
3680will yield a man page with the title \f[C]PANDOC\f[R] and section 1.
3684% PANDOC(1) Pandoc User Manuals
3688will also have \[dq]Pandoc User Manuals\[dq] in the footer.
3692% PANDOC(1) Pandoc User Manuals | Version 4.0
3696will also have \[dq]Version 4.0\[dq] in the header.
3697.SS Extension: \f[C]yaml_metadata_block\f[R]
3699A YAML metadata block is a valid YAML object, delimited by a line of
3700three hyphens (\f[C]---\f[R]) at the top and a line of three hyphens
3701(\f[C]---\f[R]) or three dots (\f[C]...\f[R]) at the bottom.
3702A YAML metadata block may occur anywhere in the document, but if it is
3703not at the beginning, it must be preceded by a blank line.
3704(Note that, because of the way pandoc concatenates input files when
3705several are provided, you may also keep the metadata in a separate YAML
3706file and pass it to pandoc as an argument, along with your Markdown
3711pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
3715Just be sure that the YAML file begins with \f[C]---\f[R] and ends with
3716\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the
3717\f[C]--metadata-file\f[R] option.
3718Using that approach however, you cannot reference content (like
3719footnotes) from the main markdown input document.
3721Metadata will be taken from the fields of the YAML object and added to
3722any existing document metadata.
3723Metadata can contain lists and objects (nested arbitrarily), but all
3724string scalars will be interpreted as Markdown.
3725Fields with names ending in an underscore will be ignored by pandoc.
3726(They may be given a role by external processors.) Field names must not
3727be interpretable as YAML numbers or boolean values (so, for example,
3728\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field
3731A document may contain multiple metadata blocks.
3732The metadata fields will be combined through a \f[I]left-biased
3733union\f[R]: if two metadata blocks attempt to set the same field, the
3734value from the first block will be taken.
3736When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown
3737document, a YAML metadata block will be produced only if the
3738\f[C]-s/--standalone\f[R] option is used.
3739All of the metadata will appear in a single block at the beginning of
3742Note that YAML escaping rules must be followed.
3743Thus, for example, if a title contains a colon, it must be quoted.
3744The pipe character (\f[C]|\f[R]) can be used to begin an indented block
3745that will be interpreted literally, without need for escaping.
3746This form is necessary when the field contains blank lines or
3747block-level formatting:
3752title: \[aq]This is the title: it contains a colon\[aq]
3756keywords: [nothing, nothingness]
3758 This is the abstract.
3760 It consists of two paragraphs.
3765Template variables will be set automatically from the metadata.
3766Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
3767be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
3772<p>This is the abstract.</p>
3773<p>It consists of two paragraphs.</p>
3777Variables can contain arbitrary YAML structures, but the template must
3778match this structure.
3779The \f[C]author\f[R] variable in the default templates expects a simple
3780list or string, but can be changed to support more complicated
3782The following combination, for example, would add an affiliation to the
3783author if one is given:
3788title: The document title
3791 affiliation: University of Somewhere
3793 affiliation: University of Nowhere
3798To use the structured authors in the example above, you would need a
3805$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
3813Raw content to include in the document\[aq]s header may be specified
3814using \f[C]header-includes\f[R]; however, it is important to mark up
3815this content as raw code for a particular output format, using the
3816\f[C]raw_attribute\f[R] extension), or it will be interpreted as
3824 \[ga]\[ga]\[ga]{=latex}
3825 \[rs]let\[rs]oldsection\[rs]section
3826 \[rs]renewcommand{\[rs]section}[1]{\[rs]clearpage\[rs]oldsection{#1}}
3830.SS Backslash escapes
3831.SS Extension: \f[C]all_symbols_escapable\f[R]
3833Except inside a code block or inline code, any punctuation or space
3834character preceded by a backslash will be treated literally, even if it
3835would normally indicate formatting.
3836Thus, for example, if one writes
3856<strong>hello</strong>
3860This rule is easier to remember than standard Markdown\[aq]s rule, which
3861allows only the following characters to be backslash-escaped:
3865\[rs]\[ga]*_{}[]()>#+-.!
3869(However, if the \f[C]markdown_strict\f[R] format is used, the standard
3870Markdown rule will be used.)
3872A backslash-escaped space is parsed as a nonbreaking space.
3873It will appear in TeX output as \f[C]\[ti]\f[R] and in HTML and XML as
3874\f[C]\[rs] \f[R] or \f[C]\[rs] \f[R].
3876A backslash-escaped newline (i.e.
3877a backslash occurring at the end of a line) is parsed as a hard line
3879It will appear in TeX output as \f[C]\[rs]\[rs]\f[R] and in HTML as
3881This is a nice alternative to Markdown\[aq]s \[dq]invisible\[dq] way of
3882indicating hard line breaks using two trailing spaces on a line.
3884Backslash escapes do not work in verbatim contexts.
3885.SS Inline formatting
3888To \f[I]emphasize\f[R] some text, surround it with \f[C]*\f[R]s or
3889\f[C]_\f[R], like this:
3893This text is _emphasized with underscores_, and this
3894is *emphasized with asterisks*.
3898Double \f[C]*\f[R] or \f[C]_\f[R] produces \f[B]strong emphasis\f[R]:
3902This is **strong emphasis** and __with underscores__.
3906A \f[C]*\f[R] or \f[C]_\f[R] character surrounded by spaces, or
3907backslash-escaped, will not trigger emphasis:
3911This is * not emphasized *, and \[rs]*neither is this\[rs]*.
3914.SS Extension: \f[C]intraword_underscores\f[R]
3916Because \f[C]_\f[R] is sometimes used inside words and identifiers,
3917pandoc does not interpret a \f[C]_\f[R] surrounded by alphanumeric
3918characters as an emphasis marker.
3919If you want to emphasize just part of a word, use \f[C]*\f[R]:
3923feas*ible*, not feas*able*.
3927.SS Extension: \f[C]strikeout\f[R]
3929To strikeout a section of text with a horizontal line, begin and end it
3930with \f[C]\[ti]\[ti]\f[R].
3935This \[ti]\[ti]is deleted text.\[ti]\[ti]
3938.SS Superscripts and subscripts
3939.SS Extension: \f[C]superscript\f[R], \f[C]subscript\f[R]
3941Superscripts may be written by surrounding the superscripted text by
3942\f[C]\[ha]\f[R] characters; subscripts may be written by surrounding the
3943subscripted text by \f[C]\[ti]\f[R] characters.
3948H\[ti]2\[ti]O is a liquid. 2\[ha]10\[ha] is 1024.
3952If the superscripted or subscripted text contains spaces, these spaces
3953must be escaped with backslashes.
3954(This is to prevent accidental superscripting and subscripting through
3955the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R].) Thus, if you
3956want the letter P with \[aq]a cat\[aq] in subscripts, use
3957\f[C]P\[ti]a\[rs] cat\[ti]\f[R], not \f[C]P\[ti]a cat\[ti]\f[R].
3960To make a short span of text verbatim, put it inside backticks:
3964What is the difference between \[ga]>>=\[ga] and \[ga]>>\[ga]?
3968If the verbatim text includes a backtick, use double backticks:
3972Here is a literal backtick \[ga]\[ga] \[ga] \[ga]\[ga].
3976(The spaces after the opening backticks and before the closing backticks
3979The general rule is that a verbatim span starts with a string of
3980consecutive backticks (optionally followed by a space) and ends with a
3981string of the same number of backticks (optionally preceded by a space).
3983Note that backslash-escapes (and other Markdown constructs) do not work
3984in verbatim contexts:
3988This is a backslash followed by an asterisk: \[ga]\[rs]*\[ga].
3991.SS Extension: \f[C]inline_code_attributes\f[R]
3993Attributes can be attached to verbatim text, just as with fenced code
3998\[ga]<$>\[ga]{.haskell}
4003To write small caps, use the \f[C]smallcaps\f[R] class:
4007[Small caps]{.smallcaps}
4011Or, without the \f[C]bracketed_spans\f[R] extension:
4015<span class=\[dq]smallcaps\[dq]>Small caps</span>
4019For compatibility with other Markdown flavors, CSS is also supported:
4023<span style=\[dq]font-variant:small-caps;\[dq]>Small caps</span>
4027This will work in all output formats that support small caps.
4029.SS Extension: \f[C]tex_math_dollars\f[R]
4031Anything between two \f[C]$\f[R] characters will be treated as TeX math.
4032The opening \f[C]$\f[R] must have a non-space character immediately to
4033its right, while the closing \f[C]$\f[R] must have a non-space character
4034immediately to its left, and must not be followed immediately by a
4036Thus, \f[C]$20,000 and $30,000\f[R] won\[aq]t parse as math.
4037If for some reason you need to enclose text in literal \f[C]$\f[R]
4038characters, backslash-escape them and they won\[aq]t be treated as math
4041TeX math will be printed in all output formats.
4042How it is rendered depends on the output format:
4045It will appear verbatim surrounded by \f[C]\[rs](...\[rs])\f[R] (for
4046inline math) or \f[C]\[rs][...\[rs]]\f[R] (for display math).
4048.B Markdown, Emacs Org mode, ConTeXt, ZimWiki
4049It will appear verbatim surrounded by \f[C]$...$\f[R] (for inline math)
4050or \f[C]$$...$$\f[R] (for display math).
4053It will be rendered using an interpreted text role \f[C]:math:\f[R].
4056It will be rendered as \f[C]latexmath:[...]\f[R].
4059It will be rendered inside a \f[C]\[at]math\f[R] command.
4062It will be rendered verbatim without \f[C]$\f[R]\[aq]s.
4064.B MediaWiki, DokuWiki
4065It will be rendered inside \f[C]<math>\f[R] tags.
4068It will be rendered inside \f[C]<span class=\[dq]math\[dq]>\f[R] tags.
4071It will be rendered, if possible, using Unicode characters, and will
4072otherwise appear verbatim.
4075It will be rendered, if possible, using MathML.
4078If the \f[C]--mathml\f[R] flag is used, it will be rendered using MathML
4079in an \f[C]inlineequation\f[R] or \f[C]informalequation\f[R] tag.
4080Otherwise it will be rendered, if possible, using Unicode characters.
4083It will be rendered using OMML math markup.
4086If the \f[C]--webtex\f[R] option is used, formulas are rendered as
4087images using CodeCogs or other compatible web service, downloaded and
4088embedded in the e-book.
4089Otherwise, they will appear verbatim.
4091.B HTML, Slidy, DZSlides, S5, EPUB
4092The way math is rendered in HTML will depend on the command-line options
4094Therefore see Math rendering in HTML above.
4096.SS Extension: \f[C]raw_html\f[R]
4098Markdown allows you to insert raw HTML (or DocBook) anywhere in a
4099document (except verbatim contexts, where \f[C]<\f[R], \f[C]>\f[R], and
4100\f[C]&\f[R] are interpreted literally).
4101(Technically this is not an extension, since standard Markdown allows
4102it, but it has been made an extension so that it can be disabled if
4105The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
4106DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile
4107output, and suppressed in other formats.
4109For a more explicit way of including raw HTML in a Markdown document,
4110see the \f[C]raw_attribute\f[R] extension.
4112In the CommonMark format, if \f[C]raw_html\f[R] is enabled,
4113superscripts, subscripts, strikeouts and small capitals will be
4115Otherwise, plain-text fallbacks will be used.
4116Note that even if \f[C]raw_html\f[R] is disabled, tables will be
4117rendered with HTML syntax if they cannot use pipe syntax.
4118.SS Extension: \f[C]markdown_in_html_blocks\f[R]
4120Standard Markdown allows you to include HTML \[dq]blocks\[dq]: blocks of
4121HTML between balanced tags that are separated from the surrounding text
4122with blank lines, and start and end at the left margin.
4123Within these blocks, everything is interpreted as HTML, not Markdown; so
4124(for example), \f[C]*\f[R] does not signify emphasis.
4126Pandoc behaves this way when the \f[C]markdown_strict\f[R] format is
4127used; but by default, pandoc interprets material between HTML block tags
4129Thus, for example, pandoc will turn
4136<td>[a link](http://google.com)</td>
4148<td><em>one</em></td>
4149<td><a href=\[dq]http://google.com\[dq]>a link</a></td>
4155whereas \f[C]Markdown.pl\f[R] will preserve it as is.
4157There is one exception to this rule: text between \f[C]<script>\f[R] and
4158\f[C]<style>\f[R] tags is not interpreted as Markdown.
4160This departure from standard Markdown should make it easier to mix
4161Markdown with HTML block elements.
4162For example, one can surround a block of Markdown text with
4163\f[C]<div>\f[R] tags without preventing it from being interpreted as
4165.SS Extension: \f[C]native_divs\f[R]
4167Use native pandoc \f[C]Div\f[R] blocks for content inside
4168\f[C]<div>\f[R] tags.
4169For the most part this should give the same output as
4170\f[C]markdown_in_html_blocks\f[R], but it makes it easier to write
4171pandoc filters to manipulate groups of blocks.
4172.SS Extension: \f[C]native_spans\f[R]
4174Use native pandoc \f[C]Span\f[R] blocks for content inside
4175\f[C]<span>\f[R] tags.
4176For the most part this should give the same output as
4177\f[C]raw_html\f[R], but it makes it easier to write pandoc filters to
4178manipulate groups of inlines.
4179.SS Extension: \f[C]raw_tex\f[R]
4181In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
4182included in a document.
4183Inline TeX commands will be preserved and passed unchanged to the LaTeX
4185Thus, for example, you can use LaTeX to include BibTeX citations:
4189This result was proved in \[rs]cite{jones.1967}.
4193Note that in LaTeX environments, like
4197\[rs]begin{tabular}{|l|l|}\[rs]hline
4198Age & Frequency \[rs]\[rs] \[rs]hline
419918--25 & 15 \[rs]\[rs]
420026--35 & 33 \[rs]\[rs]
420136--45 & 22 \[rs]\[rs] \[rs]hline
4206the material between the begin and end tags will be interpreted as raw
4207LaTeX, not as Markdown.
4209For a more explicit and flexible way of including raw TeX in a Markdown
4210document, see the \f[C]raw_attribute\f[R] extension.
4212Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
4213Emacs Org mode, and ConTeXt.
4214.SS Generic raw attribute
4215.SS Extension: \f[C]raw_attribute\f[R]
4217Inline spans and fenced code blocks with a special kind of attribute
4218will be parsed as raw content with the designated format.
4219For example, the following produces a raw roff \f[C]ms\f[R] block:
4230And the following produces a raw \f[C]html\f[R] inline element:
4234This is \[ga]<a>html</a>\[ga]{=html}
4238This can be useful to insert raw xml into \f[C]docx\f[R] documents, e.g.
4243\[ga]\[ga]\[ga]{=openxml}
4246 <w:br w:type=\[dq]page\[dq]/>
4253The format name should match the target format name (see
4254\f[C]-t/--to\f[R], above, for a list, or use
4255\f[C]pandoc --list-output-formats\f[R]).
4256Use \f[C]openxml\f[R] for \f[C]docx\f[R] output, \f[C]opendocument\f[R]
4257for \f[C]odt\f[R] output, \f[C]html5\f[R] for \f[C]epub3\f[R] output,
4258\f[C]html4\f[R] for \f[C]epub2\f[R] output, and \f[C]latex\f[R],
4259\f[C]beamer\f[R], \f[C]ms\f[R], or \f[C]html5\f[R] for \f[C]pdf\f[R]
4260output (depending on what you use for \f[C]--pdf-engine\f[R]).
4262This extension presupposes that the relevant kind of inline code or
4263fenced code block is enabled.
4264Thus, for example, to use a raw attribute with a backtick code block,
4265\f[C]backtick_code_blocks\f[R] must be enabled.
4267The raw attribute cannot be combined with regular attributes.
4269.SS Extension: \f[C]latex_macros\f[R]
4271When this extension is enabled, pandoc will parse LaTeX macro
4272definitions and apply the resulting macros to all LaTeX math and raw
4274So, for example, the following will work in all output formats, not just
4279\[rs]newcommand{\[rs]tuple}[1]{\[rs]langle #1 \[rs]rangle}
4281$\[rs]tuple{a, b, c}$
4285Note that LaTeX macros will not be applied if they occur inside inside a
4286raw span or block marked with the \f[C]raw_attribute\f[R] extension.
4288When \f[C]latex_macros\f[R] is disabled, the raw LaTeX and math will not
4290This is usually a better approach when you are targeting LaTeX or PDF.
4292Whether or not \f[C]latex_macros\f[R] is enabled, the macro definitions
4293will still be passed through as raw LaTeX.
4296Markdown allows links to be specified in several ways.
4299If you enclose a URL or email address in pointy brackets, it will become
4305<sam\[at]green.eggs.ham>
4310An inline link consists of the link text in square brackets, followed by
4311the URL in parentheses.
4312(Optionally, the URL can be followed by a link title, in quotes.)
4316This is an [inline link](/url), and here\[aq]s [one with
4317a title](http://fsf.org \[dq]click here for a good time!\[dq]).
4321There can be no space between the bracketed part and the parenthesized
4323The link text can contain formatting (such as emphasis), but the title
4326Email addresses in inline links are not autodetected, so they have to be
4327prefixed with \f[C]mailto\f[R]:
4331[Write me!](mailto:sam\[at]green.eggs.ham)
4336An \f[I]explicit\f[R] reference link has two parts, the link itself and
4337the link definition, which may occur elsewhere in the document (either
4338before or after the link).
4340The link consists of link text in square brackets, followed by a label
4342(There cannot be space between the two unless the
4343\f[C]spaced_reference_links\f[R] extension is enabled.) The link
4344definition consists of the bracketed label, followed by a colon and a
4345space, followed by the URL, and optionally (after a space) a link title
4346either in quotes or in parentheses.
4347The label must not be parseable as a citation (assuming the
4348\f[C]citations\f[R] extension is enabled): citations take precedence
4351Here are some examples:
4355[my label 1]: /foo/bar.html \[dq]My title, optional\[dq]
4357[my label 3]: http://fsf.org (The free software foundation)
4358[my label 4]: /bar#special \[aq]A title in single quotes\[aq]
4362The URL may optionally be surrounded by angle brackets:
4366[my label 5]: <http://foo.bar.baz>
4370The title may go on the next line:
4374[my label 3]: http://fsf.org
4375 \[dq]The free software foundation\[dq]
4379Note that link labels are not case sensitive.
4384Here is [my link][FOO]
4390In an \f[I]implicit\f[R] reference link, the second pair of brackets is
4397[my website]: http://foo.bar.baz
4401Note: In \f[C]Markdown.pl\f[R] and most other Markdown implementations,
4402reference link definitions cannot occur in nested constructions such as
4403list items or block quotes.
4404Pandoc lifts this arbitrary seeming restriction.
4405So the following is fine in pandoc, though not in most other
4415.SS Extension: \f[C]shortcut_reference_links\f[R]
4417In a \f[I]shortcut\f[R] reference link, the second pair of brackets may
4424[my website]: http://foo.bar.baz
4429To link to another section of the same document, use the automatically
4430generated identifier (see Header identifiers).
4435See the [Introduction](#introduction).
4443See the [Introduction].
4445[Introduction]: #introduction
4449Internal links are currently supported for HTML formats (including HTML
4450slide shows and EPUB), LaTeX, and ConTeXt.
4453A link immediately preceded by a \f[C]!\f[R] will be treated as an
4455The link text will be used as the image\[aq]s alt text:
4459
4463[movie reel]: movie.gif
4466.SS Extension: \f[C]implicit_figures\f[R]
4468An image with nonempty alt text, occurring by itself in a paragraph,
4469will be rendered as a figure with a caption.
4470The image\[aq]s alt text will be used as the caption.
4474
4478How this is rendered depends on the output format.
4479Some output formats (e.g.
4480RTF) do not yet support figures.
4481In those formats, you\[aq]ll just get an image in a paragraph by itself,
4484If you just want a regular inline image, just make sure it is not the
4485only thing in the paragraph.
4486One way to do this is to insert a nonbreaking space after the image:
4490![This image won\[aq]t be a figure](/url/of/image.png)\[rs]
4494Note that in reveal.js slide shows, an image in a paragraph by itself
4495that has the \f[C]stretch\f[R] class will fill the screen, and the
4496caption and figure tags will be omitted.
4497.SS Extension: \f[C]link_attributes\f[R]
4499Attributes can be set on links and images:
4503An inline {#id .class width=30 height=20px}
4504and a reference ![image][ref] with attributes.
4506[ref]: foo.jpg \[dq]optional title\[dq] {#id .class key=val key2=\[dq]val 2\[dq]}
4510(This syntax is compatible with PHP Markdown Extra when only
4511\f[C]#id\f[R] and \f[C].class\f[R] are used.)
4513For HTML and EPUB, all attributes except \f[C]width\f[R] and
4514\f[C]height\f[R] (but including \f[C]srcset\f[R] and \f[C]sizes\f[R])
4515are passed through as is.
4516The other writers ignore attributes that are not supported by their
4519The \f[C]width\f[R] and \f[C]height\f[R] attributes on images are
4521When used without a unit, the unit is assumed to be pixels.
4522However, any of the following unit identifiers can be used:
4523\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]
4525There must not be any spaces between the number and the unit.
4530{ width=50% }
4534Dimensions are converted to inches for output in page-based formats like
4536Dimensions are converted to pixels for output in HTML-like formats.
4537Use the \f[C]--dpi\f[R] option to specify the number of pixels per inch.
4538The default is 96dpi.
4540The \f[C]%\f[R] unit is generally relative to some available space.
4541For example the above example will render to the following.
4545\f[C]<img href=\[dq]file.jpg\[dq] style=\[dq]width: 50%;\[dq] />\f[R]
4548\f[C]\[rs]includegraphics[width=0.5\[rs]textwidth,height=\[rs]textheight]{file.jpg}\f[R]
4549(If you\[aq]re using a custom template, you need to configure
4550\f[C]graphicx\f[R] as in the default template.)
4553\f[C]\[rs]externalfigure[file.jpg][width=0.5\[rs]textwidth]\f[R]
4556Some output formats have a notion of a class (ConTeXt) or a unique
4557identifier (LaTeX \f[C]\[rs]caption\f[R]), or both (HTML).
4559When no \f[C]width\f[R] or \f[C]height\f[R] attributes are specified,
4560the fallback is to look at the image resolution and the dpi metadata
4561embedded in the image file.
4564Using the \f[C]native_divs\f[R] and \f[C]native_spans\f[R] extensions
4565(see above), HTML syntax can be used as part of markdown to create
4566native \f[C]Div\f[R] and \f[C]Span\f[R] elements in the pandoc AST (as
4567opposed to raw HTML).
4568However, there is also nicer syntax available:
4569.SS Extension: \f[C]fenced_divs\f[R]
4571Allow special fenced syntax for native \f[C]Div\f[R] blocks.
4572A Div starts with a fence containing at least three consecutive colons
4573plus some attributes.
4574The attributes may optionally be followed by another string of
4576The attribute syntax is exactly as in fenced code blocks (see Extension:
4577\f[C]fenced_code_attributes\f[R]).
4578As with fenced code blocks, one can use either attributes in curly
4579braces or a single unbraced word, which will be treated as a class name.
4580The Div ends with another line containing a string of at least three
4582The fenced Div should be separated by blank lines from preceding and
4589::::: {#special .sidebar}
4597Fenced divs can be nested.
4598Opening fences are distinguished because they \f[I]must\f[R] have
4607This is a warning within a warning.
4613Fences without attributes are always closing fences.
4614Unlike with fenced code blocks, the number of colons in the closing
4615fence need not match the number in the opening fence.
4616However, it can be helpful for visual clarity to use fences of different
4617lengths to distinguish nested divs from their parents.
4618.SS Extension: \f[C]bracketed_spans\f[R]
4620A bracketed sequence of inlines, as one would use to begin a link, will
4621be treated as a \f[C]Span\f[R] with attributes if it is followed
4622immediately by attributes:
4626[This is *some text*]{.class key=\[dq]val\[dq]}
4630.SS Extension: \f[C]footnotes\f[R]
4632Pandoc\[aq]s Markdown allows footnotes, using the following syntax:
4636Here is a footnote reference,[\[ha]1] and another.[\[ha]longnote]
4638[\[ha]1]: Here is the footnote.
4640[\[ha]longnote]: Here\[aq]s one with multiple blocks.
4642 Subsequent paragraphs are indented to show that they
4643belong to the previous footnote.
4647 The whole paragraph can be indented, or just the first
4648 line. In this way, multi-paragraph footnotes work like
4649 multi-paragraph list items.
4651This paragraph won\[aq]t be part of the note, because it
4656The identifiers in footnote references may not contain spaces, tabs, or
4658These identifiers are used only to correlate the footnote reference with
4659the note itself; in the output, footnotes will be numbered sequentially.
4661The footnotes themselves need not be placed at the end of the document.
4662They may appear anywhere except inside other block elements (lists,
4663block quotes, tables, etc.).
4664Each footnote should be separated from surrounding content (including
4665other footnotes) by blank lines.
4666.SS Extension: \f[C]inline_notes\f[R]
4668Inline footnotes are also allowed (though, unlike regular notes, they
4669cannot contain multiple paragraphs).
4670The syntax is as follows:
4674Here is an inline note.\[ha][Inlines notes are easier to write, since
4675you don\[aq]t have to pick an identifier and move down to type the
4680Inline and regular footnotes may be mixed freely.
4682.SS Extension: \f[C]citations\f[R]
4684Using an external filter, \f[C]pandoc-citeproc\f[R], pandoc can
4685automatically generate citations and a bibliography in a number of
4691pandoc --filter pandoc-citeproc myinput.txt
4695In order to use this feature, you will need to specify a bibliography
4696file using the \f[C]bibliography\f[R] metadata field in a YAML metadata
4697section, or \f[C]--bibliography\f[R] command line argument.
4698You can supply multiple \f[C]--bibliography\f[R] arguments or set
4699\f[C]bibliography\f[R] metadata field to YAML array, if you want to use
4700multiple bibliography files.
4701The bibliography may have any of these formats:
4769Note that \f[C].bib\f[R] can be used with both BibTeX and BibLaTeX
4770files; use \f[C].bibtex\f[R] to force BibTeX.
4772Note that \f[C]pandoc-citeproc --bib2json\f[R] and
4773\f[C]pandoc-citeproc --bib2yaml\f[R] can produce \f[C].json\f[R] and
4774\f[C].yaml\f[R] files from any of the supported formats.
4776In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc
4777parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown;
4778and in CSL JSON databases, an HTML-like markup:
4780.B \f[C]<i>...</i>\f[R]
4783.B \f[C]<b>...</b>\f[R]
4786.B \f[C]<span style=\[dq]font-variant:small-caps;\[dq]>...</span>\f[R] or \f[C]<sc>...</sc>\f[R]
4789.B \f[C]<sub>...</sub>\f[R]
4792.B \f[C]<sup>...</sup>\f[R]
4795.B \f[C]<span class=\[dq]nocase\[dq]>...</span>\f[R]
4796prevent a phrase from being capitalized as title case
4798\f[C]pandoc-citeproc -j\f[R] and \f[C]-y\f[R] interconvert the CSL JSON
4799and CSL YAML formats as far as possible.
4801As an alternative to specifying a bibliography file using
4802\f[C]--bibliography\f[R] or the YAML metadata field
4803\f[C]bibliography\f[R], you can include the citation data directly in
4804the \f[C]references\f[R] field of the document\[aq]s YAML metadata.
4805The field should contain an array of YAML-encoded references, for
4812- type: article-journal
4824 title: \[aq]Molecular structure of nucleic acids: a structure for deoxyribose
4826 title-short: Molecular structure of nucleic acids
4827 container-title: Nature
4831 DOI: 10.1038/171737a0
4832 URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
4838(\f[C]pandoc-citeproc --bib2yaml\f[R] can produce these from a
4839bibliography file in one of the supported formats.)
4841Citations and references can be formatted using any style supported by
4842the Citation Style Language, listed in the Zotero Style Repository.
4843These files are specified using the \f[C]--csl\f[R] option or the
4844\f[C]csl\f[R] metadata field.
4845By default, \f[C]pandoc-citeproc\f[R] will use the Chicago Manual of
4846Style author-date format.
4847The CSL project provides further information on finding and editing
4850To make your citations hyperlinks to the corresponding bibliography
4851entries, add \f[C]link-citations: true\f[R] to your YAML metadata.
4853Citations go inside square brackets and are separated by semicolons.
4854Each citation must have a key, composed of \[aq]\[at]\[aq] + the
4855citation identifier from the database, and may optionally have a prefix,
4856a locator, and a suffix.
4857The citation key must begin with a letter, digit, or \f[C]_\f[R], and
4858may contain alphanumerics, \f[C]_\f[R], and internal punctuation
4859characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]).
4860Here are some examples:
4864Blah blah [see \[at]doe99, pp. 33-35; also \[at]smith04, chap. 1].
4866Blah blah [\[at]doe99, pp. 33-35, 38-39 and *passim*].
4868Blah blah [\[at]smith04; \[at]doe99].
4872\f[C]pandoc-citeproc\f[R] detects locator terms in the CSL locale files.
4873Either abbreviated or unabbreviated forms are accepted.
4874In the \f[C]en-US\f[R] locale, locator terms can be written in either
4875singular or plural forms, as \f[C]book\f[R],
4876\f[C]bk.\f[R]/\f[C]bks.\f[R]; \f[C]chapter\f[R],
4877\f[C]chap.\f[R]/\f[C]chaps.\f[R]; \f[C]column\f[R],
4878\f[C]col.\f[R]/\f[C]cols.\f[R]; \f[C]figure\f[R],
4879\f[C]fig.\f[R]/\f[C]figs.\f[R]; \f[C]folio\f[R],
4880\f[C]fol.\f[R]/\f[C]fols.\f[R]; \f[C]number\f[R],
4881\f[C]no.\f[R]/\f[C]nos.\f[R]; \f[C]line\f[R],
4882\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];
4883\f[C]opus\f[R], \f[C]op.\f[R]/\f[C]opp.\f[R]; \f[C]page\f[R],
4884\f[C]p.\f[R]/\f[C]pp.\f[R]; \f[C]paragraph\f[R],
4885\f[C]para.\f[R]/\f[C]paras.\f[R]; \f[C]part\f[R],
4886\f[C]pt.\f[R]/\f[C]pts.\f[R]; \f[C]section\f[R],
4887\f[C]sec.\f[R]/\f[C]secs.\f[R]; \f[C]sub verbo\f[R],
4888\f[C]s.v.\f[R]/\f[C]s.vv.\f[R]; \f[C]verse\f[R],
4889\f[C]v.\f[R]/\f[C]vv.\f[R]; \f[C]volume\f[R],
4890\f[C]vol.\f[R]/\f[C]vols.\f[R]; \f[C]\[ps]\f[R]/\f[C]\[ps]\[ps]\f[R];
4891\f[C]\[sc]\f[R]/\f[C]\[sc]\[sc]\f[R].
4892If no locator term is used, \[dq]page\[dq] is assumed.
4894\f[C]pandoc-citeproc\f[R] will use heuristics to distinguish the locator
4896In complex cases, the locator can be enclosed in curly braces (using
4897\f[C]pandoc-citeproc\f[R] 0.15 and higher only):
4901[\[at]smith{ii, A, D-Z}, with a suffix]
4902[\[at]smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
4906A minus sign (\f[C]-\f[R]) before the \f[C]\[at]\f[R] will suppress
4907mention of the author in the citation.
4908This can be useful when the author is already mentioned in the text:
4912Smith says blah [-\[at]smith04].
4916You can also write an in-text citation, as follows:
4920\[at]smith04 says blah.
4922\[at]smith04 [p. 33] says blah.
4926If the style calls for a list of works cited, it will be placed in a div
4927with id \f[C]refs\f[R], if one exists:
4936Otherwise, it will be placed at the end of the document.
4937Generation of the bibliography can be suppressed by setting
4938\f[C]suppress-bibliography: true\f[R] in the YAML metadata.
4940If you wish the bibliography to have a section header, you can set
4941\f[C]reference-section-title\f[R] in the metadata, or put the header at
4942the beginning of the div with id \f[C]refs\f[R] (if you are using it) or
4943at the end of your document:
4953The bibliography will be inserted after this header.
4954Note that the \f[C]unnumbered\f[R] class will be added to this header,
4955so that the section will not be numbered.
4957If you want to include items in the bibliography without actually citing
4958them in the body text, you can define a dummy \f[C]nocite\f[R] metadata
4959field and put the citations there:
4965 \[at]item1, \[at]item2
4972In this example, the document will contain a citation for
4973\f[C]item3\f[R] only, but the bibliography will contain entries for
4974\f[C]item1\f[R], \f[C]item2\f[R], and \f[C]item3\f[R].
4976It is possible to create a bibliography with all the citations, whether
4977or not they appear in the document, by using a wildcard:
4988For LaTeX output, you can also use \f[C]natbib\f[R] or
4989\f[C]biblatex\f[R] to render the bibliography.
4990In order to do so, specify bibliography files as outlined above, and add
4991\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] argument to \f[C]pandoc\f[R]
4993Bear in mind that bibliography files have to be in respective format
4994(either BibTeX or BibLaTeX).
4996For more information, see the pandoc-citeproc man page.
4997.SS Non-pandoc extensions
4999The following Markdown syntax extensions are not enabled by default in
5000pandoc, but may be enabled by adding \f[C]+EXTENSION\f[R] to the format
5001name, where \f[C]EXTENSION\f[R] is the name of the extension.
5002Thus, for example, \f[C]markdown+hard_line_breaks\f[R] is Markdown with
5004.SS Extension: \f[C]old_dashes\f[R]
5006Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
5007\f[C]-\f[R] before a numeral is an en-dash, and \f[C]--\f[R] is an
5009This option only has an effect if \f[C]smart\f[R] is enabled.
5010It is selected automatically for \f[C]textile\f[R] input.
5011.SS Extension: \f[C]angle_brackets_escapable\f[R]
5013Allow \f[C]<\f[R] and \f[C]>\f[R] to be backslash-escaped, as they can
5014be in GitHub flavored Markdown but not original Markdown.
5015This is implied by pandoc\[aq]s default \f[C]all_symbols_escapable\f[R].
5016.SS Extension: \f[C]lists_without_preceding_blankline\f[R]
5018Allow a list to occur right after a paragraph, with no intervening blank
5020.SS Extension: \f[C]four_space_rule\f[R]
5022Selects the pandoc <= 2.0 behavior for parsing lists, so that four
5023spaces indent are needed for list item continuation paragraphs.
5024.SS Extension: \f[C]spaced_reference_links\f[R]
5026Allow whitespace between the two components of a reference link, for
5034.SS Extension: \f[C]hard_line_breaks\f[R]
5036Causes all newlines within a paragraph to be interpreted as hard line
5037breaks instead of spaces.
5038.SS Extension: \f[C]ignore_line_breaks\f[R]
5040Causes newlines within a paragraph to be ignored, rather than being
5041treated as spaces or as hard line breaks.
5042This option is intended for use with East Asian languages where spaces
5043are not used between words, but text is divided into lines for
5045.SS Extension: \f[C]east_asian_line_breaks\f[R]
5047Causes newlines within a paragraph to be ignored, rather than being
5048treated as spaces or as hard line breaks, when they occur between two
5049East Asian wide characters.
5050This is a better choice than \f[C]ignore_line_breaks\f[R] for texts that
5051include a mix of East Asian wide characters and other characters.
5052.SS Extension: \f[C]emoji\f[R]
5054Parses textual emojis like \f[C]:smile:\f[R] as Unicode emoticons.
5055.SS Extension: \f[C]tex_math_single_backslash\f[R]
5057Causes anything between \f[C]\[rs](\f[R] and \f[C]\[rs])\f[R] to be
5058interpreted as inline TeX math, and anything between \f[C]\[rs][\f[R]
5059and \f[C]\[rs]]\f[R] to be interpreted as display TeX math.
5060Note: a drawback of this extension is that it precludes escaping
5061\f[C](\f[R] and \f[C][\f[R].
5062.SS Extension: \f[C]tex_math_double_backslash\f[R]
5064Causes anything between \f[C]\[rs]\[rs](\f[R] and \f[C]\[rs]\[rs])\f[R]
5065to be interpreted as inline TeX math, and anything between
5066\f[C]\[rs]\[rs][\f[R] and \f[C]\[rs]\[rs]]\f[R] to be interpreted as
5068.SS Extension: \f[C]markdown_attribute\f[R]
5070By default, pandoc interprets material inside block-level tags as
5072This extension changes the behavior so that Markdown is only parsed
5073inside block-level tags if the tags have the attribute
5074\f[C]markdown=1\f[R].
5075.SS Extension: \f[C]mmd_title_block\f[R]
5077Enables a MultiMarkdown style title block at the top of the document,
5084Date: September 1, 2008
5085Comment: This is a sample mmd title block, with
5086 a field spanning multiple lines.
5090See the MultiMarkdown documentation for details.
5091If \f[C]pandoc_title_block\f[R] or \f[C]yaml_metadata_block\f[R] is
5092enabled, it will take precedence over \f[C]mmd_title_block\f[R].
5093.SS Extension: \f[C]abbreviations\f[R]
5095Parses PHP Markdown Extra abbreviation keys, like
5099*[HTML]: Hypertext Markup Language
5103Note that the pandoc document model does not support abbreviations, so
5104if this extension is enabled, abbreviation keys are simply skipped (as
5105opposed to being parsed as paragraphs).
5106.SS Extension: \f[C]autolink_bare_uris\f[R]
5108Makes all absolute URIs into links, even when not surrounded by pointy
5109braces \f[C]<...>\f[R].
5110.SS Extension: \f[C]mmd_link_attributes\f[R]
5112Parses multimarkdown style key-value attributes on link and image
5114This extension should not be confused with the \f[C]link_attributes\f[R]
5119This is a reference ![image][ref] with multimarkdown attributes.
5121[ref]: http://path.to/image \[dq]Image title\[dq] width=20px height=30px
5122 id=myId class=\[dq]myClass1 myClass2\[dq]
5125.SS Extension: \f[C]mmd_header_identifiers\f[R]
5127Parses multimarkdown style header identifiers (in square brackets, after
5128the header but before any trailing \f[C]#\f[R]s in an ATX header).
5129.SS Extension: \f[C]compact_definition_lists\f[R]
5131Activates the definition list syntax of pandoc 1.12.x and earlier.
5132This syntax differs from the one described above under Definition lists
5135No blank line is required between consecutive items of the definition
5138To get a \[dq]tight\[dq] or \[dq]compact\[dq] list, omit space between
5139consecutive items; the space between a term and its definition does not
5142Lazy wrapping of paragraphs is not allowed: the entire definition must
5143be indented four spaces.
5144.SS Markdown variants
5146In addition to pandoc\[aq]s extended Markdown, the following Markdown
5147variants are supported:
5149.B \f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
5150\f[C]footnotes\f[R], \f[C]pipe_tables\f[R], \f[C]raw_html\f[R],
5151\f[C]markdown_attribute\f[R], \f[C]fenced_code_blocks\f[R],
5152\f[C]definition_lists\f[R], \f[C]intraword_underscores\f[R],
5153\f[C]header_attributes\f[R], \f[C]link_attributes\f[R],
5154\f[C]abbreviations\f[R], \f[C]shortcut_reference_links\f[R],
5155\f[C]spaced_reference_links\f[R].
5157.B \f[C]markdown_github\f[R] (deprecated GitHub-Flavored Markdown)
5158\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
5159\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
5160\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
5161\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
5162\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
5163\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
5164\f[C]lists_without_preceding_blankline\f[R].
5166.B \f[C]markdown_mmd\f[R] (MultiMarkdown)
5167\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]markdown_attribute\f[R],
5168\f[C]mmd_link_attributes\f[R], \f[C]tex_math_double_backslash\f[R],
5169\f[C]intraword_underscores\f[R], \f[C]mmd_title_block\f[R],
5170\f[C]footnotes\f[R], \f[C]definition_lists\f[R],
5171\f[C]all_symbols_escapable\f[R], \f[C]implicit_header_references\f[R],
5172\f[C]auto_identifiers\f[R], \f[C]mmd_header_identifiers\f[R],
5173\f[C]shortcut_reference_links\f[R], \f[C]implicit_figures\f[R],
5174\f[C]superscript\f[R], \f[C]subscript\f[R],
5175\f[C]backtick_code_blocks\f[R], \f[C]spaced_reference_links\f[R],
5176\f[C]raw_attribute\f[R].
5178.B \f[C]markdown_strict\f[R] (Markdown.pl)
5179\f[C]raw_html\f[R], \f[C]shortcut_reference_links\f[R],
5180\f[C]spaced_reference_links\f[R].
5182We also support \f[C]commonmark\f[R] and \f[C]gfm\f[R] (GitHub-Flavored
5183Markdown, which is implemented as a set of extensions on
5184\f[C]commonmark\f[R]).
5186Note, however, that \f[C]commonmark\f[R] and \f[C]gfm\f[R] have limited
5187support for extensions.
5188Only those listed below (and \f[C]smart\f[R], \f[C]raw_tex\f[R], and
5189\f[C]hard_line_breaks\f[R]) will work.
5190The extensions can, however, all be individually disabled.
5191Also, \f[C]raw_tex\f[R] only affects \f[C]gfm\f[R] output, not input.
5193.B \f[C]gfm\f[R] (GitHub-Flavored Markdown)
5194\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
5195\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
5196\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
5197\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
5198\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
5199\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
5200\f[C]lists_without_preceding_blankline\f[R].
5201.SH PRODUCING SLIDE SHOWS WITH PANDOC
5203You can use pandoc to produce an HTML + JavaScript slide presentation
5204that can be viewed via a web browser.
5205There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
5207You can also produce a PDF slide show using LaTeX \f[C]beamer\f[R], or
5208slides shows in Microsoft PowerPoint format.
5210Here\[aq]s the Markdown source for a simple slide show,
5211\f[C]habits.txt\f[R]:
5240
5249To produce an HTML/JavaScript slide show, simply type
5253pandoc -t FORMAT -s habits.txt -o habits.html
5257where \f[C]FORMAT\f[R] is either \f[C]s5\f[R], \f[C]slidy\f[R],
5258\f[C]slideous\f[R], \f[C]dzslides\f[R], or \f[C]revealjs\f[R].
5260For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
5261the \f[C]-s/--standalone\f[R] option embeds a link to JavaScript and CSS
5262files, which are assumed to be available at the relative path
5263\f[C]s5/default\f[R] (for S5), \f[C]slideous\f[R] (for Slideous),
5264\f[C]reveal.js\f[R] (for reveal.js), or at the Slidy website at
5265\f[C]w3.org\f[R] (for Slidy).
5266(These paths can be changed by setting the \f[C]slidy-url\f[R],
5267\f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R]
5268variables; see Variables for HTML slides, above.) For DZSlides, the
5269(relatively short) JavaScript and CSS are included in the file by
5272With all HTML slide formats, the \f[C]--self-contained\f[R] option can
5273be used to produce a single file that contains all of the data necessary
5274to display the slide show, including linked scripts, stylesheets,
5277To produce a PDF slide show using beamer, type
5281pandoc -t beamer habits.txt -o habits.pdf
5285Note that a reveal.js slide show can also be converted to a PDF by
5286printing it to a file from the browser.
5288To produce a Powerpoint slide show, type
5292pandoc habits.txt -o habits.pptx
5295.SS Structuring the slide show
5297By default, the \f[I]slide level\f[R] is the highest header level in the
5298hierarchy that is followed immediately by content, and not another
5299header, somewhere in the document.
5300In the example above, level 1 headers are always followed by level 2
5301headers, which are followed by content, so 2 is the slide level.
5302This default can be overridden using the \f[C]--slide-level\f[R] option.
5304The document is carved up into slides according to the following rules:
5306A horizontal rule always starts a new slide.
5308A header at the slide level always starts a new slide.
5310Headers \f[I]below\f[R] the slide level in the hierarchy create headers
5311\f[I]within\f[R] a slide.
5313Headers \f[I]above\f[R] the slide level in the hierarchy create
5314\[dq]title slides,\[dq] which just contain the section title and help to
5315break the slide show into sections.
5317Content \f[I]above\f[R] the slide level will not appear in the slide
5320A title page is constructed automatically from the document\[aq]s title
5322(In the case of beamer, this can be disabled by commenting out some
5323lines in the default template.)
5325These rules are designed to support many different styles of slide show.
5326If you don\[aq]t care about structuring your slides into sections and
5327subsections, you can just use level 1 headers for all each slide.
5328(In that case, level 1 will be the slide level.) But you can also
5329structure the slide show into sections, as in the example above.
5331Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
5332layout will be produced, with level 1 headers building horizontally and
5333level 2 headers building vertically.
5334It is not recommended that you use deeper nesting of section levels with
5336.SS Incremental lists
5338By default, these writers produce lists that display \[dq]all at
5339once.\[dq] If you want your lists to display incrementally (one item at
5340a time), use the \f[C]-i\f[R] option.
5341If you want a particular list to depart from the default, put it in a
5342\f[C]div\f[R] block with class \f[C]incremental\f[R] or
5343\f[C]nonincremental\f[R].
5344So, for example, using the \f[C]fenced div\f[R] syntax, the following
5345would be incremental regardless of the document default:
5371While using \f[C]incremental\f[R] and \f[C]nonincremental\f[R] divs are
5372the recommended method of setting incremental lists on a per-case basis,
5373an older method is also supported: putting lists inside a blockquote
5374will depart from the document default (that is, it will display
5375incrementally without the \f[C]-i\f[R] option and all at once with the
5376\f[C]-i\f[R] option):
5385Both methods allow incremental and nonincremental lists to be mixed in a
5389You can add \[dq]pauses\[dq] within a slide by including a paragraph
5390containing three dots, separated by spaces:
5396content before the pause
5400content after the pause
5403.SS Styling the slides
5405You can change the style of HTML slides by putting customized CSS files
5406in \f[C]$DATADIR/s5/default\f[R] (for S5), \f[C]$DATADIR/slidy\f[R] (for
5407Slidy), or \f[C]$DATADIR/slideous\f[R] (for Slideous), where
5408\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
5410The originals may be found in pandoc\[aq]s system data directory
5411(generally \f[C]$CABALDIR/pandoc-VERSION/s5/default\f[R]).
5412Pandoc will look there for any files it does not find in the user data
5415For dzslides, the CSS is included in the HTML file itself, and may be
5418All reveal.js configuration options can be set through variables.
5419For example, themes can be used by setting the \f[C]theme\f[R] variable:
5427Or you can specify a custom stylesheet using the \f[C]--css\f[R] option.
5429To style beamer slides, you can specify a \f[C]theme\f[R],
5430\f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], and
5431\f[C]outertheme\f[R], using the \f[C]-V\f[R] option:
5435pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
5439Note that header attributes will turn into slide attributes (on a
5440\f[C]<div>\f[R] or \f[C]<section>\f[R]) in HTML slide formats, allowing
5441you to style individual slides.
5442In beamer, the only header attribute that affects slides is the
5443\f[C]allowframebreaks\f[R] class, which sets the
5444\f[C]allowframebreaks\f[R] option, causing multiple slides to be created
5445if the content overfills the frame.
5446This is recommended especially for bibliographies:
5450# References {.allowframebreaks}
5455Speaker notes are supported in reveal.js and PowerPoint (pptx) output.
5456You can add notes to your Markdown document thus:
5464- It can contain Markdown
5471To show the notes window in reveal.js, press \f[C]s\f[R] while viewing
5473Speaker notes in PowerPoint will be available, as usual, in handouts and
5476Notes are not yet supported for other slide formats, but the notes will
5477not appear on the slides themselves.
5480To put material in side by side columns, you can use a native div
5481container with class \f[C]columns\f[R], containing two or more div
5482containers with class \f[C]column\f[R] and a \f[C]width\f[R] attribute:
5486:::::::::::::: {.columns}
5487::: {.column width=\[dq]40%\[dq]}
5490::: {.column width=\[dq]60%\[dq]}
5496.SS Frame attributes in beamer
5498Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[R] option to
5499a frame in beamer (for example, when using the \f[C]minted\f[R]
5501This can be forced by adding the \f[C]fragile\f[R] class to the header
5502introducing the slide:
5506# Fragile slide {.fragile}
5510All of the other frame attributes described in Section 8.1 of the Beamer
5511User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R],
5512\f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R],
5513\f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R],
5514\f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R].
5515.SS Background in reveal.js and beamer
5517Background images can be added to self-contained reveal.js slideshows
5518and to beamer slideshows.
5520For the same image on every slide, use the configuration option
5521\f[C]background-image\f[R] either in the YAML metadata block or as a
5522command-line variable.
5523(There are no other options in beamer and the rest of this section
5524concerns reveal.js slideshows.)
5526For reveal.js, you can instead use the reveal.js-native option
5527\f[C]parallaxBackgroundImage\f[R].
5528You can also set \f[C]parallaxBackgroundHorizontal\f[R] and
5529\f[C]parallaxBackgroundVertical\f[R] the same way and must also set
5530\f[C]parallaxBackgroundSize\f[R] to have your values take effect.
5532To set an image for a particular reveal.js slide, add
5533\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first
5534slide-level header on the slide (which may even be empty).
5536In reveal.js\[aq]s overview mode, the parallaxBackgroundImage will show
5537up only on the first slide.
5539Other reveal.js background settings also work on individual slides,
5540including \f[C]data-background-size\f[R],
5541\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R],
5542\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R].
5544See the reveal.js documentation for more details.
5546For example in reveal.js:
5552parallaxBackgroundImage: /path/to/my/background_image.png
5557Slide 1 has background_image.png as its background.
5559## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]}
5561Slide 2 has a special image for its background, even though the header has no content.
5564.SH CREATING EPUBS WITH PANDOC
5567EPUB metadata may be specified using the \f[C]--epub-metadata\f[R]
5568option, but if the source document is Markdown, it is better to use a
5579 text: An investigation of metadata
5587 text: doi:10.234234.234/33
5589rights: \[co] 2007 John Smith, CC BY-NC
5596The following fields are recognized:
5598.B \f[C]identifier\f[R]
5599Either a string value or an object with fields \f[C]text\f[R] and
5601Valid values for \f[C]scheme\f[R] are \f[C]ISBN-10\f[R],
5602\f[C]GTIN-13\f[R], \f[C]UPC\f[R], \f[C]ISMN-10\f[R], \f[C]DOI\f[R],
5603\f[C]LCCN\f[R], \f[C]GTIN-14\f[R], \f[C]ISBN-13\f[R],
5604\f[C]Legal deposit number\f[R], \f[C]URN\f[R], \f[C]OCLC\f[R],
5605\f[C]ISMN-13\f[R], \f[C]ISBN-A\f[R], \f[C]JP\f[R], \f[C]OLCC\f[R].
5608Either a string value, or an object with fields \f[C]file-as\f[R] and
5609\f[C]type\f[R], or a list of such objects.
5610Valid values for \f[C]type\f[R] are \f[C]main\f[R], \f[C]subtitle\f[R],
5611\f[C]short\f[R], \f[C]collection\f[R], \f[C]edition\f[R],
5615Either a string value, or an object with fields \f[C]role\f[R],
5616\f[C]file-as\f[R], and \f[C]text\f[R], or a list of such objects.
5617Valid values for \f[C]role\f[R] are MARC relators, but pandoc will
5618attempt to translate the human-readable versions (like \[dq]author\[dq]
5619and \[dq]editor\[dq]) to the appropriate marc relators.
5621.B \f[C]contributor\f[R]
5622Same format as \f[C]creator\f[R].
5625A string value in \f[C]YYYY-MM-DD\f[R] format.
5626(Only the year is necessary.) Pandoc will attempt to convert other
5629.B \f[C]lang\f[R] (or legacy: \f[C]language\f[R])
5630A string value in BCP 47 format.
5631Pandoc will default to the local language if nothing is specified.
5634A string value or a list of such values.
5636.B \f[C]description\f[R]
5645.B \f[C]relation\f[R]
5648.B \f[C]coverage\f[R]
5654.B \f[C]cover-image\f[R]
5655A string value (path to cover image).
5657.B \f[C]css\f[R] (or legacy: \f[C]stylesheet\f[R])
5658A string value (path to CSS stylesheet).
5660.B \f[C]page-progression-direction\f[R]
5661Either \f[C]ltr\f[R] or \f[C]rtl\f[R].
5662Specifies the \f[C]page-progression-direction\f[R] attribute for the
5663\f[C]spine\f[R] element.
5666iBooks-specific metadata, with the following fields:
5669\f[C]version\f[R]: (string)
5671\f[C]specified-fonts\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
5674\f[C]ipad-orientation-lock\f[R]:
5675\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
5677\f[C]iphone-orientation-lock\f[R]:
5678\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
5680\f[C]binding\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
5683\f[C]scroll-axis\f[R]:
5684\f[C]vertical\f[R]|\f[C]horizontal\f[R]|\f[C]default\f[R]
5686.SS The \f[C]epub:type\f[R] attribute
5688For \f[C]epub3\f[R] output, you can mark up the header that corresponds
5689to an EPUB chapter using the \f[C]epub:type\f[R] attribute.
5690For example, to set the attribute to the value \f[C]prologue\f[R], use
5695# My chapter {epub:type=prologue}
5699Which will result in:
5703<body epub:type=\[dq]frontmatter\[dq]>
5704 <section epub:type=\[dq]prologue\[dq]>
5709Pandoc will output \f[C]<body epub:type=\[dq]bodymatter\[dq]>\f[R],
5710unless you use one of the following values, in which case either
5711\f[C]frontmatter\f[R] or \f[C]backmatter\f[R] will be output.
5717\f[C]epub:type\f[R] of first section
5719\f[C]epub:type\f[R] of body
5805By default, pandoc will download media referenced from any
5806\f[C]<img>\f[R], \f[C]<audio>\f[R], \f[C]<video>\f[R] or
5807\f[C]<source>\f[R] element present in the generated EPUB, and include it
5808in the EPUB container, yielding a completely self-contained EPUB.
5809If you want to link to external media resources instead, use raw HTML in
5810your source and add \f[C]data-external=\[dq]1\[dq]\f[R] to the tag with
5811the \f[C]src\f[R] attribute.
5816<audio controls=\[dq]1\[dq]>
5817 <source src=\[dq]http://example.com/music/toccata.mp3\[dq]
5818 data-external=\[dq]1\[dq] type=\[dq]audio/mpeg\[dq]>
5823.SH CREATING JUPYTER NOTEBOOKS WITH PANDOC
5825When creating a Jupyter notebook, pandoc will try to infer the notebook
5827Code blocks with the class \f[C]code\f[R] will be taken as code cells,
5828and intervening content will be taken as Markdown cells.
5829Attachments will automatically be created for images in Markdown cells.
5830Metadata will be taken from the \f[C]jupyter\f[R] metadata field.
5841 display_name: Python 2
5848 file_extension: \[dq].py\[dq]
5849 mimetype: \[dq]text/x-python\[dq]
5850 name: \[dq]python\[dq]
5851 nbconvert_exporter: \[dq]python\[dq]
5852 pygments_lexer: \[dq]ipython2\[dq]
5853 version: \[dq]2.7.15\[dq]
5858**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
5859bibendum felis dictum sodales.
5862print(\[dq]hello\[dq])
5868from IPython.display import HTML
5871console.log(\[dq]hello\[dq]);
5879This image  will be
5880included as a cell attachment.
5884If you want to add cell attributes, group cells differently, or add
5885output to code cells, then you need to include divs to indicate the
5887You can use either fenced divs or native divs for this.
5892:::::: {.cell .markdown}
5895**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
5896bibendum felis dictum sodales.
5899:::::: {.cell .code execution_count=1}
5900\[ga]\[ga]\[ga] {.python}
5901print(\[dq]hello\[dq])
5904::: {.output .stream .stdout}
5911:::::: {.cell .code execution_count=2}
5912\[ga]\[ga]\[ga] {.python}
5913from IPython.display import HTML
5916console.log(\[dq]hello\[dq]);
5922::: {.output .execute_result execution_count=2}
5923\[ga]\[ga]\[ga]{=html}
5925console.log(\[dq]hello\[dq]);
5934.SH SYNTAX HIGHLIGHTING
5936Pandoc will automatically highlight syntax in fenced code blocks that
5937are marked with a language name.
5938The Haskell library skylighting is used for highlighting.
5939Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and
5941To see a list of language names that pandoc will recognize, type
5942\f[C]pandoc --list-highlight-languages\f[R].
5944The color scheme can be selected using the \f[C]--highlight-style\f[R]
5946The default color scheme is \f[C]pygments\f[R], which imitates the
5947default color scheme used by the Python library pygments (though
5948pygments is not actually used to do the highlighting).
5949To see a list of highlight styles, type
5950\f[C]pandoc --list-highlight-styles\f[R].
5952If you are not satisfied with the predefined styles, you can use
5953\f[C]--print-highlight-style\f[R] to generate a JSON \f[C].theme\f[R]
5954file which can be modified and used as the argument to
5955\f[C]--highlight-style\f[R].
5956To get a JSON version of the \f[C]pygments\f[R] style, for example:
5960pandoc --print-highlight-style pygments > my.theme
5964Then edit \f[C]my.theme\f[R] and use it like this:
5968pandoc --highlight-style my.theme
5972If you are not satisfied with the built-in highlighting, or you want
5973highlight a language that isn\[aq]t supported, you can use the
5974\f[C]--syntax-definition\f[R] option to load a KDE-style XML syntax
5976Before writing your own, have a look at KDE\[aq]s repository of syntax
5979To disable highlighting, use the \f[C]--no-highlight\f[R] option.
5982Custom styles can be used in the docx and ICML formats.
5985The docx reader, by default, only reads those styles that it can convert
5986into pandoc elements, either by direct conversion or interpreting the
5987derivation of the input document\[aq]s styles.
5989By enabling the \f[C]styles\f[R] extension in the docx reader
5990(\f[C]-f docx+styles\f[R]), you can produce output that maintains the
5991styles of the input document, using the \f[C]custom-style\f[R] class.
5992Paragraph styles are interpreted as divs, while character styles are
5993interpreted as spans.
5995For example, using the \f[C]custom-style-reference.docx\f[R] file in the
5996test directory, we have the following different outputs:
5998Without the \f[C]+styles\f[R] extension:
6002$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
6005This is text with an *emphasized* text style. And this is text with a
6006**strengthened** text style.
6008> Here is a styled paragraph that inherits from Block Text.
6012And with the extension:
6016$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
6018::: {custom-style=\[dq]FirstParagraph\[dq]}
6022::: {custom-style=\[dq]BodyText\[dq]}
6023This is text with an [emphasized]{custom-style=\[dq]Emphatic\[dq]} text style.
6024And this is text with a [strengthened]{custom-style=\[dq]Strengthened\[dq]}
6028::: {custom-style=\[dq]MyBlockStyle\[dq]}
6029> Here is a styled paragraph that inherits from Block Text.
6034With these custom styles, you can use your input document as a
6035reference-doc while creating docx output (see below), and maintain the
6036same styles in your input and output files.
6039By default, pandoc\[aq]s docx and ICML output applies a predefined set
6040of styles for blocks such as paragraphs and block quotes, and uses
6041largely default formatting (italics, bold) for inlines.
6042This will work for most purposes, especially alongside a
6043\f[C]reference.docx\f[R] file.
6044However, if you need to apply your own styles to blocks, or match a
6045preexisting set of styles, pandoc allows you to define custom styles for
6046blocks and text using \f[C]div\f[R]s and \f[C]span\f[R]s, respectively.
6048If you define a \f[C]div\f[R] or \f[C]span\f[R] with the attribute
6049\f[C]custom-style\f[R], pandoc will apply your specified style to the
6051So, for example using the \f[C]bracketed_spans\f[R] syntax,
6055[Get out]{custom-style=\[dq]Emphatically\[dq]}, he said.
6059would produce a docx file with \[dq]Get out\[dq] styled with character
6060style \f[C]Emphatically\f[R].
6061Similarly, using the \f[C]fenced_divs\f[R] syntax,
6065Dickinson starts the poem simply:
6067::: {custom-style=\[dq]Poetry\[dq]}
6068| A Bird came down the Walk---
6069| He did not know I saw---
6074would style the two contained lines with the \f[C]Poetry\f[R] paragraph
6077For docx output, styles will be defined in the output file as inheriting
6078from normal text, if the styles are not yet in your reference.docx.
6079If they are already defined, pandoc will not alter the definition.
6081This feature allows for greatest customization in conjunction with
6083If you want all paragraphs after block quotes to be indented, you can
6084write a filter to apply the styles necessary.
6085If you want all italics to be transformed to the \f[C]Emphasis\f[R]
6086character style (perhaps to change their color), you can write a filter
6087which will transform all italicized inlines to inlines within an
6088\f[C]Emphasis\f[R] custom-style \f[C]span\f[R].
6091Pandoc can be extended with custom writers written in lua.
6092(Pandoc includes a lua interpreter, so lua need not be installed
6095To use a custom writer, simply specify the path to the lua script in
6096place of the output format.
6101pandoc -t data/sample.lua
6105Creating a custom writer requires writing a lua function for each
6106possible element in a pandoc document.
6107To get a documented example which you can modify according to your
6112pandoc --print-default-data-file sample.lua
6115.SH A NOTE ON SECURITY
6117If you use pandoc to convert user-contributed content in a web
6118application, here are some things to keep in mind:
6120Although pandoc itself will not create or modify any files other than
6121those you explicitly ask it create (with the exception of temporary
6122files used in producing PDFs), a filter or custom writer could in
6123principle do anything on your file system.
6124Please audit filters and custom writers very carefully before using
6127If your application uses pandoc as a Haskell library (rather than
6128shelling out to the executable), it is possible to use it in a mode that
6129fully isolates pandoc from your file system, by running the pandoc
6130operations in the \f[C]PandocPure\f[R] monad.
6131See the document Using the pandoc API for more details.
6133Pandoc\[aq]s parsers can exhibit pathological performance on some corner
6135It is wise to put any pandoc operations under a timeout, to avoid DOS
6136attacks that exploit these issues.
6137If you are using the pandoc executable, you can add the command line
6138options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size
6141The HTML generated by pandoc is not guaranteed to be safe.
6142If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
6143inject arbitrary HTML.
6144Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
6145content in attributes for headers, spans, and code blocks.
6146To be safe, you should run all the generated HTML through an HTML
6150Copyright 2006--2019 John MacFarlane (jgm\[at]berkeley.edu).
6151Released under the GPL, version 2 or greater.
6152This software carries no warranty of any kind.
6153(See COPYRIGHT for full copyright and warranty notices.) For a full list
6154of contributors, see the file AUTHORS.md in the pandoc source code.
6156The Pandoc source code and all documentation may be downloaded
6157from <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