8`pandoc` [*options*] [*input-file*]...
13Pandoc is a [Haskell] library for converting from one markup format to
14another, and a command-line tool that uses this library. It can read
15[Markdown], [CommonMark], [PHP Markdown Extra], [GitHub-Flavored
16Markdown], [MultiMarkdown], and (subsets of) [Textile],
17[reStructuredText], [HTML], [LaTeX], [MediaWiki markup], [TWiki
18markup], [TikiWiki markup], [Creole 1.0], [Haddock markup], [OPML],
19[Emacs Org mode], [DocBook], [JATS], [Muse], [txt2tags], [Vimwiki],
20[EPUB], [ODT], and [Word docx]; and it can write plain text, [Markdown],
21[CommonMark], [PHP Markdown Extra], [GitHub-Flavored Markdown],
22[MultiMarkdown], [reStructuredText], [XHTML], [HTML5], [LaTeX]
23\(including [`beamer`] slide shows\), [ConTeXt], [RTF], [OPML],
24[DocBook], [JATS], [OpenDocument], [ODT], [Word docx], [GNU Texinfo],
25[MediaWiki markup], [DokuWiki markup], [ZimWiki markup], [Haddock
26markup], [EPUB] \(v2 or v3\), [FictionBook2], [Textile], [groff man],
27[groff ms], [Emacs Org mode], [AsciiDoc], [InDesign ICML], [TEI
28Simple], [Muse], [PowerPoint] slide shows and [Slidy], [Slideous],
29[DZSlides], [reveal.js] or [S5] HTML slide shows. It can also produce
30[PDF] output on systems where LaTeX, ConTeXt, `pdfroff`,
31`wkhtmltopdf`, `prince`, or `weasyprint` is installed.
33Pandoc's enhanced version of Markdown includes syntax for [footnotes],
34[tables], flexible [ordered lists], [definition lists], [fenced code
35blocks], [superscripts and subscripts], [strikeout], [metadata blocks],
36automatic tables of contents, embedded LaTeX [math], [citations], and
37[Markdown inside HTML block elements][Extension:
38`markdown_in_html_blocks`]. (These enhancements, described further under
39[Pandoc's Markdown], can be disabled using the `markdown_strict` input
42In contrast to most existing tools for converting Markdown to HTML, which
43use regex substitutions, pandoc has a modular design: it consists of a
44set of readers, which parse text in a given format and produce a native
45representation of the document, and a set of writers, which convert
46this native representation into a target format. Thus, adding an input
47or output format requires only adding a reader or writer.
49Because pandoc's intermediate representation of a document is less
50expressive than many of the formats it converts between, one should
51not expect perfect conversions between every format and every other.
52Pandoc attempts to preserve the structural elements of a document, but
53not formatting details such as margin size. And some document elements,
54such as complex tables, may not fit into pandoc's simple document
55model. While conversions from pandoc's Markdown to all formats aspire
56to be perfect, conversions from formats more expressive than pandoc's
57Markdown can be expected to be lossy.
59[Markdown]: http://daringfireball.net/projects/markdown/
60[CommonMark]: http://commonmark.org
61[PHP Markdown Extra]: https://michelf.ca/projects/php-markdown/extra/
62[GitHub-Flavored Markdown]: https://help.github.com/articles/github-flavored-markdown/
63[MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
64[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
65[S5]: http://meyerweb.com/eric/tools/s5/
66[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
67[Slideous]: http://goessner.net/articles/slideous/
68[HTML]: http://www.w3.org/html/
69[HTML5]: http://www.w3.org/TR/html5/
70[polyglot markup]: https://www.w3.org/TR/html-polyglot/
71[XHTML]: http://www.w3.org/TR/xhtml1/
72[LaTeX]: http://latex-project.org
73[`beamer`]: https://ctan.org/pkg/beamer
74[Beamer User's Guide]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf
75[ConTeXt]: http://www.contextgarden.net/
76[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
77[DocBook]: http://docbook.org
78[JATS]: https://jats.nlm.nih.gov
79[txt2tags]: http://txt2tags.org
80[EPUB]: http://idpf.org/epub
81[OPML]: http://dev.opml.org/spec2.html
82[OpenDocument]: http://opendocument.xml.org
83[ODT]: http://en.wikipedia.org/wiki/OpenDocument
84[Textile]: http://redcloth.org/textile
85[MediaWiki markup]: https://www.mediawiki.org/wiki/Help:Formatting
86[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
87[ZimWiki markup]: http://zim-wiki.org/manual/Help/Wiki_Syntax.html
88[TWiki markup]: http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules
89[TikiWiki markup]: https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax
90[Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html
91[Creole 1.0]: http://www.wikicreole.org/wiki/Creole1.0
92[groff man]: http://man7.org/linux/man-pages/man7/groff_man.7.html
93[groff ms]: http://man7.org/linux/man-pages/man7/groff_ms.7.html
94[Haskell]: https://www.haskell.org
95[GNU Texinfo]: http://www.gnu.org/software/texinfo/
96[Emacs Org mode]: http://orgmode.org
97[AsciiDoc]: http://www.methods.co.nz/asciidoc/
98[DZSlides]: http://paulrouget.com/dzslides/
99[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML
100[PDF]: https://www.adobe.com/pdf/
101[reveal.js]: http://lab.hakim.se/reveal-js/
102[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
103[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
104[TEI Simple]: https://github.com/TEIC/TEI-Simple
105[Muse]: https://amusewiki.org/library/manual
106[PowerPoint]: https://en.wikipedia.org/wiki/Microsoft_PowerPoint
107[Vimwiki]: https://vimwiki.github.io
112If no *input-file* is specified, input is read from *stdin*.
113Otherwise, the *input-files* are concatenated (with a blank
114line between each) and used as input. Output goes to *stdout* by
115default (though output to the terminal is disabled for the
116`odt`, `docx`, `epub2`, and `epub3` output formats, unless it is
117forced using `-o -`). For output to a file, use the `-o`
120 pandoc -o output.html input.txt
122By default, pandoc produces a document fragment, not a standalone
123document with a proper header and footer. To produce a standalone
124document, use the `-s` or `--standalone` flag:
126 pandoc -s -o output.html input.txt
128For more information on how standalone documents are produced, see
131Instead of a file, an absolute URI may be given. In this case
132pandoc will fetch the content using HTTP:
134 pandoc -f html -t markdown http://www.fsf.org
136It is possible to supply a custom User-Agent string or other
137header when requesting a document from a URL:
139 pandoc -f html -t markdown --request-header User-Agent:"Mozilla/5.0" \
142If multiple input files are given, `pandoc` will concatenate them all (with
143blank lines between them) before parsing. This feature is disabled for
144 binary input formats such as `EPUB`, `odt`, and `docx`.
146The format of the input and output can be specified explicitly using
147command-line options. The input format can be specified using the
148`-r/--read` or `-f/--from` options, the output format using the
149`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
150Markdown to LaTeX, you could type:
152 pandoc -f markdown -t latex hello.txt
154To convert `hello.html` from HTML to Markdown:
156 pandoc -f html -t markdown hello.html
158Supported output formats are listed below under the `-t/--to` option.
159Supported input formats are listed below under the `-f/--from` option. Note
160that the `rst`, `textile`, `latex`, and `html` readers are not complete;
161there are some constructs that they do not parse.
163If the input or output format is not specified explicitly, `pandoc`
164will attempt to guess it from the extensions of
165the input and output filenames. Thus, for example,
167 pandoc -o hello.tex hello.txt
169will convert `hello.txt` from Markdown to LaTeX. If no output file
170is specified (so that output goes to *stdout*), or if the output file's
171extension is unknown, the output format will default to HTML.
172If no input file is specified (so that input comes from *stdin*), or
173if the input files' extensions are unknown, the input format will
174be assumed to be Markdown unless explicitly specified.
176Pandoc uses the UTF-8 character encoding for both input and output.
177If your local character encoding is not UTF-8, you
178should pipe input and output through [`iconv`]:
180 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
182Note that in some output formats (such as HTML, LaTeX, ConTeXt,
183RTF, OPML, DocBook, and Texinfo), information about
184the character encoding is included in the document header, which
185will only be included if you use the `-s/--standalone` option.
187[`iconv`]: http://www.gnu.org/software/libiconv/
192To produce a PDF, specify an output file with a `.pdf` extension.
193By default, pandoc will use LaTeX to create the PDF:
195 pandoc test.txt -o test.pdf
197Production of a PDF requires that a LaTeX engine be installed (see
198`--pdf-engine`, below), and assumes that the following LaTeX packages
199are available: [`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],
200[`ifxetex`], [`ifluatex`], [`listings`] (if the
201`--listings` option is used), [`fancyvrb`], [`longtable`],
202[`booktabs`], [`graphicx`] and [`grffile`] (if the document
203contains images), [`hyperref`], [`xcolor`] (with `colorlinks`), [`ulem`], [`geometry`] (with the
204`geometry` variable set), [`setspace`] (with `linestretch`), and
205[`babel`] (with `lang`). The use of `xelatex` or `lualatex` as
206the LaTeX engine requires [`fontspec`]. `xelatex` uses
207[`polyglossia`] (with `lang`), [`xecjk`], and [`bidi`] (with the
208`dir` variable set). If the `mathspec` variable is set,
209`xelatex` will use [`mathspec`] instead of [`unicode-math`].
210The [`upquote`] and [`microtype`] packages are used if
211available, and [`csquotes`] will be used for [typography]
212if added to the template or included in any header file. The
213[`natbib`], [`biblatex`], [`bibtex`], and [`biber`] packages can
214optionally be used for [citation rendering]. These are included
215with all recent versions of [TeX Live].
217Alternatively, pandoc can use [ConTeXt], `pdfroff`, or any of the
218following HTML/CSS-to-PDF-engines, to create a PDF: [`wkhtmltopdf`],
219[`weasyprint`] or [`prince`].
220To do this, specify an output file with a `.pdf` extension, as before,
221but add the `--pdf-engine` option or `-t context`, `-t html`, or `-t ms`
222to the command line (`-t html` defaults to `--pdf-engine=wkhtmltopdf`).
224PDF output can be controlled using [variables for LaTeX] (if
225LaTeX is used) and [variables for ConTeXt] (if ConTeXt is used).
226When using an HTML/CSS-to-PDF-engine, `--css` affects the output.
227If `wkhtmltopdf` is used, then the variables `margin-left`,
228`margin-right`, `margin-top`, `margin-bottom`, and `papersize`
229will affect the output.
231[`amsfonts`]: https://ctan.org/pkg/amsfonts
232[`amsmath`]: https://ctan.org/pkg/amsmath
233[`lm`]: https://ctan.org/pkg/lm
234[`ifxetex`]: https://ctan.org/pkg/ifxetex
235[`ifluatex`]: https://ctan.org/pkg/ifluatex
236[`listings`]: https://ctan.org/pkg/listings
237[`fancyvrb`]: https://ctan.org/pkg/fancyvrb
238[`longtable`]: https://ctan.org/pkg/longtable
239[`booktabs`]: https://ctan.org/pkg/booktabs
240[`graphicx`]: https://ctan.org/pkg/graphicx
241[`grffile`]: https://ctan.org/pkg/grffile
242[`geometry`]: https://ctan.org/pkg/geometry
243[`setspace`]: https://ctan.org/pkg/setspace
244[`xecjk`]: https://ctan.org/pkg/xecjk
245[`hyperref`]: https://ctan.org/pkg/hyperref
246[`ulem`]: https://ctan.org/pkg/ulem
247[`babel`]: https://ctan.org/pkg/babel
248[`bidi`]: https://ctan.org/pkg/bidi
249[`mathspec`]: https://ctan.org/pkg/mathspec
250[`unicode-math`]: https://ctan.org/pkg/unicode-math
251[`polyglossia`]: https://ctan.org/pkg/polyglossia
252[`fontspec`]: https://ctan.org/pkg/fontspec
253[`upquote`]: https://ctan.org/pkg/upquote
254[`microtype`]: https://ctan.org/pkg/microtype
255[`csquotes`]: https://ctan.org/pkg/csquotes
256[`natbib`]: https://ctan.org/pkg/natbib
257[`biblatex`]: https://ctan.org/pkg/biblatex
258[`bibtex`]: https://ctan.org/pkg/bibtex
259[`biber`]: https://ctan.org/pkg/biber
260[TeX Live]: http://www.tug.org/texlive/
261[`wkhtmltopdf`]: https://wkhtmltopdf.org
262[`weasyprint`]: http://weasyprint.org
263[`prince`]: https://www.princexml.com/
271`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
273: Specify input format. *FORMAT* can be `native` (native Haskell),
274 `json` (JSON version of native AST), `markdown` (pandoc's
275 extended Markdown), `markdown_strict` (original unextended
276 Markdown), `markdown_phpextra` (PHP Markdown Extra),
277 `markdown_mmd` (MultiMarkdown), `gfm` (GitHub-Flavored Markdown),
278 `commonmark` (CommonMark Markdown), `textile` (Textile), `rst`
279 (reStructuredText), `html` (HTML), `docbook` (DocBook), `t2t`
280 (txt2tags), `docx` (docx), `odt` (ODT), `epub` (EPUB), `opml` (OPML),
281 `org` (Emacs Org mode), `mediawiki` (MediaWiki markup), `twiki` (TWiki
282 markup), `tikiwiki` (TikiWiki markup), `creole` (Creole 1.0),
283 `haddock` (Haddock markup), or `latex` (LaTeX).
284 (`markdown_github` provides deprecated and less accurate support
285 for Github-Flavored Markdown; please use `gfm` instead, unless you
286 need to use extensions other than `smart`.)
287 Extensions can be individually enabled or disabled by
288 appending `+EXTENSION` or `-EXTENSION` to the format name.
289 See [Extensions] below, for a list of extensions and
290 their names. See `--list-input-formats` and `--list-extensions`,
293`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
295: Specify output format. *FORMAT* can be `native` (native Haskell),
296 `json` (JSON version of native AST), `plain` (plain text),
297 `markdown` (pandoc's extended Markdown), `markdown_strict`
298 (original unextended Markdown), `markdown_phpextra` (PHP Markdown
299 Extra), `markdown_mmd` (MultiMarkdown), `gfm` (GitHub-Flavored
300 Markdown), `commonmark` (CommonMark Markdown), `rst`
301 (reStructuredText), `html4` (XHTML 1.0 Transitional), `html` or
302 `html5` (HTML5/XHTML [polyglot markup]), `latex` (LaTeX), `beamer`
303 (LaTeX beamer slide show), `context` (ConTeXt), `man` (groff man),
304 `mediawiki` (MediaWiki markup), `dokuwiki` (DokuWiki markup),
305 `zimwiki` (ZimWiki markup), `textile` (Textile), `org` (Emacs Org
306 mode), `texinfo` (GNU Texinfo), `opml` (OPML), `docbook` or
307 `docbook4` (DocBook 4), `docbook5` (DocBook 5), `jats` (JATS XML),
308 `opendocument` (OpenDocument), `odt` (OpenOffice text document),
309 `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text
310 format), `epub2` (EPUB v2 book), `epub` or `epub3` (EPUB v3),
311 `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml`
312 (InDesign ICML), `tei` (TEI Simple), `slidy` (Slidy HTML and
313 JavaScript slide show), `slideous` (Slideous HTML and JavaScript
314 slide show), `dzslides` (DZSlides HTML5 + JavaScript slide show),
315 `revealjs` (reveal.js HTML5 + JavaScript slide show), `s5` (S5
316 HTML and JavaScript slide show), `pptx` (PowerPoint slide show) or
317 the path of a custom lua writer (see [Custom writers],
318 below). (`markdown_github` provides deprecated and less accurate
319 support for Github-Flavored Markdown; please use `gfm` instead,
320 unless you use extensions that do not work with `gfm`.) Note that
321 `odt`, `epub`, and `epub3` output will not be directed to
322 *stdout*; an output filename must be specified using the
323 `-o/--output` option. Extensions can be individually enabled or
324 disabled by appending `+EXTENSION` or `-EXTENSION` to the format
325 name. See [Extensions] below, for a list of extensions and their
326 names. See `--list-output-formats` and `--list-extensions`, below.
328`-o` *FILE*, `--output=`*FILE*
330: Write output to *FILE* instead of *stdout*. If *FILE* is
331 `-`, output will go to *stdout*, even if a non-textual format
332 (`docx`, `odt`, `epub2`, `epub3`) is specified.
334`--data-dir=`*DIRECTORY*
336: Specify the user data directory to search for pandoc data files.
337 If this option is not specified, the default user data directory
338 will be used. This is, in UNIX:
344 C:\Documents And Settings\USERNAME\Application Data\pandoc
346 and in Windows Vista or later:
348 C:\Users\USERNAME\AppData\Roaming\pandoc
350 You can find the default user data directory on your system by
351 looking at the output of `pandoc --version`.
352 A `reference.odt`, `reference.docx`, `epub.css`, `templates`,
353 `slidy`, `slideous`, or `s5` directory
354 placed in this directory will override pandoc's normal defaults.
358: Generate a bash completion script. To enable bash completion
359 with pandoc, add this to your `.bashrc`:
361 eval "$(pandoc --bash-completion)"
365: Give verbose debugging output. Currently this only has an effect
370: Suppress warning messages.
374: Exit with error status if there are any warnings.
378: Write log messages in machine-readable JSON format to
379 *FILE*. All messages above DEBUG level will be written,
380 regardless of verbosity settings (`--verbose`, `--quiet`).
382`--list-input-formats`
384: List supported input formats, one per line.
386`--list-output-formats`
388: List supported output formats, one per line.
390`--list-extensions`[`=`*FORMAT*]
392: List supported Markdown extensions, one per line, preceded
393 by a `+` or `-` indicating whether it is enabled by default
394 in *FORMAT*. If *FORMAT* is not specified, defaults for
395 pandoc's Markdown are given.
397`--list-highlight-languages`
399: List supported languages for syntax highlighting, one per
402`--list-highlight-styles`
404: List supported styles for syntax highlighting, one per line.
405 See `--highlight-style`.
418`--base-header-level=`*NUMBER*
420: Specify the base level for headers (defaults to 1).
422`--strip-empty-paragraphs`
424: *Deprecated. Use the `+empty_paragraphs` extension instead.*
425 Ignore paragraphs with no content. This option is useful
426 for converting word processing documents where users have
427 used empty paragraphs to create inter-paragraph space.
429`--indented-code-classes=`*CLASSES*
431: Specify classes to use for indented code blocks--for example,
432 `perl,numberLines` or `haskell`. Multiple classes may be separated
435`--default-image-extension=`*EXTENSION*
437: Specify a default extension to use when image paths/URLs have no
438 extension. This allows you to use the same source for formats that
439 require different kinds of images. Currently this option only affects
440 the Markdown and LaTeX readers.
444: Parse each file individually before combining for multifile
445 documents. This will allow footnotes in different files with the
446 same identifiers to work as expected. If this option is set,
447 footnotes and links will not work across files. Reading binary
448 files (docx, odt, epub) implies `--file-scope`.
452: Specify an executable to be used as a filter transforming the
453 pandoc AST after the input is parsed and before the output is
454 written. The executable should read JSON from stdin and write
455 JSON to stdout. The JSON must be formatted like pandoc's own
456 JSON input and output. The name of the output format will be
457 passed to the filter as the first argument. Hence,
459 pandoc --filter ./caps.py -t latex
463 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
465 The latter form may be useful for debugging filters.
467 Filters may be written in any language. `Text.Pandoc.JSON`
468 exports `toJSONFilter` to facilitate writing filters in Haskell.
469 Those who would prefer to write filters in python can use the
470 module [`pandocfilters`], installable from PyPI. There are also
471 pandoc filter libraries in [PHP], [perl], and
472 [JavaScript/node.js].
474 In order of preference, pandoc will look for filters in
476 1. a specified full or relative path (executable or
479 2. `$DATADIR/filters` (executable or non-executable)
480 where `$DATADIR` is the user data directory (see
481 `--data-dir`, above).
483 3. `$PATH` (executable only)
485`--lua-filter=`*SCRIPT*
487: Transform the document in a similar fashion as JSON filters (see
488 `--filter`), but use pandoc's build-in lua filtering system. The given
489 lua script is expected to return a list of lua filters which will be
490 applied in order. Each lua filter must contain element-transforming
491 functions indexed by the name of the AST element on which the filter
492 function should be applied.
494 The `pandoc` lua module provides helper functions for element
495 creation. It is always loaded into the script's lua environment.
497 The following is an example lua script for macro-expansion:
499 function expand_hello_world(inline)
500 if inline.c == '{{helloworld}}' then
501 return pandoc.Emph{ pandoc.Str "Hello, World" }
507 return {{Str = expand_hello_world}}
510`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]
512: Set the metadata field *KEY* to the value *VAL*. A value specified
513 on the command line overrides a value specified in the document.
514 Values will be parsed as YAML boolean or string values. If no value is
515 specified, the value will be treated as Boolean true. Like
516 `--variable`, `--metadata` causes template variables to be set.
517 But unlike `--variable`, `--metadata` affects the metadata of the
518 underlying document (which is accessible from filters and may be
519 printed in some output formats).
521`-p`, `--preserve-tabs`
523: Preserve tabs instead of converting them to spaces (the default).
524 Note that this will only affect tabs in literal code spans and code
525 blocks; tabs in regular text will be treated as spaces.
529: Specify the number of spaces per tab (default is 4).
531`--track-changes=accept`|`reject`|`all`
533: Specifies what to do with insertions, deletions, and comments
534 produced by the MS Word "Track Changes" feature. `accept` (the
535 default), inserts all insertions, and ignores all
536 deletions. `reject` inserts all deletions and ignores
537 insertions. Both `accept` and `reject` ignore comments. `all` puts
538 in insertions, deletions, and comments, wrapped in spans with
539 `insertion`, `deletion`, `comment-start`, and `comment-end`
540 classes, respectively. The author and time of change is
541 included. `all` is useful for scripting: only accepting changes
542 from a certain reviewer, say, or before a certain date. This
543 option only affects the docx reader.
545`--extract-media=`*DIR*
547: Extract images and other media contained in or linked from
548 the source document to the path *DIR*, creating it if
549 necessary, and adjust the images references in the document
550 so they point to the extracted files. If the source format is
551 a binary container (docx, epub, or odt), the media is
552 extracted from the container and the original
553 filenames are used. Otherwise the media is read from the
554 file system or downloaded, and new filenames are constructed
555 based on SHA1 hashes of the contents.
557`--abbreviations=`*FILE*
559: Specifies a custom abbreviations file, with abbreviations
560 one to a line. If this option is not specified, pandoc will
561 read the data file `abbreviations` from the user data
562 directory or fall back on a system default. To see the
564 `pandoc --print-default-data-file=abbreviations`. The only
565 use pandoc makes of this list is in the Markdown reader.
566 Strings ending in a period that are found in this list will
567 be followed by a nonbreaking space, so that the period will
568 not produce sentence-ending space in formats like LaTeX.
570[`pandocfilters`]: https://github.com/jgm/pandocfilters
571[PHP]: https://github.com/vinai/pandocfilters-php
572[perl]: https://metacpan.org/pod/Pandoc::Filter
573[JavaScript/node.js]: https://github.com/mvhenderson/pandoc-filter-node
575General writer options
576----------------------
580: Produce output with an appropriate header and footer (e.g. a
581 standalone HTML, LaTeX, TEI, or RTF file, not a fragment). This option
582 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
587: Use *FILE* as a custom template for the generated document. Implies
588 `--standalone`. See [Templates], below, for a description
589 of template syntax. If no extension is specified, an extension
590 corresponding to the writer will be added, so that `--template=special`
591 looks for `special.html` for HTML output. If the template is not
592 found, pandoc will search for it in the `templates` subdirectory of
593 the user data directory (see `--data-dir`). If this option is not used,
594 a default template appropriate for the output format will be used (see
595 `-D/--print-default-template`).
597`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`:`*VAL*]
599: Set the template variable *KEY* to the value *VAL* when rendering the
600 document in standalone mode. This is generally only useful when the
601 `--template` option is used to specify a custom template, since
602 pandoc automatically sets the variables used in the default
603 templates. If no *VAL* is specified, the key will be given the
606`-D` *FORMAT*, `--print-default-template=`*FORMAT*
608: Print the system default template for an output *FORMAT*. (See `-t`
609 for a list of possible *FORMAT*s.) Templates in the user data
610 directory are ignored.
612`--print-default-data-file=`*FILE*
614: Print a system default data file. Files in the user data directory
617`--eol=crlf`|`lf`|`native`
619: Manually specify line endings: `crlf` (Windows), `lf`
620 (macOS/Linux/UNIX), or `native` (line endings appropriate
621 to the OS on which pandoc is being run). The default is
626: Specify the dpi (dots per inch) value for conversion from pixels
627 to inch/centimeters and vice versa. The default is 96dpi.
628 Technically, the correct term would be ppi (pixels per inch).
630`--wrap=auto`|`none`|`preserve`
632: Determine how text is wrapped in the output (the source
633 code, not the rendered version). With `auto` (the default),
634 pandoc will attempt to wrap lines to the column width specified by
635 `--columns` (default 72). With `none`, pandoc will not wrap
636 lines at all. With `preserve`, pandoc will attempt to
637 preserve the wrapping from the source document (that is,
638 where there are nonsemantic newlines in the source, there
639 will be nonsemantic newlines in the output as well).
640 Automatic wrapping does not currently work in HTML output.
644: Specify length of lines in characters. This affects text wrapping
645 in the generated source code (see `--wrap`). It also affects
646 calculation of column widths for plain text tables (see [Tables] below).
648`--toc`, `--table-of-contents`
650: Include an automatically generated table of contents (or, in
651 the case of `latex`, `context`, `docx`, `odt`,
652 `opendocument`, `rst`, or `ms`, an instruction to create
653 one) in the output document. This option has no effect on
654 `man`, `docbook4`, `docbook5`, or `jats` output.
656`--toc-depth=`*NUMBER*
658: Specify the number of section levels to include in the table
659 of contents. The default is 3 (which means that level 1, 2, and 3
660 headers will be listed in the contents).
664: Strip out HTML comments in the Markdown or Textile source,
665 rather than passing them on to Markdown, Textile or HTML
666 output as raw HTML. This does not apply to HTML comments
667 inside raw HTML blocks when the `markdown_in_html_blocks`
668 extension is not set.
672: Disables syntax highlighting for code blocks and inlines, even when
673 a language attribute is given.
675`--highlight-style=`*STYLE*|*FILE*
677: Specifies the coloring style to be used in highlighted source code.
678 Options are `pygments` (the default), `kate`, `monochrome`,
679 `breezeDark`, `espresso`, `zenburn`, `haddock`, and `tango`.
680 For more information on syntax highlighting in pandoc, see
681 [Syntax highlighting], below. See also
682 `--list-highlight-styles`.
684 Instead of a *STYLE* name, a JSON file with extension
685 `.theme` may be supplied. This will be parsed as a KDE
686 syntax highlighting theme and (if valid) used as the
689 To generate the JSON version of an existing style,
690 use `--print-highlight-style`.
692`--print-highlight-style=`*STYLE*|*FILE*
694: Prints a JSON version of a highlighting style, which can
695 be modified, saved with a `.theme` extension, and used
696 with `--highlight-style`.
698`--syntax-definition=`*FILE*
700: Instructs pandoc to load a KDE XML syntax definition file,
701 which will be used for syntax highlighting of appropriately
702 marked code blocks. This can be used to add support for
703 new languages or to use altered syntax definitions for
706`-H` *FILE*, `--include-in-header=`*FILE*
708: Include contents of *FILE*, verbatim, at the end of the header.
709 This can be used, for example, to include special
710 CSS or JavaScript in HTML documents. This option can be used
711 repeatedly to include multiple files in the header. They will be
712 included in the order specified. Implies `--standalone`.
714`-B` *FILE*, `--include-before-body=`*FILE*
716: Include contents of *FILE*, verbatim, at the beginning of the
717 document body (e.g. after the `<body>` tag in HTML, or the
718 `\begin{document}` command in LaTeX). This can be used to include
719 navigation bars or banners in HTML documents. This option can be
720 used repeatedly to include multiple files. They will be included in
721 the order specified. Implies `--standalone`.
723`-A` *FILE*, `--include-after-body=`*FILE*
725: Include contents of *FILE*, verbatim, at the end of the document
726 body (before the `</body>` tag in HTML, or the
727 `\end{document}` command in LaTeX). This option can be used
728 repeatedly to include multiple files. They will be included in the
729 order specified. Implies `--standalone`.
731`--resource-path=`*SEARCHPATH*
733: List of paths to search for images and other resources.
734 The paths should be separated by `:` on Linux, UNIX, and
735 macOS systems, and by `;` on Windows. If `--resource-path`
736 is not specified, the default resource path is the working
737 directory. Note that, if `--resource-path` is specified,
738 the working directory must be explicitly listed or it
739 will not be searched. For example:
740 `--resource-path=.:test` will search the working directory
741 and the `test` subdirectory, in that order.
743`--request-header=`*NAME*`:`*VAL*
745: Set the request header *NAME* to the value *VAL* when making
746 HTTP requests (for example, when a URL is given on the
747 command line, or when resources used in a document must be
750Options affecting specific writers
751----------------------------------
755: Produce a standalone HTML file with no external dependencies, using
756 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
757 images, and videos. The resulting file should be "self-contained,"
758 in the sense that it needs no external files and no net access to be
759 displayed properly by a browser. This option works only with HTML output
760 formats, including `html4`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
761 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
762 stylesheets at absolute URLs will be downloaded; those at relative URLs
763 will be sought relative to the working directory (if the first source
764 file is local) or relative to the base URL (if the first source
765 file is remote). Elements with the attribute
766 `data-external="1"` will be left alone; the documents they
767 link to will not be incorporated in the document.
768 Limitation: resources that are loaded dynamically through
769 JavaScript cannot be incorporated; as a result,
770 `--self-contained` does not work with `--mathjax`, and some
771 advanced features (e.g. zoom or speaker notes) may not work
772 in an offline "self-contained" `reveal.js` slide show.
776: Use `<q>` tags for quotes in HTML.
780: Use only ASCII characters in output. Currently supported only for
781 HTML and DocBook output (which uses numerical entities instead of
782 UTF-8 when this option is selected).
786: Use reference-style links, rather than inline links, in writing Markdown
787 or reStructuredText. By default inline links are used. The
788 placement of link references is affected by the
789 `--reference-location` option.
791`--reference-location = block`|`section`|`document`
793: Specify whether footnotes (and references, if `reference-links` is
794 set) are placed at the end of the current (top-level) block, the
795 current section, or the document. The default is
796 `document`. Currently only affects the markdown writer.
800: Use ATX-style headers in Markdown and AsciiDoc output. The default is
801 to use setext-style headers for levels 1-2, and then ATX headers.
802 (Note: for `gfm` output, ATX headers are always used.)
804`--top-level-division=[default|section|chapter|part]`
806: Treat top-level headers as the given division type in LaTeX, ConTeXt,
807 DocBook, and TEI output. The hierarchy order is part, chapter, then section;
808 all headers are shifted such that the top-level header becomes the specified
809 type. The default behavior is to determine the best division type via
810 heuristics: unless other conditions apply, `section` is chosen. When the
811 LaTeX document class is set to `report`, `book`, or `memoir` (unless the
812 `article` option is specified), `chapter` is implied as the setting for this
813 option. If `beamer` is the output format, specifying either `chapter` or
814 `part` will cause top-level headers to become `\part{..}`, while
815 second-level headers remain as their default type.
817`-N`, `--number-sections`
819: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
820 By default, sections are not numbered. Sections with class
821 `unnumbered` will never be numbered, even if `--number-sections`
824`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]
826: Offset for section headings in HTML output (ignored in other
827 output formats). The first number is added to the section number for
828 top-level headers, the second for second-level headers, and so on.
829 So, for example, if you want the first top-level header in your
830 document to be numbered "6", specify `--number-offset=5`.
831 If your document starts with a level-2 header which you want to
832 be numbered "1.5", specify `--number-offset=1,4`.
833 Offsets are 0 by default. Implies `--number-sections`.
837: Use the [`listings`] package for LaTeX code blocks
841: Make list items in slide shows display incrementally (one by one).
842 The default is for lists to be displayed all at once.
844`--slide-level=`*NUMBER*
846: Specifies that headers with the specified level create
847 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
848 above this level in the hierarchy are used to divide the
849 slide show into sections; headers below this level create
850 subheads within a slide. Note that content that is
851 not contained under slide-level headers will not appear in
852 the slide show. The default is to set the slide level based
853 on the contents of the document; see [Structuring the slide
858: Wrap sections in `<section>` tags (or `<div>` tags for `html4`),
859 and attach identifiers to the enclosing `<section>` (or `<div>`)
860 rather than the header itself. See
861 [Header identifiers], below.
863`--email-obfuscation=none`|`javascript`|`references`
865: Specify a method for obfuscating `mailto:` links in HTML documents.
866 `none` leaves `mailto:` links as they are. `javascript` obfuscates
867 them using JavaScript. `references` obfuscates them by printing their
868 letters as decimal or hexadecimal character references. The default
871`--id-prefix=`*STRING*
873: Specify a prefix to be added to all identifiers and internal links
874 in HTML and DocBook output, and to footnote numbers in Markdown
875 and Haddock output. This is useful for preventing duplicate
876 identifiers when generating fragments to be included in other pages.
878`-T` *STRING*, `--title-prefix=`*STRING*
880: Specify *STRING* as a prefix at the beginning of the title
881 that appears in the HTML header (but not in the title as it
882 appears at the beginning of the HTML body). Implies
885`-c` *URL*, `--css=`*URL*
887: Link to a CSS style sheet. This option can be used repeatedly to
888 include multiple files. They will be included in the order specified.
890 A stylesheet is required for generating EPUB. If none is
891 provided using this option (or the `stylesheet` metadata
892 field), pandoc will look for a file `epub.css` in the
893 user data directory (see `--data-dir`). If it is not
894 found there, sensible defaults will be used.
896`--reference-doc=`*FILE*
898: Use the specified file as a style reference in producing a
903 : For best results, the reference docx should be a modified
904 version of a docx file produced using pandoc. The contents
905 of the reference docx are ignored, but its stylesheets and
906 document properties (including margins, page size, header,
907 and footer) are used in the new docx. If no reference docx
908 is specified on the command line, pandoc will look for a
909 file `reference.docx` in the user data directory (see
910 `--data-dir`). If this is not found either, sensible
911 defaults will be used.
913 To produce a custom `reference.docx`, first get a copy of
914 the default `reference.docx`: `pandoc
915 --print-default-data-file reference.docx >
916 custom-reference.docx`. Then open `custom-reference.docx`
917 in Word, modify the styles as you wish, and save the file.
918 For best results, do not make changes to this file other
919 than modifying the styles used by pandoc: [paragraph]
920 Normal, Body Text, First Paragraph, Compact, Title,
921 Subtitle, Author, Date, Abstract, Bibliography, Heading 1,
922 Heading 2, Heading 3, Heading 4, Heading 5, Heading 6,
923 Heading 7, Heading 8, Heading 9, Block Text, Footnote Text,
924 Definition Term, Definition, Caption, Table Caption,
925 Image Caption, Figure, Captioned Figure, TOC Heading;
926 [character] Default Paragraph Font, Body Text Char,
927 Verbatim Char, Footnote Reference, Hyperlink; [table]
932 : For best results, the reference ODT should be a modified
933 version of an ODT produced using pandoc. The contents of
934 the reference ODT are ignored, but its stylesheets are used
935 in the new ODT. If no reference ODT is specified on the
936 command line, pandoc will look for a file `reference.odt` in
937 the user data directory (see `--data-dir`). If this is not
938 found either, sensible defaults will be used.
940 To produce a custom `reference.odt`, first get a copy of
941 the default `reference.odt`: `pandoc
942 --print-default-data-file reference.odt >
943 custom-reference.odt`. Then open `custom-reference.odt` in
944 LibreOffice, modify the styles as you wish, and save the
947`--epub-cover-image=`*FILE*
949: Use the specified image as the EPUB cover. It is recommended
950 that the image be less than 1000px in width and height. Note that
951 in a Markdown source document you can also specify `cover-image`
952 in a YAML metadata block (see [EPUB Metadata], below).
954`--epub-metadata=`*FILE*
956: Look in the specified XML file for metadata for the EPUB.
957 The file should contain a series of [Dublin Core elements].
960 <dc:rights>Creative Commons</dc:rights>
961 <dc:language>es-AR</dc:language>
963 By default, pandoc will include the following metadata elements:
964 `<dc:title>` (from the document title), `<dc:creator>` (from the
965 document authors), `<dc:date>` (from the document date, which should
966 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
967 variable, or, if is not set, the locale), and `<dc:identifier
968 id="BookId">` (a randomly generated UUID). Any of these may be
969 overridden by elements in the metadata file.
971 Note: if the source document is Markdown, a YAML metadata block
972 in the document can be used instead. See below under
975`--epub-embed-font=`*FILE*
977: Embed the specified font in the EPUB. This option can be repeated
978 to embed multiple fonts. Wildcards can also be used: for example,
979 `DejaVuSans-*.ttf`. However, if you use wildcards on the command
980 line, be sure to escape them or put the whole filename in single quotes,
981 to prevent them from being interpreted by the shell. To use the
982 embedded fonts, you will need to add declarations like the following
983 to your CSS (see `--css`):
986 font-family: DejaVuSans;
989 src:url("DejaVuSans-Regular.ttf");
992 font-family: DejaVuSans;
995 src:url("DejaVuSans-Bold.ttf");
998 font-family: DejaVuSans;
1000 font-weight: normal;
1001 src:url("DejaVuSans-Oblique.ttf");
1004 font-family: DejaVuSans;
1007 src:url("DejaVuSans-BoldOblique.ttf");
1009 body { font-family: "DejaVuSans"; }
1011`--epub-chapter-level=`*NUMBER*
1013: Specify the header level at which to split the EPUB into separate
1014 "chapter" files. The default is to split into chapters at level 1
1015 headers. This option only affects the internal composition of the
1016 EPUB, not the way chapters and sections are displayed to users. Some
1017 readers may be slow if the chapter files are too large, so for large
1018 documents with few level 1 headers, one might want to use a chapter
1021`--epub-subdirectory=`*DIRNAME*
1023: Specify the subdirectory in the OCF container that is to hold
1024 the EPUB-specific contents. The default is `EPUB`. To put
1025 the EPUB contents in the top level, use an empty string.
1027`--pdf-engine=pdflatex`|`lualatex`|`xelatex`|`wkhtmltopdf`|`weasyprint`|`prince`|`context`|`pdfroff`
1029: Use the specified engine when producing PDF output.
1030 The default is `pdflatex`. If the engine is not in your PATH,
1031 the full path of the engine may be specified here.
1033`--pdf-engine-opt=`*STRING*
1035: Use the given string as a command-line argument to the `pdf-engine`.
1036 If used multiple times, the arguments are provided with spaces between
1037 them. Note that no check for duplicate options is done.
1039[Dublin Core elements]: http://dublincore.org/documents/dces/
1040[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
1045`--bibliography=`*FILE*
1047: Set the `bibliography` field in the document's metadata to *FILE*,
1048 overriding any value set in the metadata, and process citations
1049 using `pandoc-citeproc`. (This is equivalent to
1050 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
1051 If `--natbib` or `--biblatex` is also supplied, `pandoc-citeproc` is not
1052 used, making this equivalent to `--metadata bibliography=FILE`.
1053 If you supply this argument multiple times, each *FILE* will be added
1058: Set the `csl` field in the document's metadata to *FILE*,
1059 overriding any value set in the metadata. (This is equivalent to
1060 `--metadata csl=FILE`.)
1061 This option is only relevant with `pandoc-citeproc`.
1063`--citation-abbreviations=`*FILE*
1065: Set the `citation-abbreviations` field in the document's metadata to
1066 *FILE*, overriding any value set in the metadata. (This is equivalent to
1067 `--metadata citation-abbreviations=FILE`.)
1068 This option is only relevant with `pandoc-citeproc`.
1072: Use [`natbib`] for citations in LaTeX output. This option is not for use
1073 with the `pandoc-citeproc` filter or with PDF output. It is intended for
1074 use in producing a LaTeX file that can be processed with [`bibtex`].
1078: Use [`biblatex`] for citations in LaTeX output. This option is not for use
1079 with the `pandoc-citeproc` filter or with PDF output. It is intended for
1080 use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
1082Math rendering in HTML
1083----------------------
1085The default is to render TeX math as far as possible using Unicode characters.
1086Formulas are put inside a `span` with `class="math"`, so that they may be styled
1087differently from the surrounding text if needed. However, this gives acceptable
1088results only for basic math, usually you will want to use `--mathjax` or another
1089of the following options.
1091`--mathjax`[`=`*URL*]
1093: Use [MathJax] to display embedded TeX math in HTML output.
1094 TeX math will be put between `\(...\)` (for inline math)
1095 or `\[...\]` (for display math) and wrapped in `<span>` tags
1096 with class `math`. Then the MathJax JavaScript will render it.
1097 The *URL* should point to the `MathJax.js` load script.
1098 If a *URL* is not provided, a link to the Cloudflare CDN will
1103: Convert TeX math to [MathML] (in `epub3`, `docbook4`, `docbook5`, `jats`,
1104 `html4` and `html5`). This is the default in `odt` output. Note that
1105 currently only Firefox and Safari (and select e-book readers) natively
1110: Convert TeX formulas to `<img>` tags that link to an external script
1111 that converts formulas to images. The formula will be URL-encoded
1112 and concatenated with the URL provided. For SVG images you can for
1113 example use `--webtex https://latex.codecogs.com/svg.latex?`.
1114 If no URL is specified, the CodeCogs URL generating PNGs
1115 will be used (`https://latex.codecogs.com/png.latex?`).
1116 Note: the `--webtex` option will affect Markdown output
1117 as well as HTML, which is useful if you're targeting a
1118 version of Markdown without native math support.
1122: Use [KaTeX] to display embedded TeX math in HTML output.
1123 The *URL* is the base URL for the KaTeX library. If a *URL* is
1124 not provided, a link to the KaTeX CDN will be inserted.
1126`--katex-stylesheet=`*URL*
1128: The *URL* should point to the `katex.css` stylesheet. If this option is
1129 not specified, a link to the KaTeX CDN will be inserted. Note that this
1130 option does not imply `--katex`.
1132`-m` [*URL*], `--latexmathml`[`=`*URL*]
1135 Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
1136 TeX math will be displayed between `$` or `$$` characters and put in
1137 `<span>` tags with class `LaTeX`. The LaTeXMathML JavaScript will then
1138 change it to MathML. Note that currently only Firefox and Safari
1139 (and select e-book readers) natively support MathML.
1140 To insert a link the `LaTeXMathML.js` script, provide a *URL*.
1145 Use [jsMath] (the predecessor of MathJax) to display embedded TeX
1146 math in HTML output. TeX math will be put inside `<span>` tags
1147 (for inline math) or `<div>` tags (for display math) with class
1148 `math` and rendered by the jsMath script. The *URL* should point to
1149 the script (e.g. `jsMath/easy/load.js`); if provided, it will be linked
1150 to in the header of standalone HTML documents. If a *URL* is not provided,
1151 no link to the jsMath load script will be inserted; it is then
1152 up to the author to provide such a link in the HTML template.
1157 Enclose TeX math in `<eq>` tags in HTML output. The resulting HTML
1158 can then be processed by [gladTeX] to produce images of the typeset
1159 formulas and an HTML file with links to these images.
1160 So, the procedure is:
1162 pandoc -s --gladtex input.md -o myfile.htex
1163 gladtex -d myfile-images myfile.htex
1164 # produces myfile.html and images in myfile-images
1166`--mimetex`[`=`*URL*]
1169 Render TeX math using the [mimeTeX] CGI script, which generates an
1170 image for each TeX formula. This should work in all browsers. If
1171 *URL* is not specified, it is assumed that the script is at
1172 `/cgi-bin/mimetex.cgi`.
1174[MathML]: http://www.w3.org/Math/
1175[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
1176[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
1177[MathJax]: https://www.mathjax.org
1178[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
1179[mimeTeX]: http://www.forkosh.com/mimetex.html
1180[KaTeX]: https://github.com/Khan/KaTeX
1182Options for wrapper scripts
1183---------------------------
1187: Print information about command-line arguments to *stdout*, then exit.
1188 This option is intended primarily for use in wrapper scripts.
1189 The first line of output contains the name of the output file specified
1190 with the `-o` option, or `-` (for *stdout*) if no output file was
1191 specified. The remaining lines contain the command-line arguments,
1192 one per line, in the order they appear. These do not include regular
1193 pandoc options and their arguments, but do include any options appearing
1194 after a `--` separator at the end of the line.
1198: Ignore command-line arguments (for use in wrapper scripts).
1199 Regular pandoc options are not ignored. Thus, for example,
1201 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
1205 pandoc -o foo.html -s
1210When the `-s/--standalone` option is used, pandoc uses a template to
1211add header and footer material that is needed for a self-standing
1212document. To see the default template that is used, just type
1216where *FORMAT* is the name of the output format. A custom template
1217can be specified using the `--template` option. You can also override
1218the system default templates for a given output format *FORMAT*
1219by putting a file `templates/default.*FORMAT*` in the user data
1220directory (see `--data-dir`, above). *Exceptions:*
1222- For `odt` output, customize the `default.opendocument`
1224- For `pdf` output, customize the `default.latex` template
1225 (or the `default.context` template, if you use `-t context`,
1226 or the `default.ms` template, if you use `-t ms`, or the
1227 `default.html5` template, if you use `-t html5`).
1228- `docx` has no template (however, you can use
1229 `--reference-doc` to customize the output).
1231Templates contain *variables*, which allow for the inclusion of
1232arbitrary information at any point in the file. Variables may be set
1233within the document using [YAML metadata blocks][Extension:
1234`yaml_metadata_block`]. They may also be set at the
1235command line using the `-V/--variable` option: variables set in this
1236way override metadata fields with the same name.
1238Variables set by pandoc
1239-----------------------
1241Some variables are set automatically by pandoc. These vary somewhat
1242depending on the output format, but include metadata fields as well
1245`sourcefile`, `outputfile`
1246: source and destination filenames, as given on the command line.
1247 `sourcefile` can also be a list if input comes from multiple files, or empty
1248 if input is from stdin. You can use the following snippet in your template
1249 to distinguish them:
1259 Similarly, `outputfile` can be `-` if output goes to the terminal.
1261`title`, `author`, `date`
1262: allow identification of basic aspects of the document. Included
1263 in PDF metadata through LaTeX and ConTeXt. These can be set
1264 through a [pandoc title block][Extension: `pandoc_title_block`],
1265 which allows for multiple authors, or through a YAML metadata block:
1274: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and Word docx;
1275 renders in LaTeX only when using a document class that supports
1276 `\subtitle`, such as `beamer` or the [KOMA-Script] series (`scrartcl`,
1277 `scrreprt`, `scrbook`).[^subtitle]
1280: author affiliations (in LaTeX and Beamer only). Can be a
1281 list, when there are multiple authors.
1284: document summary, included in LaTeX, ConTeXt, AsciiDoc, and Word docx
1287: list of keywords to be included in HTML, PDF, and AsciiDoc metadata;
1288 may be repeated as for `author`, above
1291: contents specified by `-H/--include-in-header` (may have multiple
1295: non-null value if `--toc/--table-of-contents` was specified
1298: title of table of contents (works only with EPUB,
1299 opendocument, odt, docx)
1302: contents specified by `-B/--include-before-body` (may have
1306: contents specified by `-A/--include-after-body` (may have
1313: JSON representation of all of the document's metadata. Field
1314 values are transformed to the selected output format.
1316[^subtitle]: To make `subtitle` work with other LaTeX
1317 document classes, you can add the following to `header-includes`:
1319 \providecommand{\subtitle}[1]{%
1320 \usepackage{titling}
1322 \par\large#1\end{center}}
1329: identifies the main language of the document,
1330 using a code according to [BCP 47] (e.g. `en` or `en-GB`).
1331 For some output formats, pandoc will convert it to an appropriate
1332 format stored in the additional variables `babel-lang`,
1333 `polyglossia-lang` (LaTeX) and `context-lang` (ConTeXt).
1335 Native pandoc `span`s and `div`s with the lang attribute
1336 (value in BCP 47) can be used to switch the language in
1340: a list of other languages used in the document
1341 in the YAML metadata, according to [BCP 47]. For example:
1342 `otherlangs: [en-GB, fr]`.
1343 This is automatically generated from the `lang` attributes
1344 in all `span`s and `div`s but can be overridden.
1345 Currently only used by LaTeX through the generated
1346 `babel-otherlangs` and `polyglossia-otherlangs` variables.
1347 The LaTeX writer outputs polyglossia commands in the text but
1348 the `babel-newcommands` variable contains mappings for them
1349 to the corresponding babel.
1352: the base direction of the document, either `rtl` (right-to-left)
1353 or `ltr` (left-to-right).
1355 For bidirectional documents, native pandoc `span`s and `div`s
1356 with the `dir` attribute (value `rtl` or `ltr`) can be used to
1357 override the base direction in some output formats.
1358 This may not always be necessary if the final renderer
1359 (e.g. the browser, when generating HTML) supports the
1360 [Unicode Bidirectional Algorithm].
1362 When using LaTeX for bidirectional documents, only the `xelatex` engine
1363 is fully supported (use `--pdf-engine=xelatex`).
1365[BCP 47]: https://tools.ietf.org/html/bcp47
1366[Unicode Bidirectional Algorithm]: http://www.w3.org/International/articles/inline-bidi-markup/uba-basics
1371Variables are available for [producing slide shows with pandoc],
1372including all [reveal.js configuration options].
1375: title graphic for Beamer documents
1378: logo for Beamer documents
1381: base URL for Slidy documents (defaults to
1382 `https://www.w3.org/Talks/Tools/Slidy2`)
1385: base URL for Slideous documents (defaults to `slideous`)
1388: base URL for S5 documents (defaults to `s5/default`)
1391: base URL for reveal.js documents (defaults to `reveal.js`)
1393`theme`, `colortheme`, `fonttheme`, `innertheme`, `outertheme`
1394: themes for LaTeX [`beamer`] documents
1397: options for LaTeX beamer themes (a list).
1400: controls navigation symbols in `beamer` documents
1401 (default is `empty` for no navigation symbols; other valid values
1402 are `frame`, `vertical`, and `horizontal`).
1405: enables on "title pages" for new sections in `beamer`
1406 documents (default = true).
1409: when true, the `beamerarticle` package is loaded (for
1410 producing an article from beamer slides).
1413: aspect ratio of slides (for beamer only, `1610` for 16:10, `169` for 16:9,
1414 `149` for 14:9, `141` for 1.41:1, `54` for 5:4, `43` for 4:3 which is the
1415 default, and `32` for 3:2).
1417[reveal.js configuration options]: https://github.com/hakimel/reveal.js#configuration
1422LaTeX variables are used when [creating a PDF].
1425: paper size, e.g. `letter`, `a4`
1428: font size for body text (e.g. `10pt`, `12pt`)
1431: document class, e.g. [`article`], [`report`], [`book`], [`memoir`]
1434: option for document class, e.g. `oneside`; may be repeated
1435 for multiple options
1438: option for [`geometry`] package, e.g. `margin=1in`;
1439 may be repeated for multiple options
1441`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
1442: sets margins, if `geometry` is not used (otherwise `geometry`
1446: adjusts line spacing using the [`setspace`]
1447 package, e.g. `1.25`, `1.5`
1450: font package for use with `pdflatex`:
1451 [TeX Live] includes many options, documented in the [LaTeX Font Catalogue].
1452 The default is [Latin Modern][`lm`].
1455: options for package used as `fontfamily`: e.g. `osf,sc` with
1456 `fontfamily` set to [`mathpazo`] provides Palatino with old-style
1457 figures and true small caps; may be repeated for multiple options
1459`mainfont`, `sansfont`, `monofont`, `mathfont`, `CJKmainfont`
1460: font families for use with `xelatex` or
1461 `lualatex`: take the name of any system font, using the
1462 [`fontspec`] package. Note that if `CJKmainfont` is used,
1463 the [`xecjk`] package must be available.
1465`mainfontoptions`, `sansfontoptions`, `monofontoptions`, `mathfontoptions`, `CJKoptions`
1466: options to use with `mainfont`, `sansfont`, `monofont`, `mathfont`,
1467 `CJKmainfont` in `xelatex` and `lualatex`. Allow for any choices
1468 available through [`fontspec`], such as the OpenType features
1469 `Numbers=OldStyle,Numbers=Proportional`. May be repeated for multiple options.
1472: allows font encoding to be specified through `fontenc` package (with `pdflatex`);
1473 default is `T1` (see guide to [LaTeX font encodings])
1476: options to pass to the microtype package
1479: add color to link text; automatically enabled if any of `linkcolor`, `citecolor`,
1480 `urlcolor`, or `toccolor` are set
1482`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
1483: color for internal links, citation links, external links, and links in table of contents:
1484 uses options allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and `x11names` lists
1487: causes links to be printed as footnotes
1490: uses document class settings for indentation (the default LaTeX template
1491 otherwise removes indentation and adds space between paragraphs)
1494: disables default behavior of LaTeX template that redefines (sub)paragraphs
1495 as sections, changing the appearance of nested headings in some classes
1498: specifies contents of acknowledgments footnote after document title.
1501: include table of contents (can also be set using `--toc/--table-of-contents`)
1504: level of section to include in table of contents
1507: numbering depth for sections, if sections are numbered
1510: include list of figures, list of tables
1513: bibliography to use for resolving references
1516: bibliography style, when used with `--natbib` and `--biblatex`.
1519: bibliography title, when used with `--natbib` and `--biblatex`.
1522: list of options for biblatex.
1525: list of options for natbib.
1528: An option for LaTeX's `\pagestyle{}`. The default article class
1529 supports 'plain' (default), 'empty', and 'headings'; headings puts
1530 section titles in the header.
1532[`article`]: https://ctan.org/pkg/article
1533[`report`]: https://ctan.org/pkg/report
1534[`book`]: https://ctan.org/pkg/book
1535[KOMA-Script]: https://ctan.org/pkg/koma-script
1536[`memoir`]: https://ctan.org/pkg/memoir
1537[`xcolor`]: https://ctan.org/pkg/xcolor
1538[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
1539[`mathpazo`]: https://ctan.org/pkg/mathpazo
1540[LaTeX font encodings]: https://ctan.org/pkg/encguide
1542Variables for ConTeXt
1543---------------------
1546: paper size, e.g. `letter`, `A4`, `landscape` (see [ConTeXt Paper Setup]);
1547 may be repeated for multiple options
1550: options for page margins and text arrangement (see [ConTeXt Layout]);
1551 may be repeated for multiple options
1553`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
1554: sets margins, if `layout` is not used (otherwise `layout`
1558: font size for body text (e.g. `10pt`, `12pt`)
1560`mainfont`, `sansfont`, `monofont`, `mathfont`
1561: font families: take the name of any system font (see [ConTeXt Font Switching])
1563`linkcolor`, `contrastcolor`
1564: color for links outside and inside a page, e.g. `red`, `blue` (see [ConTeXt Color])
1567: typeface style for links, e.g. `normal`, `bold`, `slanted`, `boldslanted`, `type`, `cap`, `small`
1570: controls indentation of paragraphs, e.g. `yes,small,next` (see [ConTeXt Indentation]);
1571 may be repeated for multiple options
1574: spacing between paragraphs, e.g. `none`, `small` (using [`setupwhitespace`])
1577: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);
1578 may be repeated for multiple options
1580`headertext`, `footertext`
1581: text to be placed in running header or footer (see [ConTeXt Headers and Footers]);
1582 may be repeated up to four times for different placement
1585: page number style and location (using [`setuppagenumbering`]);
1586 may be repeated for multiple options
1589: include table of contents (can also be set using `--toc/--table-of-contents`)
1592: include list of figures, list of tables
1594[ConTeXt Paper Setup]: http://wiki.contextgarden.net/PaperSetup
1595[ConTeXt Layout]: http://wiki.contextgarden.net/Layout
1596[ConTeXt Font Switching]: http://wiki.contextgarden.net/Font_Switching
1597[ConTeXt Color]: http://wiki.contextgarden.net/Color
1598[ConTeXt Headers and Footers]: http://wiki.contextgarden.net/Headers_and_Footers
1599[ConTeXt Indentation]: http://wiki.contextgarden.net/Indentation
1600[`setupwhitespace`]: http://wiki.contextgarden.net/Command/setupwhitespace
1601[`setupinterlinespace`]: http://wiki.contextgarden.net/Command/setupinterlinespace
1602[`setuppagenumbering`]: http://wiki.contextgarden.net/Command/setuppagenumbering
1604Variables for man pages
1605-----------------------
1608: section number in man pages
1611: header in man pages
1614: footer in man pages
1617: adjusts text to left (`l`), right (`r`), center (`c`),
1618 or both (`b`) margins
1621: if `true` (the default), hyphenation will be used
1627: point size (e.g. `10p`)
1630: line height (e.g. `12p`)
1633: font family (e.g. `T` or `P`)
1636: paragraph indent (e.g. `2m`)
1638Using variables in templates
1639----------------------------
1641Variable names are sequences of alphanumerics, `-`, and `_`,
1642starting with a letter. A variable name surrounded by `$` signs
1643will be replaced by its value. For example, the string `$title$` in
1645 <title>$title$</title>
1647will be replaced by the document title.
1649To write a literal `$` in a template, use `$$`.
1651Templates may contain conditionals. The syntax is as follows:
1659This will include `X` in the template if `variable` has a non-null
1660value; otherwise it will include `Y`. `X` and `Y` are placeholders for
1661any valid template text, and may include interpolated variables or other
1662conditionals. The `$else$` section may be omitted.
1664When variables can have multiple values (for example, `author` in
1665a multi-author document), you can use the `$for$` keyword:
1668 <meta name="author" content="$author$" />
1671You can optionally specify a separator to be used between
1674 $for(author)$$author$$sep$, $endfor$
1676A dot can be used to select a field of a variable that takes
1677an object as its value. So, for example:
1679 $author.name$ ($author.affiliation$)
1681If you use custom templates, you may need to revise them as pandoc
1682changes. We recommend tracking the changes in the default templates,
1683and modifying your custom templates accordingly. An easy way to do this
1684is to fork the [pandoc-templates] repository and merge in changes after each
1687Templates may contain comments: anything on a line after `$--`
1688will be treated as a comment and ignored.
1690[pandoc-templates]: https://github.com/jgm/pandoc-templates
1695The behavior of some of the readers and writers can be adjusted by
1696enabling or disabling various extensions.
1698An extension can be enabled by adding `+EXTENSION`
1699to the format name and disabled by adding `-EXTENSION`. For example,
1700`--from markdown_strict+footnotes` is strict Markdown with footnotes
1701enabled, while `--from markdown-footnotes-pipe_tables` is pandoc's
1702Markdown without footnotes or pipe tables.
1704The markdown reader and writer make by far the most use of extensions.
1705Extensions only used by them are therefore covered in the
1706section [Pandoc's Markdown] below (See [Markdown variants] for
1707`commonmark` and `gfm`.) In the following, extensions that also work
1708for other formats are covered.
1713#### Extension: `smart` ####
1715Interpret straight quotes as curly quotes, `---` as em-dashes,
1716`--` as en-dashes, and `...` as ellipses. Nonbreaking spaces are
1717inserted after certain abbreviations, such as "Mr."
1719This extension can be enabled/disabled for the following formats:
1722: `markdown`, `commonmark`, `latex`, `mediawiki`, `org`, `rst`, `twiki`
1725: `markdown`, `latex`, `context`, `rst`
1727enabled by default in
1728: `markdown`, `latex`, `context` (both input and output)
1730Note: If you are *writing* Markdown, then the `smart` extension
1731has the reverse effect: what would have been curly quotes comes
1734In LaTeX, `smart` means to use the standard TeX ligatures
1735for quotation marks (` `` ` and ` '' ` for double quotes,
1736`` ` `` and `` ' `` for single quotes) and dashes (`--` for
1737en-dash and `---` for em-dash). If `smart` is disabled,
1738then in reading LaTeX pandoc will parse these characters
1739literally. In writing LaTeX, enabling `smart` tells pandoc
1740to use the ligatures when possible; if `smart` is disabled
1741pandoc will use unicode quotation mark and dash characters.
1746#### Extension: `auto_identifiers` ####
1748A header without an explicitly specified identifier will be
1749automatically assigned a unique identifier based on the header text.
1751This extension can be enabled/disabled for the following formats:
1754: `markdown`, `latex`, `rst`, `mediawiki`, `textile`
1759enabled by default in
1762The algorithm used to derive the identifier from the header text is:
1764 - Remove all formatting, links, etc.
1765 - Remove all footnotes.
1766 - Remove all punctuation, except underscores, hyphens, and periods.
1767 - Replace all spaces and newlines with hyphens.
1768 - Convert all alphabetic characters to lowercase.
1769 - Remove everything up to the first letter (identifiers may
1770 not begin with a number or punctuation mark).
1771 - If nothing is left after this, use the identifier `section`.
1776 ------------------------------- ----------------------------
1777 `Header identifiers in HTML` `header-identifiers-in-html`
1778 `*Dogs*?--in *my* house?` `dogs--in-my-house`
1779 `[HTML], [S5], or [RTF]?` `html-s5-or-rtf`
1780 `3. Applications` `applications`
1783These rules should, in most cases, allow one to determine the identifier
1784from the header text. The exception is when several headers have the
1785same text; in this case, the first will get an identifier as described
1786above; the second will get the same identifier with `-1` appended; the
1787third with `-2`; and so on.
1789These identifiers are used to provide link targets in the table of
1790contents generated by the `--toc|--table-of-contents` option. They
1791also make it easy to provide links from one section of a document to
1792another. A link to this section, for example, might look like this:
1795 [header identifiers](#header-identifiers-in-html-latex-and-context).
1797Note, however, that this method of providing links to sections works
1798only in HTML, LaTeX, and ConTeXt formats.
1800If the `--section-divs` option is specified, then each section will
1801be wrapped in a `section` (or a `div`, if `html4` was specified),
1802and the identifier will be attached to the enclosing `<section>`
1803(or `<div>`) tag rather than the header itself. This allows entire
1804sections to be manipulated using JavaScript or treated differently in
1807#### Extension: `ascii_identifiers` ####
1809Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
1810Accents are stripped off of accented Latin letters, and non-Latin
1816The extensions [`tex_math_dollars`](#extension-tex_math_dollars),
1817[`tex_math_single_backslash`](#extension-tex_math_single_backslash), and
1818[`tex_math_double_backslash`](#extension-tex_math_double_backslash)
1819are described in the section about Pandoc's Markdown.
1821However, they can also be used with HTML input. This is handy for
1822reading web pages formatted using MathJax, for example.
1827The following extensions (especially how they affect Markdown
1828input/output) are also described in more detail in their respective
1829sections of [Pandoc's Markdown].
1831#### [Extension: `raw_html`] {#raw_html}
1833When converting from HTML, parse elements to raw HTML which are not
1834representable in pandoc's AST.
1835By default, this is disabled for HTML input.
1837#### [Extension: `raw_tex`] {#raw_tex}
1839Allows raw LaTeX, TeX, and ConTeXt to be included in a document.
1841This extension can be enabled/disabled for the following formats
1842(in addition to `markdown`):
1845: `latex`, `org`, `textile`
1850#### [Extension: `native_divs`] {#native_divs}
1852This extension is enabled by default for HTML input. This means that
1853`div`s are parsed to pandoc native elements. (Alternatively, you
1854can parse them to raw HTML using `-f html-native_divs+raw_html`.)
1856When converting HTML to Markdown, for example, you may want to drop all
1859 pandoc -f html-native_divs-native_spans -t markdown
1861#### [Extension: `native_spans`] {#native_spans}
1863Analogous to `native_divs` above.
1866Literate Haskell support
1867------------------------
1869#### Extension: `literate_haskell` ####
1871Treat the document as literate Haskell source.
1873This extension can be enabled/disabled for the following formats:
1876: `markdown`, `rst`, `latex`
1879: `markdown`, `rst`, `latex`, `html`
1881If you append `+lhs` (or `+literate_haskell`) to one of the formats
1882above, pandoc will treat the document as literate Haskell source.
1885 - In Markdown input, "bird track" sections will be parsed as Haskell
1886 code rather than block quotations. Text between `\begin{code}`
1887 and `\end{code}` will also be treated as Haskell code. For
1888 ATX-style headers the character '=' will be used instead of '#'.
1890 - In Markdown output, code blocks with classes `haskell` and `literate`
1891 will be rendered using bird tracks, and block quotations will be
1892 indented one space, so they will not be treated as Haskell code.
1893 In addition, headers will be rendered setext-style (with underlines)
1894 rather than ATX-style (with '#' characters). (This is because ghc
1895 treats '#' characters in column 1 as introducing line numbers.)
1897 - In restructured text input, "bird track" sections will be parsed
1900 - In restructured text output, code blocks with class `haskell` will
1901 be rendered using bird tracks.
1903 - In LaTeX input, text in `code` environments will be parsed as
1906 - In LaTeX output, code blocks with class `haskell` will be rendered
1907 inside `code` environments.
1909 - In HTML output, code blocks with class `haskell` will be rendered
1910 with class `literatehaskell` and bird tracks.
1914 pandoc -f markdown+lhs -t html
1916reads literate Haskell source formatted with Markdown conventions and writes
1917ordinary HTML (without bird tracks).
1919 pandoc -f markdown+lhs -t html+lhs
1921writes HTML with the Haskell code in bird tracks, so it can be copied
1922and pasted as literate Haskell source.
1924Note that GHC expects the bird tracks in the first column, so indentend literate
1925code blocks (e.g. inside an itemized environment) will not be picked up by the
1931#### Extension: `empty_paragraphs` ####
1933Allows empty paragraphs. By default empty paragraphs are
1936This extension can be enabled/disabled for the following formats:
1942: `markdown`, `docx`, `odt`, `opendocument`, `html`
1944#### Extension: `amuse` ####
1946In the `muse` input format, this enables Text::Amuse
1947extensions to Emacs Muse markup.
1949#### Extension: `citations` {#org-citations}
1951Some aspects of [Pandoc's Markdown citation syntax](#citations) are also accepted
1958Pandoc understands an extended and slightly revised version of
1959John Gruber's [Markdown] syntax. This document explains the syntax,
1960noting differences from standard Markdown. Except where noted, these
1961differences can be suppressed by using the `markdown_strict` format instead
1962of `markdown`. Extensions can be enabled or disabled to specify the
1963behavior more granularly. They are described in the following. See also
1964[Extensions] above, for extensions that work also on other formats.
1969Markdown is designed to be easy to write, and, even more importantly,
1972> A Markdown-formatted document should be publishable as-is, as plain
1973> text, without looking like it's been marked up with tags or formatting
1975> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
1977This principle has guided pandoc's decisions in finding syntax for
1978tables, footnotes, and other extensions.
1980There is, however, one respect in which pandoc's aims are different
1981from the original aims of Markdown. Whereas Markdown was originally
1982designed with HTML generation in mind, pandoc is designed for multiple
1983output formats. Thus, while pandoc allows the embedding of raw HTML,
1984it discourages it, and provides other, non-HTMLish ways of representing
1985important document elements like definition lists, tables, mathematics, and
1991A paragraph is one or more lines of text followed by one or more blank lines.
1992Newlines are treated as spaces, so you can reflow your paragraphs as you like.
1993If you need a hard line break, put two or more spaces at the end of a line.
1995#### Extension: `escaped_line_breaks` ####
1997A backslash followed by a newline is also a hard line break.
1998Note: in multiline and grid table cells, this is the only way
1999to create a hard line break, since trailing spaces in the cells
2005There are two kinds of headers: Setext and ATX.
2007### Setext-style headers ###
2009A setext-style header is a line of text "underlined" with a row of `=` signs
2010(for a level one header) or `-` signs (for a level two header):
2018The header text can contain inline formatting, such as emphasis (see
2019[Inline formatting], below).
2022### ATX-style headers ###
2024An ATX-style header consists of one to six `#` signs and a line of
2025text, optionally followed by any number of `#` signs. The number of
2026`#` signs at the beginning of the line is the header level:
2028 ## A level-two header
2030 ### A level-three header ###
2032As with setext-style headers, the header text can contain formatting:
2034 # A level-one header with a [link](/url) and *emphasis*
2036#### Extension: `blank_before_header` ####
2038Standard Markdown syntax does not require a blank line before a header.
2039Pandoc does require this (except, of course, at the beginning of the
2040document). The reason for the requirement is that it is all too easy for a
2041`#` to end up at the beginning of a line by accident (perhaps through line
2042wrapping). Consider, for example:
2044 I like several of their flavors of ice cream:
2045 #22, for example, and #5.
2047#### Extension: `space_in_atx_header` ####
2049Many Markdown implementations do not require a space between the
2050opening `#`s of an ATX header and the header text, so that
2051`#5 bolt` and `#hashtag` count as headers. With this extension,
2052pandoc does require the space.
2054### Header identifiers ###
2056See also the [`auto_identifiers` extension](#extension-auto_identifiers) above.
2058#### Extension: `header_attributes` ####
2060Headers can be assigned attributes using this syntax at the end
2061of the line containing the header text:
2063 {#identifier .class .class key=value key=value}
2065Thus, for example, the following headers will all be assigned the identifier
2070 ## My header ## {#foo}
2072 My other header {#foo}
2075(This syntax is compatible with [PHP Markdown Extra].)
2077Note that although this syntax allows assignment of classes and key/value
2078attributes, writers generally don't use all of this information. Identifiers,
2079classes, and key/value attributes are used in HTML and HTML-based formats such
2080as EPUB and slidy. Identifiers are used for labels and link anchors in the
2081LaTeX, ConTeXt, Textile, and AsciiDoc writers.
2083Headers with the class `unnumbered` will not be numbered, even if
2084`--number-sections` is specified. A single hyphen (`-`) in an attribute
2085context is equivalent to `.unnumbered`, and preferable in non-English
2092 # My header {.unnumbered}
2094#### Extension: `implicit_header_references` ####
2096Pandoc behaves as if reference links have been defined for each header.
2097So, to link to a header
2099 # Header identifiers in HTML
2103 [Header identifiers in HTML]
2107 [Header identifiers in HTML][]
2111 [the section on header identifiers][header identifiers in
2114instead of giving the identifier explicitly:
2116 [Header identifiers in HTML](#header-identifiers-in-html)
2118If there are multiple headers with identical text, the corresponding
2119reference will link to the first one only, and you will need to use explicit
2120links to link to the others, as described above.
2122Like regular reference links, these references are case-insensitive.
2124Explicit link reference definitions always take priority over
2125implicit header references. So, in the following example, the
2126link will point to `bar`, not to `#foo`:
2137Markdown uses email conventions for quoting blocks of text.
2138A block quotation is one or more paragraphs or other block elements
2139(such as lists or headers), with each line preceded by a `>` character
2140and an optional space. (The `>` need not start at the left margin, but
2141it should not be indented more than three spaces.)
2143 > This is a block quote. This
2144 > paragraph has two lines.
2146 > 1. This is a list inside a block quote.
2149A "lazy" form, which requires the `>` character only on the first
2150line of each block, is also allowed:
2152 > This is a block quote. This
2153 paragraph has two lines.
2155 > 1. This is a list inside a block quote.
2158Among the block elements that can be contained in a block quote are
2159other block quotes. That is, block quotes can be nested:
2161 > This is a block quote.
2163 > > A block quote within a block quote.
2165If the `>` character is followed by an optional space, that space
2166will be considered part of the block quote marker and not part of
2167the indentation of the contents. Thus, to put an indented code
2168block in a block quote, you need five spaces after the `>`:
2172#### Extension: `blank_before_blockquote` ####
2174Standard Markdown syntax does not require a blank line before a block
2175quote. Pandoc does require this (except, of course, at the beginning of the
2176document). The reason for the requirement is that it is all too easy for a
2177`>` to end up at the beginning of a line by accident (perhaps through line
2178wrapping). So, unless the `markdown_strict` format is used, the following does
2179not produce a nested block quote in pandoc:
2181 > This is a block quote.
2185Verbatim (code) blocks
2186----------------------
2188### Indented code blocks ###
2190A block of text indented four spaces (or one tab) is treated as verbatim
2191text: that is, special characters do not trigger special formatting,
2192and all spaces and line breaks are preserved. For example,
2195 moveShip(5 * gravity, DOWN);
2198The initial (four space or one tab) indentation is not considered part
2199of the verbatim text, and is removed in the output.
2201Note: blank lines in the verbatim text need not begin with four spaces.
2204### Fenced code blocks ###
2206#### Extension: `fenced_code_blocks` ####
2208In addition to standard indented code blocks, pandoc supports
2209*fenced* code blocks. These begin with a row of three or more
2210tildes (`~`) and end with a row of tildes that must be at least as long as
2211the starting row. Everything between these lines is treated as code. No
2212indentation is necessary:
2216 moveShip(5 * gravity, DOWN);
2220Like regular code blocks, fenced code blocks must be separated
2221from surrounding text by blank lines.
2223If the code itself contains a row of tildes or backticks, just use a longer
2224row of tildes or backticks at the start and end:
2228 code including tildes
2232#### Extension: `backtick_code_blocks` ####
2234Same as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes
2237#### Extension: `fenced_code_attributes` ####
2239Optionally, you may attach attributes to fenced or backtick code block using
2242 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
2244 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
2245 qsort (filter (>= x) xs)
2246 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2248Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
2249`startFrom` is an attribute with value `100`. Some output formats can use this
2250information to do syntax highlighting. Currently, the only output formats
2251that uses this information are HTML, LaTeX, Docx, and Ms. If highlighting
2252is supported for your output format and language, then the code block above
2253will appear highlighted, with numbered lines. (To see which languages are
2254supported, type `pandoc --list-highlight-languages`.) Otherwise, the code
2255block above will appear as follows:
2257 <pre id="mycode" class="haskell numberLines" startFrom="100">
2263The `numberLines` (or `number-lines`) class will cause the lines
2264of the code block to be numbered, starting with `1` or the value
2265of the `startFrom` attribute. The `lineAnchors` (or
2266`line-anchors`) class will cause the lines to be clickable
2267anchors in HTML output.
2269A shortcut form can also be used for specifying the language of
2276This is equivalent to:
2282If the `fenced_code_attributes` extension is disabled, but
2283input contains class attribute(s) for the code block, the first
2284class attribute will be printed after the opening fence as a bare
2287To prevent all highlighting, use the `--no-highlight` flag.
2288To set the highlighting style, use `--highlight-style`.
2289For more information on highlighting, see [Syntax highlighting],
2295#### Extension: `line_blocks` ####
2297A line block is a sequence of lines beginning with a vertical bar (`|`)
2298followed by a space. The division into lines will be preserved in
2299the output, as will any leading spaces; otherwise, the lines will
2300be formatted as Markdown. This is useful for verse and addresses:
2302 | The limerick packs laughs anatomical
2303 | In space that is quite economical.
2304 | But the good ones I've seen
2305 | So seldom are clean
2306 | And the clean ones so seldom are comical
2309 | Berkeley, CA 94718
2311The lines can be hard-wrapped if needed, but the continuation
2312line must begin with a space.
2314 | The Right Honorable Most Venerable and Righteous Samuel L.
2317 | Berkeley, CA 94718
2319This syntax is borrowed from [reStructuredText].
2326A bullet list is a list of bulleted list items. A bulleted list
2327item begins with a bullet (`*`, `+`, or `-`). Here is a simple
2334This will produce a "compact" list. If you want a "loose" list, in which
2335each item is formatted as a paragraph, put spaces between the items:
2343The bullets need not be flush with the left margin; they may be
2344indented one, two, or three spaces. The bullet must be followed
2347List items look best if subsequent lines are flush with the first
2348line (after the bullet):
2354But Markdown also allows a "lazy" format:
2360### Block content in list items ###
2362A list item may contain multiple paragraphs and other block-level
2363content. However, subsequent paragraphs must be preceded by a blank line
2364and indented to line up with the first non-space content after
2371 * Second paragraph. With a code block, which must be indented
2376Exception: if the list marker is followed by an indented code
2377block, which must begin 5 spaces after the list marker, then
2378subsequent paragraphs must begin two columns after the last
2379character of the list marker:
2383 continuation paragraph
2385List items may include other lists. In this case the preceding blank
2386line is optional. The nested list must be indented to line up with
2387the first non-space character after the list marker of the
2388containing list item.
2400As noted above, Markdown allows you to write list items "lazily," instead of
2401indenting continuation lines. However, if there are multiple paragraphs or
2402other blocks in a list item, the first line of each must be indented.
2404 + A lazy, lazy, list
2407 + Another one; this looks
2410 Second paragraph of second
2413### Ordered lists ###
2415Ordered lists work just like bulleted lists, except that the items
2416begin with enumerators rather than bullets.
2418In standard Markdown, enumerators are decimal numbers followed
2419by a period and a space. The numbers themselves are ignored, so
2420there is no difference between this list:
2432#### Extension: `fancy_lists` ####
2434Unlike standard Markdown, pandoc allows ordered list items to be marked
2435with uppercase and lowercase letters and roman numerals, in addition to
2436Arabic numerals. List markers may be enclosed in parentheses or followed by a
2437single right-parentheses or period. They must be separated from the
2438text that follows by at least one space, and, if the list marker is a
2439capital letter with a period, by at least two spaces.[^2]
2441[^2]: The point of this rule is to ensure that normal paragraphs
2442 starting with people's initials, like
2444 B. Russell was an English philosopher.
2446 do not get treated as list items.
2448 This rule will not prevent
2452 from being interpreted as a list item. In this case, a backslash
2457The `fancy_lists` extension also allows '`#`' to be used as an
2458ordered list marker in place of a numeral:
2463#### Extension: `startnum` ####
2465Pandoc also pays attention to the type of list marker used, and to the
2466starting number, and both of these are preserved where possible in the
2467output format. Thus, the following yields a list with numbers followed
2468by a single parenthesis, starting with 9, and a sublist with lowercase
2478Pandoc will start a new list each time a different type of list
2479marker is used. So, the following will create three lists:
2486If default list markers are desired, use `#.`:
2493### Definition lists ###
2495#### Extension: `definition_lists` ####
2497Pandoc supports definition lists, using the syntax of
2498[PHP Markdown Extra] with some extensions.[^3]
2504 Term 2 with *inline markup*
2508 { some code, part of Definition 2 }
2510 Third paragraph of definition 2.
2512Each term must fit on one line, which may optionally be followed by
2513a blank line, and must be followed by one or more definitions.
2514A definition begins with a colon or tilde, which may be indented one
2517A term may have multiple definitions, and each definition may consist of one or
2518more block elements (paragraph, code block, list, etc.), each indented four
2519spaces or one tab stop. The body of the definition (including the first line,
2520aside from the colon or tilde) should be indented four spaces. However,
2521as with other Markdown lists, you can "lazily" omit indentation except
2522at the beginning of a paragraph or other block element:
2527 with lazy continuation.
2529 Second paragraph of the definition.
2531If you leave space before the definition (as in the example above),
2532the text of the definition will be treated as a paragraph. In some
2533output formats, this will mean greater spacing between term/definition
2534pairs. For a more compact definition list, omit the space before the
2544Note that space between items in a definition list is required.
2545(A variant that loosens this requirement, but disallows "lazy"
2546hard wrapping, can be activated with `compact_definition_lists`: see
2547[Non-pandoc extensions], below.)
2549[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
2551### Numbered example lists ###
2553#### Extension: `example_lists` ####
2555The special list marker `@` can be used for sequentially numbered
2556examples. The first list item with a `@` marker will be numbered '1',
2557the next '2', and so on, throughout the document. The numbered examples
2558need not occur in a single list; each new list using `@` will take up
2559where the last stopped. So, for example:
2561 (@) My first example will be numbered (1).
2562 (@) My second example will be numbered (2).
2564 Explanation of examples.
2566 (@) My third example will be numbered (3).
2568Numbered examples can be labeled and referred to elsewhere in the
2571 (@good) This is a good example.
2573 As (@good) illustrates, ...
2575The label can be any string of alphanumeric characters, underscores,
2578Note: continuation paragraphs in example lists must always
2579be indented four spaces, regardless of the length of the
2580list marker. That is, example lists always behave as if the
2581`four_space_rule` extension is set. This is because example
2582labels tend to be long, and indenting content to the
2583first non-space character after the label would be awkward.
2585### Compact and loose lists ###
2587Pandoc behaves differently from `Markdown.pl` on some "edge
2588cases" involving lists. Consider this source:
2598Pandoc transforms this into a "compact list" (with no `<p>` tags around
2599"First", "Second", or "Third"), while Markdown puts `<p>` tags around
2600"Second" and "Third" (but not "First"), because of the blank space
2601around "Third". Pandoc follows a simple rule: if the text is followed by
2602a blank line, it is treated as a paragraph. Since "Second" is followed
2603by a list, and not a blank line, it isn't treated as a paragraph. The
2604fact that the list is followed by a blank line is irrelevant. (Note:
2605Pandoc works this way even when the `markdown_strict` format is specified. This
2606behavior is consistent with the official Markdown syntax description,
2607even though it is different from that of `Markdown.pl`.)
2610### Ending a list ###
2612What if you want to put an indented code block after a list?
2619Trouble! Here pandoc (like other Markdown implementations) will treat
2620`{ my code block }` as the second paragraph of item two, and not as
2623To "cut off" the list after item two, you can insert some non-indented
2624content, like an HTML comment, which won't produce visible output in
2630 <!-- end of list -->
2634You can use the same trick if you want two consecutive lists instead
2650A line containing a row of three or more `*`, `-`, or `_` characters
2651(optionally separated by spaces) produces a horizontal rule:
2661Four kinds of tables may be used. The first three kinds presuppose the use of
2662a fixed-width font, such as Courier. The fourth kind can be used with
2663proportionally spaced fonts, as it does not require lining up columns.
2665#### Extension: `table_captions` ####
2667A caption may optionally be provided with all 4 kinds of tables (as
2668illustrated in the examples below). A caption is a paragraph beginning
2669with the string `Table:` (or just `:`), which will be stripped off.
2670It may appear either before or after the table.
2672#### Extension: `simple_tables` ####
2674Simple tables look like this:
2676 Right Left Center Default
2677 ------- ------ ---------- -------
2682 Table: Demonstration of simple table syntax.
2684The headers and table rows must each fit on one line. Column
2685alignments are determined by the position of the header text relative
2686to the dashed line below it:[^4]
2688 - If the dashed line is flush with the header text on the right side
2689 but extends beyond it on the left, the column is right-aligned.
2690 - If the dashed line is flush with the header text on the left side
2691 but extends beyond it on the right, the column is left-aligned.
2692 - If the dashed line extends beyond the header text on both sides,
2693 the column is centered.
2694 - If the dashed line is flush with the header text on both sides,
2695 the default alignment is used (in most cases, this will be left).
2697[^4]: This scheme is due to Michel Fortin, who proposed it on the
2698 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
2700The table must end with a blank line, or a line of dashes followed by
2703The column headers may be omitted, provided a dashed line is used
2704to end the table. For example:
2706 ------- ------ ---------- -------
2710 ------- ------ ---------- -------
2712When headers are omitted, column alignments are determined on the basis
2713of the first line of the table body. So, in the tables above, the columns
2714would be right, left, center, and right aligned, respectively.
2716#### Extension: `multiline_tables` ####
2718Multiline tables allow headers and table rows to span multiple lines
2719of text (but cells that span multiple columns or rows of the table are
2720not supported). Here is an example:
2722 -------------------------------------------------------------
2723 Centered Default Right Left
2724 Header Aligned Aligned Aligned
2725 ----------- ------- --------------- -------------------------
2726 First row 12.0 Example of a row that
2727 spans multiple lines.
2729 Second row 5.0 Here's another one. Note
2730 the blank line between
2732 -------------------------------------------------------------
2734 Table: Here's the caption. It, too, may span
2737These work like simple tables, but with the following differences:
2739 - They must begin with a row of dashes, before the header text
2740 (unless the headers are omitted).
2741 - They must end with a row of dashes, then a blank line.
2742 - The rows must be separated by blank lines.
2744In multiline tables, the table parser pays attention to the widths of
2745the columns, and the writers try to reproduce these relative widths in
2746the output. So, if you find that one of the columns is too narrow in the
2747output, try widening it in the Markdown source.
2749Headers may be omitted in multiline tables as well as simple tables:
2751 ----------- ------- --------------- -------------------------
2752 First row 12.0 Example of a row that
2753 spans multiple lines.
2755 Second row 5.0 Here's another one. Note
2756 the blank line between
2758 ----------- ------- --------------- -------------------------
2760 : Here's a multiline table without headers.
2762It is possible for a multiline table to have just one row, but the row
2763should be followed by a blank line (and then the row of dashes that ends
2764the table), or the table may be interpreted as a simple table.
2766#### Extension: `grid_tables` ####
2768Grid tables look like this:
2770 : Sample grid table.
2772 +---------------+---------------+--------------------+
2773 | Fruit | Price | Advantages |
2774 +===============+===============+====================+
2775 | Bananas | $1.34 | - built-in wrapper |
2776 | | | - bright color |
2777 +---------------+---------------+--------------------+
2778 | Oranges | $2.10 | - cures scurvy |
2780 +---------------+---------------+--------------------+
2782The row of `=`s separates the header from the table body, and can be
2783omitted for a headerless table. The cells of grid tables may contain
2784arbitrary block elements (multiple paragraphs, code blocks, lists,
2785etc.). Cells that span multiple columns or rows are not
2786supported. Grid tables can be created easily using [Emacs table mode].
2788[Emacs table mode]: http://table.sourceforge.net/
2790Alignments can be specified as with pipe tables, by putting
2791colons at the boundaries of the separator line after the
2794 +---------------+---------------+--------------------+
2795 | Right | Left | Centered |
2796 +==============:+:==============+:==================:+
2797 | Bananas | $1.34 | built-in wrapper |
2798 +---------------+---------------+--------------------+
2800For headerless tables, the colons go on the top line instead:
2802 +--------------:+:--------------+:------------------:+
2803 | Right | Left | Centered |
2804 +---------------+---------------+--------------------+
2806##### Grid Table Limitations #####
2808Pandoc does not support grid tables with row spans or column spans.
2809This means that neither variable numbers of columns across rows nor
2810variable numbers of rows across columns are supported by Pandoc.
2811All grid tables must have the same number of columns in each row,
2812and the same number of rows in each column. For example, the
2813Docutils [sample grid tables] will not render as expected with
2816[sample grid tables]: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#grid-tables
2819#### Extension: `pipe_tables` ####
2821Pipe tables look like this:
2823 | Right | Left | Default | Center |
2824 |------:|:-----|---------|:------:|
2825 | 12 | 12 | 12 | 12 |
2826 | 123 | 123 | 123 | 123 |
2829 : Demonstration of pipe table syntax.
2831The syntax is identical to [PHP Markdown Extra tables]. The beginning and
2832ending pipe characters are optional, but pipes are required between all
2833columns. The colons indicate column alignment as shown. The header
2834cannot be omitted. To simulate a headerless table, include a header
2837Since the pipes indicate column boundaries, columns need not be vertically
2838aligned, as they are in the above example. So, this is a perfectly
2839legal (though ugly) pipe table:
2847The cells of pipe tables cannot contain block elements like paragraphs
2848and lists, and cannot span multiple lines. If a pipe table contains a
2849row whose printable content is wider than the column width (see
2850`--columns`), then the cell contents will wrap, with the
2851relative cell widths determined by the widths of the separator
2852lines. (In this case, the table will take up the full text
2853width.) If no lines are wider than column width, then
2854cell contents will not be wrapped, and the cells will be sized
2857Note: pandoc also recognizes pipe tables of the following
2858form, as can be produced by Emacs' orgtbl-mode:
2865The difference is that `+` is used instead of `|`. Other orgtbl features
2866are not supported. In particular, to get non-default column alignment,
2867you'll need to add colons as above.
2869[PHP Markdown Extra tables]: https://michelf.ca/projects/php-markdown/extra/#table
2874#### Extension: `pandoc_title_block` ####
2876If the file begins with a title block
2879 % author(s) (separated by semicolons)
2882it will be parsed as bibliographic information, not regular text. (It
2883will be used, for example, in the title of standalone LaTeX or HTML
2884output.) The block may contain just a title, a title and an author,
2885or all three elements. If you want to include an author but no
2886title, or a title and a date but no author, you need a blank line:
2895The title may occupy multiple lines, but continuation lines must
2896begin with leading space, thus:
2901If a document has multiple authors, the authors may be put on
2902separate lines with leading space, or separated by semicolons, or
2903both. So, all of the following are equivalent:
2908 % Author One; Author Two
2913The date must fit on one line.
2915All three metadata fields may contain standard inline formatting
2916(italics, links, footnotes, etc.).
2918Title blocks will always be parsed, but they will affect the output only
2919when the `--standalone` (`-s`) option is chosen. In HTML output, titles
2920will appear twice: once in the document head -- this is the title that
2921will appear at the top of the window in a browser -- and once at the
2922beginning of the document body. The title in the document head can have
2923an optional prefix attached (`--title-prefix` or `-T` option). The title
2924in the body appears as an H1 element with class "title", so it can be
2925suppressed or reformatted with CSS. If a title prefix is specified with
2926`-T` and no title block appears in the document, the title prefix will
2927be used by itself as the HTML title.
2929The man page writer extracts a title, man page section number, and
2930other header and footer information from the title line. The title
2931is assumed to be the first word on the title line, which may optionally
2932end with a (single-digit) section number in parentheses. (There should
2933be no space between the title and the parentheses.) Anything after
2934this is assumed to be additional footer and header text. A single pipe
2935character (`|`) should be used to separate the footer text from the header
2940will yield a man page with the title `PANDOC` and section 1.
2942 % PANDOC(1) Pandoc User Manuals
2944will also have "Pandoc User Manuals" in the footer.
2946 % PANDOC(1) Pandoc User Manuals | Version 4.0
2948will also have "Version 4.0" in the header.
2950#### Extension: `yaml_metadata_block` ####
2952A YAML metadata block is a valid YAML object, delimited by a line of three
2953hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
2954(`...`) at the bottom. A YAML metadata block may occur anywhere in the
2955document, but if it is not at the beginning, it must be preceded by a blank
2956line. (Note that, because of the way pandoc concatenates input files when
2957several are provided, you may also keep the metadata in a separate YAML file
2958and pass it to pandoc as an argument, along with your Markdown files:
2960 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
2962Just be sure that the YAML file begins with `---` and ends with `---` or
2965Metadata will be taken from the fields of the YAML object and added to any
2966existing document metadata. Metadata can contain lists and objects (nested
2967arbitrarily), but all string scalars will be interpreted as Markdown. Fields
2968with names ending in an underscore will be ignored by pandoc. (They may be
2969given a role by external processors.)
2971A document may contain multiple metadata blocks. The metadata fields will
2972be combined through a *left-biased union*: if two metadata blocks attempt
2973to set the same field, the value from the first block will be taken.
2975When pandoc is used with `-t markdown` to create a Markdown document,
2976a YAML metadata block will be produced only if the `-s/--standalone`
2977option is used. All of the metadata will appear in a single block
2978at the beginning of the document.
2980Note that YAML escaping rules must be followed. Thus, for example,
2981if a title contains a colon, it must be quoted. The pipe character
2982(`|`) can be used to begin an indented block that will be interpreted
2983literally, without need for escaping. This form is necessary
2984when the field contains blank lines or block-level formatting:
2987 title: 'This is the title: it contains a colon'
2991 tags: [nothing, nothingness]
2993 This is the abstract.
2995 It consists of two paragraphs.
2998Template variables will be set automatically from the metadata. Thus, for
2999example, in writing HTML, the variable `abstract` will be set to the HTML
3000equivalent of the Markdown in the `abstract` field:
3002 <p>This is the abstract.</p>
3003 <p>It consists of two paragraphs.</p>
3005Variables can contain arbitrary YAML structures, but the template must match
3006this structure. The `author` variable in the default templates expects a
3007simple list or string, but can be changed to support more complicated
3008structures. The following combination, for example, would add an affiliation
3009to the author if one is given:
3012 title: The document title
3015 affiliation: University of Somewhere
3017 affiliation: University of Nowhere
3020To use the structured authors in the example above, you would need a custom
3025 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
3035#### Extension: `all_symbols_escapable` ####
3037Except inside a code block or inline code, any punctuation or space
3038character preceded by a backslash will be treated literally, even if it
3039would normally indicate formatting. Thus, for example, if one writes
3049 <strong>hello</strong>
3051This rule is easier to remember than standard Markdown's rule,
3052which allows only the following characters to be backslash-escaped:
3056(However, if the `markdown_strict` format is used, the standard Markdown rule
3059A backslash-escaped space is parsed as a nonbreaking space. It will
3060appear in TeX output as `~` and in HTML and XML as `\ ` or
3063A backslash-escaped newline (i.e. a backslash occurring at the end of
3064a line) is parsed as a hard line break. It will appear in TeX output as
3065`\\` and in HTML as `<br />`. This is a nice alternative to
3066Markdown's "invisible" way of indicating hard line breaks using
3067two trailing spaces on a line.
3069Backslash escapes do not work in verbatim contexts.
3076To *emphasize* some text, surround it with `*`s or `_`, like this:
3078 This text is _emphasized with underscores_, and this
3079 is *emphasized with asterisks*.
3081Double `*` or `_` produces **strong emphasis**:
3083 This is **strong emphasis** and __with underscores__.
3085A `*` or `_` character surrounded by spaces, or backslash-escaped,
3086will not trigger emphasis:
3088 This is * not emphasized *, and \*neither is this\*.
3090#### Extension: `intraword_underscores` ####
3092Because `_` is sometimes used inside words and identifiers,
3093pandoc does not interpret a `_` surrounded by alphanumeric
3094characters as an emphasis marker. If you want to emphasize
3095just part of a word, use `*`:
3097 feas*ible*, not feas*able*.
3102#### Extension: `strikeout` ####
3104To strikeout a section of text with a horizontal line, begin and end it
3105with `~~`. Thus, for example,
3107 This ~~is deleted text.~~
3110### Superscripts and subscripts ###
3112#### Extension: `superscript`, `subscript` ####
3114Superscripts may be written by surrounding the superscripted text by `^`
3115characters; subscripts may be written by surrounding the subscripted
3116text by `~` characters. Thus, for example,
3118 H~2~O is a liquid. 2^10^ is 1024.
3120If the superscripted or subscripted text contains spaces, these spaces
3121must be escaped with backslashes. (This is to prevent accidental
3122superscripting and subscripting through the ordinary use of `~` and `^`.)
3123Thus, if you want the letter P with 'a cat' in subscripts, use
3124`P~a\ cat~`, not `P~a cat~`.
3129To make a short span of text verbatim, put it inside backticks:
3131 What is the difference between `>>=` and `>>`?
3133If the verbatim text includes a backtick, use double backticks:
3135 Here is a literal backtick `` ` ``.
3137(The spaces after the opening backticks and before the closing
3138backticks will be ignored.)
3140The general rule is that a verbatim span starts with a string
3141of consecutive backticks (optionally followed by a space)
3142and ends with a string of the same number of backticks (optionally
3143preceded by a space).
3145Note that backslash-escapes (and other Markdown constructs) do not
3146work in verbatim contexts:
3148 This is a backslash followed by an asterisk: `\*`.
3150#### Extension: `inline_code_attributes` ####
3152Attributes can be attached to verbatim text, just as with
3153[fenced code blocks]:
3159To write small caps, use the `smallcaps` class:
3161 [Small caps]{.smallcaps}
3163Or, without the `bracketed_spans` extension:
3165 <span class="smallcaps">Small caps</span>
3167For compatibility with other Markdown flavors, CSS is also supported:
3169 <span style="font-variant:small-caps;">Small caps</span>
3171This will work in all output formats that support small caps.
3177#### Extension: `tex_math_dollars` ####
3179Anything between two `$` characters will be treated as TeX math. The
3180opening `$` must have a non-space character immediately to its right,
3181while the closing `$` must have a non-space character immediately to its
3182left, and must not be followed immediately by a digit. Thus,
3183`$20,000 and $30,000` won't parse as math. If for some reason
3184you need to enclose text in literal `$` characters, backslash-escape
3185them and they won't be treated as math delimiters.
3187TeX math will be printed in all output formats. How it is rendered
3188depends on the output format:
3190Markdown, LaTeX, Emacs Org mode, ConTeXt, ZimWiki
3191 ~ It will appear verbatim between `$` characters.
3194 ~ It will be rendered using an [interpreted text role `:math:`].
3197 ~ It will be rendered as `latexmath:[...]`.
3200 ~ It will be rendered inside a `@math` command.
3203 ~ It will be rendered verbatim without `$`'s.
3206 ~ It will be rendered inside `<math>` tags.
3209 ~ It will be rendered inside `<span class="math">` tags.
3212 ~ It will be rendered, if possible, using Unicode characters,
3213 and will otherwise appear verbatim.
3216 ~ It will be rendered, if possible, using MathML.
3219 ~ If the `--mathml` flag is used, it will be rendered using MathML
3220 in an `inlineequation` or `informalequation` tag. Otherwise it
3221 will be rendered, if possible, using Unicode characters.
3224 ~ It will be rendered using OMML math markup.
3227 ~ If the `--webtex` option is used, formulas are rendered as images
3228 using CodeCogs or other compatible web service, downloaded
3229 and embedded in the e-book. Otherwise, they will appear verbatim.
3231HTML, Slidy, DZSlides, S5, EPUB
3232 ~ The way math is rendered in HTML will depend on the
3233 command-line options selected. Therefore see [Math rendering in HTML]
3236[interpreted text role `:math:`]: http://docutils.sourceforge.net/docs/ref/rst/roles.html#math
3241#### Extension: `raw_html` ####
3243Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
3244(except verbatim contexts, where `<`, `>`, and `&` are interpreted
3245literally). (Technically this is not an extension, since standard
3246Markdown allows it, but it has been made an extension so that it can
3247be disabled if desired.)
3249The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
3250DZSlides, EPUB, Markdown, Emacs Org mode, and Textile output, and suppressed
3253#### Extension: `markdown_in_html_blocks` ####
3255Standard Markdown allows you to include HTML "blocks": blocks
3256of HTML between balanced tags that are separated from the surrounding text
3257with blank lines, and start and end at the left margin. Within
3258these blocks, everything is interpreted as HTML, not Markdown;
3259so (for example), `*` does not signify emphasis.
3261Pandoc behaves this way when the `markdown_strict` format is used; but
3262by default, pandoc interprets material between HTML block tags as Markdown.
3263Thus, for example, pandoc will turn
3268 <td>[a link](http://google.com)</td>
3276 <td><em>one</em></td>
3277 <td><a href="http://google.com">a link</a></td>
3281whereas `Markdown.pl` will preserve it as is.
3283There is one exception to this rule: text between `<script>` and
3284`<style>` tags is not interpreted as Markdown.
3286This departure from standard Markdown should make it easier to mix
3287Markdown with HTML block elements. For example, one can surround
3288a block of Markdown text with `<div>` tags without preventing it
3289from being interpreted as Markdown.
3291#### Extension: `native_divs` ####
3293Use native pandoc `Div` blocks for content inside `<div>` tags.
3294For the most part this should give the same output as
3295`markdown_in_html_blocks`, but it makes it easier to write pandoc
3296filters to manipulate groups of blocks.
3298#### Extension: `native_spans` ####
3300Use native pandoc `Span` blocks for content inside `<span>` tags.
3301For the most part this should give the same output as `raw_html`,
3302but it makes it easier to write pandoc filters to manipulate groups
3305#### Extension: `fenced_divs` ####
3307Allow special fenced syntax for native `Div` blocks. A Div
3308starts with a fence containing at least three consecutive
3309colons plus some attributes. The attributes may optionally
3310be followed by another string of consecutive colons.
3311The attribute syntax is exactly as in fenced code blocks (see
3312[Extension: `fenced_code_attributes`]). As with fenced
3313code blocks, one can use either attributes in curly braces
3314or a single unbraced word, which will be treated as a class
3315name. The Div ends with another line containing a string of at
3316least three consecutive colons. The fenced Div should be
3317separated by blank lines from preceding and following blocks.
3321 ::::: {#special .sidebar}
3322 Here is a paragraph.
3327Fenced divs can be nested. Opening fences are distinguished
3328because they *must* have attributes:
3334 This is a warning within a warning.
3338Fences without attributes are always closing fences. Unlike
3339with fenced code blocks, the number of colons in the closing
3340fence need not match the number in the opening fence. However,
3341it can be helpful for visual clarity to use fences of different
3342lengths to distinguish nested divs from their parents.
3344#### Extension: `raw_tex` ####
3346In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
3347included in a document. Inline TeX commands will be preserved and passed
3348unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
3349LaTeX to include BibTeX citations:
3351 This result was proved in \cite{jones.1967}.
3353Note that in LaTeX environments, like
3355 \begin{tabular}{|l|l|}\hline
3356 Age & Frequency \\ \hline
3359 36--45 & 22 \\ \hline
3362the material between the begin and end tags will be interpreted as raw
3363LaTeX, not as Markdown.
3365Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
3366Emacs Org mode, and ConTeXt.
3368### Generic raw attribute ###
3370#### Extension: `raw_attribute` ####
3372Inline spans and fenced code blocks with a special
3373kind of attribute will be parsed as raw content with the
3374designated format. For example, the following produces a raw
3381And the following produces a raw `html` inline element:
3383 This is `<a>html</a>`{=html}
3385The format name should match the target format name (see
3386`-t/--to`, above, for a list, or use `pandoc
3387--list-output-formats`).
3389This extension presupposes that the relevant kind of
3390inline code or fenced code block is enabled. Thus, for
3391example, to use a raw attribute with a backtick code block,
3392`backtick_code_blocks` must be enabled.
3394The raw attribute cannot be combined with regular attributes.
3399#### Extension: `latex_macros` ####
3401For output formats other than LaTeX, pandoc will parse LaTeX
3402macro definitions and apply the resulting macros to all LaTeX
3403math and raw LaTeX. So, for example, the following will work in
3404all output formats, not just LaTeX:
3406 \newcommand{\tuple}[1]{\langle #1 \rangle}
3410In LaTeX output, the macro definitions will not be passed
3411through as raw LaTeX.
3413When `latex_macros` is disabled, the macro definitions will
3414be passed through as raw LaTeX, and the raw LaTeX and math will
3415not have macros applied. This is usually a better approach when
3416you are targeting LaTeX or PDF.
3421Markdown allows links to be specified in several ways.
3423### Automatic links ###
3425If you enclose a URL or email address in pointy brackets, it
3429 <sam@green.eggs.ham>
3433An inline link consists of the link text in square brackets,
3434followed by the URL in parentheses. (Optionally, the URL can
3435be followed by a link title, in quotes.)
3437 This is an [inline link](/url), and here's [one with
3438 a title](http://fsf.org "click here for a good time!").
3440There can be no space between the bracketed part and the parenthesized part.
3441The link text can contain formatting (such as emphasis), but the title cannot.
3443Email addresses in inline links are not autodetected, so they have to be
3444prefixed with `mailto`:
3446 [Write me!](mailto:sam@green.eggs.ham)
3448### Reference links ###
3450An *explicit* reference link has two parts, the link itself and the link
3451definition, which may occur elsewhere in the document (either
3452before or after the link).
3454The link consists of link text in square brackets, followed by a label in
3455square brackets. (There cannot be space between the two unless the
3456`spaced_reference_links` extension is enabled.) The link definition
3457consists of the bracketed label, followed by a colon and a space, followed by
3458the URL, and optionally (after a space) a link title either in quotes or in
3459parentheses. The label must not be parseable as a citation (assuming
3460the `citations` extension is enabled): citations take precedence over
3463Here are some examples:
3465 [my label 1]: /foo/bar.html "My title, optional"
3467 [my label 3]: http://fsf.org (The free software foundation)
3468 [my label 4]: /bar#special 'A title in single quotes'
3470The URL may optionally be surrounded by angle brackets:
3472 [my label 5]: <http://foo.bar.baz>
3474The title may go on the next line:
3476 [my label 3]: http://fsf.org
3477 "The free software foundation"
3479Note that link labels are not case sensitive. So, this will work:
3481 Here is [my link][FOO]
3485In an *implicit* reference link, the second pair of brackets is
3490 [my website]: http://foo.bar.baz
3492Note: In `Markdown.pl` and most other Markdown implementations,
3493reference link definitions cannot occur in nested constructions
3494such as list items or block quotes. Pandoc lifts this arbitrary
3495seeming restriction. So the following is fine in pandoc, though
3496not in most other implementations:
3502#### Extension: `shortcut_reference_links` ####
3504In a *shortcut* reference link, the second pair of brackets may
3509 [my website]: http://foo.bar.baz
3511### Internal links ###
3513To link to another section of the same document, use the automatically
3514generated identifier (see [Header identifiers]). For example:
3516 See the [Introduction](#introduction).
3520 See the [Introduction].
3522 [Introduction]: #introduction
3524Internal links are currently supported for HTML formats (including
3525HTML slide shows and EPUB), LaTeX, and ConTeXt.
3530A link immediately preceded by a `!` will be treated as an image.
3531The link text will be used as the image's alt text:
3533 
3537 [movie reel]: movie.gif
3539#### Extension: `implicit_figures` ####
3541An image with nonempty alt text, occurring by itself in a
3542paragraph, will be rendered as a figure with a caption. The
3543image's alt text will be used as the caption.
3545 
3547How this is rendered depends on the output format. Some output
3548formats (e.g. RTF) do not yet support figures. In those
3549formats, you'll just get an image in a paragraph by itself, with
3552If you just want a regular inline image, just make sure it is not
3553the only thing in the paragraph. One way to do this is to insert a
3554nonbreaking space after the image:
3556 \
3558Note that in reveal.js slide shows, an image in a paragraph
3559by itself that has the `stretch` class will fill the screen,
3560and the caption and figure tags will be omitted.
3562#### Extension: `link_attributes` ####
3564Attributes can be set on links and images:
3566 An inline {#id .class width=30 height=20px}
3567 and a reference ![image][ref] with attributes.
3569 [ref]: foo.jpg "optional title" {#id .class key=val key2="val 2"}
3571(This syntax is compatible with [PHP Markdown Extra] when only `#id`
3572and `.class` are used.)
3574For HTML and EPUB, all attributes except `width` and `height` (but
3575including `srcset` and `sizes`) are passed through as is. The other
3576writers ignore attributes that are not supported by their output
3579The `width` and `height` attributes on images are treated specially. When
3580used without a unit, the unit is assumed to be pixels. However, any of
3581the following unit identifiers can be used: `px`, `cm`, `mm`, `in`, `inch`
3582and `%`. There must not be any spaces between the number and the unit.
3586{ width=50% }
3589- Dimensions are converted to inches for output in page-based formats like
3590 LaTeX. Dimensions are converted to pixels for output in HTML-like
3591 formats. Use the `--dpi` option to specify the number of pixels per
3592 inch. The default is 96dpi.
3593- The `%` unit is generally relative to some available space.
3594 For example the above example will render to
3595 `<img href="file.jpg" style="width: 50%;" />` (HTML),
3596 `\includegraphics[width=0.5\textwidth]{file.jpg}` (LaTeX), or
3597 `\externalfigure[file.jpg][width=0.5\textwidth]` (ConTeXt).
3598- Some output formats have a notion of a class
3599 ([ConTeXt](http://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings))
3600 or a unique identifier (LaTeX `\caption`), or both (HTML).
3601- When no `width` or `height` attributes are specified, the fallback
3602 is to look at the image resolution and the dpi metadata embedded in
3608#### Extension: `bracketed_spans` ####
3610A bracketed sequence of inlines, as one would use to begin
3611a link, will be treated as a span with attributes if it is
3612followed immediately by attributes:
3614 [This is *some text*]{.class key="val"}
3619#### Extension: `footnotes` ####
3621Pandoc's Markdown allows footnotes, using the following syntax:
3623 Here is a footnote reference,[^1] and another.[^longnote]
3625 [^1]: Here is the footnote.
3627 [^longnote]: Here's one with multiple blocks.
3629 Subsequent paragraphs are indented to show that they
3630 belong to the previous footnote.
3634 The whole paragraph can be indented, or just the first
3635 line. In this way, multi-paragraph footnotes work like
3636 multi-paragraph list items.
3638 This paragraph won't be part of the note, because it
3641The identifiers in footnote references may not contain spaces, tabs,
3642or newlines. These identifiers are used only to correlate the
3643footnote reference with the note itself; in the output, footnotes
3644will be numbered sequentially.
3646The footnotes themselves need not be placed at the end of the
3647document. They may appear anywhere except inside other block elements
3648(lists, block quotes, tables, etc.). Each footnote should be
3649separated from surrounding content (including other footnotes)
3652#### Extension: `inline_notes` ####
3654Inline footnotes are also allowed (though, unlike regular notes,
3655they cannot contain multiple paragraphs). The syntax is as follows:
3657 Here is an inline note.^[Inlines notes are easier to write, since
3658 you don't have to pick an identifier and move down to type the
3661Inline and regular footnotes may be mixed freely.
3666#### Extension: `citations` ####
3668Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
3669citations and a bibliography in a number of styles. Basic usage is
3671 pandoc --filter pandoc-citeproc myinput.txt
3673In order to use this feature, you will need to specify a bibliography file
3674using the `bibliography` metadata field in a YAML metadata section, or
3675`--bibliography` command line argument. You can supply multiple `--bibliography`
3676arguments or set `bibliography` metadata field to YAML array, if you want to
3677use multiple bibliography files. The bibliography may have any of these
3680 Format File extension
3681 ------------ --------------
3694Note that `.bib` can be used with both BibTeX and BibLaTeX files;
3695use `.bibtex` to force BibTeX.
3697Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`
3698can produce `.json` and `.yaml` files from any of the supported formats.
3700In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc parses
3701a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown; and in CSL JSON databases, an [HTML-like markup][CSL markup specs]:
3709`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`
3718`<span class="nocase">...</span>`
3719: prevent a phrase from being capitalized as title case
3721`pandoc-citeproc -j` and `-y` interconvert the CSL JSON
3722and CSL YAML formats as far as possible.
3724As an alternative to specifying a bibliography file using `--bibliography`
3725or the YAML metadata field `bibliography`, you can include
3726the citation data directly in the `references` field of the
3727document's YAML metadata. The field should contain an array of
3728YAML-encoded references, for example:
3732 - type: article-journal
3744 title: 'Molecular structure of nucleic acids: a structure for deoxyribose
3746 title-short: Molecular structure of nucleic acids
3747 container-title: Nature
3751 DOI: 10.1038/171737a0
3752 URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
3756(`pandoc-citeproc --bib2yaml` can produce these from a bibliography file in one
3757of the supported formats.)
3759Citations and references can be formatted using any style supported by the
3760[Citation Style Language], listed in the [Zotero Style Repository].
3761These files are specified using the `--csl` option or the `csl` metadata field.
3762By default, `pandoc-citeproc` will use the [Chicago Manual of Style] author-date
3763format. The CSL project provides further information on [finding and editing styles].
3765To make your citations hyperlinks to the corresponding bibliography
3766entries, add `link-citations: true` to your YAML metadata.
3768Citations go inside square brackets and are separated by semicolons.
3769Each citation must have a key, composed of '@' + the citation
3770identifier from the database, and may optionally have a prefix,
3771a locator, and a suffix. The citation key must begin with a letter, digit,
3772or `_`, and may contain alphanumerics, `_`, and internal punctuation
3773characters (`:.#$%&-+?<>~/`). Here are some examples:
3775 Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
3777 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
3779 Blah blah [@smith04; @doe99].
3781`pandoc-citeproc` detects locator terms in the [CSL locale files].
3782Either abbreviated or unabbreviated forms are accepted. In the `en-US`
3783locale, locator terms can be written in either singular or plural forms,
3784as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
3785`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`, `fol.`/`fols.`;
3786`number`, `no.`/`nos.`; `line`, `l.`/`ll.`; `note`, `n.`/`nn.`; `opus`,
3787`op.`/`opp.`; `page`, `p.`/`pp.`; `paragraph`, `para.`/`paras.`; `part`,
3788`pt.`/`pts.`; `section`, `sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`;
3789`verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
3790locator term is used, "page" is assumed.
3792A minus sign (`-`) before the `@` will suppress mention of
3793the author in the citation. This can be useful when the
3794author is already mentioned in the text:
3796 Smith says blah [-@smith04].
3798You can also write an in-text citation, as follows:
3802 @smith04 [p. 33] says blah.
3804If the style calls for a list of works cited, it will be placed
3805at the end of the document. Normally, you will want to end your
3806document with an appropriate header:
3812The bibliography will be inserted after this header. Note that
3813the `unnumbered` class will be added to this header, so that the
3814section will not be numbered.
3816If you want to include items in the bibliography without actually
3817citing them in the body text, you can define a dummy `nocite` metadata
3818field and put the citations there:
3827In this example, the document will contain a citation for `item3`
3828only, but the bibliography will contain entries for `item1`, `item2`, and
3831It is possible to create a bibliography with all the citations,
3832whether or not they appear in the document, by using a wildcard:
3839For LaTeX or PDF output, you can also use [`natbib`] or [`biblatex`]
3840to render bibliography. In order to do so, specify bibliography files as
3841outlined above, and add `--natbib` or `--biblatex` argument to `pandoc`
3842invocation. Bear in mind that bibliography files have to be in respective
3843format (either BibTeX or BibLaTeX).
3845For more information, see the [pandoc-citeproc man page].
3847[CSL markup specs]: http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
3848[Chicago Manual of Style]: http://chicagomanualofstyle.org
3849[Citation Style Language]: http://citationstyles.org
3850[Zotero Style Repository]: https://www.zotero.org/styles
3851[finding and editing styles]: http://citationstyles.org/styles/
3852[CSL locale files]: https://github.com/citation-style-language/locales
3853[pandoc-citeproc man page]: https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md
3855Non-pandoc extensions
3856---------------------
3858The following Markdown syntax extensions are not enabled by default
3859in pandoc, but may be enabled by adding `+EXTENSION` to the format
3860name, where `EXTENSION` is the name of the extension. Thus, for
3861example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
3863#### Extension: `old_dashes` ####
3865Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
3866`-` before a numeral is an en-dash, and `--` is an em-dash.
3867This option only has an effect if `smart` is enabled. It is
3868selected automatically for `textile` input.
3870#### Extension: `angle_brackets_escapable` ####
3872Allow `<` and `>` to be backslash-escaped, as they can be in
3873GitHub flavored Markdown but not original Markdown. This is
3874implied by pandoc's default `all_symbols_escapable`.
3876#### Extension: `lists_without_preceding_blankline` ####
3878Allow a list to occur right after a paragraph, with no intervening
3881#### Extension: `four_space_rule` ####
3883Selects the pandoc <= 2.0 behavior for parsing lists, so that
3884four spaces indent are needed for list item continuation
3887#### Extension: `spaced_reference_links` ####
3889Allow whitespace between the two components of a reference link,
3894#### Extension: `hard_line_breaks` ####
3896Causes all newlines within a paragraph to be interpreted as hard line
3897breaks instead of spaces.
3899#### Extension: `ignore_line_breaks` ####
3901Causes newlines within a paragraph to be ignored, rather than being
3902treated as spaces or as hard line breaks. This option is intended for
3903use with East Asian languages where spaces are not used between words,
3904but text is divided into lines for readability.
3906#### Extension: `east_asian_line_breaks` ####
3908Causes newlines within a paragraph to be ignored, rather than
3909being treated as spaces or as hard line breaks, when they occur
3910between two East Asian wide characters. This is a better choice
3911than `ignore_line_breaks` for texts that include a mix of East
3912Asian wide characters and other characters.
3914#### Extension: `emoji` ####
3916Parses textual emojis like `:smile:` as Unicode emoticons.
3918#### Extension: `tex_math_single_backslash` ####
3920Causes anything between `\(` and `\)` to be interpreted as inline
3921TeX math, and anything between `\[` and `\]` to be interpreted
3922as display TeX math. Note: a drawback of this extension is that
3923it precludes escaping `(` and `[`.
3925#### Extension: `tex_math_double_backslash` ####
3927Causes anything between `\\(` and `\\)` to be interpreted as inline
3928TeX math, and anything between `\\[` and `\\]` to be interpreted
3931#### Extension: `markdown_attribute` ####
3933By default, pandoc interprets material inside block-level tags as Markdown.
3934This extension changes the behavior so that Markdown is only parsed
3935inside block-level tags if the tags have the attribute `markdown=1`.
3937#### Extension: `mmd_title_block` ####
3939Enables a [MultiMarkdown] style title block at the top of
3940the document, for example:
3944 Date: September 1, 2008
3945 Comment: This is a sample mmd title block, with
3946 a field spanning multiple lines.
3948See the MultiMarkdown documentation for details. If `pandoc_title_block` or
3949`yaml_metadata_block` is enabled, it will take precedence over
3952#### Extension: `abbreviations` ####
3954Parses PHP Markdown Extra abbreviation keys, like
3956 *[HTML]: Hypertext Markup Language
3958Note that the pandoc document model does not support
3959abbreviations, so if this extension is enabled, abbreviation keys are
3960simply skipped (as opposed to being parsed as paragraphs).
3962#### Extension: `autolink_bare_uris` ####
3964Makes all absolute URIs into links, even when not surrounded by
3965pointy braces `<...>`.
3967#### Extension: `mmd_link_attributes` ####
3969Parses multimarkdown style key-value attributes on link
3970and image references. This extension should not be confused with the
3971[`link_attributes`](#extension-link_attributes) extension.
3973 This is a reference ![image][ref] with multimarkdown attributes.
3975 [ref]: http://path.to/image "Image title" width=20px height=30px
3976 id=myId class="myClass1 myClass2"
3978#### Extension: `mmd_header_identifiers` ####
3980Parses multimarkdown style header identifiers (in square brackets,
3981after the header but before any trailing `#`s in an ATX header).
3983#### Extension: `compact_definition_lists` ####
3985Activates the definition list syntax of pandoc 1.12.x and earlier.
3986This syntax differs from the one described above under [Definition lists]
3989 - No blank line is required between consecutive items of the
3991 - To get a "tight" or "compact" list, omit space between consecutive
3992 items; the space between a term and its definition does not affect
3994 - Lazy wrapping of paragraphs is not allowed: the entire definition must
3995 be indented four spaces.[^6]
3997[^6]: To see why laziness is incompatible with relaxing the requirement
3998 of a blank line between items, consider the following example:
4005 Is this a single list item with two definitions of "bar," the first of
4006 which is lazily wrapped, or two list items? To remove the ambiguity
4007 we must either disallow lazy wrapping or require a blank line between
4013In addition to pandoc's extended Markdown, the following Markdown
4014variants are supported:
4016`markdown_phpextra` (PHP Markdown Extra)
4017: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
4018 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
4019 `header_attributes`, `link_attributes`, `abbreviations`,
4020 `shortcut_reference_links`, `spaced_reference_links`.
4022`markdown_github` (deprecated GitHub-Flavored Markdown)
4023: `pipe_tables`, `raw_html`, `fenced_code_blocks`, `gfm_auto_identifiers`,
4024 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
4025 `space_in_atx_header`, `intraword_underscores`, `strikeout`,
4026 `emoji`, `shortcut_reference_links`, `angle_brackets_escapable`,
4027 `lists_without_preceding_blankline`.
4029`markdown_mmd` (MultiMarkdown)
4030: `pipe_tables`, `raw_html`, `markdown_attribute`, `mmd_link_attributes`,
4031 `tex_math_double_backslash`, `intraword_underscores`,
4032 `mmd_title_block`, `footnotes`, `definition_lists`,
4033 `all_symbols_escapable`, `implicit_header_references`,
4034 `auto_identifiers`, `mmd_header_identifiers`,
4035 `shortcut_reference_links`, `implicit_figures`,
4036 `superscript`, `subscript`, `backtick_code_blocks`,
4037 `spaced_reference_links`, `raw_attribute`.
4039`markdown_strict` (Markdown.pl)
4040: `raw_html`, `shortcut_reference_links`,
4041 `spaced_reference_links`.
4043We also support `commonmark` and `gfm` (GitHub-Flavored Markdown,
4044which is implemented as a set of extensions on `commonmark`).
4046Note, however, that `commonmark` and `gfm` have limited support
4047for extensions. Only those listed below (and `smart` and
4048`raw_tex`) will work. The extensions can, however, all be
4049individually disabled.
4050Also, `raw_tex` only affects `gfm` output, not input.
4052`gfm` (GitHub-Flavored Markdown)
4053: `pipe_tables`, `raw_html`, `fenced_code_blocks`, `auto_identifiers`,
4054 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
4055 `intraword_underscores`, `strikeout`, `hard_line_breaks`, `emoji`,
4056 `shortcut_reference_links`, `angle_brackets_escapable`.
4058Producing slide shows with pandoc
4059=================================
4061You can use pandoc to produce an HTML + JavaScript slide presentation
4062that can be viewed via a web browser. There are five ways to do this,
4063using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
4064You can also produce a PDF slide show using LaTeX [`beamer`], or
4065slides shows in Microsoft [PowerPoint] format.
4067Here's the Markdown source for a simple slide show, `habits.txt`:
4094 
4101To produce an HTML/JavaScript slide show, simply type
4103 pandoc -t FORMAT -s habits.txt -o habits.html
4105where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
4107For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
4108`-s/--standalone` option embeds a link to JavaScript and CSS files, which are
4109assumed to be available at the relative path `s5/default` (for S5), `slideous`
4110(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
4111`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
4112`slideous-url`, `revealjs-url`, or `s5-url` variables; see [Variables for slides],
4113above.) For DZSlides, the (relatively short) JavaScript and CSS are included in
4116With all HTML slide formats, the `--self-contained` option can be used to
4117produce a single file that contains all of the data necessary to display the
4118slide show, including linked scripts, stylesheets, images, and videos.
4120To produce a PDF slide show using beamer, type
4122 pandoc -t beamer habits.txt -o habits.pdf
4124Note that a reveal.js slide show can also be converted to a PDF
4125by printing it to a file from the browser.
4127To produce a Powerpoint slide show, type
4129 pandoc habits.txt -o habits.pptx
4131Structuring the slide show
4132--------------------------
4134By default, the *slide level* is the highest header level in
4135the hierarchy that is followed immediately by content, and not another
4136header, somewhere in the document. In the example above, level 1 headers
4137are always followed by level 2 headers, which are followed by content,
4138so 2 is the slide level. This default can be overridden using
4139the `--slide-level` option.
4141The document is carved up into slides according to the following
4144 * A horizontal rule always starts a new slide.
4146 * A header at the slide level always starts a new slide.
4148 * Headers *below* the slide level in the hierarchy create
4149 headers *within* a slide.
4151 * Headers *above* the slide level in the hierarchy create
4152 "title slides," which just contain the section title
4153 and help to break the slide show into sections.
4155 * Content *above* the slide level will not appear in the slide
4158 * A title page is constructed automatically from the document's title
4159 block, if present. (In the case of beamer, this can be disabled
4160 by commenting out some lines in the default template.)
4162These rules are designed to support many different styles of slide show. If
4163you don't care about structuring your slides into sections and subsections,
4164you can just use level 1 headers for all each slide. (In that case, level 1
4165will be the slide level.) But you can also structure the slide show into
4166sections, as in the example above.
4168Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
4169layout will be produced, with level 1 headers building horizontally
4170and level 2 headers building vertically. It is not recommended that
4171you use deeper nesting of section levels with reveal.js.
4176By default, these writers produce lists that display "all at once."
4177If you want your lists to display incrementally (one item at a time),
4178use the `-i` option. If you want a particular list to depart from the
4179default (that is, to display incrementally without the `-i` option and
4180all at once with the `-i` option), put it in a block quote:
4185In this way incremental and nonincremental lists can be mixed in
4191You can add "pauses" within a slide by including a paragraph containing
4192three dots, separated by spaces:
4194 # Slide with a pause
4196 content before the pause
4200 content after the pause
4205You can change the style of HTML slides by putting customized CSS files
4206in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
4207or `$DATADIR/slideous` (for Slideous),
4208where `$DATADIR` is the user data directory (see `--data-dir`, above).
4209The originals may be found in pandoc's system data directory (generally
4210`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
4211files it does not find in the user data directory.
4213For dzslides, the CSS is included in the HTML file itself, and may
4216All [reveal.js configuration options] can be set through variables.
4217For example, themes can be used by setting the `theme` variable:
4221Or you can specify a custom stylesheet using the `--css` option.
4223To style beamer slides, you can specify a `theme`, `colortheme`,
4224`fonttheme`, `innertheme`, and `outertheme`, using the `-V` option:
4226 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
4228Note that header attributes will turn into slide attributes
4229(on a `<div>` or `<section>`) in HTML slide formats, allowing you
4230to style individual slides. In beamer, the only header attribute
4231that affects slides is the `allowframebreaks` class, which sets the
4232`allowframebreaks` option, causing multiple slides to be created
4233if the content overfills the frame. This is recommended especially for
4236 # References {.allowframebreaks}
4241reveal.js has good support for speaker notes. You can add notes to your
4242Markdown document thus:
4248 - It can contain Markdown
4253To show the notes window, press `s` while viewing the presentation.
4254Notes are not yet supported for other slide formats, but the notes
4255will not appear on the slides themselves.
4260To put material in side by side columns, you can use a native
4261div container with class `columns`, containing two or more div
4262containers with class `column` and a `width` attribute:
4264 :::::::::::::: {.columns}
4265 ::: {.column width="40%"}
4268 ::: {.column width="60%"}
4273Frame attributes in beamer
4274--------------------------
4276Sometimes it is necessary to add the LaTeX `[fragile]` option to
4277a frame in beamer (for example, when using the `minted` environment).
4278This can be forced by adding the `fragile` class to the header
4279introducing the slide:
4281 # Fragile slide {.fragile}
4283All of the other frame attributes described in Section 8.1 of
4284the [Beamer User's Guide] may also be used: `allowdisplaybreaks`,
4285`allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`,
4288Creating EPUBs with pandoc
4289==========================
4294EPUB metadata may be specified using the `--epub-metadata` option, but
4295if the source document is Markdown, it is better to use a [YAML metadata
4296block][Extension: `yaml_metadata_block`]. Here is an example:
4303 text: An investigation of metadata
4311 text: doi:10.234234.234/33
4313 rights: © 2007 John Smith, CC BY-NC
4318The following fields are recognized:
4321 ~ Either a string value or an object with fields `text` and
4322 `scheme`. Valid values for `scheme` are `ISBN-10`,
4323 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
4324 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
4325 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
4328 ~ Either a string value, or an object with fields `file-as` and
4329 `type`, or a list of such objects. Valid values for `type` are
4330 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
4333 ~ Either a string value, or an object with fields `role`, `file-as`,
4334 and `text`, or a list of such objects. Valid values for `role` are
4335 [MARC relators], but
4336 pandoc will attempt to translate the human-readable versions
4337 (like "author" and "editor") to the appropriate marc relators.
4340 ~ Same format as `creator`.
4343 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
4344 Pandoc will attempt to convert other common date formats.
4346`lang` (or legacy: `language`)
4347 ~ A string value in [BCP 47] format. Pandoc will default to the local
4348 language if nothing is specified.
4351 ~ A string value or a list of such values.
4372 ~ A string value (path to cover image).
4375 ~ A string value (path to CSS stylesheet).
4377`page-progression-direction`
4378 ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`
4379 attribute for the [`spine` element].
4382 ~ iBooks-specific metadata, with the following fields:
4384 - `version`: (string)
4385 - `specified-fonts`: `true`|`false` (default `false`)
4386 - `ipad-orientation-lock`: `portrait-only`|`landscape-only`
4387 - `iphone-orientation-lock`: `portrait-only`|`landscape-only`
4388 - `binding`: `true`|`false` (default `true`)
4389 - `scroll-axis`: `vertical`|`horizontal`|`default`
4391[MARC relators]: http://loc.gov/marc/relators/relaterm.html
4392[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
4397By default, pandoc will download linked media (including audio and
4398video) and include it in the EPUB container, yielding a completely
4399self-contained EPUB. If you want to link to external media resources
4400instead, use raw HTML in your source and add `data-external="1"` to the tag
4401with the `src` attribute. For example:
4403 <audio controls="1">
4404 <source src="http://example.com/music/toccata.mp3"
4405 data-external="1" type="audio/mpeg">
4412Pandoc will automatically highlight syntax in [fenced code blocks] that
4413are marked with a language name. The Haskell library [skylighting] is
4414used for highlighting, which works in HTML, Docx, Ms, and LaTeX/PDF output.
4415To see a list of language names that pandoc will recognize, type
4416`pandoc --list-highlight-languages`.
4418The color scheme can be selected using the `--highlight-style` option.
4419The default color scheme is `pygments`, which imitates the default color
4420scheme used by the Python library pygments (though pygments is not actually
4421used to do the highlighting). To see a list of highlight styles,
4422type `pandoc --list-highlight-styles`.
4424To disable highlighting, use the `--no-highlight` option.
4426[skylighting]: https://github.com/jgm/skylighting
4428Custom Styles in Docx Output
4429============================
4431By default, pandoc's docx output applies a predefined set of styles for
4432blocks such as paragraphs and block quotes, and uses largely default
4433formatting (italics, bold) for inlines. This will work for most
4434purposes, especially alongside a `reference.docx` file. However, if you
4435need to apply your own styles to blocks, or match a preexisting set of
4436styles, pandoc allows you to define custom styles for blocks and text
4437using `div`s and `span`s, respectively.
4439If you define a `div` or `span` with the attribute `custom-style`,
4440pandoc will apply your specified style to the contained elements. So,
4441for example using the `bracketed_spans` syntax,
4443 [Get out]{custom-style="Emphatically"}, he said.
4445would produce a docx file with "Get out" styled with character
4446style `Emphatically`. Similarly, using the `fenced_divs` syntax,
4448 Dickinson starts the poem simply:
4450 ::: {custom-style="Poetry"}
4451 | A Bird came down the Walk---
4452 | He did not know I saw---
4455would style the two contained lines with the `Poetry` paragraph style.
4457If the styles are not yet in your reference.docx, they will be defined
4458in the output file as inheriting from normal text. If they are already
4459defined, pandoc will not alter the definition.
4461This feature allows for greatest customization in conjunction with
4462[pandoc filters]. If you want all paragraphs after block quotes to be
4463indented, you can write a filter to apply the styles necessary. If you
4464want all italics to be transformed to the `Emphasis` character style
4465(perhaps to change their color), you can write a filter which will
4466transform all italicized inlines to inlines within an `Emphasis`
4469[pandoc filters]: http://pandoc.org/filters.html
4474Pandoc can be extended with custom writers written in [lua]. (Pandoc
4475includes a lua interpreter, so lua need not be installed separately.)
4477To use a custom writer, simply specify the path to the lua script
4478in place of the output format. For example:
4480 pandoc -t data/sample.lua
4482Creating a custom writer requires writing a lua function for each
4483possible element in a pandoc document. To get a documented example
4484which you can modify according to your needs, do
4486 pandoc --print-default-data-file sample.lua
4488[lua]: http://www.lua.org
4493Copyright 2006-2017 John MacFarlane (jgm@berkeley.edu). Released
4494under the [GPL], version 2 or greater. This software carries no
4495warranty of any kind. (See COPYRIGHT for full copyright and
4496warranty notices.) For a full list of contributors, see the file
4497AUTHORS.md in the pandoc source code.
4499[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
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