2.\" Automatically generated by Pandoc 2.10
4.TH "Pandoc User\[aq]s Guide" "" "June 29, 2020" "pandoc 2.10" ""
7pandoc - general markup converter
10\f[C]pandoc\f[R] [\f[I]options\f[R]] [\f[I]input-file\f[R]]...
13Pandoc is a Haskell library for converting from one markup format to
14another, and a command-line tool that uses this library.
16Pandoc can convert between numerous markup and word processing formats,
17including, but not limited to, various flavors of Markdown, HTML, LaTeX
19For the full lists of input and output formats, see the \f[C]--from\f[R]
20and \f[C]--to\f[R] options below.
21Pandoc can also produce PDF output: see creating a PDF, below.
23Pandoc\[aq]s enhanced version of Markdown includes syntax for tables,
24definition lists, metadata blocks, footnotes, citations, math, and much
26See below under Pandoc\[aq]s Markdown.
28Pandoc has a modular design: it consists of a set of readers, which
29parse text in a given format and produce a native representation of the
30document (an \f[I]abstract syntax tree\f[R] or AST), and a set of
31writers, which convert this native representation into a target format.
32Thus, adding an input or output format requires only adding a reader or
34Users can also run custom pandoc filters to modify the intermediate AST.
36Because pandoc\[aq]s intermediate representation of a document is less
37expressive than many of the formats it converts between, one should not
38expect perfect conversions between every format and every other.
39Pandoc attempts to preserve the structural elements of a document, but
40not formatting details such as margin size.
41And some document elements, such as complex tables, may not fit into
42pandoc\[aq]s simple document model.
43While conversions from pandoc\[aq]s Markdown to all formats aspire to be
44perfect, conversions from formats more expressive than pandoc\[aq]s
45Markdown can be expected to be lossy.
48If no \f[I]input-files\f[R] are specified, input is read from
50Output goes to \f[I]stdout\f[R] by default.
51For output to a file, use the \f[C]-o\f[R] option:
55pandoc -o output.html input.txt
59By default, pandoc produces a document fragment.
60To produce a standalone document (e.g.
61a valid HTML file including \f[C]<head>\f[R] and \f[C]<body>\f[R]), use
62the \f[C]-s\f[R] or \f[C]--standalone\f[R] flag:
66pandoc -s -o output.html input.txt
70For more information on how standalone documents are produced, see
73If multiple input files are given, \f[C]pandoc\f[R] will concatenate
74them all (with blank lines between them) before parsing.
75(Use \f[C]--file-scope\f[R] to parse files individually.)
78The format of the input and output can be specified explicitly using
80The input format can be specified using the \f[C]-f/--from\f[R] option,
81the output format using the \f[C]-t/--to\f[R] option.
82Thus, to convert \f[C]hello.txt\f[R] from Markdown to LaTeX, you could
87pandoc -f markdown -t latex hello.txt
91To convert \f[C]hello.html\f[R] from HTML to Markdown:
95pandoc -f html -t markdown hello.html
99Supported input and output formats are listed below under Options (see
100\f[C]-f\f[R] for input formats and \f[C]-t\f[R] for output formats).
101You can also use \f[C]pandoc --list-input-formats\f[R] and
102\f[C]pandoc --list-output-formats\f[R] to print lists of supported
105If the input or output format is not specified explicitly,
106\f[C]pandoc\f[R] will attempt to guess it from the extensions of the
112pandoc -o hello.tex hello.txt
116will convert \f[C]hello.txt\f[R] from Markdown to LaTeX.
117If no output file is specified (so that output goes to
118\f[I]stdout\f[R]), or if the output file\[aq]s extension is unknown, the
119output format will default to HTML.
120If no input file is specified (so that input comes from
121\f[I]stdin\f[R]), or if the input files\[aq] extensions are unknown, the
122input format will be assumed to be Markdown.
123.SS Character encoding
125Pandoc uses the UTF-8 character encoding for both input and output.
126If your local character encoding is not UTF-8, you should pipe input and
127output through \f[C]iconv\f[R]:
131iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
135Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,
136OPML, DocBook, and Texinfo), information about the character encoding is
137included in the document header, which will only be included if you use
138the \f[C]-s/--standalone\f[R] option.
141To produce a PDF, specify an output file with a \f[C].pdf\f[R]
146pandoc test.txt -o test.pdf
150By default, pandoc will use LaTeX to create the PDF, which requires that
151a LaTeX engine be installed (see \f[C]--pdf-engine\f[R] below).
152Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an
154To do this, specify an output file with a \f[C].pdf\f[R] extension, as
155before, but add the \f[C]--pdf-engine\f[R] option or
156\f[C]-t context\f[R], \f[C]-t html\f[R], or \f[C]-t ms\f[R] to the
158The tool used to generate the PDF from the intermediate format may be
159specified using \f[C]--pdf-engine\f[R].
161You can control the PDF style using variables, depending on the
162intermediate format used: see variables for LaTeX, variables for
163ConTeXt, variables for \f[C]wkhtmltopdf\f[R], variables for ms.
164When HTML is used as an intermediate format, the output can be styled
165using \f[C]--css\f[R].
167To debug the PDF creation, it can be useful to look at the intermediate
168representation: instead of \f[C]-o test.pdf\f[R], use for example
169\f[C]-s -o test.tex\f[R] to output the generated LaTeX.
170You can then test it with \f[C]pdflatex test.tex\f[R].
172When using LaTeX, the following packages need to be available (they are
173included with all recent versions of TeX Live): \f[C]amsfonts\f[R],
174\f[C]amsmath\f[R], \f[C]lm\f[R], \f[C]unicode-math\f[R],
175\f[C]ifxetex\f[R], \f[C]ifluatex\f[R], \f[C]listings\f[R] (if the
176\f[C]--listings\f[R] option is used), \f[C]fancyvrb\f[R],
177\f[C]longtable\f[R], \f[C]booktabs\f[R], \f[C]graphicx\f[R] (if the
178document contains images), \f[C]hyperref\f[R], \f[C]xcolor\f[R],
179\f[C]ulem\f[R], \f[C]geometry\f[R] (with the \f[C]geometry\f[R] variable
180set), \f[C]setspace\f[R] (with \f[C]linestretch\f[R]), and
181\f[C]babel\f[R] (with \f[C]lang\f[R]).
182The use of \f[C]xelatex\f[R] or \f[C]lualatex\f[R] as the PDF engine
183requires \f[C]fontspec\f[R].
184\f[C]xelatex\f[R] uses \f[C]polyglossia\f[R] (with \f[C]lang\f[R]),
185\f[C]xecjk\f[R], and \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable
187If the \f[C]mathspec\f[R] variable is set, \f[C]xelatex\f[R] will use
188\f[C]mathspec\f[R] instead of \f[C]unicode-math\f[R].
189The \f[C]upquote\f[R] and \f[C]microtype\f[R] packages are used if
190available, and \f[C]csquotes\f[R] will be used for typography if the
191\f[C]csquotes\f[R] variable or metadata field is set to a true value.
192The \f[C]natbib\f[R], \f[C]biblatex\f[R], \f[C]bibtex\f[R], and
193\f[C]biber\f[R] packages can optionally be used for citation rendering.
194The following packages will be used to improve output quality if
195present, but pandoc does not require them to be present:
196\f[C]upquote\f[R] (for straight quotes in verbatim environments),
197\f[C]microtype\f[R] (for better spacing adjustments), \f[C]parskip\f[R]
198(for better inter-paragraph spaces), \f[C]xurl\f[R] (for better line
199breaks in URLs), \f[C]bookmark\f[R] (for better PDF bookmarks), and
200\f[C]footnotehyper\f[R] or \f[C]footnote\f[R] (to allow footnotes in
202.SS Reading from the Web
204Instead of an input file, an absolute URI may be given.
205In this case pandoc will fetch the content using HTTP:
209pandoc -f html -t markdown https://www.fsf.org
213It is possible to supply a custom User-Agent string or other header when
214requesting a document from a URL:
218pandoc -f html -t markdown --request-header User-Agent:\[dq]Mozilla/5.0\[dq] \[rs]
225\f[B]\f[CB]-f\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-r\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--from=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--read=\f[B]\f[R]\f[I]FORMAT\f[R]
227\f[I]FORMAT\f[R] can be:
230\f[C]commonmark\f[R] (CommonMark Markdown)
232\f[C]creole\f[R] (Creole 1.0)
234\f[C]csv\f[R] (CSV table)
236\f[C]docbook\f[R] (DocBook)
238\f[C]docx\f[R] (Word docx)
240\f[C]dokuwiki\f[R] (DokuWiki markup)
244\f[C]fb2\f[R] (FictionBook2 e-book)
246\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
247accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
248if you need extensions not supported in \f[C]gfm\f[R].
250\f[C]haddock\f[R] (Haddock markup)
254\f[C]ipynb\f[R] (Jupyter notebook)
256\f[C]jats\f[R] (JATS XML)
258\f[C]jira\f[R] (Jira/Confluence wiki markup)
260\f[C]json\f[R] (JSON version of native AST)
262\f[C]latex\f[R] (LaTeX)
264\f[C]markdown\f[R] (Pandoc\[aq]s Markdown)
266\f[C]markdown_mmd\f[R] (MultiMarkdown)
268\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
270\f[C]markdown_strict\f[R] (original unextended Markdown)
272\f[C]mediawiki\f[R] (MediaWiki markup)
274\f[C]man\f[R] (roff man)
278\f[C]native\f[R] (native Haskell)
284\f[C]org\f[R] (Emacs Org mode)
286\f[C]rst\f[R] (reStructuredText)
288\f[C]t2t\f[R] (txt2tags)
290\f[C]textile\f[R] (Textile)
292\f[C]tikiwiki\f[R] (TikiWiki markup)
294\f[C]twiki\f[R] (TWiki markup)
296\f[C]vimwiki\f[R] (Vimwiki)
298Extensions can be individually enabled or disabled by appending
299\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
300See Extensions below, for a list of extensions and their names.
301See \f[C]--list-input-formats\f[R] and \f[C]--list-extensions\f[R],
305\f[B]\f[CB]-t\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-w\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--to=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--write=\f[B]\f[R]\f[I]FORMAT\f[R]
306Specify output format.
307\f[I]FORMAT\f[R] can be:
310\f[C]asciidoc\f[R] (AsciiDoc) or \f[C]asciidoctor\f[R] (AsciiDoctor)
312\f[C]beamer\f[R] (LaTeX beamer slide show)
314\f[C]commonmark\f[R] (CommonMark Markdown)
316\f[C]context\f[R] (ConTeXt)
318\f[C]docbook\f[R] or \f[C]docbook4\f[R] (DocBook 4)
320\f[C]docbook5\f[R] (DocBook 5)
322\f[C]docx\f[R] (Word docx)
324\f[C]dokuwiki\f[R] (DokuWiki markup)
326\f[C]epub\f[R] or \f[C]epub3\f[R] (EPUB v3 book)
328\f[C]epub2\f[R] (EPUB v2)
330\f[C]fb2\f[R] (FictionBook2 e-book)
332\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
333accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
334if you need extensions not supported in \f[C]gfm\f[R].
336\f[C]haddock\f[R] (Haddock markup)
338\f[C]html\f[R] or \f[C]html5\f[R] (HTML, i.e.
339HTML5/XHTML polyglot markup)
341\f[C]html4\f[R] (XHTML 1.0 Transitional)
343\f[C]icml\f[R] (InDesign ICML)
345\f[C]ipynb\f[R] (Jupyter notebook)
347\f[C]jats_archiving\f[R] (JATS XML, Archiving and Interchange Tag Set)
349\f[C]jats_articleauthoring\f[R] (JATS XML, Article Authoring Tag Set)
351\f[C]jats_publishing\f[R] (JATS XML, Journal Publishing Tag Set)
353\f[C]jats\f[R] (alias for \f[C]jats_archiving\f[R])
355\f[C]jira\f[R] (Jira/Confluence wiki markup)
357\f[C]json\f[R] (JSON version of native AST)
359\f[C]latex\f[R] (LaTeX)
361\f[C]man\f[R] (roff man)
363\f[C]markdown\f[R] (Pandoc\[aq]s Markdown)
365\f[C]markdown_mmd\f[R] (MultiMarkdown)
367\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
369\f[C]markdown_strict\f[R] (original unextended Markdown)
371\f[C]mediawiki\f[R] (MediaWiki markup)
373\f[C]ms\f[R] (roff ms)
375\f[C]muse\f[R] (Muse),
377\f[C]native\f[R] (native Haskell),
379\f[C]odt\f[R] (OpenOffice text document)
383\f[C]opendocument\f[R] (OpenDocument)
385\f[C]org\f[R] (Emacs Org mode)
389\f[C]plain\f[R] (plain text),
391\f[C]pptx\f[R] (PowerPoint slide show)
393\f[C]rst\f[R] (reStructuredText)
395\f[C]rtf\f[R] (Rich Text Format)
397\f[C]texinfo\f[R] (GNU Texinfo)
399\f[C]textile\f[R] (Textile)
401\f[C]slideous\f[R] (Slideous HTML and JavaScript slide show)
403\f[C]slidy\f[R] (Slidy HTML and JavaScript slide show)
405\f[C]dzslides\f[R] (DZSlides HTML5 + JavaScript slide show),
407\f[C]revealjs\f[R] (reveal.js HTML5 + JavaScript slide show)
409\f[C]s5\f[R] (S5 HTML and JavaScript slide show)
411\f[C]tei\f[R] (TEI Simple)
413\f[C]xwiki\f[R] (XWiki markup)
415\f[C]zimwiki\f[R] (ZimWiki markup)
417the path of a custom Lua writer, see Custom writers below
419Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and
420\f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless
421forced with \f[C]-o -\f[R].
423Extensions can be individually enabled or disabled by appending
424\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
425See Extensions below, for a list of extensions and their names.
426See \f[C]--list-output-formats\f[R] and \f[C]--list-extensions\f[R],
430\f[B]\f[CB]-o\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--output=\f[B]\f[R]\f[I]FILE\f[R]
431Write output to \f[I]FILE\f[R] instead of \f[I]stdout\f[R].
432If \f[I]FILE\f[R] is \f[C]-\f[R], output will go to \f[I]stdout\f[R],
433even if a non-textual format (\f[C]docx\f[R], \f[C]odt\f[R],
434\f[C]epub2\f[R], \f[C]epub3\f[R]) is specified.
436\f[B]\f[CB]--data-dir=\f[B]\f[R]\f[I]DIRECTORY\f[R]
437Specify the user data directory to search for pandoc data files.
438If this option is not specified, the default user data directory will be
440On *nix and macOS systems this will be the \f[C]pandoc\f[R] subdirectory
441of the XDG data directory (by default, \f[C]$HOME/.local/share\f[R],
442overridable by setting the \f[C]XDG_DATA_HOME\f[R] environment
444If that directory does not exist, \f[C]$HOME/.pandoc\f[R] will be used
445(for backwards compatibility).
446In Windows the default user data directory is
447\f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]pandoc\f[R].
448You can find the default user data directory on your system by looking
449at the output of \f[C]pandoc --version\f[R].
450A \f[C]reference.odt\f[R], \f[C]reference.docx\f[R], \f[C]epub.css\f[R],
451\f[C]templates\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R], or
452\f[C]s5\f[R] directory placed in this directory will override
453pandoc\[aq]s normal defaults.
455\f[B]\f[CB]-d\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--defaults=\f[B]\f[R]\f[I]FILE\f[R]
456Specify a set of default option settings.
457\f[I]FILE\f[R] is a YAML file whose fields correspond to command-line
459All options for document conversion, including input and output files,
460can be set using a defaults file.
461The file will be searched for first in the working directory, and then
462in the \f[C]defaults\f[R] subdirectory of the user data directory (see
463\f[C]--data-dir\f[R]).
464The \f[C].yaml\f[R] extension may be omitted.
465See the section Default files for more information on the file format.
466Settings from the defaults file may be overridden or extended by
467subsequent options on the command line.
469\f[B]\f[CB]--bash-completion\f[B]\f[R]
470Generate a bash completion script.
471To enable bash completion with pandoc, add this to your
477eval \[dq]$(pandoc --bash-completion)\[dq]
482\f[B]\f[CB]--verbose\f[B]\f[R]
483Give verbose debugging output.
485\f[B]\f[CB]--quiet\f[B]\f[R]
486Suppress warning messages.
488\f[B]\f[CB]--fail-if-warnings\f[B]\f[R]
489Exit with error status if there are any warnings.
491\f[B]\f[CB]--log=\f[B]\f[R]\f[I]FILE\f[R]
492Write log messages in machine-readable JSON format to \f[I]FILE\f[R].
493All messages above DEBUG level will be written, regardless of verbosity
494settings (\f[C]--verbose\f[R], \f[C]--quiet\f[R]).
496\f[B]\f[CB]--list-input-formats\f[B]\f[R]
497List supported input formats, one per line.
499\f[B]\f[CB]--list-output-formats\f[B]\f[R]
500List supported output formats, one per line.
502\f[B]\f[CB]--list-extensions\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]FORMAT\f[R]]
503List supported extensions for \f[I]FORMAT\f[R], one per line, preceded
504by a \f[C]+\f[R] or \f[C]-\f[R] indicating whether it is enabled by
505default in \f[I]FORMAT\f[R].
506If \f[I]FORMAT\f[R] is not specified, defaults for pandoc\[aq]s Markdown
509\f[B]\f[CB]--list-highlight-languages\f[B]\f[R]
510List supported languages for syntax highlighting, one per line.
512\f[B]\f[CB]--list-highlight-styles\f[B]\f[R]
513List supported styles for syntax highlighting, one per line.
514See \f[C]--highlight-style\f[R].
516\f[B]\f[CB]-v\f[B]\f[R], \f[B]\f[CB]--version\f[B]\f[R]
519\f[B]\f[CB]-h\f[B]\f[R], \f[B]\f[CB]--help\f[B]\f[R]
523\f[B]\f[CB]--shift-heading-level-by=\f[B]\f[R]\f[I]NUMBER\f[R]
524Shift heading levels by a positive or negative integer.
525For example, with \f[C]--shift-heading-level-by=-1\f[R], level 2
526headings become level 1 headings, and level 3 headings become level 2
528Headings cannot have a level less than 1, so a heading that would be
529shifted below level 1 becomes a regular paragraph.
530Exception: with a shift of -N, a level-N heading at the beginning of the
531document replaces the metadata title.
532\f[C]--shift-heading-level-by=-1\f[R] is a good choice when converting
533HTML or Markdown documents that use an initial level-1 heading for the
534document title and level-2+ headings for sections.
535\f[C]--shift-heading-level-by=1\f[R] may be a good choice for converting
536Markdown documents that use level-1 headings for sections to HTML, since
537pandoc uses a level-1 heading to render the document title.
539\f[B]\f[CB]--base-header-level=\f[B]\f[R]\f[I]NUMBER\f[R]
540\f[I]Deprecated. Use \f[CI]--shift-heading-level-by\f[I]=X instead,
541where X = NUMBER - 1.\f[R] Specify the base level for headings (defaults
544\f[B]\f[CB]--strip-empty-paragraphs\f[B]\f[R]
545\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension
546instead.\f[R] Ignore paragraphs with no content.
547This option is useful for converting word processing documents where
548users have used empty paragraphs to create inter-paragraph space.
550\f[B]\f[CB]--indented-code-classes=\f[B]\f[R]\f[I]CLASSES\f[R]
551Specify classes to use for indented code blocks--for example,
552\f[C]perl,numberLines\f[R] or \f[C]haskell\f[R].
553Multiple classes may be separated by spaces or commas.
555\f[B]\f[CB]--default-image-extension=\f[B]\f[R]\f[I]EXTENSION\f[R]
556Specify a default extension to use when image paths/URLs have no
558This allows you to use the same source for formats that require
559different kinds of images.
560Currently this option only affects the Markdown and LaTeX readers.
562\f[B]\f[CB]--file-scope\f[B]\f[R]
563Parse each file individually before combining for multifile documents.
564This will allow footnotes in different files with the same identifiers
566If this option is set, footnotes and links will not work across files.
567Reading binary files (docx, odt, epub) implies \f[C]--file-scope\f[R].
569\f[B]\f[CB]-F\f[B]\f[R] \f[I]PROGRAM\f[R], \f[B]\f[CB]--filter=\f[B]\f[R]\f[I]PROGRAM\f[R]
570Specify an executable to be used as a filter transforming the pandoc AST
571after the input is parsed and before the output is written.
572The executable should read JSON from stdin and write JSON to stdout.
573The JSON must be formatted like pandoc\[aq]s own JSON input and output.
574The name of the output format will be passed to the filter as the first
581pandoc --filter ./caps.py -t latex
589pandoc -t json | ./caps.py latex | pandoc -f json -t latex
593The latter form may be useful for debugging filters.
595Filters may be written in any language.
596\f[C]Text.Pandoc.JSON\f[R] exports \f[C]toJSONFilter\f[R] to facilitate
597writing filters in Haskell.
598Those who would prefer to write filters in python can use the module
599\f[C]pandocfilters\f[R], installable from PyPI.
600There are also pandoc filter libraries in PHP, perl, and
603In order of preference, pandoc will look for filters in
605a specified full or relative path (executable or non-executable)
607\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
608\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
611\f[C]$PATH\f[R] (executable only)
613Filters and Lua-filters are applied in the order specified on the
617\f[B]\f[CB]-L\f[B]\f[R] \f[I]SCRIPT\f[R], \f[B]\f[CB]--lua-filter=\f[B]\f[R]\f[I]SCRIPT\f[R]
618Transform the document in a similar fashion as JSON filters (see
619\f[C]--filter\f[R]), but use pandoc\[aq]s build-in Lua filtering system.
620The given Lua script is expected to return a list of Lua filters which
621will be applied in order.
622Each Lua filter must contain element-transforming functions indexed by
623the name of the AST element on which the filter function should be
627The \f[C]pandoc\f[R] Lua module provides helper functions for element
629It is always loaded into the script\[aq]s Lua environment.
631The following is an example Lua script for macro-expansion:
635function expand_hello_world(inline)
636 if inline.c == \[aq]{{helloworld}}\[aq] then
637 return pandoc.Emph{ pandoc.Str \[dq]Hello, World\[dq] }
643return {{Str = expand_hello_world}}
647In order of preference, pandoc will look for Lua filters in
649a specified full or relative path (executable or non-executable)
651\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
652\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
656\f[B]\f[CB]-M\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--metadata=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
657Set the metadata field \f[I]KEY\f[R] to the value \f[I]VAL\f[R].
658A value specified on the command line overrides a value specified in the
659document using YAML metadata blocks.
660Values will be parsed as YAML boolean or string values.
661If no value is specified, the value will be treated as Boolean true.
662Like \f[C]--variable\f[R], \f[C]--metadata\f[R] causes template
664But unlike \f[C]--variable\f[R], \f[C]--metadata\f[R] affects the
665metadata of the underlying document (which is accessible from filters
666and may be printed in some output formats) and metadata values will be
667escaped when inserted into the template.
669\f[B]\f[CB]--metadata-file=\f[B]\f[R]\f[I]FILE\f[R]
670Read metadata from the supplied YAML (or JSON) file.
671This option can be used with every input format, but string scalars in
672the YAML file will always be parsed as Markdown.
673Generally, the input will be handled the same as in YAML metadata
675This option can be used repeatedly to include multiple metadata files;
676values in files specified later on the command line will be preferred
677over those specified in earlier files.
678Metadata values specified inside the document, or by using \f[C]-M\f[R],
679overwrite values specified with this option.
681\f[B]\f[CB]-p\f[B]\f[R], \f[B]\f[CB]--preserve-tabs\f[B]\f[R]
682Preserve tabs instead of converting them to spaces.
683(By default, pandoc converts tabs to spaces before parsing its input.)
684Note that this will only affect tabs in literal code spans and code
686Tabs in regular text are always treated as spaces.
688\f[B]\f[CB]--tab-stop=\f[B]\f[R]\f[I]NUMBER\f[R]
689Specify the number of spaces per tab (default is 4).
691\f[B]\f[CB]--track-changes=accept\f[B]\f[R]|\f[B]\f[CB]reject\f[B]\f[R]|\f[B]\f[CB]all\f[B]\f[R]
692Specifies what to do with insertions, deletions, and comments produced
693by the MS Word \[dq]Track Changes\[dq] feature.
694\f[C]accept\f[R] (the default), inserts all insertions, and ignores all
696\f[C]reject\f[R] inserts all deletions and ignores insertions.
697Both \f[C]accept\f[R] and \f[C]reject\f[R] ignore comments.
698\f[C]all\f[R] puts in insertions, deletions, and comments, wrapped in
699spans with \f[C]insertion\f[R], \f[C]deletion\f[R],
700\f[C]comment-start\f[R], and \f[C]comment-end\f[R] classes,
702The author and time of change is included.
703\f[C]all\f[R] is useful for scripting: only accepting changes from a
704certain reviewer, say, or before a certain date.
705If a paragraph is inserted or deleted, \f[C]track-changes=all\f[R]
706produces a span with the class
707\f[C]paragraph-insertion\f[R]/\f[C]paragraph-deletion\f[R] before the
708affected paragraph break.
709This option only affects the docx reader.
711\f[B]\f[CB]--extract-media=\f[B]\f[R]\f[I]DIR\f[R]
712Extract images and other media contained in or linked from the source
713document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
714the images references in the document so they point to the extracted
716If the source format is a binary container (docx, epub, or odt), the
717media is extracted from the container and the original filenames are
719Otherwise the media is read from the file system or downloaded, and new
720filenames are constructed based on SHA1 hashes of the contents.
722\f[B]\f[CB]--abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
723Specifies a custom abbreviations file, with abbreviations one to a line.
724If this option is not specified, pandoc will read the data file
725\f[C]abbreviations\f[R] from the user data directory or fall back on a
727To see the system default, use
728\f[C]pandoc --print-default-data-file=abbreviations\f[R].
729The only use pandoc makes of this list is in the Markdown reader.
730Strings ending in a period that are found in this list will be followed
731by a nonbreaking space, so that the period will not produce
732sentence-ending space in formats like LaTeX.
733.SS General writer options
735\f[B]\f[CB]-s\f[B]\f[R], \f[B]\f[CB]--standalone\f[B]\f[R]
736Produce output with an appropriate header and footer (e.g.
737a standalone HTML, LaTeX, TEI, or RTF file, not a fragment).
738This option is set automatically for \f[C]pdf\f[R], \f[C]epub\f[R],
739\f[C]epub3\f[R], \f[C]fb2\f[R], \f[C]docx\f[R], and \f[C]odt\f[R]
741For \f[C]native\f[R] output, this option causes metadata to be included;
742otherwise, metadata is suppressed.
744\f[B]\f[CB]--template=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
745Use the specified file as a custom template for the generated document.
746Implies \f[C]--standalone\f[R].
747See Templates, below, for a description of template syntax.
748If no extension is specified, an extension corresponding to the writer
749will be added, so that \f[C]--template=special\f[R] looks for
750\f[C]special.html\f[R] for HTML output.
751If the template is not found, pandoc will search for it in the
752\f[C]templates\f[R] subdirectory of the user data directory (see
753\f[C]--data-dir\f[R]).
754If this option is not used, a default template appropriate for the
755output format will be used (see \f[C]-D/--print-default-template\f[R]).
757\f[B]\f[CB]-V\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--variable=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
758Set the template variable \f[I]KEY\f[R] to the value \f[I]VAL\f[R] when
759rendering the document in standalone mode.
760If no \f[I]VAL\f[R] is specified, the key will be given the value
763\f[B]\f[CB]-D\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--print-default-template=\f[B]\f[R]\f[I]FORMAT\f[R]
764Print the system default template for an output \f[I]FORMAT\f[R].
765(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates
766in the user data directory are ignored.
767This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
768output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
769\f[C]--print-default-template\f[R] on the command line.
772Note that some of the default templates use partials, for example
773\f[C]styles.html\f[R].
774To print the partials, use \f[C]--print-default-data-file\f[R]: for
775example, \f[C]--print-default-data-file=templates/styles.html\f[R].
778\f[B]\f[CB]--print-default-data-file=\f[B]\f[R]\f[I]FILE\f[R]
779Print a system default data file.
780Files in the user data directory are ignored.
781This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
782output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
783\f[C]--print-default-data-file\f[R] on the command line.
785\f[B]\f[CB]--eol=crlf\f[B]\f[R]|\f[B]\f[CB]lf\f[B]\f[R]|\f[B]\f[CB]native\f[B]\f[R]
786Manually specify line endings: \f[C]crlf\f[R] (Windows), \f[C]lf\f[R]
787(macOS/Linux/UNIX), or \f[C]native\f[R] (line endings appropriate to the
788OS on which pandoc is being run).
789The default is \f[C]native\f[R].
791\f[B]\f[CB]--dpi\f[B]\f[R]=\f[I]NUMBER\f[R]
792Specify the default dpi (dots per inch) value for conversion from pixels
793to inch/centimeters and vice versa.
794(Technically, the correct term would be ppi: pixels per inch.) The
796When images contain information about dpi internally, the encoded value
797is used instead of the default specified by this option.
799\f[B]\f[CB]--wrap=auto\f[B]\f[R]|\f[B]\f[CB]none\f[B]\f[R]|\f[B]\f[CB]preserve\f[B]\f[R]
800Determine how text is wrapped in the output (the source code, not the
802With \f[C]auto\f[R] (the default), pandoc will attempt to wrap lines to
803the column width specified by \f[C]--columns\f[R] (default 72).
804With \f[C]none\f[R], pandoc will not wrap lines at all.
805With \f[C]preserve\f[R], pandoc will attempt to preserve the wrapping
806from the source document (that is, where there are nonsemantic newlines
807in the source, there will be nonsemantic newlines in the output as
809Automatic wrapping does not currently work in HTML output.
810In \f[C]ipynb\f[R] output, this option affects wrapping of the contents
813\f[B]\f[CB]--columns=\f[B]\f[R]\f[I]NUMBER\f[R]
814Specify length of lines in characters.
815This affects text wrapping in the generated source code (see
817It also affects calculation of column widths for plain text tables (see
820\f[B]\f[CB]--toc\f[B]\f[R], \f[B]\f[CB]--table-of-contents\f[B]\f[R]
821Include an automatically generated table of contents (or, in the case of
822\f[C]latex\f[R], \f[C]context\f[R], \f[C]docx\f[R], \f[C]odt\f[R],
823\f[C]opendocument\f[R], \f[C]rst\f[R], or \f[C]ms\f[R], an instruction
824to create one) in the output document.
825This option has no effect unless \f[C]-s/--standalone\f[R] is used, and
826it has no effect on \f[C]man\f[R], \f[C]docbook4\f[R],
827\f[C]docbook5\f[R], or \f[C]jats\f[R] output.
830Note that if you are producing a PDF via \f[C]ms\f[R], the table of
831contents will appear at the beginning of the document, before the title.
832If you would prefer it to be at the end of the document, use the option
833\f[C]--pdf-engine-opt=--no-toc-relocation\f[R].
836\f[B]\f[CB]--toc-depth=\f[B]\f[R]\f[I]NUMBER\f[R]
837Specify the number of section levels to include in the table of
839The default is 3 (which means that level-1, 2, and 3 headings will be
840listed in the contents).
842\f[B]\f[CB]--strip-comments\f[B]\f[R]
843Strip out HTML comments in the Markdown or Textile source, rather than
844passing them on to Markdown, Textile or HTML output as raw HTML.
845This does not apply to HTML comments inside raw HTML blocks when the
846\f[C]markdown_in_html_blocks\f[R] extension is not set.
848\f[B]\f[CB]--no-highlight\f[B]\f[R]
849Disables syntax highlighting for code blocks and inlines, even when a
850language attribute is given.
852\f[B]\f[CB]--highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
853Specifies the coloring style to be used in highlighted source code.
854Options are \f[C]pygments\f[R] (the default), \f[C]kate\f[R],
855\f[C]monochrome\f[R], \f[C]breezeDark\f[R], \f[C]espresso\f[R],
856\f[C]zenburn\f[R], \f[C]haddock\f[R], and \f[C]tango\f[R].
857For more information on syntax highlighting in pandoc, see Syntax
859See also \f[C]--list-highlight-styles\f[R].
862Instead of a \f[I]STYLE\f[R] name, a JSON file with extension
863\f[C].theme\f[R] may be supplied.
864This will be parsed as a KDE syntax highlighting theme and (if valid)
865used as the highlighting style.
867To generate the JSON version of an existing style, use
868\f[C]--print-highlight-style\f[R].
871\f[B]\f[CB]--print-highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
872Prints a JSON version of a highlighting style, which can be modified,
873saved with a \f[C].theme\f[R] extension, and used with
874\f[C]--highlight-style\f[R].
875This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
876output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
877\f[C]--print-highlight-style\f[R] on the command line.
879\f[B]\f[CB]--syntax-definition=\f[B]\f[R]\f[I]FILE\f[R]
880Instructs pandoc to load a KDE XML syntax definition file, which will be
881used for syntax highlighting of appropriately marked code blocks.
882This can be used to add support for new languages or to use altered
883syntax definitions for existing languages.
884This option may be repeated to add multiple syntax definitions.
886\f[B]\f[CB]-H\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-in-header=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
887Include contents of \f[I]FILE\f[R], verbatim, at the end of the header.
888This can be used, for example, to include special CSS or JavaScript in
890This option can be used repeatedly to include multiple files in the
892They will be included in the order specified.
893Implies \f[C]--standalone\f[R].
895\f[B]\f[CB]-B\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-before-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
896Include contents of \f[I]FILE\f[R], verbatim, at the beginning of the
898after the \f[C]<body>\f[R] tag in HTML, or the
899\f[C]\[rs]begin{document}\f[R] command in LaTeX).
900This can be used to include navigation bars or banners in HTML
902This option can be used repeatedly to include multiple files.
903They will be included in the order specified.
904Implies \f[C]--standalone\f[R].
906\f[B]\f[CB]-A\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-after-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
907Include contents of \f[I]FILE\f[R], verbatim, at the end of the document
908body (before the \f[C]</body>\f[R] tag in HTML, or the
909\f[C]\[rs]end{document}\f[R] command in LaTeX).
910This option can be used repeatedly to include multiple files.
911They will be included in the order specified.
912Implies \f[C]--standalone\f[R].
914\f[B]\f[CB]--resource-path=\f[B]\f[R]\f[I]SEARCHPATH\f[R]
915List of paths to search for images and other resources.
916The paths should be separated by \f[C]:\f[R] on Linux, UNIX, and macOS
917systems, and by \f[C];\f[R] on Windows.
918If \f[C]--resource-path\f[R] is not specified, the default resource path
919is the working directory.
920Note that, if \f[C]--resource-path\f[R] is specified, the working
921directory must be explicitly listed or it will not be searched.
922For example: \f[C]--resource-path=.:test\f[R] will search the working
923directory and the \f[C]test\f[R] subdirectory, in that order.
926\f[C]--resource-path\f[R] only has an effect if (a) the output format
927embeds images (for example, \f[C]docx\f[R], \f[C]pdf\f[R], or
928\f[C]html\f[R] with \f[C]--self-contained\f[R]) or (b) it is used
929together with \f[C]--extract-media\f[R].
932\f[B]\f[CB]--request-header=\f[B]\f[R]\f[I]NAME\f[R]\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]
933Set the request header \f[I]NAME\f[R] to the value \f[I]VAL\f[R] when
934making HTTP requests (for example, when a URL is given on the command
935line, or when resources used in a document must be downloaded).
936If you\[aq]re behind a proxy, you also need to set the environment
937variable \f[C]http_proxy\f[R] to \f[C]http://...\f[R].
939\[ga]--no-check-certificate
940Disable the certificate verification to allow access to unsecure HTTP
941resources (for example when the certificate is no longer valid or self
943.SS Options affecting specific writers
945\f[B]\f[CB]--self-contained\f[B]\f[R]
946Produce a standalone HTML file with no external dependencies, using
947\f[C]data:\f[R] URIs to incorporate the contents of linked scripts,
948stylesheets, images, and videos.
949Implies \f[C]--standalone\f[R].
950The resulting file should be \[dq]self-contained,\[dq] in the sense that
951it needs no external files and no net access to be displayed properly by
953This option works only with HTML output formats, including
954\f[C]html4\f[R], \f[C]html5\f[R], \f[C]html+lhs\f[R],
955\f[C]html5+lhs\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
956\f[C]dzslides\f[R], and \f[C]revealjs\f[R].
957Scripts, images, and stylesheets at absolute URLs will be downloaded;
958those at relative URLs will be sought relative to the working directory
959(if the first source file is local) or relative to the base URL (if the
960first source file is remote).
961Elements with the attribute \f[C]data-external=\[dq]1\[dq]\f[R] will be
962left alone; the documents they link to will not be incorporated in the
964Limitation: resources that are loaded dynamically through JavaScript
965cannot be incorporated; as a result, \f[C]--self-contained\f[R] does not
966work with \f[C]--mathjax\f[R], and some advanced features (e.g.
967zoom or speaker notes) may not work in an offline
968\[dq]self-contained\[dq] \f[C]reveal.js\f[R] slide show.
970\f[B]\f[CB]--html-q-tags\f[B]\f[R]
971Use \f[C]<q>\f[R] tags for quotes in HTML.
973\f[B]\f[CB]--ascii\f[B]\f[R]
974Use only ASCII characters in output.
975Currently supported for XML and HTML formats (which use entities instead
976of UTF-8 when this option is selected), CommonMark, gfm, and Markdown
977(which use entities), roff ms (which use hexadecimal escapes), and to a
978limited degree LaTeX (which uses standard commands for accented
979characters when possible).
980roff man output uses ASCII by default.
982\f[B]\f[CB]--reference-links\f[B]\f[R]
983Use reference-style links, rather than inline links, in writing Markdown
985By default inline links are used.
986The placement of link references is affected by the
987\f[C]--reference-location\f[R] option.
989\f[B]\f[CB]--reference-location = block\f[B]\f[R]|\f[B]\f[CB]section\f[B]\f[R]|\f[B]\f[CB]document\f[B]\f[R]
990Specify whether footnotes (and references, if \f[C]reference-links\f[R]
991is set) are placed at the end of the current (top-level) block, the
992current section, or the document.
993The default is \f[C]document\f[R].
994Currently only affects the markdown writer.
996\f[B]\f[CB]--atx-headers\f[B]\f[R]
997Use ATX-style headings in Markdown output.
998The default is to use setext-style headings for levels 1 to 2, and then
1000(Note: for \f[C]gfm\f[R] output, ATX headings are always used.) This
1001option also affects markdown cells in \f[C]ipynb\f[R] output.
1003\f[B]\f[CB]--top-level-division=[default|section|chapter|part]\f[B]\f[R]
1004Treat top-level headings as the given division type in LaTeX, ConTeXt,
1005DocBook, and TEI output.
1006The hierarchy order is part, chapter, then section; all headings are
1007shifted such that the top-level heading becomes the specified type.
1008The default behavior is to determine the best division type via
1009heuristics: unless other conditions apply, \f[C]section\f[R] is chosen.
1010When the \f[C]documentclass\f[R] variable is set to \f[C]report\f[R],
1011\f[C]book\f[R], or \f[C]memoir\f[R] (unless the \f[C]article\f[R] option
1012is specified), \f[C]chapter\f[R] is implied as the setting for this
1014If \f[C]beamer\f[R] is the output format, specifying either
1015\f[C]chapter\f[R] or \f[C]part\f[R] will cause top-level headings to
1016become \f[C]\[rs]part{..}\f[R], while second-level headings remain as
1019\f[B]\f[CB]-N\f[B]\f[R], \f[B]\f[CB]--number-sections\f[B]\f[R]
1020Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
1021By default, sections are not numbered.
1022Sections with class \f[C]unnumbered\f[R] will never be numbered, even if
1023\f[C]--number-sections\f[R] is specified.
1025\f[B]\f[CB]--number-offset=\f[B]\f[R]\f[I]NUMBER\f[R][\f[B]\f[CB],\f[B]\f[R]\f[I]NUMBER\f[R]\f[B]\f[CB],\f[B]\f[R]\f[I]...\f[R]]
1026Offset for section headings in HTML output (ignored in other output
1028The first number is added to the section number for top-level headings,
1029the second for second-level headings, and so on.
1030So, for example, if you want the first top-level heading in your
1031document to be numbered \[dq]6\[dq], specify
1032\f[C]--number-offset=5\f[R].
1033If your document starts with a level-2 heading which you want to be
1034numbered \[dq]1.5\[dq], specify \f[C]--number-offset=1,4\f[R].
1035Offsets are 0 by default.
1036Implies \f[C]--number-sections\f[R].
1038\f[B]\f[CB]--listings\f[B]\f[R]
1039Use the \f[C]listings\f[R] package for LaTeX code blocks.
1040The package does not support multi-byte encoding for source code.
1041To handle UTF-8 you would need to use a custom template.
1042This issue is fully documented here: Encoding issue with the listings
1045\f[B]\f[CB]-i\f[B]\f[R], \f[B]\f[CB]--incremental\f[B]\f[R]
1046Make list items in slide shows display incrementally (one by one).
1047The default is for lists to be displayed all at once.
1049\f[B]\f[CB]--slide-level=\f[B]\f[R]\f[I]NUMBER\f[R]
1050Specifies that headings with the specified level create slides (for
1051\f[C]beamer\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
1053Headings above this level in the hierarchy are used to divide the slide
1054show into sections; headings below this level create subheads within a
1056Note that content that is not contained under slide-level headings will
1057not appear in the slide show.
1058The default is to set the slide level based on the contents of the
1059document; see Structuring the slide show.
1061\f[B]\f[CB]--section-divs\f[B]\f[R]
1062Wrap sections in \f[C]<section>\f[R] tags (or \f[C]<div>\f[R] tags for
1063\f[C]html4\f[R]), and attach identifiers to the enclosing
1064\f[C]<section>\f[R] (or \f[C]<div>\f[R]) rather than the heading itself.
1065See Heading identifiers, below.
1067\f[B]\f[CB]--email-obfuscation=none\f[B]\f[R]|\f[B]\f[CB]javascript\f[B]\f[R]|\f[B]\f[CB]references\f[B]\f[R]
1068Specify a method for obfuscating \f[C]mailto:\f[R] links in HTML
1070\f[C]none\f[R] leaves \f[C]mailto:\f[R] links as they are.
1071\f[C]javascript\f[R] obfuscates them using JavaScript.
1072\f[C]references\f[R] obfuscates them by printing their letters as
1073decimal or hexadecimal character references.
1074The default is \f[C]none\f[R].
1076\f[B]\f[CB]--id-prefix=\f[B]\f[R]\f[I]STRING\f[R]
1077Specify a prefix to be added to all identifiers and internal links in
1078HTML and DocBook output, and to footnote numbers in Markdown and Haddock
1080This is useful for preventing duplicate identifiers when generating
1081fragments to be included in other pages.
1083\f[B]\f[CB]-T\f[B]\f[R] \f[I]STRING\f[R], \f[B]\f[CB]--title-prefix=\f[B]\f[R]\f[I]STRING\f[R]
1084Specify \f[I]STRING\f[R] as a prefix at the beginning of the title that
1085appears in the HTML header (but not in the title as it appears at the
1086beginning of the HTML body).
1087Implies \f[C]--standalone\f[R].
1089\f[B]\f[CB]-c\f[B]\f[R] \f[I]URL\f[R], \f[B]\f[CB]--css=\f[B]\f[R]\f[I]URL\f[R]
1090Link to a CSS style sheet.
1091This option can be used repeatedly to include multiple files.
1092They will be included in the order specified.
1095A stylesheet is required for generating EPUB.
1096If none is provided using this option (or the \f[C]css\f[R] or
1097\f[C]stylesheet\f[R] metadata fields), pandoc will look for a file
1098\f[C]epub.css\f[R] in the user data directory (see
1099\f[C]--data-dir\f[R]).
1100If it is not found there, sensible defaults will be used.
1103\f[B]\f[CB]--reference-doc=\f[B]\f[R]\f[I]FILE\f[R]
1104Use the specified file as a style reference in producing a docx or ODT
1109For best results, the reference docx should be a modified version of a
1110docx file produced using pandoc.
1111The contents of the reference docx are ignored, but its stylesheets and
1112document properties (including margins, page size, header, and footer)
1113are used in the new docx.
1114If no reference docx is specified on the command line, pandoc will look
1115for a file \f[C]reference.docx\f[R] in the user data directory (see
1116\f[C]--data-dir\f[R]).
1117If this is not found either, sensible defaults will be used.
1120To produce a custom \f[C]reference.docx\f[R], first get a copy of the
1121default \f[C]reference.docx\f[R]:
1122\f[C]pandoc -o custom-reference.docx --print-default-data-file reference.docx\f[R].
1123Then open \f[C]custom-reference.docx\f[R] in Word, modify the styles as
1124you wish, and save the file.
1125For best results, do not make changes to this file other than modifying
1126the styles used by pandoc:
1190Default Paragraph Font
1206For best results, the reference ODT should be a modified version of an
1207ODT produced using pandoc.
1208The contents of the reference ODT are ignored, but its stylesheets are
1210If no reference ODT is specified on the command line, pandoc will look
1211for a file \f[C]reference.odt\f[R] in the user data directory (see
1212\f[C]--data-dir\f[R]).
1213If this is not found either, sensible defaults will be used.
1216To produce a custom \f[C]reference.odt\f[R], first get a copy of the
1217default \f[C]reference.odt\f[R]:
1218\f[C]pandoc -o custom-reference.odt --print-default-data-file reference.odt\f[R].
1219Then open \f[C]custom-reference.odt\f[R] in LibreOffice, modify the
1220styles as you wish, and save the file.
1224Templates included with Microsoft PowerPoint 2013 (either with
1225\f[C].pptx\f[R] or \f[C].potx\f[R] extension) are known to work, as are
1226most templates derived from these.
1229The specific requirement is that the template should begin with the
1230following first four layouts:
1240All templates included with a recent version of MS PowerPoint will fit
1242(You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to
1245You can also modify the default \f[C]reference.pptx\f[R]: first run
1246\f[C]pandoc -o custom-reference.pptx --print-default-data-file reference.pptx\f[R],
1247and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc
1248will use the first four layout slides, as mentioned above).
1252\f[B]\f[CB]--epub-cover-image=\f[B]\f[R]\f[I]FILE\f[R]
1253Use the specified image as the EPUB cover.
1254It is recommended that the image be less than 1000px in width and
1256Note that in a Markdown source document you can also specify
1257\f[C]cover-image\f[R] in a YAML metadata block (see EPUB Metadata,
1260\f[B]\f[CB]--epub-metadata=\f[B]\f[R]\f[I]FILE\f[R]
1261Look in the specified XML file for metadata for the EPUB.
1262The file should contain a series of Dublin Core elements.
1268 <dc:rights>Creative Commons</dc:rights>
1269 <dc:language>es-AR</dc:language>
1273By default, pandoc will include the following metadata elements:
1274\f[C]<dc:title>\f[R] (from the document title), \f[C]<dc:creator>\f[R]
1275(from the document authors), \f[C]<dc:date>\f[R] (from the document
1276date, which should be in ISO 8601 format), \f[C]<dc:language>\f[R] (from
1277the \f[C]lang\f[R] variable, or, if is not set, the locale), and
1278\f[C]<dc:identifier id=\[dq]BookId\[dq]>\f[R] (a randomly generated
1280Any of these may be overridden by elements in the metadata file.
1282Note: if the source document is Markdown, a YAML metadata block in the
1283document can be used instead.
1284See below under EPUB Metadata.
1287\f[B]\f[CB]--epub-embed-font=\f[B]\f[R]\f[I]FILE\f[R]
1288Embed the specified font in the EPUB.
1289This option can be repeated to embed multiple fonts.
1290Wildcards can also be used: for example, \f[C]DejaVuSans-*.ttf\f[R].
1291However, if you use wildcards on the command line, be sure to escape
1292them or put the whole filename in single quotes, to prevent them from
1293being interpreted by the shell.
1294To use the embedded fonts, you will need to add declarations like the
1295following to your CSS (see \f[C]--css\f[R]):
1301font-family: DejaVuSans;
1304src:url(\[dq]DejaVuSans-Regular.ttf\[dq]);
1307font-family: DejaVuSans;
1310src:url(\[dq]DejaVuSans-Bold.ttf\[dq]);
1313font-family: DejaVuSans;
1316src:url(\[dq]DejaVuSans-Oblique.ttf\[dq]);
1319font-family: DejaVuSans;
1322src:url(\[dq]DejaVuSans-BoldOblique.ttf\[dq]);
1324body { font-family: \[dq]DejaVuSans\[dq]; }
1329\f[B]\f[CB]--epub-chapter-level=\f[B]\f[R]\f[I]NUMBER\f[R]
1330Specify the heading level at which to split the EPUB into separate
1331\[dq]chapter\[dq] files.
1332The default is to split into chapters at level-1 headings.
1333This option only affects the internal composition of the EPUB, not the
1334way chapters and sections are displayed to users.
1335Some readers may be slow if the chapter files are too large, so for
1336large documents with few level-1 headings, one might want to use a
1337chapter level of 2 or 3.
1339\f[B]\f[CB]--epub-subdirectory=\f[B]\f[R]\f[I]DIRNAME\f[R]
1340Specify the subdirectory in the OCF container that is to hold the
1341EPUB-specific contents.
1342The default is \f[C]EPUB\f[R].
1343To put the EPUB contents in the top level, use an empty string.
1345\f[B]\f[CB]--ipynb-output=all|none|best\f[B]\f[R]
1346Determines how ipynb output cells are treated.
1347\f[C]all\f[R] means that all of the data formats included in the
1348original are preserved.
1349\f[C]none\f[R] means that the contents of data cells are omitted.
1350\f[C]best\f[R] causes pandoc to try to pick the richest data block in
1351each output cell that is compatible with the output format.
1352The default is \f[C]best\f[R].
1354\f[B]\f[CB]--pdf-engine=\f[B]\f[R]\f[I]PROGRAM\f[R]
1355Use the specified engine when producing PDF output.
1356Valid values are \f[C]pdflatex\f[R], \f[C]lualatex\f[R],
1357\f[C]xelatex\f[R], \f[C]latexmk\f[R], \f[C]tectonic\f[R],
1358\f[C]wkhtmltopdf\f[R], \f[C]weasyprint\f[R], \f[C]prince\f[R],
1359\f[C]context\f[R], and \f[C]pdfroff\f[R].
1360If the engine is not in your PATH, the full path of the engine may be
1362If this option is not specified, pandoc uses the following defaults
1363depending on the output format specified using \f[C]-t/--to\f[R]:
1366\f[C]-t latex\f[R] or none: \f[C]pdflatex\f[R] (other options:
1367\f[C]xelatex\f[R], \f[C]lualatex\f[R], \f[C]tectonic\f[R],
1370\f[C]-t context\f[R]: \f[C]context\f[R]
1372\f[C]-t html\f[R]: \f[C]wkhtmltopdf\f[R] (other options:
1373\f[C]prince\f[R], \f[C]weasyprint\f[R]; see print-css.rocks for a good
1374introduction to PDF generation from HTML/CSS.)
1376\f[C]-t ms\f[R]: \f[C]pdfroff\f[R]
1379\f[B]\f[CB]--pdf-engine-opt=\f[B]\f[R]\f[I]STRING\f[R]
1380Use the given string as a command-line argument to the
1381\f[C]pdf-engine\f[R].
1382For example, to use a persistent directory \f[C]foo\f[R] for
1383\f[C]latexmk\f[R]\[aq]s auxiliary files, use
1384\f[C]--pdf-engine-opt=-outdir=foo\f[R].
1385Note that no check for duplicate options is done.
1386.SS Citation rendering
1388\f[B]\f[CB]--bibliography=\f[B]\f[R]\f[I]FILE\f[R]
1389Set the \f[C]bibliography\f[R] field in the document\[aq]s metadata to
1390\f[I]FILE\f[R], overriding any value set in the metadata, and process
1391citations using \f[C]pandoc-citeproc\f[R].
1392(This is equivalent to
1393\f[C]--metadata bibliography=FILE --filter pandoc-citeproc\f[R].) If
1394\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] is also supplied,
1395\f[C]pandoc-citeproc\f[R] is not used, making this equivalent to
1396\f[C]--metadata bibliography=FILE\f[R].
1397If you supply this argument multiple times, each \f[I]FILE\f[R] will be
1398added to bibliography.
1400\f[B]\f[CB]--csl=\f[B]\f[R]\f[I]FILE\f[R]
1401Set the \f[C]csl\f[R] field in the document\[aq]s metadata to
1402\f[I]FILE\f[R], overriding any value set in the metadata.
1403(This is equivalent to \f[C]--metadata csl=FILE\f[R].) This option is
1404only relevant with \f[C]pandoc-citeproc\f[R].
1406\f[B]\f[CB]--citation-abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
1407Set the \f[C]citation-abbreviations\f[R] field in the document\[aq]s
1408metadata to \f[I]FILE\f[R], overriding any value set in the metadata.
1409(This is equivalent to
1410\f[C]--metadata citation-abbreviations=FILE\f[R].) This option is only
1411relevant with \f[C]pandoc-citeproc\f[R].
1413\f[B]\f[CB]--natbib\f[B]\f[R]
1414Use \f[C]natbib\f[R] for citations in LaTeX output.
1415This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
1417It is intended for use in producing a LaTeX file that can be processed
1418with \f[C]bibtex\f[R].
1420\f[B]\f[CB]--biblatex\f[B]\f[R]
1421Use \f[C]biblatex\f[R] for citations in LaTeX output.
1422This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
1424It is intended for use in producing a LaTeX file that can be processed
1425with \f[C]bibtex\f[R] or \f[C]biber\f[R].
1426.SS Math rendering in HTML
1428The default is to render TeX math as far as possible using Unicode
1430Formulas are put inside a \f[C]span\f[R] with
1431\f[C]class=\[dq]math\[dq]\f[R], so that they may be styled differently
1432from the surrounding text if needed.
1433However, this gives acceptable results only for basic math, usually you
1434will want to use \f[C]--mathjax\f[R] or another of the following
1437\f[B]\f[CB]--mathjax\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
1438Use MathJax to display embedded TeX math in HTML output.
1439TeX math will be put between \f[C]\[rs](...\[rs])\f[R] (for inline math)
1440or \f[C]\[rs][...\[rs]]\f[R] (for display math) and wrapped in
1441\f[C]<span>\f[R] tags with class \f[C]math\f[R].
1442Then the MathJax JavaScript will render it.
1443The \f[I]URL\f[R] should point to the \f[C]MathJax.js\f[R] load script.
1444If a \f[I]URL\f[R] is not provided, a link to the Cloudflare CDN will be
1447\f[B]\f[CB]--mathml\f[B]\f[R]
1448Convert TeX math to MathML (in \f[C]epub3\f[R], \f[C]docbook4\f[R],
1449\f[C]docbook5\f[R], \f[C]jats\f[R], \f[C]html4\f[R] and
1451This is the default in \f[C]odt\f[R] output.
1452Note that currently only Firefox and Safari (and select e-book readers)
1453natively support MathML.
1455\f[B]\f[CB]--webtex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
1456Convert TeX formulas to \f[C]<img>\f[R] tags that link to an external
1457script that converts formulas to images.
1458The formula will be URL-encoded and concatenated with the URL provided.
1459For SVG images you can for example use
1460\f[C]--webtex https://latex.codecogs.com/svg.latex?\f[R].
1461If no URL is specified, the CodeCogs URL generating PNGs will be used
1462(\f[C]https://latex.codecogs.com/png.latex?\f[R]).
1463Note: the \f[C]--webtex\f[R] option will affect Markdown output as well
1464as HTML, which is useful if you\[aq]re targeting a version of Markdown
1465without native math support.
1467\f[B]\f[CB]--katex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
1468Use KaTeX to display embedded TeX math in HTML output.
1469The \f[I]URL\f[R] is the base URL for the KaTeX library.
1470That directory should contain a \f[C]katex.min.js\f[R] and a
1471\f[C]katex.min.css\f[R] file.
1472If a \f[I]URL\f[R] is not provided, a link to the KaTeX CDN will be
1475\f[B]\f[CB]--gladtex\f[B]\f[R]
1476Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
1477The resulting HTML can then be processed by GladTeX to produce images of
1478the typeset formulas and an HTML file with links to these images.
1479So, the procedure is:
1484pandoc -s --gladtex input.md -o myfile.htex
1485gladtex -d myfile-images myfile.htex
1486# produces myfile.html and images in myfile-images
1490.SS Options for wrapper scripts
1492\f[B]\f[CB]--dump-args\f[B]\f[R]
1493Print information about command-line arguments to \f[I]stdout\f[R], then
1495This option is intended primarily for use in wrapper scripts.
1496The first line of output contains the name of the output file specified
1497with the \f[C]-o\f[R] option, or \f[C]-\f[R] (for \f[I]stdout\f[R]) if
1498no output file was specified.
1499The remaining lines contain the command-line arguments, one per line, in
1500the order they appear.
1501These do not include regular pandoc options and their arguments, but do
1502include any options appearing after a \f[C]--\f[R] separator at the end
1505\f[B]\f[CB]--ignore-args\f[B]\f[R]
1506Ignore command-line arguments (for use in wrapper scripts).
1507Regular pandoc options are not ignored.
1513pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
1521pandoc -o foo.html -s
1527If pandoc completes successfully, it will return exit code 0.
1528Nonzero exit codes have the following meanings:
1542PandocFailOnWarningError
1562PandocUnknownReaderError
1567PandocUnknownWriterError
1572PandocUnsupportedExtensionError
1577PandocEpubSubdirectoryError
1587PandocPDFProgramNotFoundError
1597PandocShouldNeverHappenError
1637PandocUTF8DecodingError
1642PandocIpynbDecodingError
1647PandocCouldNotFindDataFileError
1652PandocResourceNotFound
1657The \f[C]--defaults\f[R] option may be used to specify a package of
1659Here is a sample defaults file demonstrating all of the fields that may
1665# reader: may be used instead of from:
1667# writer: may be used instead of to:
1669# leave blank for output to stdout:
1671# leave blank for input from stdin, use [] for no input:
1675# or you may use input-file: with a single value
1679self-contained: false
1681# note that structured variables may be specified:
1688# metadata values specified here are parsed as literal
1689# string text, not markdown:
1696# or you may use metadata-file: with a single value
1698# Note that these take files, not their contents:
1699include-before-body: []
1700include-after-body: []
1701include-in-header: []
1702resource-path: [\[dq].\[dq]]
1704# filters will be assumed to be Lua filters if they have
1705# the .lua extension, and json filters otherwise. But
1706# the filter type can also be specified explicitly, as shown:
1717# ERROR, WARNING, or INFO
1721# citeproc, natbib, or biblatex
1722cite-method: citeproc
1723# part, chapter, section, or default:
1724top-level-division: chapter
1729- \[dq]-shell-escape\[dq]
1730# you may also use pdf-engine-opt: with a single option
1731# pdf-engine-opt: \[dq]-shell-escape\[dq]
1733# auto, preserve, or none
1738extract-media: mediadir
1740table-of-contents: true
1742number-sections: false
1743# a list of offsets at each heading level
1744number-offset: [0,0,0,0,0,0]
1745# toc: may also be used instead of table-of-contents:
1746shift-heading-level-by: 1
1748identifier-prefix: foo
1749title-prefix: \[dq]\[dq]
1750strip-empty-paragraphs: true
1751# lf, crlf, or native
1753strip-comments: false
1754indented-code-classes: []
1756default-image-extension: \[dq].jpg\[dq]
1758# either a style name of a style definition file:
1759highlight-style: pygments
1762# or you may use syntax-definition: with a single value
1765reference-doc: myref.docx
1767# method is plain, webtex, gladtex, mathml, mathjax, katex
1768# you may specify a url with webtex, mathjax, katex
1771 url: \[dq]https://cdn.jsdelivr.net/npm/mathjax\[at]3/es5/tex-mml-chtml.js\[dq]
1772# none, references, or javascript
1773email-obfuscation: javascript
1781epub-subdirectory: EPUB
1782epub-metadata: meta.xml
1785epub-chapter-level: 1
1786epub-cover-image: cover.jpg
1788reference-links: true
1789# block, section, or document
1790reference-location: block
1793# accept, reject, or all
1794track-changes: accept
1803# A list of two-element lists
1805- [\[dq]User-Agent\[dq], \[dq]Mozilla/5.0\[dq]]
1807fail-if-warnings: false
1814Fields that are omitted will just have their regular default values.
1815So a defaults file can be as simple as one line:
1823Default files can be placed in the \f[C]defaults\f[R] subdirectory of
1824the user data directory and used from any directory.
1825For example, one could create a file specifying defaults for writing
1826letters, save it as \f[C]letter.yaml\f[R] in the \f[C]defaults\f[R]
1827subdirectory of the user data directory, and then invoke these defaults
1828from any directory using \f[C]pandoc --defaults letter\f[R] or
1829\f[C]pandoc -dletter\f[R].
1831When multiple defaults are used, their contents will be combined.
1833Note that, where command-line arguments may be repeated
1834(\f[C]--metadata-file\f[R], \f[C]--css\f[R],
1835\f[C]--include-in-header\f[R], \f[C]--include-before-body\f[R],
1836\f[C]--include-after-body\f[R], \f[C]--variable\f[R],
1837\f[C]--metadata\f[R], \f[C]--syntax-definition\f[R]), the values
1838specified on the command line will combine with values specified in the
1839defaults file, rather than replacing them.
1842When the \f[C]-s/--standalone\f[R] option is used, pandoc uses a
1843template to add header and footer material that is needed for a
1844self-standing document.
1845To see the default template that is used, just type
1853where \f[I]FORMAT\f[R] is the name of the output format.
1854A custom template can be specified using the \f[C]--template\f[R]
1856You can also override the system default templates for a given output
1857format \f[I]FORMAT\f[R] by putting a file
1858\f[C]templates/default.*FORMAT*\f[R] in the user data directory (see
1859\f[C]--data-dir\f[R], above).
1860\f[I]Exceptions:\f[R]
1862For \f[C]odt\f[R] output, customize the \f[C]default.opendocument\f[R]
1865For \f[C]pdf\f[R] output, customize the \f[C]default.latex\f[R] template
1866(or the \f[C]default.context\f[R] template, if you use
1867\f[C]-t context\f[R], or the \f[C]default.ms\f[R] template, if you use
1868\f[C]-t ms\f[R], or the \f[C]default.html\f[R] template, if you use
1871\f[C]docx\f[R] and \f[C]pptx\f[R] have no template (however, you can use
1872\f[C]--reference-doc\f[R] to customize the output).
1874Templates contain \f[I]variables\f[R], which allow for the inclusion of
1875arbitrary information at any point in the file.
1876They may be set at the command line using the \f[C]-V/--variable\f[R]
1878If a variable is not set, pandoc will look for the key in the
1879document\[aq]s metadata, which can be set using either YAML metadata
1880blocks or with the \f[C]-M/--metadata\f[R] option.
1881In addition, some variables are given default values by pandoc.
1882See Variables below for a list of variables used in pandoc\[aq]s default
1885If you use custom templates, you may need to revise them as pandoc
1887We recommend tracking the changes in the default templates, and
1888modifying your custom templates accordingly.
1889An easy way to do this is to fork the pandoc-templates repository and
1890merge in changes after each pandoc release.
1894Anything between the sequence \f[C]$--\f[R] and the end of the line will
1895be treated as a comment and omitted from the output.
1898To mark variables and control structures in the template, either
1899\f[C]$\f[R]...\f[C]$\f[R] or \f[C]${\f[R]...\f[C]}\f[R] may be used as
1901The styles may also be mixed in the same template, but the opening and
1902closing delimiter must match in each case.
1903The opening delimiter may be followed by one or more spaces or tabs,
1904which will be ignored.
1905The closing delimiter may be followed by one or more spaces or tabs,
1906which will be ignored.
1908To include a literal \f[C]$\f[R] in the document, use \f[C]$$\f[R].
1909.SS Interpolated variables
1911A slot for an interpolated variable is a variable name surrounded by
1913Variable names must begin with a letter and can contain letters,
1914numbers, \f[C]_\f[R], \f[C]-\f[R], and \f[C].\f[R].
1915The keywords \f[C]it\f[R], \f[C]if\f[R], \f[C]else\f[R],
1916\f[C]endif\f[R], \f[C]for\f[R], \f[C]sep\f[R], and \f[C]endfor\f[R] may
1917not be used as variable names.
1933Variable names with periods are used to get at structured variable
1935So, for example, \f[C]employee.salary\f[R] will return the value of the
1936\f[C]salary\f[R] field of the object that is the value of the
1937\f[C]employee\f[R] field.
1939If the value of the variable is simple value, it will be rendered
1941(Note that no escaping is done; the assumption is that the calling
1942program will escape the strings appropriately for the output format.)
1944If the value is a list, the values will be concatenated.
1946If the value is a map, the string \f[C]true\f[R] will be rendered.
1948Every other value will be rendered as the empty string.
1951A conditional begins with \f[C]if(variable)\f[R] (enclosed in matched
1952delimiters) and ends with \f[C]endif\f[R] (enclosed in matched
1954It may optionally contain an \f[C]else\f[R] (enclosed in matched
1956The \f[C]if\f[R] section is used if \f[C]variable\f[R] has a non-empty
1957value, otherwise the \f[C]else\f[R] section is used (if present).
1974${if(foo)}bar${endif}
1988The keyword \f[C]elseif\f[R] may be used to simplify complex nested
2004A for loop begins with \f[C]for(variable)\f[R] (enclosed in matched
2005delimiters) and ends with \f[C]endfor\f[R] (enclosed in matched
2008If \f[C]variable\f[R] is an array, the material inside the loop will be
2009evaluated repeatedly, with \f[C]variable\f[R] being set to each value of
2010the array in turn, and concatenated.
2012If \f[C]variable\f[R] is a map, the material inside will be set to the
2015If the value of the associated variable is not an array or a map, a
2016single iteration will be performed on its value.
2022$for(foo)$$foo$$sep$, $endfor$
2025 - $foo.last$, $foo.first$
2029 - ${ foo.bar.last }, ${ foo.bar.first }
2033$it.name$: $it.office$
2038You may optionally specify a separator between consecutive values using
2039\f[C]sep\f[R] (enclosed in matched delimiters).
2040The material between \f[C]sep\f[R] and the \f[C]endfor\f[R] is the
2045${ for(foo) }${ foo }${ sep }, ${ endfor }
2049Instead of using \f[C]variable\f[R] inside the loop, the special
2050anaphoric keyword \f[C]it\f[R] may be used.
2055 - ${ it.last }, ${ it.first }
2061Partials (subtemplates stored in different files) may be included by
2062using the name of the partial, followed by \f[C]()\f[R], for example:
2070Partials will be sought in the directory containing the main template.
2071The file name will be assumed to have the same extension as the main
2072template if it lacks an extension.
2073When calling the partial, the full name including file extension can
2082(If a partial is not found in the directory of the template, it will
2083also be sought in the \f[C]templates\f[R] subdirectory of the user data
2086Partials may optionally be applied to variables using a colon:
2092${ articles:bibentry() }
2096If \f[C]articles\f[R] is an array, this will iterate over its values,
2097applying the partial \f[C]bibentry()\f[R] to each one.
2098So the second example above is equivalent to
2108Note that the anaphoric keyword \f[C]it\f[R] must be used when iterating
2110In the above examples, the \f[C]bibentry\f[R] partial should contain
2111\f[C]it.title\f[R] (and so on) instead of \f[C]articles.title\f[R].
2113Final newlines are omitted from included partials.
2115Partials may include other partials.
2117A separator between values of an array may be specified in square
2118brackets, immediately after the variable name or partial:
2124${articles:bibentry()[; ]$
2128The separator in this case is literal and (unlike with \f[C]sep\f[R] in
2129an explicit \f[C]for\f[R] loop) cannot contain interpolated variables or
2130other template directives.
2133To ensure that content is \[dq]nested,\[dq] that is, subsequent lines
2134indented, use the \f[C]\[ha]\f[R] directive:
2138$item.number$ $\[ha]$$item.description$ ($item.price$)
2142In this example, if \f[C]item.description\f[R] has multiple lines, they
2143will all be indented to line up with the first line:
214700123 A fine bottle of 18-year old
2148 Oban whiskey. ($148)
2152To nest multiple lines to the same level, align them with the
2153\f[C]\[ha]\f[R] directive in the template.
2158$item.number$ $\[ha]$$item.description$ ($item.price$)
2159 (Available til $item.sellby$.)
216700123 A fine bottle of 18-year old
2168 Oban whiskey. ($148)
2169 (Available til March 30, 2020.)
2173If a variable occurs by itself on a line, preceded by whitespace and not
2174followed by further text or directives on the same line, and the
2175variable\[aq]s value contains multiple lines, it will be nested
2179Normally, spaces in the template itself (as opposed to values of the
2180interpolated variables) are not breakable, but they can be made
2181breakable in part of the template by using the \f[C]\[ti]\f[R] keyword
2182(ended with another \f[C]\[ti]\f[R]).
2186$\[ti]$This long line may break if the document is rendered
2187with a short line length.$\[ti]$
2192A pipe transforms the value of a variable or partial.
2193Pipes are specified using a slash (\f[C]/\f[R]) between the variable
2194name (or partial) and the pipe name.
2203$for(metadata/pairs)$
2204- $it.key$: $it.value$
2207$employee:name()/uppercase$
2211Pipes may be chained:
2215$for(employees/pairs)$
2216$it.key/alpha/uppercase$. $it.name$
2221Some pipes take parameters:
2225|----------------------|------------|
2227$it.name.first/uppercase/left 20 \[dq]| \[dq]$$it.name.salary/right 10 \[dq] | \[dq] \[dq] |\[dq]$
2229|----------------------|------------|
2233Currently the following pipes are predefined:
2235\f[C]pairs\f[R]: Converts a map or array to an array of maps, each with
2236\f[C]key\f[R] and \f[C]value\f[R] fields.
2237If the original value was an array, the \f[C]key\f[R] will be the array
2238index, starting with 1.
2240\f[C]uppercase\f[R]: Converts text to uppercase.
2242\f[C]lowercase\f[R]: Converts text to lowercase.
2244\f[C]length\f[R]: Returns the length of the value: number of characters
2245for a textual value, number of elements for a map or array.
2247\f[C]reverse\f[R]: Reverses a textual value or array, and has no effect
2250\f[C]first\f[R]: Returns the first value of an array, if applied to a
2251non-empty array; otherwise returns the original value.
2253\f[C]last\f[R]: Returns the last value of an array, if applied to a
2254non-empty array; otherwise returns the original value.
2256\f[C]rest\f[R]: Returns all but the first value of an array, if applied
2257to a non-empty array; otherwise returns the original value.
2259\f[C]allbutlast\f[R]: Returns all but the last value of an array, if
2260applied to a non-empty array; otherwise returns the original value.
2262\f[C]chomp\f[R]: Removes trailing newlines (and breakable space).
2264\f[C]nowrap\f[R]: Disables line wrapping on breakable spaces.
2266\f[C]alpha\f[R]: Converts textual values that can be read as an integer
2267into lowercase alphabetic characters \f[C]a..z\f[R] (mod 26).
2268This can be used to get lettered enumeration from array indices.
2269To get uppercase letters, chain with \f[C]uppercase\f[R].
2271\f[C]roman\f[R]: Converts textual values that can be read as an integer
2272into lowercase roman numerials.
2273This can be used to get lettered enumeration from array indices.
2274To get uppercase roman, chain with \f[C]uppercase\f[R].
2276\f[C]left n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
2277textual value in a block of width \f[C]n\f[R], aligned to the left, with
2278an optional left and right border.
2279Has no effect on other values.
2280This can be used to align material in tables.
2281Widths are positive integers indicating the number of characters.
2282Borders are strings inside double quotes; literal \f[C]\[dq]\f[R] and
2283\f[C]\[rs]\f[R] characters must be backslash-escaped.
2285\f[C]right n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
2286textual value in a block of width \f[C]n\f[R], aligned to the right, and
2287has no effect on other values.
2289\f[C]center n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
2290textual value in a block of width \f[C]n\f[R], aligned to the center,
2291and has no effect on other values.
2293.SS Metadata variables
2295\f[B]\f[CB]title\f[B]\f[R], \f[B]\f[CB]author\f[B]\f[R], \f[B]\f[CB]date\f[B]\f[R]
2296allow identification of basic aspects of the document.
2297Included in PDF metadata through LaTeX and ConTeXt.
2298These can be set through a pandoc title block, which allows for multiple
2299authors, or through a YAML metadata block:
2312Note that if you just want to set PDF or HTML metadata, without
2313including a title block in the document itself, you can set the
2314\f[C]title-meta\f[R], \f[C]author-meta\f[R], and \f[C]date-meta\f[R]
2316(By default these are set automatically, based on \f[C]title\f[R],
2317\f[C]author\f[R], and \f[C]date\f[R].)
2320\f[B]\f[CB]subtitle\f[B]\f[R]
2321document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
2324\f[B]\f[CB]abstract\f[B]\f[R]
2325document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx
2328\f[B]\f[CB]keywords\f[B]\f[R]
2329list of keywords to be included in HTML, PDF, ODT, pptx, docx and
2330AsciiDoc metadata; repeat as for \f[C]author\f[R], above
2332\f[B]\f[CB]subject\f[B]\f[R]
2333document subject, included in ODT, PDF, docx and pptx metadata
2335\f[B]\f[CB]description\f[B]\f[R]
2336document description, included in ODT, docx and pptx metadata.
2337Some applications show this as \f[C]Comments\f[R] metadata.
2339\f[B]\f[CB]category\f[B]\f[R]
2340document category, included in docx and pptx metadata
2342Additionally, any root-level string metadata, not included in ODT, docx
2343or pptx metadata is added as a \f[I]custom property\f[R].
2344The following YAML metadata block for instance:
2349title: \[aq]This is the title\[aq]
2350subtitle: \[dq]This is the subtitle\[dq]
2358 It consists of two paragraphs
2363will include \f[C]title\f[R], \f[C]author\f[R] and \f[C]description\f[R]
2364as standard document properties and \f[C]subtitle\f[R] as a custom
2365property when converting to docx, ODT or pptx.
2366.SS Language variables
2368\f[B]\f[CB]lang\f[B]\f[R]
2369identifies the main language of the document using IETF language tags
2370(following the BCP 47 standard), such as \f[C]en\f[R] or
2372The Language subtag lookup tool can look up or verify these tags.
2373This affects most formats, and controls hyphenation in PDF output when
2374using LaTeX (through \f[C]babel\f[R] and \f[C]polyglossia\f[R]) or
2378Use native pandoc Divs and Spans with the \f[C]lang\f[R] attribute to
2387Text in the main document language (British English).
2390> Cette citation est \['e]crite en fran\[,c]ais canadien.
2393More text in English. [\[aq]Zitat auf Deutsch.\[aq]]{lang=de}
2398\f[B]\f[CB]dir\f[B]\f[R]
2399the base script direction, either \f[C]rtl\f[R] (right-to-left) or
2400\f[C]ltr\f[R] (left-to-right).
2403For bidirectional documents, native pandoc \f[C]span\f[R]s and
2404\f[C]div\f[R]s with the \f[C]dir\f[R] attribute (value \f[C]rtl\f[R] or
2405\f[C]ltr\f[R]) can be used to override the base direction in some output
2407This may not always be necessary if the final renderer (e.g.
2408the browser, when generating HTML) supports the Unicode Bidirectional
2411When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[R]
2412engine is fully supported (use \f[C]--pdf-engine=xelatex\f[R]).
2414.SS Variables for HTML math
2416\f[B]\f[CB]classoption\f[B]\f[R]
2417when using KaTeX, you can render display math equations flush left using
2418YAML metadata or with \f[C]-M classoption=fleqn\f[R].
2419.SS Variables for HTML slides
2421These affect HTML output when producing slide shows with pandoc.
2423All reveal.js configuration options are available as variables.
2424To turn off boolean flags that default to true in reveal.js, use
2427\f[B]\f[CB]revealjs-url\f[B]\f[R]
2428base URL for reveal.js documents (defaults to
2429\f[C]https://unpkg.com/reveal.js\[at]\[ha]4/\f[R])
2431\f[B]\f[CB]s5-url\f[B]\f[R]
2432base URL for S5 documents (defaults to \f[C]s5/default\f[R])
2434\f[B]\f[CB]slidy-url\f[B]\f[R]
2435base URL for Slidy documents (defaults to
2436\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[R])
2438\f[B]\f[CB]slideous-url\f[B]\f[R]
2439base URL for Slideous documents (defaults to \f[C]slideous\f[R])
2441\f[B]\f[CB]title-slide-attributes\f[B]\f[R]
2442additional attributes for the title slide of reveal.js slide shows.
2443See background in reveal.js and beamer for an example.
2444.SS Variables for Beamer slides
2446These variables change the appearance of PDF slides using
2449\f[B]\f[CB]aspectratio\f[B]\f[R]
2450slide aspect ratio (\f[C]43\f[R] for 4:3 [default], \f[C]169\f[R] for
245116:9, \f[C]1610\f[R] for 16:10, \f[C]149\f[R] for 14:9, \f[C]141\f[R]
2452for 1.41:1, \f[C]54\f[R] for 5:4, \f[C]32\f[R] for 3:2)
2454\f[B]\f[CB]beamerarticle\f[B]\f[R]
2455produce an article from Beamer slides
2457\f[B]\f[CB]beameroption\f[B]\f[R]
2458add extra beamer option with \f[C]\[rs]setbeameroption{}\f[R]
2460\f[B]\f[CB]institute\f[B]\f[R]
2461author affiliations: can be a list when there are multiple authors
2463\f[B]\f[CB]logo\f[B]\f[R]
2464logo image for slides
2466\f[B]\f[CB]navigation\f[B]\f[R]
2467controls navigation symbols (default is \f[C]empty\f[R] for no
2468navigation symbols; other valid values are \f[C]frame\f[R],
2469\f[C]vertical\f[R], and \f[C]horizontal\f[R])
2471\f[B]\f[CB]section-titles\f[B]\f[R]
2472enables \[dq]title pages\[dq] for new sections (default is true)
2474\f[B]\f[CB]theme\f[B]\f[R], \f[B]\f[CB]colortheme\f[B]\f[R], \f[B]\f[CB]fonttheme\f[B]\f[R], \f[B]\f[CB]innertheme\f[B]\f[R], \f[B]\f[CB]outertheme\f[B]\f[R]
2477\f[B]\f[CB]themeoptions\f[B]\f[R]
2478options for LaTeX beamer themes (a list).
2480\f[B]\f[CB]titlegraphic\f[B]\f[R]
2481image for title slide
2482.SS Variables for PowerPoint
2484These variables control the visual aspects of a slide show that are not
2485easily controlled via templates.
2487\f[B]\f[CB]monofont\f[B]\f[R]
2488font to use for code.
2489.SS Variables for LaTeX
2491Pandoc uses these variables when creating a PDF with a LaTeX engine.
2494\f[B]\f[CB]block-headings\f[B]\f[R]
2495make \f[C]\[rs]paragraph\f[R] and \f[C]\[rs]subparagraph\f[R] (fourth-
2496and fifth-level headings, or fifth- and sixth-level with book classes)
2497free-standing rather than run-in; requires further formatting to
2498distinguish from \f[C]\[rs]subsubsection\f[R] (third- or fourth-level
2500Instead of using this option, KOMA-Script can adjust headings more
2507documentclass: scrartcl
2509 \[rs]RedeclareSectionCommand[
2510 beforeskip=-10pt plus -2pt minus -1pt,
2511 afterskip=1sp plus -1sp minus 1sp,
2512 font=\[rs]normalfont\[rs]itshape]{paragraph}
2513 \[rs]RedeclareSectionCommand[
2514 beforeskip=-10pt plus -2pt minus -1pt,
2515 afterskip=1sp plus -1sp minus 1sp,
2516 font=\[rs]normalfont\[rs]scshape,
2517 indent=0pt]{subparagraph}
2523\f[B]\f[CB]classoption\f[B]\f[R]
2524option for document class, e.g.
2525\f[C]oneside\f[R]; repeat for multiple options:
2539\f[B]\f[CB]documentclass\f[B]\f[R]
2540document class: usually one of the standard classes, \f[C]article\f[R],
2541\f[C]book\f[R], and \f[C]report\f[R]; the KOMA-Script equivalents,
2542\f[C]scrartcl\f[R], \f[C]scrbook\f[R], and \f[C]scrreprt\f[R], which
2543default to smaller margins; or \f[C]memoir\f[R]
2545\f[B]\f[CB]geometry\f[B]\f[R]
2546option for \f[C]geometry\f[R] package, e.g.
2547\f[C]margin=1in\f[R]; repeat for multiple options:
2562\f[B]\f[CB]hyperrefoptions\f[B]\f[R]
2563option for \f[C]hyperref\f[R] package, e.g.
2564\f[C]linktoc=all\f[R]; repeat for multiple options:
2573- pdfpagemode=FullScreen
2579\f[B]\f[CB]indent\f[B]\f[R]
2580uses document class settings for indentation (the default LaTeX template
2581otherwise removes indentation and adds space between paragraphs)
2583\f[B]\f[CB]linestretch\f[B]\f[R]
2584adjusts line spacing using the \f[C]setspace\f[R] package, e.g.
2585\f[C]1.25\f[R], \f[C]1.5\f[R]
2587\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2588sets margins if \f[C]geometry\f[R] is not used (otherwise
2589\f[C]geometry\f[R] overrides these)
2591\f[B]\f[CB]pagestyle\f[B]\f[R]
2592control \f[C]\[rs]pagestyle{}\f[R]: the default article class supports
2593\f[C]plain\f[R] (default), \f[C]empty\f[R] (no running heads or page
2594numbers), and \f[C]headings\f[R] (section titles in running heads)
2596\f[B]\f[CB]papersize\f[B]\f[R]
2598\f[C]letter\f[R], \f[C]a4\f[R]
2600\f[B]\f[CB]secnumdepth\f[B]\f[R]
2601numbering depth for sections (with \f[C]--number-sections\f[R] option or
2602\f[C]numbersections\f[R] variable)
2605\f[B]\f[CB]fontenc\f[B]\f[R]
2606allows font encoding to be specified through \f[C]fontenc\f[R] package
2607(with \f[C]pdflatex\f[R]); default is \f[C]T1\f[R] (see LaTeX font
2610\f[B]\f[CB]fontfamily\f[B]\f[R]
2611font package for use with \f[C]pdflatex\f[R]: TeX Live includes many
2612options, documented in the LaTeX Font Catalogue.
2613The default is Latin Modern.
2615\f[B]\f[CB]fontfamilyoptions\f[B]\f[R]
2616options for package used as \f[C]fontfamily\f[R]; repeat for multiple
2618For example, to use the Libertine font with proportional lowercase
2619(old-style) figures through the \f[C]libertinus\f[R] package:
2625fontfamily: libertinus
2634\f[B]\f[CB]fontsize\f[B]\f[R]
2635font size for body text.
2636The standard classes allow 10pt, 11pt, and 12pt.
2637To use another size, set \f[C]documentclass\f[R] to one of the
2638KOMA-Script classes, such as \f[C]scrartcl\f[R] or \f[C]scrbook\f[R].
2640\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R], \f[B]\f[CB]CJKmainfont\f[B]\f[R]
2641font families for use with \f[C]xelatex\f[R] or \f[C]lualatex\f[R]: take
2642the name of any system font, using the \f[C]fontspec\f[R] package.
2643\f[C]CJKmainfont\f[R] uses the \f[C]xecjk\f[R] package.
2645\f[B]\f[CB]mainfontoptions\f[B]\f[R], \f[B]\f[CB]sansfontoptions\f[B]\f[R], \f[B]\f[CB]monofontoptions\f[B]\f[R], \f[B]\f[CB]mathfontoptions\f[B]\f[R], \f[B]\f[CB]CJKoptions\f[B]\f[R]
2646options to use with \f[C]mainfont\f[R], \f[C]sansfont\f[R],
2647\f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R] in
2648\f[C]xelatex\f[R] and \f[C]lualatex\f[R].
2649Allow for any choices available through \f[C]fontspec\f[R]; repeat for
2651For example, to use the TeX Gyre version of Palatino with lowercase
2658mainfont: TeX Gyre Pagella
2661- Numbers=Proportional
2667\f[B]\f[CB]microtypeoptions\f[B]\f[R]
2668options to pass to the microtype package
2671\f[B]\f[CB]colorlinks\f[B]\f[R]
2672add color to link text; automatically enabled if any of
2673\f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R],
2674\f[C]urlcolor\f[R], or \f[C]toccolor\f[R] are set
2676\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]filecolor\f[B]\f[R], \f[B]\f[CB]citecolor\f[B]\f[R], \f[B]\f[CB]urlcolor\f[B]\f[R], \f[B]\f[CB]toccolor\f[B]\f[R]
2677color for internal links, external links, citation links, linked URLs,
2678and links in table of contents, respectively: uses options allowed by
2679\f[C]xcolor\f[R], including the \f[C]dvipsnames\f[R],
2680\f[C]svgnames\f[R], and \f[C]x11names\f[R] lists
2682\f[B]\f[CB]links-as-notes\f[B]\f[R]
2683causes links to be printed as footnotes
2686\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
2687include list of figures, list of tables
2689\f[B]\f[CB]thanks\f[B]\f[R]
2690contents of acknowledgments footnote after document title
2692\f[B]\f[CB]toc\f[B]\f[R]
2693include table of contents (can also be set using
2694\f[C]--toc/--table-of-contents\f[R])
2696\f[B]\f[CB]toc-depth\f[B]\f[R]
2697level of section to include in table of contents
2698.SS BibLaTeX Bibliographies
2700These variables function when using BibLaTeX for citation rendering.
2702\f[B]\f[CB]biblatexoptions\f[B]\f[R]
2703list of options for biblatex
2705\f[B]\f[CB]biblio-style\f[B]\f[R]
2706bibliography style, when used with \f[C]--natbib\f[R] and
2707\f[C]--biblatex\f[R].
2709\f[B]\f[CB]biblio-title\f[B]\f[R]
2710bibliography title, when used with \f[C]--natbib\f[R] and
2711\f[C]--biblatex\f[R].
2713\f[B]\f[CB]bibliography\f[B]\f[R]
2714bibliography to use for resolving references
2716\f[B]\f[CB]natbiboptions\f[B]\f[R]
2717list of options for natbib
2718.SS Variables for ConTeXt
2720Pandoc uses these variables when creating a PDF with ConTeXt.
2722\f[B]\f[CB]fontsize\f[B]\f[R]
2723font size for body text (e.g.
2724\f[C]10pt\f[R], \f[C]12pt\f[R])
2726\f[B]\f[CB]headertext\f[B]\f[R], \f[B]\f[CB]footertext\f[B]\f[R]
2727text to be placed in running header or footer (see ConTeXt Headers and
2728Footers); repeat up to four times for different placement
2730\f[B]\f[CB]indenting\f[B]\f[R]
2731controls indentation of paragraphs, e.g.
2732\f[C]yes,small,next\f[R] (see ConTeXt Indentation); repeat for multiple
2735\f[B]\f[CB]interlinespace\f[B]\f[R]
2736adjusts line spacing, e.g.
2737\f[C]4ex\f[R] (using \f[C]setupinterlinespace\f[R]); repeat for multiple
2740\f[B]\f[CB]layout\f[B]\f[R]
2741options for page margins and text arrangement (see ConTeXt Layout);
2742repeat for multiple options
2744\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]contrastcolor\f[B]\f[R]
2745color for links outside and inside a page, e.g.
2746\f[C]red\f[R], \f[C]blue\f[R] (see ConTeXt Color)
2748\f[B]\f[CB]linkstyle\f[B]\f[R]
2749typeface style for links, e.g.
2750\f[C]normal\f[R], \f[C]bold\f[R], \f[C]slanted\f[R],
2751\f[C]boldslanted\f[R], \f[C]type\f[R], \f[C]cap\f[R], \f[C]small\f[R]
2753\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
2754include list of figures, list of tables
2756\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R]
2757font families: take the name of any system font (see ConTeXt Font
2760\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2761sets margins, if \f[C]layout\f[R] is not used (otherwise
2762\f[C]layout\f[R] overrides these)
2764\f[B]\f[CB]pagenumbering\f[B]\f[R]
2765page number style and location (using \f[C]setuppagenumbering\f[R]);
2766repeat for multiple options
2768\f[B]\f[CB]papersize\f[B]\f[R]
2770\f[C]letter\f[R], \f[C]A4\f[R], \f[C]landscape\f[R] (see ConTeXt Paper
2771Setup); repeat for multiple options
2773\f[B]\f[CB]pdfa\f[B]\f[R]
2774adds to the preamble the setup necessary to generate PDF/A of the type
2776\f[C]1a:2005\f[R], \f[C]2a\f[R].
2777If no type is specified (i.e.
2778the value is set to True, by e.g.
2779\f[C]--metadata=pdfa\f[R] or \f[C]pdfa: true\f[R] in a YAML metadata
2780block), \f[C]1b:2005\f[R] will be used as default, for reasons of
2781backwards compatibility.
2782Using \f[C]--variable=pdfa\f[R] without specified value is not
2784To successfully generate PDF/A the required ICC color profiles have to
2785be available and the content and all included files (such as images)
2786have to be standard conforming.
2787The ICC profiles and output intent may be specified using the variables
2788\f[C]pdfaiccprofile\f[R] and \f[C]pdfaintent\f[R].
2789See also ConTeXt PDFA for more details.
2791\f[B]\f[CB]pdfaiccprofile\f[B]\f[R]
2792when used in conjunction with \f[C]pdfa\f[R], specifies the ICC profile
2793to use in the PDF, e.g.
2794\f[C]default.cmyk\f[R].
2795If left unspecified, \f[C]sRGB.icc\f[R] is used as default.
2796May be repeated to include multiple profiles.
2797Note that the profiles have to be available on the system.
2798They can be obtained from ConTeXt ICC Profiles.
2800\f[B]\f[CB]pdfaintent\f[B]\f[R]
2801when used in conjunction with \f[C]pdfa\f[R], specifies the output
2802intent for the colors, e.g.
2803\f[C]ISO coated v2 300\[rs]letterpercent\[rs]space (ECI)\f[R] If left
2804unspecified, \f[C]sRGB IEC61966-2.1\f[R] is used as default.
2806\f[B]\f[CB]toc\f[B]\f[R]
2807include table of contents (can also be set using
2808\f[C]--toc/--table-of-contents\f[R])
2810\f[B]\f[CB]whitespace\f[B]\f[R]
2811spacing between paragraphs, e.g.
2812\f[C]none\f[R], \f[C]small\f[R] (using \f[C]setupwhitespace\f[R])
2814\f[B]\f[CB]includesource\f[B]\f[R]
2815include all source documents as file attachments in the PDF file
2816.SS Variables for \f[C]wkhtmltopdf\f[R]
2818Pandoc uses these variables when creating a PDF with
2819\f[C]wkhtmltopdf\f[R].
2820The \f[C]--css\f[R] option also affects the output.
2822\f[B]\f[CB]footer-html\f[B]\f[R], \f[B]\f[CB]header-html\f[B]\f[R]
2823add information to the header and footer
2825\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
2828\f[B]\f[CB]papersize\f[B]\f[R]
2829sets the PDF paper size
2830.SS Variables for man pages
2832\f[B]\f[CB]adjusting\f[B]\f[R]
2833adjusts text to left (\f[C]l\f[R]), right (\f[C]r\f[R]), center
2834(\f[C]c\f[R]), or both (\f[C]b\f[R]) margins
2836\f[B]\f[CB]footer\f[B]\f[R]
2839\f[B]\f[CB]header\f[B]\f[R]
2842\f[B]\f[CB]hyphenate\f[B]\f[R]
2843if \f[C]true\f[R] (the default), hyphenation will be used
2845\f[B]\f[CB]section\f[B]\f[R]
2846section number in man pages
2849\f[B]\f[CB]fontfamily\f[B]\f[R]
2851\f[C]T\f[R] or \f[C]P\f[R])
2853\f[B]\f[CB]indent\f[B]\f[R]
2854paragraph indent (e.g.
2857\f[B]\f[CB]lineheight\f[B]\f[R]
2861\f[B]\f[CB]pointsize\f[B]\f[R]
2864.SS Variables set automatically
2866Pandoc sets these variables automatically in response to options or
2867document contents; users can also modify them.
2868These vary depending on the output format, and include the following:
2870\f[B]\f[CB]body\f[B]\f[R]
2873\f[B]\f[CB]date-meta\f[B]\f[R]
2874the \f[C]date\f[R] variable converted to ISO 8601 YYYY-MM-DD, included
2875in all HTML based formats (dzslides, epub, html, html4, html5, revealjs,
2876s5, slideous, slidy).
2877The recognized formats for \f[C]date\f[R] are: \f[C]mm/dd/yyyy\f[R],
2878\f[C]mm/dd/yy\f[R], \f[C]yyyy-mm-dd\f[R] (ISO 8601),
2879\f[C]dd MM yyyy\f[R] (e.g.
2880either \f[C]02 Apr 2018\f[R] or \f[C]02 April 2018\f[R]),
2881\f[C]MM dd, yyyy\f[R] (e.g.
2882\f[C]Apr. 02, 2018\f[R] or
2883\f[C]April 02, 2018),\f[R]yyyy[mm[dd]]]\f[C](e.g.\f[R]20180402,
2884\f[C]201804\f[R] or \f[C]2018\f[R]).
2886\f[B]\f[CB]header-includes\f[B]\f[R]
2887contents specified by \f[C]-H/--include-in-header\f[R] (may have
2890\f[B]\f[CB]include-before\f[B]\f[R]
2891contents specified by \f[C]-B/--include-before-body\f[R] (may have
2894\f[B]\f[CB]include-after\f[B]\f[R]
2895contents specified by \f[C]-A/--include-after-body\f[R] (may have
2898\f[B]\f[CB]meta-json\f[B]\f[R]
2899JSON representation of all of the document\[aq]s metadata.
2900Field values are transformed to the selected output format.
2902\f[B]\f[CB]numbersections\f[B]\f[R]
2903non-null value if \f[C]-N/--number-sections\f[R] was specified
2905\f[B]\f[CB]sourcefile\f[B]\f[R], \f[B]\f[CB]outputfile\f[B]\f[R]
2906source and destination filenames, as given on the command line.
2907\f[C]sourcefile\f[R] can also be a list if input comes from multiple
2908files, or empty if input is from stdin.
2909You can use the following snippet in your template to distinguish them:
2924Similarly, \f[C]outputfile\f[R] can be \f[C]-\f[R] if output goes to the
2927If you need absolute paths, use e.g.
2928\f[C]$curdir$/$sourcefile$\f[R].
2931\f[B]\f[CB]curdir\f[B]\f[R]
2932working directory from which pandoc is run.
2934\f[B]\f[CB]toc\f[B]\f[R]
2935non-null value if \f[C]--toc/--table-of-contents\f[R] was specified
2937\f[B]\f[CB]toc-title\f[B]\f[R]
2938title of table of contents (works only with EPUB, HTML, opendocument,
2939odt, docx, pptx, beamer, LaTeX)
2942The behavior of some of the readers and writers can be adjusted by
2943enabling or disabling various extensions.
2945An extension can be enabled by adding \f[C]+EXTENSION\f[R] to the format
2946name and disabled by adding \f[C]-EXTENSION\f[R].
2947For example, \f[C]--from markdown_strict+footnotes\f[R] is strict
2948Markdown with footnotes enabled, while
2949\f[C]--from markdown-footnotes-pipe_tables\f[R] is pandoc\[aq]s Markdown
2950without footnotes or pipe tables.
2952The markdown reader and writer make by far the most use of extensions.
2953Extensions only used by them are therefore covered in the section
2954Pandoc\[aq]s Markdown below (See Markdown variants for
2955\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions
2956that also work for other formats are covered.
2958Note that markdown extensions added to the \f[C]ipynb\f[R] format affect
2959Markdown cells in Jupyter notebooks (as do command-line options like
2960\f[C]--atx-headers\f[R]).
2962.SS Extension: \f[C]smart\f[R]
2964Interpret straight quotes as curly quotes, \f[C]---\f[R] as em-dashes,
2965\f[C]--\f[R] as en-dashes, and \f[C]...\f[R] as ellipses.
2966Nonbreaking spaces are inserted after certain abbreviations, such as
2969This extension can be enabled/disabled for the following formats:
2972\f[C]markdown\f[R], \f[C]commonmark\f[R], \f[C]latex\f[R],
2973\f[C]mediawiki\f[R], \f[C]org\f[R], \f[C]rst\f[R], \f[C]twiki\f[R]
2976\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R], \f[C]rst\f[R]
2978enabled by default in
2979\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R] (both input and
2982Note: If you are \f[I]writing\f[R] Markdown, then the \f[C]smart\f[R]
2983extension has the reverse effect: what would have been curly quotes
2986In LaTeX, \f[C]smart\f[R] means to use the standard TeX ligatures for
2987quotation marks (\f[C]\[ga]\[ga]\f[R] and \f[C]\[aq]\[aq]\f[R] for
2988double quotes, \f[C]\[ga]\f[R] and \f[C]\[aq]\f[R] for single quotes)
2989and dashes (\f[C]--\f[R] for en-dash and \f[C]---\f[R] for em-dash).
2990If \f[C]smart\f[R] is disabled, then in reading LaTeX pandoc will parse
2991these characters literally.
2992In writing LaTeX, enabling \f[C]smart\f[R] tells pandoc to use the
2993ligatures when possible; if \f[C]smart\f[R] is disabled pandoc will use
2994unicode quotation mark and dash characters.
2995.SS Headings and sections
2996.SS Extension: \f[C]auto_identifiers\f[R]
2998A heading without an explicitly specified identifier will be
2999automatically assigned a unique identifier based on the heading text.
3001This extension can be enabled/disabled for the following formats:
3004\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]rst\f[R], \f[C]mediawiki\f[R],
3008\f[C]markdown\f[R], \f[C]muse\f[R]
3010enabled by default in
3011\f[C]markdown\f[R], \f[C]muse\f[R]
3013The default algorithm used to derive the identifier from the heading
3016Remove all formatting, links, etc.
3018Remove all footnotes.
3020Remove all non-alphanumeric characters, except underscores, hyphens, and
3023Replace all spaces and newlines with hyphens.
3025Convert all alphabetic characters to lowercase.
3027Remove everything up to the first letter (identifiers may not begin with
3028a number or punctuation mark).
3030If nothing is left after this, use the identifier \f[C]section\f[R].
3044\f[C]Heading identifiers in HTML\f[R]
3046\f[C]heading-identifiers-in-html\f[R]
3049\f[C]Ma\[^i]tre d\[aq]h\[^o]tel\f[R]
3051\f[C]ma\[^i]tre-dh\[^o]tel\f[R]
3054\f[C]*Dogs*?--in *my* house?\f[R]
3056\f[C]dogs--in-my-house\f[R]
3059\f[C][HTML], [S5], or [RTF]?\f[R]
3061\f[C]html-s5-or-rtf\f[R]
3064\f[C]3. Applications\f[R]
3066\f[C]applications\f[R]
3075These rules should, in most cases, allow one to determine the identifier
3076from the heading text.
3077The exception is when several headings have the same text; in this case,
3078the first will get an identifier as described above; the second will get
3079the same identifier with \f[C]-1\f[R] appended; the third with
3080\f[C]-2\f[R]; and so on.
3082(However, a different algorithm is used if
3083\f[C]gfm_auto_identifiers\f[R] is enabled; see below.)
3085These identifiers are used to provide link targets in the table of
3086contents generated by the \f[C]--toc|--table-of-contents\f[R] option.
3087They also make it easy to provide links from one section of a document
3089A link to this section, for example, might look like this:
3094[heading identifiers](#heading-identifiers-in-html-latex-and-context).
3098Note, however, that this method of providing links to sections works
3099only in HTML, LaTeX, and ConTeXt formats.
3101If the \f[C]--section-divs\f[R] option is specified, then each section
3102will be wrapped in a \f[C]section\f[R] (or a \f[C]div\f[R], if
3103\f[C]html4\f[R] was specified), and the identifier will be attached to
3104the enclosing \f[C]<section>\f[R] (or \f[C]<div>\f[R]) tag rather than
3106This allows entire sections to be manipulated using JavaScript or
3107treated differently in CSS.
3108.SS Extension: \f[C]ascii_identifiers\f[R]
3110Causes the identifiers produced by \f[C]auto_identifiers\f[R] to be pure
3112Accents are stripped off of accented Latin letters, and non-Latin
3114.SS Extension: \f[C]gfm_auto_identifiers\f[R]
3116Changes the algorithm used by \f[C]auto_identifiers\f[R] to conform to
3118Spaces are converted to dashes (\f[C]-\f[R]), uppercase characters to
3119lowercase characters, and punctuation characters other than \f[C]-\f[R]
3120and \f[C]_\f[R] are removed.
3121Emojis are replaced by their names.
3124The extensions \f[C]tex_math_dollars\f[R],
3125\f[C]tex_math_single_backslash\f[R], and
3126\f[C]tex_math_double_backslash\f[R] are described in the section about
3127Pandoc\[aq]s Markdown.
3129However, they can also be used with HTML input.
3130This is handy for reading web pages formatted using MathJax, for
3134The following extensions (especially how they affect Markdown
3135input/output) are also described in more detail in their respective
3136sections of Pandoc\[aq]s Markdown.
3137.SS Extension: \f[C]raw_html\f[R]
3139When converting from HTML, parse elements to raw HTML which are not
3140representable in pandoc\[aq]s AST.
3141By default, this is disabled for HTML input.
3142.SS Extension: \f[C]raw_tex\f[R]
3144Allows raw LaTeX, TeX, and ConTeXt to be included in a document.
3146This extension can be enabled/disabled for the following formats (in
3147addition to \f[C]markdown\f[R]):
3150\f[C]latex\f[R], \f[C]org\f[R], \f[C]textile\f[R], \f[C]html\f[R]
3151(environments, \f[C]\[rs]ref\f[R], and \f[C]\[rs]eqref\f[R] only),
3155\f[C]textile\f[R], \f[C]commonmark\f[R]
3157Note: as applied to \f[C]ipynb\f[R], \f[C]raw_html\f[R] and
3158\f[C]raw_tex\f[R] affect not only raw TeX in markdown cells, but data
3159with mime type \f[C]text/html\f[R] in output cells.
3160Since the \f[C]ipynb\f[R] reader attempts to preserve the richest
3161possible outputs when several options are given, you will get best
3162results if you disable \f[C]raw_html\f[R] and \f[C]raw_tex\f[R] when
3163converting to formats like \f[C]docx\f[R] which don\[aq]t allow raw
3164\f[C]html\f[R] or \f[C]tex\f[R].
3165.SS Extension: \f[C]native_divs\f[R]
3167This extension is enabled by default for HTML input.
3168This means that \f[C]div\f[R]s are parsed to pandoc native elements.
3169(Alternatively, you can parse them to raw HTML using
3170\f[C]-f html-native_divs+raw_html\f[R].)
3172When converting HTML to Markdown, for example, you may want to drop all
3173\f[C]div\f[R]s and \f[C]span\f[R]s:
3177pandoc -f html-native_divs-native_spans -t markdown
3180.SS Extension: \f[C]native_spans\f[R]
3182Analogous to \f[C]native_divs\f[R] above.
3183.SS Literate Haskell support
3184.SS Extension: \f[C]literate_haskell\f[R]
3186Treat the document as literate Haskell source.
3188This extension can be enabled/disabled for the following formats:
3191\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R]
3194\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R], \f[C]html\f[R]
3196If you append \f[C]+lhs\f[R] (or \f[C]+literate_haskell\f[R]) to one of
3197the formats above, pandoc will treat the document as literate Haskell
3201In Markdown input, \[dq]bird track\[dq] sections will be parsed as
3202Haskell code rather than block quotations.
3203Text between \f[C]\[rs]begin{code}\f[R] and \f[C]\[rs]end{code}\f[R]
3204will also be treated as Haskell code.
3205For ATX-style headings the character \[aq]=\[aq] will be used instead of
3208In Markdown output, code blocks with classes \f[C]haskell\f[R] and
3209\f[C]literate\f[R] will be rendered using bird tracks, and block
3210quotations will be indented one space, so they will not be treated as
3212In addition, headings will be rendered setext-style (with underlines)
3213rather than ATX-style (with \[aq]#\[aq] characters).
3214(This is because ghc treats \[aq]#\[aq] characters in column 1 as
3215introducing line numbers.)
3217In restructured text input, \[dq]bird track\[dq] sections will be parsed
3220In restructured text output, code blocks with class \f[C]haskell\f[R]
3221will be rendered using bird tracks.
3223In LaTeX input, text in \f[C]code\f[R] environments will be parsed as
3226In LaTeX output, code blocks with class \f[C]haskell\f[R] will be
3227rendered inside \f[C]code\f[R] environments.
3229In HTML output, code blocks with class \f[C]haskell\f[R] will be
3230rendered with class \f[C]literatehaskell\f[R] and bird tracks.
3236pandoc -f markdown+lhs -t html
3240reads literate Haskell source formatted with Markdown conventions and
3241writes ordinary HTML (without bird tracks).
3245pandoc -f markdown+lhs -t html+lhs
3249writes HTML with the Haskell code in bird tracks, so it can be copied
3250and pasted as literate Haskell source.
3252Note that GHC expects the bird tracks in the first column, so indented
3253literate code blocks (e.g.
3254inside an itemized environment) will not be picked up by the Haskell
3257.SS Extension: \f[C]empty_paragraphs\f[R]
3259Allows empty paragraphs.
3260By default empty paragraphs are omitted.
3262This extension can be enabled/disabled for the following formats:
3265\f[C]docx\f[R], \f[C]html\f[R]
3268\f[C]docx\f[R], \f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]html\f[R]
3269.SS Extension: \f[C]native_numbering\f[R]
3271Enables native numbering of figures and tables.
3272Enumeration starts at 1.
3274This extension can be enabled/disabled for the following formats:
3277\f[C]odt\f[R], \f[C]opendocument\f[R]
3278.SS Extension: \f[C]styles\f[R] {#ext-styles}
3280When converting from docx, read all docx styles as divs (for paragraph
3281styles) and spans (for character styles) regardless of whether pandoc
3282understands the meaning of these styles.
3283This can be used with docx custom styles.
3288.SS Extension: \f[C]amuse\f[R]
3290In the \f[C]muse\f[R] input format, this enables Text::Amuse extensions
3291to Emacs Muse markup.
3292.SS Extension: \f[C]citations\f[R]
3294Some aspects of Pandoc\[aq]s Markdown citation syntax are also accepted
3295in \f[C]org\f[R] input.
3296.SS Extension: \f[C]ntb\f[R]
3298In the \f[C]context\f[R] output format this enables the use of Natural
3299Tables (TABLE) instead of the default Extreme Tables (xtables).
3300Natural tables allow more fine-grained global customization but come at
3301a performance penalty compared to extreme tables.
3302.SH PANDOC\[aq]S MARKDOWN
3304Pandoc understands an extended and slightly revised version of John
3305Gruber\[aq]s Markdown syntax.
3306This document explains the syntax, noting differences from standard
3308Except where noted, these differences can be suppressed by using the
3309\f[C]markdown_strict\f[R] format instead of \f[C]markdown\f[R].
3310Extensions can be enabled or disabled to specify the behavior more
3312They are described in the following.
3313See also Extensions above, for extensions that work also on other
3317Markdown is designed to be easy to write, and, even more importantly,
3321A Markdown-formatted document should be publishable as-is, as plain
3322text, without looking like it\[aq]s been marked up with tags or
3323formatting instructions.
3327This principle has guided pandoc\[aq]s decisions in finding syntax for
3328tables, footnotes, and other extensions.
3330There is, however, one respect in which pandoc\[aq]s aims are different
3331from the original aims of Markdown.
3332Whereas Markdown was originally designed with HTML generation in mind,
3333pandoc is designed for multiple output formats.
3334Thus, while pandoc allows the embedding of raw HTML, it discourages it,
3335and provides other, non-HTMLish ways of representing important document
3336elements like definition lists, tables, mathematics, and footnotes.
3339A paragraph is one or more lines of text followed by one or more blank
3341Newlines are treated as spaces, so you can reflow your paragraphs as you
3343If you need a hard line break, put two or more spaces at the end of a
3345.SS Extension: \f[C]escaped_line_breaks\f[R]
3347A backslash followed by a newline is also a hard line break.
3348Note: in multiline and grid table cells, this is the only way to create
3349a hard line break, since trailing spaces in the cells are ignored.
3352There are two kinds of headings: Setext and ATX.
3353.SS Setext-style headings
3355A setext-style heading is a line of text \[dq]underlined\[dq] with a row
3356of \f[C]=\f[R] signs (for a level-one heading) or \f[C]-\f[R] signs (for
3357a level-two heading):
3369The heading text can contain inline formatting, such as emphasis (see
3370Inline formatting, below).
3371.SS ATX-style headings
3373An ATX-style heading consists of one to six \f[C]#\f[R] signs and a line
3374of text, optionally followed by any number of \f[C]#\f[R] signs.
3375The number of \f[C]#\f[R] signs at the beginning of the line is the
3380## A level-two heading
3382### A level-three heading ###
3386As with setext-style headings, the heading text can contain formatting:
3390# A level-one heading with a [link](/url) and *emphasis*
3393.SS Extension: \f[C]blank_before_header\f[R]
3395Standard Markdown syntax does not require a blank line before a heading.
3396Pandoc does require this (except, of course, at the beginning of the
3398The reason for the requirement is that it is all too easy for a
3399\f[C]#\f[R] to end up at the beginning of a line by accident (perhaps
3400through line wrapping).
3401Consider, for example:
3405I like several of their flavors of ice cream:
3406#22, for example, and #5.
3409.SS Extension: \f[C]space_in_atx_header\f[R]
3411Many Markdown implementations do not require a space between the opening
3412\f[C]#\f[R]s of an ATX heading and the heading text, so that
3413\f[C]#5 bolt\f[R] and \f[C]#hashtag\f[R] count as headings.
3414With this extension, pandoc does require the space.
3415.SS Heading identifiers
3417See also the \f[C]auto_identifiers\f[R] extension above.
3418.SS Extension: \f[C]header_attributes\f[R]
3420Headings can be assigned attributes using this syntax at the end of the
3421line containing the heading text:
3425{#identifier .class .class key=value key=value}
3429Thus, for example, the following headings will all be assigned the
3430identifier \f[C]foo\f[R]:
3436## My heading ## {#foo}
3438My other heading {#foo}
3443(This syntax is compatible with PHP Markdown Extra.)
3445Note that although this syntax allows assignment of classes and
3446key/value attributes, writers generally don\[aq]t use all of this
3448Identifiers, classes, and key/value attributes are used in HTML and
3449HTML-based formats such as EPUB and slidy.
3450Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
3451Textile, Jira markup, and AsciiDoc writers.
3453Headings with the class \f[C]unnumbered\f[R] will not be numbered, even
3454if \f[C]--number-sections\f[R] is specified.
3455A single hyphen (\f[C]-\f[R]) in an attribute context is equivalent to
3456\f[C].unnumbered\f[R], and preferable in non-English documents.
3469# My heading {.unnumbered}
3473If the \f[C]unlisted\f[R] class is present in addition to
3474\f[C]unnumbered\f[R], the heading will not be included in a table of
3476(Currently this feature is only implemented for certain formats: those
3477based on LaTeX and HTML, PowerPoint, and RTF.)
3478.SS Extension: \f[C]implicit_header_references\f[R]
3480Pandoc behaves as if reference links have been defined for each heading.
3481So, to link to a heading
3485# Heading identifiers in HTML
3493[Heading identifiers in HTML]
3501[Heading identifiers in HTML][]
3509[the section on heading identifiers][heading identifiers in
3514instead of giving the identifier explicitly:
3518[Heading identifiers in HTML](#heading-identifiers-in-html)
3522If there are multiple headings with identical text, the corresponding
3523reference will link to the first one only, and you will need to use
3524explicit links to link to the others, as described above.
3526Like regular reference links, these references are case-insensitive.
3528Explicit link reference definitions always take priority over implicit
3530So, in the following example, the link will point to \f[C]bar\f[R], not
3544Markdown uses email conventions for quoting blocks of text.
3545A block quotation is one or more paragraphs or other block elements
3546(such as lists or headings), with each line preceded by a \f[C]>\f[R]
3547character and an optional space.
3548(The \f[C]>\f[R] need not start at the left margin, but it should not be
3549indented more than three spaces.)
3553> This is a block quote. This
3554> paragraph has two lines.
3556> 1. This is a list inside a block quote.
3561A \[dq]lazy\[dq] form, which requires the \f[C]>\f[R] character only on
3562the first line of each block, is also allowed:
3566> This is a block quote. This
3567paragraph has two lines.
3569> 1. This is a list inside a block quote.
3574Among the block elements that can be contained in a block quote are
3576That is, block quotes can be nested:
3580> This is a block quote.
3582> > A block quote within a block quote.
3586If the \f[C]>\f[R] character is followed by an optional space, that
3587space will be considered part of the block quote marker and not part of
3588the indentation of the contents.
3589Thus, to put an indented code block in a block quote, you need five
3590spaces after the \f[C]>\f[R]:
3597.SS Extension: \f[C]blank_before_blockquote\f[R]
3599Standard Markdown syntax does not require a blank line before a block
3601Pandoc does require this (except, of course, at the beginning of the
3603The reason for the requirement is that it is all too easy for a
3604\f[C]>\f[R] to end up at the beginning of a line by accident (perhaps
3605through line wrapping).
3606So, unless the \f[C]markdown_strict\f[R] format is used, the following
3607does not produce a nested block quote in pandoc:
3611> This is a block quote.
3615.SS Verbatim (code) blocks
3616.SS Indented code blocks
3618A block of text indented four spaces (or one tab) is treated as verbatim
3619text: that is, special characters do not trigger special formatting, and
3620all spaces and line breaks are preserved.
3626 moveShip(5 * gravity, DOWN);
3631The initial (four space or one tab) indentation is not considered part
3632of the verbatim text, and is removed in the output.
3634Note: blank lines in the verbatim text need not begin with four spaces.
3635.SS Fenced code blocks
3636.SS Extension: \f[C]fenced_code_blocks\f[R]
3638In addition to standard indented code blocks, pandoc supports
3639\f[I]fenced\f[R] code blocks.
3640These begin with a row of three or more tildes (\f[C]\[ti]\f[R]) and end
3641with a row of tildes that must be at least as long as the starting row.
3642Everything between these lines is treated as code.
3643No indentation is necessary:
3647\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3649 moveShip(5 * gravity, DOWN);
3651\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3655Like regular code blocks, fenced code blocks must be separated from
3656surrounding text by blank lines.
3658If the code itself contains a row of tildes or backticks, just use a
3659longer row of tildes or backticks at the start and end:
3663\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3664\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3665code including tildes
3666\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3667\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
3670.SS Extension: \f[C]backtick_code_blocks\f[R]
3672Same as \f[C]fenced_code_blocks\f[R], but uses backticks
3673(\f[C]\[ga]\f[R]) instead of tildes (\f[C]\[ti]\f[R]).
3674.SS Extension: \f[C]fenced_code_attributes\f[R]
3676Optionally, you may attach attributes to fenced or backtick code block
3681\[ti]\[ti]\[ti]\[ti] {#mycode .haskell .numberLines startFrom=\[dq]100\[dq]}
3683qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
3684 qsort (filter (>= x) xs)
3685\[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]
3689Here \f[C]mycode\f[R] is an identifier, \f[C]haskell\f[R] and
3690\f[C]numberLines\f[R] are classes, and \f[C]startFrom\f[R] is an
3691attribute with value \f[C]100\f[R].
3692Some output formats can use this information to do syntax highlighting.
3693Currently, the only output formats that uses this information are HTML,
3694LaTeX, Docx, Ms, and PowerPoint.
3695If highlighting is supported for your output format and language, then
3696the code block above will appear highlighted, with numbered lines.
3697(To see which languages are supported, type
3698\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block
3699above will appear as follows:
3703<pre id=\[dq]mycode\[dq] class=\[dq]haskell numberLines\[dq] startFrom=\[dq]100\[dq]>
3711The \f[C]numberLines\f[R] (or \f[C]number-lines\f[R]) class will cause
3712the lines of the code block to be numbered, starting with \f[C]1\f[R] or
3713the value of the \f[C]startFrom\f[R] attribute.
3714The \f[C]lineAnchors\f[R] (or \f[C]line-anchors\f[R]) class will cause
3715the lines to be clickable anchors in HTML output.
3717A shortcut form can also be used for specifying the language of the code
3722\[ga]\[ga]\[ga]haskell
3728This is equivalent to:
3732\[ga]\[ga]\[ga] {.haskell}
3738If the \f[C]fenced_code_attributes\f[R] extension is disabled, but input
3739contains class attribute(s) for the code block, the first class
3740attribute will be printed after the opening fence as a bare word.
3742To prevent all highlighting, use the \f[C]--no-highlight\f[R] flag.
3743To set the highlighting style, use \f[C]--highlight-style\f[R].
3744For more information on highlighting, see Syntax highlighting, below.
3746.SS Extension: \f[C]line_blocks\f[R]
3748A line block is a sequence of lines beginning with a vertical bar
3749(\f[C]|\f[R]) followed by a space.
3750The division into lines will be preserved in the output, as will any
3751leading spaces; otherwise, the lines will be formatted as Markdown.
3752This is useful for verse and addresses:
3756| The limerick packs laughs anatomical
3757| In space that is quite economical.
3758| But the good ones I\[aq]ve seen
3759| So seldom are clean
3760| And the clean ones so seldom are comical
3767The lines can be hard-wrapped if needed, but the continuation line must
3772| The Right Honorable Most Venerable and Righteous Samuel L.
3779This syntax is borrowed from reStructuredText.
3783A bullet list is a list of bulleted list items.
3784A bulleted list item begins with a bullet (\f[C]*\f[R], \f[C]+\f[R], or
3786Here is a simple example:
3796This will produce a \[dq]compact\[dq] list.
3797If you want a \[dq]loose\[dq] list, in which each item is formatted as a
3798paragraph, put spaces between the items:
3810The bullets need not be flush with the left margin; they may be indented
3811one, two, or three spaces.
3812The bullet must be followed by whitespace.
3814List items look best if subsequent lines are flush with the first line
3825But Markdown also allows a \[dq]lazy\[dq] format:
3834.SS Block content in list items
3836A list item may contain multiple paragraphs and other block-level
3838However, subsequent paragraphs must be preceded by a blank line and
3839indented to line up with the first non-space content after the list
3848 * Second paragraph. With a code block, which must be indented
3855Exception: if the list marker is followed by an indented code block,
3856which must begin 5 spaces after the list marker, then subsequent
3857paragraphs must begin two columns after the last character of the list
3864 continuation paragraph
3868List items may include other lists.
3869In this case the preceding blank line is optional.
3870The nested list must be indented to line up with the first non-space
3871character after the list marker of the containing list item.
3887As noted above, Markdown allows you to write list items
3888\[dq]lazily,\[dq] instead of indenting continuation lines.
3889However, if there are multiple paragraphs or other blocks in a list
3890item, the first line of each must be indented.
3897+ Another one; this looks
3900 Second paragraph of second
3906Ordered lists work just like bulleted lists, except that the items begin
3907with enumerators rather than bullets.
3909In standard Markdown, enumerators are decimal numbers followed by a
3911The numbers themselves are ignored, so there is no difference between
3931.SS Extension: \f[C]fancy_lists\f[R]
3933Unlike standard Markdown, pandoc allows ordered list items to be marked
3934with uppercase and lowercase letters and roman numerals, in addition to
3936List markers may be enclosed in parentheses or followed by a single
3937right-parentheses or period.
3938They must be separated from the text that follows by at least one space,
3939and, if the list marker is a capital letter with a period, by at least
3942The \f[C]fancy_lists\f[R] extension also allows \[aq]\f[C]#\f[R]\[aq] to
3943be used as an ordered list marker in place of a numeral:
3951.SS Extension: \f[C]startnum\f[R]
3953Pandoc also pays attention to the type of list marker used, and to the
3954starting number, and both of these are preserved where possible in the
3956Thus, the following yields a list with numbers followed by a single
3957parenthesis, starting with 9, and a sublist with lowercase roman
3971Pandoc will start a new list each time a different type of list marker
3973So, the following will create three lists:
3984If default list markers are desired, use \f[C]#.\f[R]:
3993.SS Extension: \f[C]task_lists\f[R]
3995Pandoc supports task lists, using the syntax of GitHub-Flavored
4000- [ ] an unchecked task list item
4005.SS Extension: \f[C]definition_lists\f[R]
4007Pandoc supports definition lists, using the syntax of PHP Markdown Extra
4008with some extensions.
4016Term 2 with *inline markup*
4020 { some code, part of Definition 2 }
4022 Third paragraph of definition 2.
4026Each term must fit on one line, which may optionally be followed by a
4027blank line, and must be followed by one or more definitions.
4028A definition begins with a colon or tilde, which may be indented one or
4031A term may have multiple definitions, and each definition may consist of
4032one or more block elements (paragraph, code block, list, etc.), each
4033indented four spaces or one tab stop.
4034The body of the definition (including the first line, aside from the
4035colon or tilde) should be indented four spaces.
4036However, as with other Markdown lists, you can \[dq]lazily\[dq] omit
4037indentation except at the beginning of a paragraph or other block
4045with lazy continuation.
4047 Second paragraph of the definition.
4051If you leave space before the definition (as in the example above), the
4052text of the definition will be treated as a paragraph.
4053In some output formats, this will mean greater spacing between
4054term/definition pairs.
4055For a more compact definition list, omit the space before the
4069Note that space between items in a definition list is required.
4070(A variant that loosens this requirement, but disallows \[dq]lazy\[dq]
4071hard wrapping, can be activated with \f[C]compact_definition_lists\f[R]:
4072see Non-pandoc extensions, below.)
4073.SS Numbered example lists
4074.SS Extension: \f[C]example_lists\f[R]
4076The special list marker \f[C]\[at]\f[R] can be used for sequentially
4078The first list item with a \f[C]\[at]\f[R] marker will be numbered
4079\[aq]1\[aq], the next \[aq]2\[aq], and so on, throughout the document.
4080The numbered examples need not occur in a single list; each new list
4081using \f[C]\[at]\f[R] will take up where the last stopped.
4086(\[at]) My first example will be numbered (1).
4087(\[at]) My second example will be numbered (2).
4089Explanation of examples.
4091(\[at]) My third example will be numbered (3).
4095Numbered examples can be labeled and referred to elsewhere in the
4100(\[at]good) This is a good example.
4102As (\[at]good) illustrates, ...
4106The label can be any string of alphanumeric characters, underscores, or
4109Note: continuation paragraphs in example lists must always be indented
4110four spaces, regardless of the length of the list marker.
4111That is, example lists always behave as if the \f[C]four_space_rule\f[R]
4113This is because example labels tend to be long, and indenting content to
4114the first non-space character after the label would be awkward.
4115.SS Compact and loose lists
4117Pandoc behaves differently from \f[C]Markdown.pl\f[R] on some \[dq]edge
4118cases\[dq] involving lists.
4119Consider this source:
4133Pandoc transforms this into a \[dq]compact list\[dq] (with no
4134\f[C]<p>\f[R] tags around \[dq]First\[dq], \[dq]Second\[dq], or
4135\[dq]Third\[dq]), while Markdown puts \f[C]<p>\f[R] tags around
4136\[dq]Second\[dq] and \[dq]Third\[dq] (but not \[dq]First\[dq]), because
4137of the blank space around \[dq]Third\[dq].
4138Pandoc follows a simple rule: if the text is followed by a blank line,
4139it is treated as a paragraph.
4140Since \[dq]Second\[dq] is followed by a list, and not a blank line, it
4141isn\[aq]t treated as a paragraph.
4142The fact that the list is followed by a blank line is irrelevant.
4143(Note: Pandoc works this way even when the \f[C]markdown_strict\f[R]
4145This behavior is consistent with the official Markdown syntax
4146description, even though it is different from that of
4147\f[C]Markdown.pl\f[R].)
4150What if you want to put an indented code block after a list?
4161Trouble! Here pandoc (like other Markdown implementations) will treat
4162\f[C]{ my code block }\f[R] as the second paragraph of item two, and not
4165To \[dq]cut off\[dq] the list after item two, you can insert some
4166non-indented content, like an HTML comment, which won\[aq]t produce
4167visible output in any format:
4180You can use the same trick if you want two consecutive lists instead of
4198A line containing a row of three or more \f[C]*\f[R], \f[C]-\f[R], or
4199\f[C]_\f[R] characters (optionally separated by spaces) produces a
4211Four kinds of tables may be used.
4212The first three kinds presuppose the use of a fixed-width font, such as
4214The fourth kind can be used with proportionally spaced fonts, as it does
4215not require lining up columns.
4216.SS Extension: \f[C]table_captions\f[R]
4218A caption may optionally be provided with all 4 kinds of tables (as
4219illustrated in the examples below).
4220A caption is a paragraph beginning with the string \f[C]Table:\f[R] (or
4221just \f[C]:\f[R]), which will be stripped off.
4222It may appear either before or after the table.
4223.SS Extension: \f[C]simple_tables\f[R]
4225Simple tables look like this:
4229 Right Left Center Default
4230------- ------ ---------- -------
4235Table: Demonstration of simple table syntax.
4239The header and table rows must each fit on one line.
4240Column alignments are determined by the position of the header text
4241relative to the dashed line below it:
4243If the dashed line is flush with the header text on the right side but
4244extends beyond it on the left, the column is right-aligned.
4246If the dashed line is flush with the header text on the left side but
4247extends beyond it on the right, the column is left-aligned.
4249If the dashed line extends beyond the header text on both sides, the
4252If the dashed line is flush with the header text on both sides, the
4253default alignment is used (in most cases, this will be left).
4255The table must end with a blank line, or a line of dashes followed by a
4258The column header row may be omitted, provided a dashed line is used to
4264------- ------ ---------- -------
4268------- ------ ---------- -------
4272When the header row is omitted, column alignments are determined on the
4273basis of the first line of the table body.
4274So, in the tables above, the columns would be right, left, center, and
4275right aligned, respectively.
4276.SS Extension: \f[C]multiline_tables\f[R]
4278Multiline tables allow header and table rows to span multiple lines of
4279text (but cells that span multiple columns or rows of the table are not
4285-------------------------------------------------------------
4286 Centered Default Right Left
4287 Header Aligned Aligned Aligned
4288----------- ------- --------------- -------------------------
4289 First row 12.0 Example of a row that
4290 spans multiple lines.
4292 Second row 5.0 Here\[aq]s another one. Note
4293 the blank line between
4295-------------------------------------------------------------
4297Table: Here\[aq]s the caption. It, too, may span
4302These work like simple tables, but with the following differences:
4304They must begin with a row of dashes, before the header text (unless the
4305header row is omitted).
4307They must end with a row of dashes, then a blank line.
4309The rows must be separated by blank lines.
4311In multiline tables, the table parser pays attention to the widths of
4312the columns, and the writers try to reproduce these relative widths in
4314So, if you find that one of the columns is too narrow in the output, try
4315widening it in the Markdown source.
4317The header may be omitted in multiline tables as well as simple tables:
4321----------- ------- --------------- -------------------------
4322 First row 12.0 Example of a row that
4323 spans multiple lines.
4325 Second row 5.0 Here\[aq]s another one. Note
4326 the blank line between
4328----------- ------- --------------- -------------------------
4330: Here\[aq]s a multiline table without a header.
4334It is possible for a multiline table to have just one row, but the row
4335should be followed by a blank line (and then the row of dashes that ends
4336the table), or the table may be interpreted as a simple table.
4337.SS Extension: \f[C]grid_tables\f[R]
4339Grid tables look like this:
4345+---------------+---------------+--------------------+
4346| Fruit | Price | Advantages |
4347+===============+===============+====================+
4348| Bananas | $1.34 | - built-in wrapper |
4349| | | - bright color |
4350+---------------+---------------+--------------------+
4351| Oranges | $2.10 | - cures scurvy |
4353+---------------+---------------+--------------------+
4357The row of \f[C]=\f[R]s separates the header from the table body, and
4358can be omitted for a headerless table.
4359The cells of grid tables may contain arbitrary block elements (multiple
4360paragraphs, code blocks, lists, etc.).
4361Cells that span multiple columns or rows are not supported.
4362Grid tables can be created easily using Emacs\[aq] table-mode
4363(\f[C]M-x table-insert\f[R]).
4365Alignments can be specified as with pipe tables, by putting colons at
4366the boundaries of the separator line after the header:
4370+---------------+---------------+--------------------+
4371| Right | Left | Centered |
4372+==============:+:==============+:==================:+
4373| Bananas | $1.34 | built-in wrapper |
4374+---------------+---------------+--------------------+
4378For headerless tables, the colons go on the top line instead:
4382+--------------:+:--------------+:------------------:+
4383| Right | Left | Centered |
4384+---------------+---------------+--------------------+
4387.SS Grid Table Limitations
4389Pandoc does not support grid tables with row spans or column spans.
4390This means that neither variable numbers of columns across rows nor
4391variable numbers of rows across columns are supported by Pandoc.
4392All grid tables must have the same number of columns in each row, and
4393the same number of rows in each column.
4394For example, the Docutils sample grid tables will not render as expected
4396.SS Extension: \f[C]pipe_tables\f[R]
4398Pipe tables look like this:
4402| Right | Left | Default | Center |
4403|------:|:-----|---------|:------:|
4404| 12 | 12 | 12 | 12 |
4405| 123 | 123 | 123 | 123 |
4408 : Demonstration of pipe table syntax.
4412The syntax is identical to PHP Markdown Extra tables.
4413The beginning and ending pipe characters are optional, but pipes are
4414required between all columns.
4415The colons indicate column alignment as shown.
4416The header cannot be omitted.
4417To simulate a headerless table, include a header with blank cells.
4419Since the pipes indicate column boundaries, columns need not be
4420vertically aligned, as they are in the above example.
4421So, this is a perfectly legal (though ugly) pipe table:
4433The cells of pipe tables cannot contain block elements like paragraphs
4434and lists, and cannot span multiple lines.
4435If a pipe table contains a row whose Markdown content is wider than the
4436column width (see \f[C]--columns\f[R]), then the table will take up the
4437full text width and the cell contents will wrap, with the relative cell
4438widths determined by the number of dashes in the line separating the
4439table header from the table body.
4440(For example \f[C]---|-\f[R] would make the first column 3/4 and the
4441second column 1/4 of the full text width.) On the other hand, if no
4442lines are wider than column width, then cell contents will not be
4443wrapped, and the cells will be sized to their contents.
4445Note: pandoc also recognizes pipe tables of the following form, as can
4446be produced by Emacs\[aq] orgtbl-mode:
4457The difference is that \f[C]+\f[R] is used instead of \f[C]|\f[R].
4458Other orgtbl features are not supported.
4459In particular, to get non-default column alignment, you\[aq]ll need to
4462.SS Extension: \f[C]pandoc_title_block\f[R]
4464If the file begins with a title block
4469% author(s) (separated by semicolons)
4474it will be parsed as bibliographic information, not regular text.
4475(It will be used, for example, in the title of standalone LaTeX or HTML
4476output.) The block may contain just a title, a title and an author, or
4478If you want to include an author but no title, or a title and a date but
4479no author, you need a blank line:
4496The title may occupy multiple lines, but continuation lines must begin
4497with leading space, thus:
4506If a document has multiple authors, the authors may be put on separate
4507lines with leading space, or separated by semicolons, or both.
4508So, all of the following are equivalent:
4519% Author One; Author Two
4530The date must fit on one line.
4532All three metadata fields may contain standard inline formatting
4533(italics, links, footnotes, etc.).
4535Title blocks will always be parsed, but they will affect the output only
4536when the \f[C]--standalone\f[R] (\f[C]-s\f[R]) option is chosen.
4537In HTML output, titles will appear twice: once in the document head --
4538this is the title that will appear at the top of the window in a browser
4539-- and once at the beginning of the document body.
4540The title in the document head can have an optional prefix attached
4541(\f[C]--title-prefix\f[R] or \f[C]-T\f[R] option).
4542The title in the body appears as an H1 element with class
4543\[dq]title\[dq], so it can be suppressed or reformatted with CSS.
4544If a title prefix is specified with \f[C]-T\f[R] and no title block
4545appears in the document, the title prefix will be used by itself as the
4548The man page writer extracts a title, man page section number, and other
4549header and footer information from the title line.
4550The title is assumed to be the first word on the title line, which may
4551optionally end with a (single-digit) section number in parentheses.
4552(There should be no space between the title and the parentheses.)
4553Anything after this is assumed to be additional footer and header text.
4554A single pipe character (\f[C]|\f[R]) should be used to separate the
4555footer text from the header text.
4564will yield a man page with the title \f[C]PANDOC\f[R] and section 1.
4568% PANDOC(1) Pandoc User Manuals
4572will also have \[dq]Pandoc User Manuals\[dq] in the footer.
4576% PANDOC(1) Pandoc User Manuals | Version 4.0
4580will also have \[dq]Version 4.0\[dq] in the header.
4581.SS Extension: \f[C]yaml_metadata_block\f[R]
4583A YAML metadata block is a valid YAML object, delimited by a line of
4584three hyphens (\f[C]---\f[R]) at the top and a line of three hyphens
4585(\f[C]---\f[R]) or three dots (\f[C]...\f[R]) at the bottom.
4586A YAML metadata block may occur anywhere in the document, but if it is
4587not at the beginning, it must be preceded by a blank line.
4588(Note that, because of the way pandoc concatenates input files when
4589several are provided, you may also keep the metadata in a separate YAML
4590file and pass it to pandoc as an argument, along with your Markdown
4595pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
4599Just be sure that the YAML file begins with \f[C]---\f[R] and ends with
4600\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the
4601\f[C]--metadata-file\f[R] option.
4602Using that approach however, you cannot reference content (like
4603footnotes) from the main markdown input document.
4605Metadata will be taken from the fields of the YAML object and added to
4606any existing document metadata.
4607Metadata can contain lists and objects (nested arbitrarily), but all
4608string scalars will be interpreted as Markdown.
4609Fields with names ending in an underscore will be ignored by pandoc.
4610(They may be given a role by external processors.) Field names must not
4611be interpretable as YAML numbers or boolean values (so, for example,
4612\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field
4615A document may contain multiple metadata blocks.
4616If two metadata blocks attempt to set the same field, the value from the
4617second block will be taken.
4619When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown
4620document, a YAML metadata block will be produced only if the
4621\f[C]-s/--standalone\f[R] option is used.
4622All of the metadata will appear in a single block at the beginning of
4625Note that YAML escaping rules must be followed.
4626Thus, for example, if a title contains a colon, it must be quoted.
4627The pipe character (\f[C]|\f[R]) can be used to begin an indented block
4628that will be interpreted literally, without need for escaping.
4629This form is necessary when the field contains blank lines or
4630block-level formatting:
4635title: \[aq]This is the title: it contains a colon\[aq]
4639keywords: [nothing, nothingness]
4641 This is the abstract.
4643 It consists of two paragraphs.
4648Template variables will be set automatically from the metadata.
4649Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
4650be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
4655<p>This is the abstract.</p>
4656<p>It consists of two paragraphs.</p>
4660Variables can contain arbitrary YAML structures, but the template must
4661match this structure.
4662The \f[C]author\f[R] variable in the default templates expects a simple
4663list or string, but can be changed to support more complicated
4665The following combination, for example, would add an affiliation to the
4666author if one is given:
4671title: The document title
4674 affiliation: University of Somewhere
4676 affiliation: University of Nowhere
4681To use the structured authors in the example above, you would need a
4688$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
4696Raw content to include in the document\[aq]s header may be specified
4697using \f[C]header-includes\f[R]; however, it is important to mark up
4698this content as raw code for a particular output format, using the
4699\f[C]raw_attribute\f[R] extension), or it will be interpreted as
4707 \[ga]\[ga]\[ga]{=latex}
4708 \[rs]let\[rs]oldsection\[rs]section
4709 \[rs]renewcommand{\[rs]section}[1]{\[rs]clearpage\[rs]oldsection{#1}}
4713.SS Backslash escapes
4714.SS Extension: \f[C]all_symbols_escapable\f[R]
4716Except inside a code block or inline code, any punctuation or space
4717character preceded by a backslash will be treated literally, even if it
4718would normally indicate formatting.
4719Thus, for example, if one writes
4739<strong>hello</strong>
4743This rule is easier to remember than standard Markdown\[aq]s rule, which
4744allows only the following characters to be backslash-escaped:
4748\[rs]\[ga]*_{}[]()>#+-.!
4752(However, if the \f[C]markdown_strict\f[R] format is used, the standard
4753Markdown rule will be used.)
4755A backslash-escaped space is parsed as a nonbreaking space.
4756In TeX output, it will appear as \f[C]\[ti]\f[R].
4757In HTML and XML output, it will appear as a literal unicode nonbreaking
4758space character (note that it will thus actually look
4759\[dq]invisible\[dq] in the generated HTML source; you can still use the
4760\f[C]--ascii\f[R] command-line option to make it appear as an explicit
4763A backslash-escaped newline (i.e.
4764a backslash occurring at the end of a line) is parsed as a hard line
4766It will appear in TeX output as \f[C]\[rs]\[rs]\f[R] and in HTML as
4768This is a nice alternative to Markdown\[aq]s \[dq]invisible\[dq] way of
4769indicating hard line breaks using two trailing spaces on a line.
4771Backslash escapes do not work in verbatim contexts.
4772.SS Inline formatting
4775To \f[I]emphasize\f[R] some text, surround it with \f[C]*\f[R]s or
4776\f[C]_\f[R], like this:
4780This text is _emphasized with underscores_, and this
4781is *emphasized with asterisks*.
4785Double \f[C]*\f[R] or \f[C]_\f[R] produces \f[B]strong emphasis\f[R]:
4789This is **strong emphasis** and __with underscores__.
4793A \f[C]*\f[R] or \f[C]_\f[R] character surrounded by spaces, or
4794backslash-escaped, will not trigger emphasis:
4798This is * not emphasized *, and \[rs]*neither is this\[rs]*.
4801.SS Extension: \f[C]intraword_underscores\f[R]
4803Because \f[C]_\f[R] is sometimes used inside words and identifiers,
4804pandoc does not interpret a \f[C]_\f[R] surrounded by alphanumeric
4805characters as an emphasis marker.
4806If you want to emphasize just part of a word, use \f[C]*\f[R]:
4810feas*ible*, not feas*able*.
4814.SS Extension: \f[C]strikeout\f[R]
4816To strikeout a section of text with a horizontal line, begin and end it
4817with \f[C]\[ti]\[ti]\f[R].
4822This \[ti]\[ti]is deleted text.\[ti]\[ti]
4825.SS Superscripts and subscripts
4826.SS Extension: \f[C]superscript\f[R], \f[C]subscript\f[R]
4828Superscripts may be written by surrounding the superscripted text by
4829\f[C]\[ha]\f[R] characters; subscripts may be written by surrounding the
4830subscripted text by \f[C]\[ti]\f[R] characters.
4835H\[ti]2\[ti]O is a liquid. 2\[ha]10\[ha] is 1024.
4839The text between \f[C]\[ha]...\[ha]\f[R] or \f[C]\[ti]...\[ti]\f[R] may
4840not contain spaces or newlines.
4841If the superscripted or subscripted text contains spaces, these spaces
4842must be escaped with backslashes.
4843(This is to prevent accidental superscripting and subscripting through
4844the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R], and also bad
4845interactions with footnotes.) Thus, if you want the letter P with \[aq]a
4846cat\[aq] in subscripts, use \f[C]P\[ti]a\[rs] cat\[ti]\f[R], not
4847\f[C]P\[ti]a cat\[ti]\f[R].
4850To make a short span of text verbatim, put it inside backticks:
4854What is the difference between \[ga]>>=\[ga] and \[ga]>>\[ga]?
4858If the verbatim text includes a backtick, use double backticks:
4862Here is a literal backtick \[ga]\[ga] \[ga] \[ga]\[ga].
4866(The spaces after the opening backticks and before the closing backticks
4869The general rule is that a verbatim span starts with a string of
4870consecutive backticks (optionally followed by a space) and ends with a
4871string of the same number of backticks (optionally preceded by a space).
4873Note that backslash-escapes (and other Markdown constructs) do not work
4874in verbatim contexts:
4878This is a backslash followed by an asterisk: \[ga]\[rs]*\[ga].
4881.SS Extension: \f[C]inline_code_attributes\f[R]
4883Attributes can be attached to verbatim text, just as with fenced code
4888\[ga]<$>\[ga]{.haskell}
4893To write small caps, use the \f[C]smallcaps\f[R] class:
4897[Small caps]{.smallcaps}
4901Or, without the \f[C]bracketed_spans\f[R] extension:
4905<span class=\[dq]smallcaps\[dq]>Small caps</span>
4909For compatibility with other Markdown flavors, CSS is also supported:
4913<span style=\[dq]font-variant:small-caps;\[dq]>Small caps</span>
4917This will work in all output formats that support small caps.
4919.SS Extension: \f[C]tex_math_dollars\f[R]
4921Anything between two \f[C]$\f[R] characters will be treated as TeX math.
4922The opening \f[C]$\f[R] must have a non-space character immediately to
4923its right, while the closing \f[C]$\f[R] must have a non-space character
4924immediately to its left, and must not be followed immediately by a
4926Thus, \f[C]$20,000 and $30,000\f[R] won\[aq]t parse as math.
4927If for some reason you need to enclose text in literal \f[C]$\f[R]
4928characters, backslash-escape them and they won\[aq]t be treated as math
4931For display math, use \f[C]$$\f[R] delimiters.
4932(In this case, the delimiters may be separated from the formula by
4935TeX math will be printed in all output formats.
4936How it is rendered depends on the output format:
4939It will appear verbatim surrounded by \f[C]\[rs](...\[rs])\f[R] (for
4940inline math) or \f[C]\[rs][...\[rs]]\f[R] (for display math).
4942Markdown, Emacs Org mode, ConTeXt, ZimWiki
4943It will appear verbatim surrounded by \f[C]$...$\f[R] (for inline math)
4944or \f[C]$$...$$\f[R] (for display math).
4947It will appear verbatim surrounded by
4948\f[C]{{formula}}..{{/formula}}\f[R].
4951It will be rendered using an interpreted text role \f[C]:math:\f[R].
4954For AsciiDoc output format (\f[C]-t asciidoc\f[R]) it will appear
4955verbatim surrounded by \f[C]latexmath:[$...$]\f[R] (for inline math) or
4956\f[C][latexmath]++++\[rs][...\[rs]]+++\f[R] (for display math).
4957For AsciiDoctor output format (\f[C]-t asciidoctor\f[R]) the LaTex
4958delimiters (\f[C]$..$\f[R] and \f[C]\[rs][..\[rs]]\f[R]) are omitted.
4961It will be rendered inside a \f[C]\[at]math\f[R] command.
4963roff man, Jira markup
4964It will be rendered verbatim without \f[C]$\f[R]\[aq]s.
4967It will be rendered inside \f[C]<math>\f[R] tags.
4970It will be rendered inside \f[C]<span class=\[dq]math\[dq]>\f[R] tags.
4973It will be rendered, if possible, using Unicode characters, and will
4974otherwise appear verbatim.
4977It will be rendered, if possible, using MathML.
4980If the \f[C]--mathml\f[R] flag is used, it will be rendered using MathML
4981in an \f[C]inlineequation\f[R] or \f[C]informalequation\f[R] tag.
4982Otherwise it will be rendered, if possible, using Unicode characters.
4985It will be rendered using OMML math markup.
4988If the \f[C]--webtex\f[R] option is used, formulas are rendered as
4989images using CodeCogs or other compatible web service, downloaded and
4990embedded in the e-book.
4991Otherwise, they will appear verbatim.
4993HTML, Slidy, DZSlides, S5, EPUB
4994The way math is rendered in HTML will depend on the command-line options
4996Therefore see Math rendering in HTML above.
4998.SS Extension: \f[C]raw_html\f[R]
5000Markdown allows you to insert raw HTML (or DocBook) anywhere in a
5001document (except verbatim contexts, where \f[C]<\f[R], \f[C]>\f[R], and
5002\f[C]&\f[R] are interpreted literally).
5003(Technically this is not an extension, since standard Markdown allows
5004it, but it has been made an extension so that it can be disabled if
5007The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
5008DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile
5009output, and suppressed in other formats.
5011For a more explicit way of including raw HTML in a Markdown document,
5012see the \f[C]raw_attribute\f[R] extension.
5014In the CommonMark format, if \f[C]raw_html\f[R] is enabled,
5015superscripts, subscripts, strikeouts and small capitals will be
5017Otherwise, plain-text fallbacks will be used.
5018Note that even if \f[C]raw_html\f[R] is disabled, tables will be
5019rendered with HTML syntax if they cannot use pipe syntax.
5020.SS Extension: \f[C]markdown_in_html_blocks\f[R]
5022Standard Markdown allows you to include HTML \[dq]blocks\[dq]: blocks of
5023HTML between balanced tags that are separated from the surrounding text
5024with blank lines, and start and end at the left margin.
5025Within these blocks, everything is interpreted as HTML, not Markdown; so
5026(for example), \f[C]*\f[R] does not signify emphasis.
5028Pandoc behaves this way when the \f[C]markdown_strict\f[R] format is
5029used; but by default, pandoc interprets material between HTML block tags
5031Thus, for example, pandoc will turn
5038<td>[a link](https://google.com)</td>
5050<td><em>one</em></td>
5051<td><a href=\[dq]https://google.com\[dq]>a link</a></td>
5057whereas \f[C]Markdown.pl\f[R] will preserve it as is.
5059There is one exception to this rule: text between \f[C]<script>\f[R] and
5060\f[C]<style>\f[R] tags is not interpreted as Markdown.
5062This departure from standard Markdown should make it easier to mix
5063Markdown with HTML block elements.
5064For example, one can surround a block of Markdown text with
5065\f[C]<div>\f[R] tags without preventing it from being interpreted as
5067.SS Extension: \f[C]native_divs\f[R]
5069Use native pandoc \f[C]Div\f[R] blocks for content inside
5070\f[C]<div>\f[R] tags.
5071For the most part this should give the same output as
5072\f[C]markdown_in_html_blocks\f[R], but it makes it easier to write
5073pandoc filters to manipulate groups of blocks.
5074.SS Extension: \f[C]native_spans\f[R]
5076Use native pandoc \f[C]Span\f[R] blocks for content inside
5077\f[C]<span>\f[R] tags.
5078For the most part this should give the same output as
5079\f[C]raw_html\f[R], but it makes it easier to write pandoc filters to
5080manipulate groups of inlines.
5081.SS Extension: \f[C]raw_tex\f[R]
5083In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
5084included in a document.
5085Inline TeX commands will be preserved and passed unchanged to the LaTeX
5087Thus, for example, you can use LaTeX to include BibTeX citations:
5091This result was proved in \[rs]cite{jones.1967}.
5095Note that in LaTeX environments, like
5099\[rs]begin{tabular}{|l|l|}\[rs]hline
5100Age & Frequency \[rs]\[rs] \[rs]hline
510118--25 & 15 \[rs]\[rs]
510226--35 & 33 \[rs]\[rs]
510336--45 & 22 \[rs]\[rs] \[rs]hline
5108the material between the begin and end tags will be interpreted as raw
5109LaTeX, not as Markdown.
5111For a more explicit and flexible way of including raw TeX in a Markdown
5112document, see the \f[C]raw_attribute\f[R] extension.
5114Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
5115Emacs Org mode, and ConTeXt.
5116.SS Generic raw attribute
5117.SS Extension: \f[C]raw_attribute\f[R]
5119Inline spans and fenced code blocks with a special kind of attribute
5120will be parsed as raw content with the designated format.
5121For example, the following produces a raw roff \f[C]ms\f[R] block:
5132And the following produces a raw \f[C]html\f[R] inline element:
5136This is \[ga]<a>html</a>\[ga]{=html}
5140This can be useful to insert raw xml into \f[C]docx\f[R] documents, e.g.
5145\[ga]\[ga]\[ga]{=openxml}
5148 <w:br w:type=\[dq]page\[dq]/>
5155The format name should match the target format name (see
5156\f[C]-t/--to\f[R], above, for a list, or use
5157\f[C]pandoc --list-output-formats\f[R]).
5158Use \f[C]openxml\f[R] for \f[C]docx\f[R] output, \f[C]opendocument\f[R]
5159for \f[C]odt\f[R] output, \f[C]html5\f[R] for \f[C]epub3\f[R] output,
5160\f[C]html4\f[R] for \f[C]epub2\f[R] output, and \f[C]latex\f[R],
5161\f[C]beamer\f[R], \f[C]ms\f[R], or \f[C]html5\f[R] for \f[C]pdf\f[R]
5162output (depending on what you use for \f[C]--pdf-engine\f[R]).
5164This extension presupposes that the relevant kind of inline code or
5165fenced code block is enabled.
5166Thus, for example, to use a raw attribute with a backtick code block,
5167\f[C]backtick_code_blocks\f[R] must be enabled.
5169The raw attribute cannot be combined with regular attributes.
5171.SS Extension: \f[C]latex_macros\f[R]
5173When this extension is enabled, pandoc will parse LaTeX macro
5174definitions and apply the resulting macros to all LaTeX math and raw
5176So, for example, the following will work in all output formats, not just
5181\[rs]newcommand{\[rs]tuple}[1]{\[rs]langle #1 \[rs]rangle}
5183$\[rs]tuple{a, b, c}$
5187Note that LaTeX macros will not be applied if they occur inside a raw
5188span or block marked with the \f[C]raw_attribute\f[R] extension.
5190When \f[C]latex_macros\f[R] is disabled, the raw LaTeX and math will not
5192This is usually a better approach when you are targeting LaTeX or PDF.
5194Macro definitions in LaTeX will be passed through as raw LaTeX only if
5195\f[C]latex_macros\f[R] is not enabled.
5196Macro definitions in Markdown source (or other formats allowing
5197\f[C]raw_tex\f[R]) will be passed through regardless of whether
5198\f[C]latex_macros\f[R] is enabled.
5201Markdown allows links to be specified in several ways.
5204If you enclose a URL or email address in pointy brackets, it will become
5210<sam\[at]green.eggs.ham>
5215An inline link consists of the link text in square brackets, followed by
5216the URL in parentheses.
5217(Optionally, the URL can be followed by a link title, in quotes.)
5221This is an [inline link](/url), and here\[aq]s [one with
5222a title](https://fsf.org \[dq]click here for a good time!\[dq]).
5226There can be no space between the bracketed part and the parenthesized
5228The link text can contain formatting (such as emphasis), but the title
5231Email addresses in inline links are not autodetected, so they have to be
5232prefixed with \f[C]mailto\f[R]:
5236[Write me!](mailto:sam\[at]green.eggs.ham)
5241An \f[I]explicit\f[R] reference link has two parts, the link itself and
5242the link definition, which may occur elsewhere in the document (either
5243before or after the link).
5245The link consists of link text in square brackets, followed by a label
5247(There cannot be space between the two unless the
5248\f[C]spaced_reference_links\f[R] extension is enabled.) The link
5249definition consists of the bracketed label, followed by a colon and a
5250space, followed by the URL, and optionally (after a space) a link title
5251either in quotes or in parentheses.
5252The label must not be parseable as a citation (assuming the
5253\f[C]citations\f[R] extension is enabled): citations take precedence
5256Here are some examples:
5260[my label 1]: /foo/bar.html \[dq]My title, optional\[dq]
5262[my label 3]: https://fsf.org (The free software foundation)
5263[my label 4]: /bar#special \[aq]A title in single quotes\[aq]
5267The URL may optionally be surrounded by angle brackets:
5271[my label 5]: <http://foo.bar.baz>
5275The title may go on the next line:
5279[my label 3]: https://fsf.org
5280 \[dq]The free software foundation\[dq]
5284Note that link labels are not case sensitive.
5289Here is [my link][FOO]
5295In an \f[I]implicit\f[R] reference link, the second pair of brackets is
5302[my website]: http://foo.bar.baz
5306Note: In \f[C]Markdown.pl\f[R] and most other Markdown implementations,
5307reference link definitions cannot occur in nested constructions such as
5308list items or block quotes.
5309Pandoc lifts this arbitrary seeming restriction.
5310So the following is fine in pandoc, though not in most other
5320.SS Extension: \f[C]shortcut_reference_links\f[R]
5322In a \f[I]shortcut\f[R] reference link, the second pair of brackets may
5329[my website]: http://foo.bar.baz
5334To link to another section of the same document, use the automatically
5335generated identifier (see Heading identifiers).
5340See the [Introduction](#introduction).
5348See the [Introduction].
5350[Introduction]: #introduction
5354Internal links are currently supported for HTML formats (including HTML
5355slide shows and EPUB), LaTeX, and ConTeXt.
5358A link immediately preceded by a \f[C]!\f[R] will be treated as an
5360The link text will be used as the image\[aq]s alt text:
5364
5368[movie reel]: movie.gif
5371.SS Extension: \f[C]implicit_figures\f[R]
5373An image with nonempty alt text, occurring by itself in a paragraph,
5374will be rendered as a figure with a caption.
5375The image\[aq]s alt text will be used as the caption.
5379
5383How this is rendered depends on the output format.
5384Some output formats (e.g.
5385RTF) do not yet support figures.
5386In those formats, you\[aq]ll just get an image in a paragraph by itself,
5389If you just want a regular inline image, just make sure it is not the
5390only thing in the paragraph.
5391One way to do this is to insert a nonbreaking space after the image:
5395![This image won\[aq]t be a figure](/url/of/image.png)\[rs]
5399Note that in reveal.js slide shows, an image in a paragraph by itself
5400that has the \f[C]stretch\f[R] class will fill the screen, and the
5401caption and figure tags will be omitted.
5402.SS Extension: \f[C]link_attributes\f[R]
5404Attributes can be set on links and images:
5408An inline {#id .class width=30 height=20px}
5409and a reference ![image][ref] with attributes.
5411[ref]: foo.jpg \[dq]optional title\[dq] {#id .class key=val key2=\[dq]val 2\[dq]}
5415(This syntax is compatible with PHP Markdown Extra when only
5416\f[C]#id\f[R] and \f[C].class\f[R] are used.)
5418For HTML and EPUB, all known HTML5 attributes except \f[C]width\f[R] and
5419\f[C]height\f[R] (but including \f[C]srcset\f[R] and \f[C]sizes\f[R])
5420are passed through as is.
5421Unknown attributes are passed through as custom attributes, with
5422\f[C]data-\f[R] prepended.
5423The other writers ignore attributes that are not specifically supported
5424by their output format.
5426The \f[C]width\f[R] and \f[C]height\f[R] attributes on images are
5428When used without a unit, the unit is assumed to be pixels.
5429However, any of the following unit identifiers can be used:
5430\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]
5432There must not be any spaces between the number and the unit.
5437{ width=50% }
5441Dimensions may be converted to a form that is compatible with the output
5442format (for example, dimensions given in pixels will be converted to
5443inches when converting HTML to LaTeX).
5444Conversion between pixels and physical measurements is affected by the
5445\f[C]--dpi\f[R] option (by default, 96 dpi is assumed, unless the image
5446itself contains dpi information).
5448The \f[C]%\f[R] unit is generally relative to some available space.
5449For example the above example will render to the following.
5453\f[C]<img href=\[dq]file.jpg\[dq] style=\[dq]width: 50%;\[dq] />\f[R]
5456\f[C]\[rs]includegraphics[width=0.5\[rs]textwidth,height=\[rs]textheight]{file.jpg}\f[R]
5457(If you\[aq]re using a custom template, you need to configure
5458\f[C]graphicx\f[R] as in the default template.)
5461\f[C]\[rs]externalfigure[file.jpg][width=0.5\[rs]textwidth]\f[R]
5464Some output formats have a notion of a class (ConTeXt) or a unique
5465identifier (LaTeX \f[C]\[rs]caption\f[R]), or both (HTML).
5467When no \f[C]width\f[R] or \f[C]height\f[R] attributes are specified,
5468the fallback is to look at the image resolution and the dpi metadata
5469embedded in the image file.
5472Using the \f[C]native_divs\f[R] and \f[C]native_spans\f[R] extensions
5473(see above), HTML syntax can be used as part of markdown to create
5474native \f[C]Div\f[R] and \f[C]Span\f[R] elements in the pandoc AST (as
5475opposed to raw HTML).
5476However, there is also nicer syntax available:
5477.SS Extension: \f[C]fenced_divs\f[R]
5479Allow special fenced syntax for native \f[C]Div\f[R] blocks.
5480A Div starts with a fence containing at least three consecutive colons
5481plus some attributes.
5482The attributes may optionally be followed by another string of
5484The attribute syntax is exactly as in fenced code blocks (see Extension:
5485\f[C]fenced_code_attributes\f[R]).
5486As with fenced code blocks, one can use either attributes in curly
5487braces or a single unbraced word, which will be treated as a class name.
5488The Div ends with another line containing a string of at least three
5490The fenced Div should be separated by blank lines from preceding and
5497::::: {#special .sidebar}
5505Fenced divs can be nested.
5506Opening fences are distinguished because they \f[I]must\f[R] have
5515This is a warning within a warning.
5521Fences without attributes are always closing fences.
5522Unlike with fenced code blocks, the number of colons in the closing
5523fence need not match the number in the opening fence.
5524However, it can be helpful for visual clarity to use fences of different
5525lengths to distinguish nested divs from their parents.
5526.SS Extension: \f[C]bracketed_spans\f[R]
5528A bracketed sequence of inlines, as one would use to begin a link, will
5529be treated as a \f[C]Span\f[R] with attributes if it is followed
5530immediately by attributes:
5534[This is *some text*]{.class key=\[dq]val\[dq]}
5538.SS Extension: \f[C]footnotes\f[R]
5540Pandoc\[aq]s Markdown allows footnotes, using the following syntax:
5544Here is a footnote reference,[\[ha]1] and another.[\[ha]longnote]
5546[\[ha]1]: Here is the footnote.
5548[\[ha]longnote]: Here\[aq]s one with multiple blocks.
5550 Subsequent paragraphs are indented to show that they
5551belong to the previous footnote.
5555 The whole paragraph can be indented, or just the first
5556 line. In this way, multi-paragraph footnotes work like
5557 multi-paragraph list items.
5559This paragraph won\[aq]t be part of the note, because it
5564The identifiers in footnote references may not contain spaces, tabs, or
5566These identifiers are used only to correlate the footnote reference with
5567the note itself; in the output, footnotes will be numbered sequentially.
5569The footnotes themselves need not be placed at the end of the document.
5570They may appear anywhere except inside other block elements (lists,
5571block quotes, tables, etc.).
5572Each footnote should be separated from surrounding content (including
5573other footnotes) by blank lines.
5574.SS Extension: \f[C]inline_notes\f[R]
5576Inline footnotes are also allowed (though, unlike regular notes, they
5577cannot contain multiple paragraphs).
5578The syntax is as follows:
5582Here is an inline note.\[ha][Inlines notes are easier to write, since
5583you don\[aq]t have to pick an identifier and move down to type the
5588Inline and regular footnotes may be mixed freely.
5590.SS Extension: \f[C]citations\f[R]
5592Using an external filter, \f[C]pandoc-citeproc\f[R], pandoc can
5593automatically generate citations and a bibliography in a number of
5599pandoc --filter pandoc-citeproc myinput.txt
5603In order to use this feature, you will need to specify a bibliography
5604file using the \f[C]bibliography\f[R] metadata field in a YAML metadata
5605section, or \f[C]--bibliography\f[R] command line argument.
5606You can supply multiple \f[C]--bibliography\f[R] arguments or set
5607\f[C]bibliography\f[R] metadata field to YAML array, if you want to use
5608multiple bibliography files.
5609The bibliography may have any of these formats:
5677Note that \f[C].bib\f[R] can be used with both BibTeX and BibLaTeX
5678files; use \f[C].bibtex\f[R] to force BibTeX.
5680Note that \f[C]pandoc-citeproc --bib2json\f[R] and
5681\f[C]pandoc-citeproc --bib2yaml\f[R] can produce \f[C].json\f[R] and
5682\f[C].yaml\f[R] files from any of the supported formats.
5684In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc
5685parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown;
5686and in CSL JSON databases, an HTML-like markup:
5688\f[B]\f[CB]<i>...</i>\f[B]\f[R]
5691\f[B]\f[CB]<b>...</b>\f[B]\f[R]
5694\f[B]\f[CB]<span style=\[dq]font-variant:small-caps;\[dq]>...</span>\f[B]\f[R] or \f[B]\f[CB]<sc>...</sc>\f[B]\f[R]
5697\f[B]\f[CB]<sub>...</sub>\f[B]\f[R]
5700\f[B]\f[CB]<sup>...</sup>\f[B]\f[R]
5703\f[B]\f[CB]<span class=\[dq]nocase\[dq]>...</span>\f[B]\f[R]
5704prevent a phrase from being capitalized as title case
5706\f[C]pandoc-citeproc -j\f[R] and \f[C]-y\f[R] interconvert the CSL JSON
5707and CSL YAML formats as far as possible.
5709As an alternative to specifying a bibliography file using
5710\f[C]--bibliography\f[R] or the YAML metadata field
5711\f[C]bibliography\f[R], you can include the citation data directly in
5712the \f[C]references\f[R] field of the document\[aq]s YAML metadata.
5713The field should contain an array of YAML-encoded references, for
5720- type: article-journal
5732 title: \[aq]Molecular structure of nucleic acids: a structure for deoxyribose
5734 title-short: Molecular structure of nucleic acids
5735 container-title: Nature
5739 DOI: 10.1038/171737a0
5740 URL: https://www.nature.com/articles/171737a0
5746(\f[C]pandoc-citeproc --bib2yaml\f[R] can produce these from a
5747bibliography file in one of the supported formats.)
5749Citations and references can be formatted using any style supported by
5750the Citation Style Language, listed in the Zotero Style Repository.
5751These files are specified using the \f[C]--csl\f[R] option or the
5752\f[C]csl\f[R] metadata field.
5753By default, \f[C]pandoc-citeproc\f[R] will use the Chicago Manual of
5754Style author-date format.
5755The CSL project provides further information on finding and editing
5758To make your citations hyperlinks to the corresponding bibliography
5759entries, add \f[C]link-citations: true\f[R] to your YAML metadata.
5761Citations go inside square brackets and are separated by semicolons.
5762Each citation must have a key, composed of \[aq]\[at]\[aq] + the
5763citation identifier from the database, and may optionally have a prefix,
5764a locator, and a suffix.
5765The citation key must begin with a letter, digit, or \f[C]_\f[R], and
5766may contain alphanumerics, \f[C]_\f[R], and internal punctuation
5767characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]).
5768Here are some examples:
5772Blah blah [see \[at]doe99, pp. 33-35; also \[at]smith04, chap. 1].
5774Blah blah [\[at]doe99, pp. 33-35, 38-39 and *passim*].
5776Blah blah [\[at]smith04; \[at]doe99].
5780\f[C]pandoc-citeproc\f[R] detects locator terms in the CSL locale files.
5781Either abbreviated or unabbreviated forms are accepted.
5782In the \f[C]en-US\f[R] locale, locator terms can be written in either
5783singular or plural forms, as \f[C]book\f[R],
5784\f[C]bk.\f[R]/\f[C]bks.\f[R]; \f[C]chapter\f[R],
5785\f[C]chap.\f[R]/\f[C]chaps.\f[R]; \f[C]column\f[R],
5786\f[C]col.\f[R]/\f[C]cols.\f[R]; \f[C]figure\f[R],
5787\f[C]fig.\f[R]/\f[C]figs.\f[R]; \f[C]folio\f[R],
5788\f[C]fol.\f[R]/\f[C]fols.\f[R]; \f[C]number\f[R],
5789\f[C]no.\f[R]/\f[C]nos.\f[R]; \f[C]line\f[R],
5790\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];
5791\f[C]opus\f[R], \f[C]op.\f[R]/\f[C]opp.\f[R]; \f[C]page\f[R],
5792\f[C]p.\f[R]/\f[C]pp.\f[R]; \f[C]paragraph\f[R],
5793\f[C]para.\f[R]/\f[C]paras.\f[R]; \f[C]part\f[R],
5794\f[C]pt.\f[R]/\f[C]pts.\f[R]; \f[C]section\f[R],
5795\f[C]sec.\f[R]/\f[C]secs.\f[R]; \f[C]sub verbo\f[R],
5796\f[C]s.v.\f[R]/\f[C]s.vv.\f[R]; \f[C]verse\f[R],
5797\f[C]v.\f[R]/\f[C]vv.\f[R]; \f[C]volume\f[R],
5798\f[C]vol.\f[R]/\f[C]vols.\f[R]; \f[C]\[ps]\f[R]/\f[C]\[ps]\[ps]\f[R];
5799\f[C]\[sc]\f[R]/\f[C]\[sc]\[sc]\f[R].
5800If no locator term is used, \[dq]page\[dq] is assumed.
5802\f[C]pandoc-citeproc\f[R] will use heuristics to distinguish the locator
5804In complex cases, the locator can be enclosed in curly braces (using
5805\f[C]pandoc-citeproc\f[R] 0.15 and higher only):
5809[\[at]smith{ii, A, D-Z}, with a suffix]
5810[\[at]smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
5814A minus sign (\f[C]-\f[R]) before the \f[C]\[at]\f[R] will suppress
5815mention of the author in the citation.
5816This can be useful when the author is already mentioned in the text:
5820Smith says blah [-\[at]smith04].
5824You can also write an in-text citation, as follows:
5828\[at]smith04 says blah.
5830\[at]smith04 [p. 33] says blah.
5834If the style calls for a list of works cited, it will be placed in a div
5835with id \f[C]refs\f[R], if one exists:
5844Otherwise, it will be placed at the end of the document.
5845Generation of the bibliography can be suppressed by setting
5846\f[C]suppress-bibliography: true\f[R] in the YAML metadata.
5848If you wish the bibliography to have a section heading, you can set
5849\f[C]reference-section-title\f[R] in the metadata, or put the heading at
5850the beginning of the div with id \f[C]refs\f[R] (if you are using it) or
5851at the end of your document:
5861The bibliography will be inserted after this heading.
5862Note that the \f[C]unnumbered\f[R] class will be added to this heading,
5863so that the section will not be numbered.
5865If you want to include items in the bibliography without actually citing
5866them in the body text, you can define a dummy \f[C]nocite\f[R] metadata
5867field and put the citations there:
5873 \[at]item1, \[at]item2
5880In this example, the document will contain a citation for
5881\f[C]item3\f[R] only, but the bibliography will contain entries for
5882\f[C]item1\f[R], \f[C]item2\f[R], and \f[C]item3\f[R].
5884It is possible to create a bibliography with all the citations, whether
5885or not they appear in the document, by using a wildcard:
5896For LaTeX output, you can also use \f[C]natbib\f[R] or
5897\f[C]biblatex\f[R] to render the bibliography.
5898In order to do so, specify bibliography files as outlined above, and add
5899\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] argument to \f[C]pandoc\f[R]
5901Bear in mind that bibliography files have to be in respective format
5902(either BibTeX or BibLaTeX).
5904For more information, see the pandoc-citeproc man page.
5905.SS Non-pandoc extensions
5907The following Markdown syntax extensions are not enabled by default in
5908pandoc, but may be enabled by adding \f[C]+EXTENSION\f[R] to the format
5909name, where \f[C]EXTENSION\f[R] is the name of the extension.
5910Thus, for example, \f[C]markdown+hard_line_breaks\f[R] is Markdown with
5912.SS Extension: \f[C]old_dashes\f[R]
5914Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
5915\f[C]-\f[R] before a numeral is an en-dash, and \f[C]--\f[R] is an
5917This option only has an effect if \f[C]smart\f[R] is enabled.
5918It is selected automatically for \f[C]textile\f[R] input.
5919.SS Extension: \f[C]angle_brackets_escapable\f[R]
5921Allow \f[C]<\f[R] and \f[C]>\f[R] to be backslash-escaped, as they can
5922be in GitHub flavored Markdown but not original Markdown.
5923This is implied by pandoc\[aq]s default \f[C]all_symbols_escapable\f[R].
5924.SS Extension: \f[C]lists_without_preceding_blankline\f[R]
5926Allow a list to occur right after a paragraph, with no intervening blank
5928.SS Extension: \f[C]four_space_rule\f[R]
5930Selects the pandoc <= 2.0 behavior for parsing lists, so that four
5931spaces indent are needed for list item continuation paragraphs.
5932.SS Extension: \f[C]spaced_reference_links\f[R]
5934Allow whitespace between the two components of a reference link, for
5942.SS Extension: \f[C]hard_line_breaks\f[R]
5944Causes all newlines within a paragraph to be interpreted as hard line
5945breaks instead of spaces.
5946.SS Extension: \f[C]ignore_line_breaks\f[R]
5948Causes newlines within a paragraph to be ignored, rather than being
5949treated as spaces or as hard line breaks.
5950This option is intended for use with East Asian languages where spaces
5951are not used between words, but text is divided into lines for
5953.SS Extension: \f[C]east_asian_line_breaks\f[R]
5955Causes newlines within a paragraph to be ignored, rather than being
5956treated as spaces or as hard line breaks, when they occur between two
5957East Asian wide characters.
5958This is a better choice than \f[C]ignore_line_breaks\f[R] for texts that
5959include a mix of East Asian wide characters and other characters.
5960.SS Extension: \f[C]emoji\f[R]
5962Parses textual emojis like \f[C]:smile:\f[R] as Unicode emoticons.
5963.SS Extension: \f[C]tex_math_single_backslash\f[R]
5965Causes anything between \f[C]\[rs](\f[R] and \f[C]\[rs])\f[R] to be
5966interpreted as inline TeX math, and anything between \f[C]\[rs][\f[R]
5967and \f[C]\[rs]]\f[R] to be interpreted as display TeX math.
5968Note: a drawback of this extension is that it precludes escaping
5969\f[C](\f[R] and \f[C][\f[R].
5970.SS Extension: \f[C]tex_math_double_backslash\f[R]
5972Causes anything between \f[C]\[rs]\[rs](\f[R] and \f[C]\[rs]\[rs])\f[R]
5973to be interpreted as inline TeX math, and anything between
5974\f[C]\[rs]\[rs][\f[R] and \f[C]\[rs]\[rs]]\f[R] to be interpreted as
5976.SS Extension: \f[C]markdown_attribute\f[R]
5978By default, pandoc interprets material inside block-level tags as
5980This extension changes the behavior so that Markdown is only parsed
5981inside block-level tags if the tags have the attribute
5982\f[C]markdown=1\f[R].
5983.SS Extension: \f[C]mmd_title_block\f[R]
5985Enables a MultiMarkdown style title block at the top of the document,
5992Date: September 1, 2008
5993Comment: This is a sample mmd title block, with
5994 a field spanning multiple lines.
5998See the MultiMarkdown documentation for details.
5999If \f[C]pandoc_title_block\f[R] or \f[C]yaml_metadata_block\f[R] is
6000enabled, it will take precedence over \f[C]mmd_title_block\f[R].
6001.SS Extension: \f[C]abbreviations\f[R]
6003Parses PHP Markdown Extra abbreviation keys, like
6007*[HTML]: Hypertext Markup Language
6011Note that the pandoc document model does not support abbreviations, so
6012if this extension is enabled, abbreviation keys are simply skipped (as
6013opposed to being parsed as paragraphs).
6014.SS Extension: \f[C]autolink_bare_uris\f[R]
6016Makes all absolute URIs into links, even when not surrounded by pointy
6017braces \f[C]<...>\f[R].
6018.SS Extension: \f[C]mmd_link_attributes\f[R]
6020Parses multimarkdown style key-value attributes on link and image
6022This extension should not be confused with the \f[C]link_attributes\f[R]
6027This is a reference ![image][ref] with multimarkdown attributes.
6029[ref]: https://path.to/image \[dq]Image title\[dq] width=20px height=30px
6030 id=myId class=\[dq]myClass1 myClass2\[dq]
6033.SS Extension: \f[C]mmd_header_identifiers\f[R]
6035Parses multimarkdown style heading identifiers (in square brackets,
6036after the heading but before any trailing \f[C]#\f[R]s in an ATX
6038.SS Extension: \f[C]compact_definition_lists\f[R]
6040Activates the definition list syntax of pandoc 1.12.x and earlier.
6041This syntax differs from the one described above under Definition lists
6044No blank line is required between consecutive items of the definition
6047To get a \[dq]tight\[dq] or \[dq]compact\[dq] list, omit space between
6048consecutive items; the space between a term and its definition does not
6051Lazy wrapping of paragraphs is not allowed: the entire definition must
6052be indented four spaces.
6053.SS Extension: \f[C]gutenberg\f[R]
6055Use Project Gutenberg conventions for \f[C]plain\f[R] output: all-caps
6056for strong emphasis, surround by underscores for regular emphasis, add
6057extra blank space around headings.
6058.SS Markdown variants
6060In addition to pandoc\[aq]s extended Markdown, the following Markdown
6061variants are supported:
6063\f[B]\f[CB]markdown_phpextra\f[B]\f[R] (PHP Markdown Extra)
6064\f[C]footnotes\f[R], \f[C]pipe_tables\f[R], \f[C]raw_html\f[R],
6065\f[C]markdown_attribute\f[R], \f[C]fenced_code_blocks\f[R],
6066\f[C]definition_lists\f[R], \f[C]intraword_underscores\f[R],
6067\f[C]header_attributes\f[R], \f[C]link_attributes\f[R],
6068\f[C]abbreviations\f[R], \f[C]shortcut_reference_links\f[R],
6069\f[C]spaced_reference_links\f[R].
6071\f[B]\f[CB]markdown_github\f[B]\f[R] (deprecated GitHub-Flavored Markdown)
6072\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
6073\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
6074\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
6075\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
6076\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
6077\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
6078\f[C]lists_without_preceding_blankline\f[R].
6080\f[B]\f[CB]markdown_mmd\f[B]\f[R] (MultiMarkdown)
6081\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]markdown_attribute\f[R],
6082\f[C]mmd_link_attributes\f[R], \f[C]tex_math_double_backslash\f[R],
6083\f[C]intraword_underscores\f[R], \f[C]mmd_title_block\f[R],
6084\f[C]footnotes\f[R], \f[C]definition_lists\f[R],
6085\f[C]all_symbols_escapable\f[R], \f[C]implicit_header_references\f[R],
6086\f[C]auto_identifiers\f[R], \f[C]mmd_header_identifiers\f[R],
6087\f[C]shortcut_reference_links\f[R], \f[C]implicit_figures\f[R],
6088\f[C]superscript\f[R], \f[C]subscript\f[R],
6089\f[C]backtick_code_blocks\f[R], \f[C]spaced_reference_links\f[R],
6090\f[C]raw_attribute\f[R].
6092\f[B]\f[CB]markdown_strict\f[B]\f[R] (Markdown.pl)
6093\f[C]raw_html\f[R], \f[C]shortcut_reference_links\f[R],
6094\f[C]spaced_reference_links\f[R].
6096We also support \f[C]commonmark\f[R] and \f[C]gfm\f[R] (GitHub-Flavored
6097Markdown, which is implemented as a set of extensions on
6098\f[C]commonmark\f[R]).
6100Note, however, that \f[C]commonmark\f[R] and \f[C]gfm\f[R] have limited
6101support for extensions.
6102Only those listed below (and \f[C]smart\f[R], \f[C]raw_tex\f[R], and
6103\f[C]hard_line_breaks\f[R]) will work.
6104The extensions can, however, all be individually disabled.
6105Also, \f[C]raw_tex\f[R] only affects \f[C]gfm\f[R] output, not input.
6107\f[B]\f[CB]gfm\f[B]\f[R] (GitHub-Flavored Markdown)
6108\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
6109\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
6110\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
6111\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
6112\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
6113\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
6114\f[C]lists_without_preceding_blankline\f[R].
6115.SH PRODUCING SLIDE SHOWS WITH PANDOC
6117You can use pandoc to produce an HTML + JavaScript slide presentation
6118that can be viewed via a web browser.
6119There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
6121You can also produce a PDF slide show using LaTeX \f[C]beamer\f[R], or
6122slides shows in Microsoft PowerPoint format.
6124Here\[aq]s the Markdown source for a simple slide show,
6125\f[C]habits.txt\f[R]:
6154
6163To produce an HTML/JavaScript slide show, simply type
6167pandoc -t FORMAT -s habits.txt -o habits.html
6171where \f[C]FORMAT\f[R] is either \f[C]s5\f[R], \f[C]slidy\f[R],
6172\f[C]slideous\f[R], \f[C]dzslides\f[R], or \f[C]revealjs\f[R].
6174For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
6175the \f[C]-s/--standalone\f[R] option embeds a link to JavaScript and CSS
6176files, which are assumed to be available at the relative path
6177\f[C]s5/default\f[R] (for S5), \f[C]slideous\f[R] (for Slideous),
6178\f[C]reveal.js\f[R] (for reveal.js), or at the Slidy website at
6179\f[C]w3.org\f[R] (for Slidy).
6180(These paths can be changed by setting the \f[C]slidy-url\f[R],
6181\f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R]
6182variables; see Variables for HTML slides, above.) For DZSlides, the
6183(relatively short) JavaScript and CSS are included in the file by
6186With all HTML slide formats, the \f[C]--self-contained\f[R] option can
6187be used to produce a single file that contains all of the data necessary
6188to display the slide show, including linked scripts, stylesheets,
6191To produce a PDF slide show using beamer, type
6195pandoc -t beamer habits.txt -o habits.pdf
6199Note that a reveal.js slide show can also be converted to a PDF by
6200printing it to a file from the browser.
6202To produce a Powerpoint slide show, type
6206pandoc habits.txt -o habits.pptx
6209.SS Structuring the slide show
6211By default, the \f[I]slide level\f[R] is the highest heading level in
6212the hierarchy that is followed immediately by content, and not another
6213heading, somewhere in the document.
6214In the example above, level-1 headings are always followed by level-2
6215headings, which are followed by content, so the slide level is 2.
6216This default can be overridden using the \f[C]--slide-level\f[R] option.
6218The document is carved up into slides according to the following rules:
6220A horizontal rule always starts a new slide.
6222A heading at the slide level always starts a new slide.
6224Headings \f[I]below\f[R] the slide level in the hierarchy create
6225headings \f[I]within\f[R] a slide.
6227Headings \f[I]above\f[R] the slide level in the hierarchy create
6228\[dq]title slides,\[dq] which just contain the section title and help to
6229break the slide show into sections.
6230Non-slide content under these headings will be included on the title
6231slide (for HTML slide shows) or in a subsequent slide with the same
6234A title page is constructed automatically from the document\[aq]s title
6236(In the case of beamer, this can be disabled by commenting out some
6237lines in the default template.)
6239These rules are designed to support many different styles of slide show.
6240If you don\[aq]t care about structuring your slides into sections and
6241subsections, you can just use level-1 headings for all each slide.
6242(In that case, level-1 will be the slide level.) But you can also
6243structure the slide show into sections, as in the example above.
6245Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
6246layout will be produced, with level-1 headings building horizontally and
6247level-2 headings building vertically.
6248It is not recommended that you use deeper nesting of section levels with
6250.SS Incremental lists
6252By default, these writers produce lists that display \[dq]all at
6253once.\[dq] If you want your lists to display incrementally (one item at
6254a time), use the \f[C]-i\f[R] option.
6255If you want a particular list to depart from the default, put it in a
6256\f[C]div\f[R] block with class \f[C]incremental\f[R] or
6257\f[C]nonincremental\f[R].
6258So, for example, using the \f[C]fenced div\f[R] syntax, the following
6259would be incremental regardless of the document default:
6285While using \f[C]incremental\f[R] and \f[C]nonincremental\f[R] divs are
6286the recommended method of setting incremental lists on a per-case basis,
6287an older method is also supported: putting lists inside a blockquote
6288will depart from the document default (that is, it will display
6289incrementally without the \f[C]-i\f[R] option and all at once with the
6290\f[C]-i\f[R] option):
6299Both methods allow incremental and nonincremental lists to be mixed in a
6302Note: Neither the \f[C]-i/--incremental\f[R] option nor any of the
6303methods described here currently works for PowerPoint output.
6306You can add \[dq]pauses\[dq] within a slide by including a paragraph
6307containing three dots, separated by spaces:
6313content before the pause
6317content after the pause
6321Note: this feature is not yet implemented for PowerPoint output.
6322.SS Styling the slides
6324You can change the style of HTML slides by putting customized CSS files
6325in \f[C]$DATADIR/s5/default\f[R] (for S5), \f[C]$DATADIR/slidy\f[R] (for
6326Slidy), or \f[C]$DATADIR/slideous\f[R] (for Slideous), where
6327\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
6329The originals may be found in pandoc\[aq]s system data directory
6330(generally \f[C]$CABALDIR/pandoc-VERSION/s5/default\f[R]).
6331Pandoc will look there for any files it does not find in the user data
6334For dzslides, the CSS is included in the HTML file itself, and may be
6337All reveal.js configuration options can be set through variables.
6338For example, themes can be used by setting the \f[C]theme\f[R] variable:
6346Or you can specify a custom stylesheet using the \f[C]--css\f[R] option.
6348To style beamer slides, you can specify a \f[C]theme\f[R],
6349\f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], and
6350\f[C]outertheme\f[R], using the \f[C]-V\f[R] option:
6354pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
6358Note that heading attributes will turn into slide attributes (on a
6359\f[C]<div>\f[R] or \f[C]<section>\f[R]) in HTML slide formats, allowing
6360you to style individual slides.
6361In beamer, the only heading attribute that affects slides is the
6362\f[C]allowframebreaks\f[R] class, which sets the
6363\f[C]allowframebreaks\f[R] option, causing multiple slides to be created
6364if the content overfills the frame.
6365This is recommended especially for bibliographies:
6369# References {.allowframebreaks}
6374Speaker notes are supported in reveal.js and PowerPoint (pptx) output.
6375You can add notes to your Markdown document thus:
6383- It can contain Markdown
6390To show the notes window in reveal.js, press \f[C]s\f[R] while viewing
6392Speaker notes in PowerPoint will be available, as usual, in handouts and
6395Notes are not yet supported for other slide formats, but the notes will
6396not appear on the slides themselves.
6399To put material in side by side columns, you can use a native div
6400container with class \f[C]columns\f[R], containing two or more div
6401containers with class \f[C]column\f[R] and a \f[C]width\f[R] attribute:
6405:::::::::::::: {.columns}
6406::: {.column width=\[dq]40%\[dq]}
6409::: {.column width=\[dq]60%\[dq]}
6415.SS Additional columns attributes in beamer
6417The div containers with classes \f[C]columns\f[R] and \f[C]column\f[R]
6418can optionally have an \f[C]align\f[R] attribute.
6419The class \f[C]columns\f[R] can optionally have a \f[C]totalwidth\f[R]
6420attribute or an \f[C]onlytextwidth\f[R] class.
6424:::::::::::::: {.columns align=center totalwidth=8em}
6425::: {.column width=\[dq]40%\[dq]}
6428::: {.column width=\[dq]60%\[dq] align=bottom}
6435The \f[C]align\f[R] attributes on \f[C]columns\f[R] and \f[C]column\f[R]
6436can be used with the values \f[C]top\f[R], \f[C]top-baseline\f[R],
6437\f[C]center\f[R] and \f[C]bottom\f[R] to vertically align the columns.
6438It defaults to \f[C]top\f[R] in \f[C]columns\f[R].
6440The \f[C]totalwidth\f[R] attribute limits the width of the columns to
6445:::::::::::::: {.columns align=top .onlytextwidth}
6446::: {.column width=\[dq]40%\[dq] align=center}
6449::: {.column width=\[dq]60%\[dq]}
6456The class \f[C]onlytextwidth\f[R] sets the \f[C]totalwidth\f[R] to
6457\f[C]\[rs]textwidth\f[R].
6459See Section 12.7 of the Beamer User\[aq]s Guide for more details.
6460.SS Frame attributes in beamer
6462Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[R] option to
6463a frame in beamer (for example, when using the \f[C]minted\f[R]
6465This can be forced by adding the \f[C]fragile\f[R] class to the heading
6466introducing the slide:
6470# Fragile slide {.fragile}
6474All of the other frame attributes described in Section 8.1 of the Beamer
6475User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R],
6476\f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R],
6477\f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R],
6478\f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R].
6479.SS Background in reveal.js and beamer
6481Background images can be added to self-contained reveal.js slideshows
6482and to beamer slideshows.
6484For the same image on every slide, use the configuration option
6485\f[C]background-image\f[R] either in the YAML metadata block or as a
6486command-line variable.
6487(There are no other options in beamer and the rest of this section
6488concerns reveal.js slideshows.)
6490For reveal.js, you can instead use the reveal.js-native option
6491\f[C]parallaxBackgroundImage\f[R].
6492You can also set \f[C]parallaxBackgroundHorizontal\f[R] and
6493\f[C]parallaxBackgroundVertical\f[R] the same way and must also set
6494\f[C]parallaxBackgroundSize\f[R] to have your values take effect.
6496To set an image for a particular reveal.js slide, add
6497\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first
6498slide-level heading on the slide (which may even be empty).
6500In reveal.js\[aq]s overview mode, the parallaxBackgroundImage will show
6501up only on the first slide.
6503Other reveal.js background settings also work on individual slides,
6504including \f[C]data-background-size\f[R],
6505\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R],
6506\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R].
6508To add a background image to the automatically generated title slide,
6509use the \f[C]title-slide-attributes\f[R] variable in the YAML metadata
6511It must contain a map of attribute names and values.
6513See the reveal.js documentation for more details.
6515For example in reveal.js:
6521parallaxBackgroundImage: /path/to/my/background_image.png
6522title-slide-attributes:
6523 data-background-image: /path/to/title_image.png
6524 data-background-size: contain
6529Slide 1 has background_image.png as its background.
6531## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]}
6533Slide 2 has a special image for its background, even though the heading has no content.
6536.SH CREATING EPUBS WITH PANDOC
6539EPUB metadata may be specified using the \f[C]--epub-metadata\f[R]
6540option, but if the source document is Markdown, it is better to use a
6551 text: An investigation of metadata
6559 text: doi:10.234234.234/33
6561rights: \[co] 2007 John Smith, CC BY-NC
6568The following fields are recognized:
6570\f[B]\f[CB]identifier\f[B]\f[R]
6571Either a string value or an object with fields \f[C]text\f[R] and
6573Valid values for \f[C]scheme\f[R] are \f[C]ISBN-10\f[R],
6574\f[C]GTIN-13\f[R], \f[C]UPC\f[R], \f[C]ISMN-10\f[R], \f[C]DOI\f[R],
6575\f[C]LCCN\f[R], \f[C]GTIN-14\f[R], \f[C]ISBN-13\f[R],
6576\f[C]Legal deposit number\f[R], \f[C]URN\f[R], \f[C]OCLC\f[R],
6577\f[C]ISMN-13\f[R], \f[C]ISBN-A\f[R], \f[C]JP\f[R], \f[C]OLCC\f[R].
6579\f[B]\f[CB]title\f[B]\f[R]
6580Either a string value, or an object with fields \f[C]file-as\f[R] and
6581\f[C]type\f[R], or a list of such objects.
6582Valid values for \f[C]type\f[R] are \f[C]main\f[R], \f[C]subtitle\f[R],
6583\f[C]short\f[R], \f[C]collection\f[R], \f[C]edition\f[R],
6586\f[B]\f[CB]creator\f[B]\f[R]
6587Either a string value, or an object with fields \f[C]role\f[R],
6588\f[C]file-as\f[R], and \f[C]text\f[R], or a list of such objects.
6589Valid values for \f[C]role\f[R] are MARC relators, but pandoc will
6590attempt to translate the human-readable versions (like \[dq]author\[dq]
6591and \[dq]editor\[dq]) to the appropriate marc relators.
6593\f[B]\f[CB]contributor\f[B]\f[R]
6594Same format as \f[C]creator\f[R].
6596\f[B]\f[CB]date\f[B]\f[R]
6597A string value in \f[C]YYYY-MM-DD\f[R] format.
6598(Only the year is necessary.) Pandoc will attempt to convert other
6601\f[B]\f[CB]lang\f[B]\f[R] (or legacy: \f[B]\f[CB]language\f[B]\f[R])
6602A string value in BCP 47 format.
6603Pandoc will default to the local language if nothing is specified.
6605\f[B]\f[CB]subject\f[B]\f[R]
6606A string value or a list of such values.
6608\f[B]\f[CB]description\f[B]\f[R]
6611\f[B]\f[CB]type\f[B]\f[R]
6614\f[B]\f[CB]format\f[B]\f[R]
6617\f[B]\f[CB]relation\f[B]\f[R]
6620\f[B]\f[CB]coverage\f[B]\f[R]
6623\f[B]\f[CB]rights\f[B]\f[R]
6626\f[B]\f[CB]cover-image\f[B]\f[R]
6627A string value (path to cover image).
6629\f[B]\f[CB]css\f[B]\f[R] (or legacy: \f[B]\f[CB]stylesheet\f[B]\f[R])
6630A string value (path to CSS stylesheet).
6632\f[B]\f[CB]page-progression-direction\f[B]\f[R]
6633Either \f[C]ltr\f[R] or \f[C]rtl\f[R].
6634Specifies the \f[C]page-progression-direction\f[R] attribute for the
6635\f[C]spine\f[R] element.
6637\f[B]\f[CB]ibooks\f[B]\f[R]
6638iBooks-specific metadata, with the following fields:
6641\f[C]version\f[R]: (string)
6643\f[C]specified-fonts\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
6646\f[C]ipad-orientation-lock\f[R]:
6647\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
6649\f[C]iphone-orientation-lock\f[R]:
6650\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
6652\f[C]binding\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
6655\f[C]scroll-axis\f[R]:
6656\f[C]vertical\f[R]|\f[C]horizontal\f[R]|\f[C]default\f[R]
6658.SS The \f[C]epub:type\f[R] attribute
6660For \f[C]epub3\f[R] output, you can mark up the heading that corresponds
6661to an EPUB chapter using the \f[C]epub:type\f[R] attribute.
6662For example, to set the attribute to the value \f[C]prologue\f[R], use
6667# My chapter {epub:type=prologue}
6671Which will result in:
6675<body epub:type=\[dq]frontmatter\[dq]>
6676 <section epub:type=\[dq]prologue\[dq]>
6681Pandoc will output \f[C]<body epub:type=\[dq]bodymatter\[dq]>\f[R],
6682unless you use one of the following values, in which case either
6683\f[C]frontmatter\f[R] or \f[C]backmatter\f[R] will be output.
6689\f[C]epub:type\f[R] of first section
6691\f[C]epub:type\f[R] of body
6812By default, pandoc will download media referenced from any
6813\f[C]<img>\f[R], \f[C]<audio>\f[R], \f[C]<video>\f[R] or
6814\f[C]<source>\f[R] element present in the generated EPUB, and include it
6815in the EPUB container, yielding a completely self-contained EPUB.
6816If you want to link to external media resources instead, use raw HTML in
6817your source and add \f[C]data-external=\[dq]1\[dq]\f[R] to the tag with
6818the \f[C]src\f[R] attribute.
6823<audio controls=\[dq]1\[dq]>
6824 <source src=\[dq]https://example.com/music/toccata.mp3\[dq]
6825 data-external=\[dq]1\[dq] type=\[dq]audio/mpeg\[dq]>
6830.SH CREATING JUPYTER NOTEBOOKS WITH PANDOC
6832When creating a Jupyter notebook, pandoc will try to infer the notebook
6834Code blocks with the class \f[C]code\f[R] will be taken as code cells,
6835and intervening content will be taken as Markdown cells.
6836Attachments will automatically be created for images in Markdown cells.
6837Metadata will be taken from the \f[C]jupyter\f[R] metadata field.
6848 display_name: Python 2
6855 file_extension: \[dq].py\[dq]
6856 mimetype: \[dq]text/x-python\[dq]
6857 name: \[dq]python\[dq]
6858 nbconvert_exporter: \[dq]python\[dq]
6859 pygments_lexer: \[dq]ipython2\[dq]
6860 version: \[dq]2.7.15\[dq]
6865**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
6866bibendum felis dictum sodales.
6869print(\[dq]hello\[dq])
6875from IPython.display import HTML
6878console.log(\[dq]hello\[dq]);
6886This image  will be
6887included as a cell attachment.
6891If you want to add cell attributes, group cells differently, or add
6892output to code cells, then you need to include divs to indicate the
6894You can use either fenced divs or native divs for this.
6899:::::: {.cell .markdown}
6902**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
6903bibendum felis dictum sodales.
6906:::::: {.cell .code execution_count=1}
6907\[ga]\[ga]\[ga] {.python}
6908print(\[dq]hello\[dq])
6911::: {.output .stream .stdout}
6918:::::: {.cell .code execution_count=2}
6919\[ga]\[ga]\[ga] {.python}
6920from IPython.display import HTML
6923console.log(\[dq]hello\[dq]);
6929::: {.output .execute_result execution_count=2}
6930\[ga]\[ga]\[ga]{=html}
6932console.log(\[dq]hello\[dq]);
6942If you include raw HTML or TeX in an output cell, use the [raw
6943attribute][Extension: \f[C]fenced_attribute\f[R]], as shown in the last
6944cell of the example above.
6945Although pandoc can process \[dq]bare\[dq] raw HTML and TeX, the result
6946is often interspersed raw elements and normal textual elements, and in
6947an output cell pandoc expects a single, connected raw block.
6948To avoid using raw HTML or TeX except when marked explicitly using raw
6949attributes, we recommend specifying the extensions
6950\f[C]-raw_html-raw_tex+raw_attribute\f[R] when translating between
6951Markdown and ipynb notebooks.
6953Note that options and extensions that affect reading and writing of
6954Markdown will also affect Markdown cells in ipynb notebooks.
6955For example, \f[C]--wrap=preserve\f[R] will preserve soft line breaks in
6956Markdown cells; \f[C]--atx-headers\f[R] will cause ATX-style headings to
6957be used; and \f[C]--preserve-tabs\f[R] will prevent tabs from being
6959.SH SYNTAX HIGHLIGHTING
6961Pandoc will automatically highlight syntax in fenced code blocks that
6962are marked with a language name.
6963The Haskell library skylighting is used for highlighting.
6964Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and
6966To see a list of language names that pandoc will recognize, type
6967\f[C]pandoc --list-highlight-languages\f[R].
6969The color scheme can be selected using the \f[C]--highlight-style\f[R]
6971The default color scheme is \f[C]pygments\f[R], which imitates the
6972default color scheme used by the Python library pygments (though
6973pygments is not actually used to do the highlighting).
6974To see a list of highlight styles, type
6975\f[C]pandoc --list-highlight-styles\f[R].
6977If you are not satisfied with the predefined styles, you can use
6978\f[C]--print-highlight-style\f[R] to generate a JSON \f[C].theme\f[R]
6979file which can be modified and used as the argument to
6980\f[C]--highlight-style\f[R].
6981To get a JSON version of the \f[C]pygments\f[R] style, for example:
6985pandoc --print-highlight-style pygments > my.theme
6989Then edit \f[C]my.theme\f[R] and use it like this:
6993pandoc --highlight-style my.theme
6997If you are not satisfied with the built-in highlighting, or you want
6998highlight a language that isn\[aq]t supported, you can use the
6999\f[C]--syntax-definition\f[R] option to load a KDE-style XML syntax
7001Before writing your own, have a look at KDE\[aq]s repository of syntax
7004To disable highlighting, use the \f[C]--no-highlight\f[R] option.
7007Custom styles can be used in the docx and ICML formats.
7010By default, pandoc\[aq]s docx and ICML output applies a predefined set
7011of styles for blocks such as paragraphs and block quotes, and uses
7012largely default formatting (italics, bold) for inlines.
7013This will work for most purposes, especially alongside a
7014\f[C]reference.docx\f[R] file.
7015However, if you need to apply your own styles to blocks, or match a
7016preexisting set of styles, pandoc allows you to define custom styles for
7017blocks and text using \f[C]div\f[R]s and \f[C]span\f[R]s, respectively.
7019If you define a \f[C]div\f[R] or \f[C]span\f[R] with the attribute
7020\f[C]custom-style\f[R], pandoc will apply your specified style to the
7021contained elements (with the exception of elements whose function
7022depends on a style, like headings, code blocks, block quotes, or links).
7023So, for example, using the \f[C]bracketed_spans\f[R] syntax,
7027[Get out]{custom-style=\[dq]Emphatically\[dq]}, he said.
7031would produce a docx file with \[dq]Get out\[dq] styled with character
7032style \f[C]Emphatically\f[R].
7033Similarly, using the \f[C]fenced_divs\f[R] syntax,
7037Dickinson starts the poem simply:
7039::: {custom-style=\[dq]Poetry\[dq]}
7040| A Bird came down the Walk---
7041| He did not know I saw---
7046would style the two contained lines with the \f[C]Poetry\f[R] paragraph
7049For docx output, styles will be defined in the output file as inheriting
7050from normal text, if the styles are not yet in your reference.docx.
7051If they are already defined, pandoc will not alter the definition.
7053This feature allows for greatest customization in conjunction with
7055If you want all paragraphs after block quotes to be indented, you can
7056write a filter to apply the styles necessary.
7057If you want all italics to be transformed to the \f[C]Emphasis\f[R]
7058character style (perhaps to change their color), you can write a filter
7059which will transform all italicized inlines to inlines within an
7060\f[C]Emphasis\f[R] custom-style \f[C]span\f[R].
7062For docx output, you don\[aq]t need to enable any extensions for custom
7066The docx reader, by default, only reads those styles that it can convert
7067into pandoc elements, either by direct conversion or interpreting the
7068derivation of the input document\[aq]s styles.
7070By enabling the \f[C]styles\f[R] extension in the docx reader
7071(\f[C]-f docx+styles\f[R]), you can produce output that maintains the
7072styles of the input document, using the \f[C]custom-style\f[R] class.
7073Paragraph styles are interpreted as divs, while character styles are
7074interpreted as spans.
7076For example, using the \f[C]custom-style-reference.docx\f[R] file in the
7077test directory, we have the following different outputs:
7079Without the \f[C]+styles\f[R] extension:
7083$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
7086This is text with an *emphasized* text style. And this is text with a
7087**strengthened** text style.
7089> Here is a styled paragraph that inherits from Block Text.
7093And with the extension:
7097$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
7099::: {custom-style=\[dq]First Paragraph\[dq]}
7103::: {custom-style=\[dq]Body Text\[dq]}
7104This is text with an [emphasized]{custom-style=\[dq]Emphatic\[dq]} text style.
7105And this is text with a [strengthened]{custom-style=\[dq]Strengthened\[dq]}
7109::: {custom-style=\[dq]My Block Style\[dq]}
7110> Here is a styled paragraph that inherits from Block Text.
7115With these custom styles, you can use your input document as a
7116reference-doc while creating docx output (see below), and maintain the
7117same styles in your input and output files.
7120Pandoc can be extended with custom writers written in Lua.
7121(Pandoc includes a Lua interpreter, so Lua need not be installed
7124To use a custom writer, simply specify the path to the Lua script in
7125place of the output format.
7130pandoc -t data/sample.lua
7134Creating a custom writer requires writing a Lua function for each
7135possible element in a pandoc document.
7136To get a documented example which you can modify according to your
7141pandoc --print-default-data-file sample.lua
7145Note that custom writers have no default template.
7146If you want to use \f[C]--standalone\f[R] with a custom writer, you will
7147need to specify a template manually using \f[C]--template\f[R] or add a
7148new default template with the name
7149\f[C]default.NAME_OF_CUSTOM_WRITER.lua\f[R] to the \f[C]templates\f[R]
7150subdirectory of your user data directory (see Templates).
7151.SH A NOTE ON SECURITY
7153If you use pandoc to convert user-contributed content in a web
7154application, here are some things to keep in mind:
7156Although pandoc itself will not create or modify any files other than
7157those you explicitly ask it create (with the exception of temporary
7158files used in producing PDFs), a filter or custom writer could in
7159principle do anything on your file system.
7160Please audit filters and custom writers very carefully before using
7163If your application uses pandoc as a Haskell library (rather than
7164shelling out to the executable), it is possible to use it in a mode that
7165fully isolates pandoc from your file system, by running the pandoc
7166operations in the \f[C]PandocPure\f[R] monad.
7167See the document Using the pandoc API for more details.
7169Pandoc\[aq]s parsers can exhibit pathological performance on some corner
7171It is wise to put any pandoc operations under a timeout, to avoid DOS
7172attacks that exploit these issues.
7173If you are using the pandoc executable, you can add the command line
7174options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size
7177The HTML generated by pandoc is not guaranteed to be safe.
7178If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
7179inject arbitrary HTML.
7180Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
7181content in attributes for headings, spans, and code blocks.
7182To be safe, you should run all the generated HTML through an HTML
7186Copyright 2006--2020 John MacFarlane (jgm\[at]berkeley.edu).
7187Released under the GPL, version 2 or greater.
7188This software carries no warranty of any kind.
7189(See COPYRIGHT for full copyright and warranty notices.) For a full list
7190of contributors, see the file AUTHORS.md in the pandoc source code.
7192The Pandoc source code and all documentation may be downloaded
7193from <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