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 Markdown],
16and (subsets of) [Textile], [reStructuredText], [HTML], [LaTeX], [MediaWiki markup], [TWiki
17markup], [Haddock markup], [OPML], [Emacs Org mode], [DocBook],
18[txt2tags], [EPUB], [ODT] and [Word docx]; and it can write plain text,
19[Markdown], [CommonMark], [PHP Markdown Extra], [GitHub-Flavored Markdown],
20[reStructuredText], [XHTML], [HTML5], [LaTeX] (including
21[`beamer`] slide shows), [ConTeXt], [RTF], [OPML], [DocBook],
22[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],
23[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),
24[FictionBook2], [Textile], [groff man] pages, [Emacs Org mode],
25[AsciiDoc], [InDesign ICML], and [Slidy], [Slideous], [DZSlides],
26[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
27on systems where LaTeX is installed.
29Pandoc's enhanced version of markdown includes syntax for [footnotes],
30[tables], flexible [ordered lists], [definition lists], [fenced code blocks],
31[superscripts and subscripts], [strikeout], [metadata blocks], automatic tables of
32contents, [embedded LaTeX math][Math rendering in HTML], [citations], and [markdown inside HTML block
33elements][Extension: `markdown_in_html_blocks`]. (These enhancements, described below under
34[Pandoc's markdown], can be disabled using the
35`markdown_strict` input or output format.)
37In contrast to most existing tools for converting markdown to HTML, which
38use regex substitutions, Pandoc has a modular design: it consists of a
39set of readers, which parse text in a given format and produce a native
40representation of the document, and a set of writers, which convert
41this native representation into a target format. Thus, adding an input
42or output format requires only adding a reader or writer.
44Because Pandoc's intermediate representation of a document is less
45expressive than many of the formats it converts between, one should
46not expect perfect conversions between every format and every other.
47Pandoc attempts to preserve the structural elements of a document, but
48not formatting details such as margin size. And some document elements,
49such as complex tables, may not fit into Pandoc's simple document
50model. While conversions from Pandoc's Markdown to all formats aspire
51to be perfect, conversions from formats more expressive than Pandoc's
52Markdown can be expected to be lossy.
54[markdown]: http://daringfireball.net/projects/markdown/
55[CommonMark]: http://commonmark.org
56[PHP Markdown Extra]: https://michelf.ca/projects/php-markdown/extra/
57[GitHub-Flavored Markdown]: https://help.github.com/articles/github-flavored-markdown/
58[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
59[S5]: http://meyerweb.com/eric/tools/s5/
60[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
61[Slideous]: http://goessner.net/articles/slideous/
62[HTML]: http://www.w3.org/html/
63[HTML5]: http://www.w3.org/TR/html5/
64[XHTML]: http://www.w3.org/TR/xhtml1/
65[LaTeX]: http://latex-project.org
66[`beamer`]: https://ctan.org/pkg/beamer
67[ConTeXt]: http://pragma-ade.nl
68[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
69[DocBook]: http://docbook.org
70[txt2tags]: http://txt2tags.org
71[EPUB]: http://idpf.org/epub
72[OPML]: http://dev.opml.org/spec2.html
73[OpenDocument]: http://opendocument.xml.org
74[ODT]: http://en.wikipedia.org/wiki/OpenDocument
75[Textile]: http://redcloth.org/textile
76[MediaWiki markup]: https://www.mediawiki.org/wiki/Help:Formatting
77[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
78[TWiki markup]: http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules
79[Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html
80[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
81[Haskell]: https://www.haskell.org
82[GNU Texinfo]: http://www.gnu.org/software/texinfo/
83[Emacs Org mode]: http://orgmode.org
84[AsciiDoc]: http://www.methods.co.nz/asciidoc/
85[DZSlides]: http://paulrouget.com/dzslides/
86[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
87[PDF]: https://www.adobe.com/pdf/
88[reveal.js]: http://lab.hakim.se/reveal-js/
89[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
90[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
95If no *input-file* is specified, input is read from *stdin*.
96Otherwise, the *input-files* are concatenated (with a blank
97line between each) and used as input. Output goes to *stdout* by
98default (though output to *stdout* is disabled for the `odt`, `docx`,
99`epub`, and `epub3` output formats). For output to a file, use the
102 pandoc -o output.html input.txt
104By default, pandoc produces a document fragment, not a standalone
105document with a proper header and footer. To produce a standalone
106document, use the `-s` or `--standalone` flag:
108 pandoc -s -o output.html input.txt
110For more information on how standalone documents are produced, see
113Instead of a file, an absolute URI may be given. In this case
114pandoc will fetch the content using HTTP:
116 pandoc -f html -t markdown http://www.fsf.org
118If multiple input files are given, `pandoc` will concatenate them all (with
119blank lines between them) before parsing. This feature is disabled for
120 binary input formats such as `EPUB`, `odt`, and `docx`.
122The format of the input and output can be specified explicitly using
123command-line options. The input format can be specified using the
124`-r/--read` or `-f/--from` options, the output format using the
125`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
126markdown to LaTeX, you could type:
128 pandoc -f markdown -t latex hello.txt
130To convert `hello.html` from HTML to markdown:
132 pandoc -f html -t markdown hello.html
134Supported output formats are listed below under the `-t/--to` option.
135Supported input formats are listed below under the `-f/--from` option. Note
136that the `rst`, `textile`, `latex`, and `html` readers are not complete;
137there are some constructs that they do not parse.
139If the input or output format is not specified explicitly, `pandoc`
140will attempt to guess it from the extensions of
141the input and output filenames. Thus, for example,
143 pandoc -o hello.tex hello.txt
145will convert `hello.txt` from markdown to LaTeX. If no output file
146is specified (so that output goes to *stdout*), or if the output file's
147extension is unknown, the output format will default to HTML.
148If no input file is specified (so that input comes from *stdin*), or
149if the input files' extensions are unknown, the input format will
150be assumed to be markdown unless explicitly specified.
152Pandoc uses the UTF-8 character encoding for both input and output.
153If your local character encoding is not UTF-8, you
154should pipe input and output through [`iconv`]:
156 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
158Note that in some output formats (such as HTML, LaTeX, ConTeXt,
159RTF, OPML, DocBook, and Texinfo), information about
160the character encoding is included in the document header, which
161will only be included if you use the `-s/--standalone` option.
163[`iconv`]: http://www.gnu.org/software/libiconv/
168To produce a PDF, specify an output file with a `.pdf` extension.
169Pandoc will use LaTeX to convert it to PDF:
171 pandoc test.txt -o test.pdf
173Production of a PDF requires that a LaTeX engine be installed (see
174`--latex-engine`, below), and assumes that the following LaTeX packages
175are available: [`amsfonts`], [`amsmath`], [`lm`],
176[`ifxetex`], [`ifluatex`], [`eurosym`], [`listings`] (if the
177`--listings` option is used), [`fancyvrb`], [`longtable`],
178[`booktabs`], [`url`], [`graphicx`] and [`grffile`] (if the
179document contains images), [`color`], [`hyperref`], [`ulem`],
180[`geometry`] (with the `geometry` variable set), [`setspace`] (with
181`linestretch`), and [`babel`] (with `lang`). The use of `xelatex` or
182`lualatex` as the LaTeX engine requires [`fontspec`]; `xelatex` uses
183[`mathspec`], [`polyglossia`] (with `lang`), [`xecjk`], and
184[`bidi`] (with the `dir` variable set). The [`upquote`] and
185[`microtype`] packages are used if available, and [`csquotes`] will
186be used for [smart punctuation] if added to the template. The
187[`natbib`], [`biblatex`], [`bibtex`], and [`biber`] packages can
188optionally be used for [citation rendering]. These are included with
189all recent versions of [TeX Live].
191PDF output can be controlled using [variables for LaTeX].
193[`amsfonts`]: https://ctan.org/pkg/amsfonts
194[`amsmath`]: https://ctan.org/pkg/amsmath
195[`lm`]: https://ctan.org/pkg/lm
196[`ifxetex`]: https://ctan.org/pkg/ifxetex
197[`ifluatex`]: https://ctan.org/pkg/ifluatex
198[`eurosym`]: https://ctan.org/pkg/eurosym
199[`listings`]: https://ctan.org/pkg/listings
200[`fancyvrb`]: https://ctan.org/pkg/fancyvrb
201[`longtable`]: https://ctan.org/pkg/longtable
202[`booktabs`]: https://ctan.org/pkg/booktabs
203[`url`]: https://ctan.org/pkg/url
204[`graphicx`]: https://ctan.org/pkg/graphicx
205[`grffile`]: https://ctan.org/pkg/grffile
206[`geometry`]: https://ctan.org/pkg/geometry
207[`setspace`]: https://ctan.org/pkg/setspace
208[`color`]: http://ctan.org/pkg/color
209[`xecjk`]: https://ctan.org/pkg/xecjk
210[`hyperref`]: https://ctan.org/pkg/hyperref
211[`ulem`]: https://ctan.org/pkg/ulem
212[`babel`]: https://ctan.org/pkg/babel
213[`bidi`]: https://ctan.org/pkg/bidi
214[`mathspec`]: https://ctan.org/pkg/mathspec
215[`polyglossia`]: https://ctan.org/pkg/polyglossia
216[`fontspec`]: https://ctan.org/pkg/fontspec
217[`upquote`]: https://ctan.org/pkg/upquote
218[`microtype`]: https://ctan.org/pkg/microtype
219[`csquotes`]: https://ctan.org/pkg/csquotes
220[`natbib`]: https://ctan.org/pkg/natbib
221[`biblatex`]: https://ctan.org/pkg/biblatex
222[`bibtex`]: https://ctan.org/pkg/bibtex
223[`biber`]: https://ctan.org/pkg/biber
224[TeX Live]: http://www.tug.org/texlive/
229A user who wants a drop-in replacement for `Markdown.pl` may create
230a symbolic link to the `pandoc` executable called `hsmarkdown`. When
231invoked under the name `hsmarkdown`, `pandoc` will behave as if
232invoked with `-f markdown_strict --email-obfuscation=references`,
233and all command-line options will be treated as regular arguments.
234This approach does not work under [Cygwin], due to problems with
235its simulation of symbolic links.
237[Cygwin]: https://cygwin.com
245`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
247: Specify input format. *FORMAT* can be `native` (native Haskell),
248 `json` (JSON version of native AST), `markdown` (pandoc's
249 extended markdown), `markdown_strict` (original unextended
250 markdown), `markdown_phpextra` (PHP Markdown Extra),
251 `markdown_github` (GitHub-Flavored Markdown),
252 `commonmark` (CommonMark markdown), `textile` (Textile), `rst`
253 (reStructuredText), `html` (HTML), `docbook` (DocBook), `t2t`
254 (txt2tags), `docx` (docx), `odt` (ODT), `epub` (EPUB), `opml` (OPML),
255 `org` (Emacs Org mode), `mediawiki` (MediaWiki markup), `twiki` (TWiki
256 markup), `haddock` (Haddock markup), or `latex` (LaTeX). If
257 `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`, the
258 input will be treated as literate Haskell source: see [Literate
259 Haskell support], below. Markdown
260 syntax extensions can be individually enabled or disabled by
261 appending `+EXTENSION` or `-EXTENSION` to the format name. So, for
262 example, `markdown_strict+footnotes+definition_lists` is strict
263 markdown with footnotes and definition lists enabled, and
264 `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown
265 without pipe tables and with hard line breaks. See [Pandoc's
266 markdown], below, for a list of extensions and
269`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
271: Specify output format. *FORMAT* can be `native` (native Haskell),
272 `json` (JSON version of native AST), `plain` (plain text),
273 `markdown` (pandoc's extended markdown), `markdown_strict`
274 (original unextended markdown), `markdown_phpextra` (PHP Markdown
275 Extra), `markdown_github` (GitHub-Flavored
276 Markdown), `commonmark` (CommonMark markdown), `rst`
277 (reStructuredText), `html` (XHTML), `html5` (HTML5), `latex`
278 (LaTeX), `beamer` (LaTeX beamer slide show), `context` (ConTeXt),
279 `man` (groff man), `mediawiki` (MediaWiki markup), `dokuwiki`
280 (DokuWiki markup), `textile` (Textile), `org` (Emacs Org mode),
281 `texinfo` (GNU Texinfo), `opml` (OPML), `docbook` (DocBook),
282 `opendocument` (OpenDocument), `odt` (OpenOffice text document),
283 `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text
284 format), `epub` (EPUB v2 book), `epub3` (EPUB v3), `fb2`
285 (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml` (InDesign
286 ICML), `slidy` (Slidy HTML and javascript slide show), `slideous`
287 (Slideous HTML and javascript slide show), `dzslides` (DZSlides
288 HTML5 + javascript slide show), `revealjs` (reveal.js HTML5 +
289 javascript slide show), `s5` (S5 HTML and javascript slide show),
290 or the path of a custom lua writer (see [Custom
291 writers], below). Note that `odt`, `epub`, and
292 `epub3` output will not be directed to *stdout*; an output
293 filename must be specified using the `-o/--output` option. If
294 `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
295 `html`, or `html5`, the output will be rendered as literate
296 Haskell source: see [Literate Haskell
297 support], below. Markdown syntax
298 extensions can be individually enabled or disabled by appending
299 `+EXTENSION` or `-EXTENSION` to the format name, as described
302`-o` *FILE*, `--output=`*FILE*
304: Write output to *FILE* instead of *stdout*. If *FILE* is
305 `-`, output will go to *stdout*. (Exception: if the output
306 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
308`--data-dir=`*DIRECTORY*
310: Specify the user data directory to search for pandoc data files.
311 If this option is not specified, the default user data directory
312 will be used. This is, in Unix:
318 C:\Documents And Settings\USERNAME\Application Data\pandoc
320 and in Windows Vista or later:
322 C:\Users\USERNAME\AppData\Roaming\pandoc
324 You can find the default user data directory on your system by
325 looking at the output of `pandoc --version`.
326 A `reference.odt`, `reference.docx`, `epub.css`, `templates`,
327 `slidy`, `slideous`, or `s5` directory
328 placed in this directory will override pandoc's normal defaults.
332: Generate a bash completion script. To enable bash completion
333 with pandoc, add this to your `.bashrc`:
335 eval "$(pandoc --bash-completion)"
339: Give verbose debugging output. Currently this only has an effect
355: Parse untranslatable HTML codes and LaTeX environments as raw HTML
356 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
357 input. Raw HTML can be printed in markdown, reStructuredText, HTML,
358 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
359 can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
360 The default is for the readers to omit untranslatable HTML codes and
361 LaTeX environments. (The LaTeX reader does pass through untranslatable
362 LaTeX *commands*, even if `-R` is not specified.)
366: Produce typographically correct output, converting straight quotes
367 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
368 `...` to ellipses. Nonbreaking spaces are inserted after certain
369 abbreviations, such as "Mr." (Note: This option is significant only when
370 the input format is `markdown`, `markdown_strict`, `textile` or `twiki`.
371 It is selected automatically when the input format is `textile` or the
372 output format is `latex` or `context`, unless `--no-tex-ligatures`
377: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
378 a numeral is an en-dash, and `--` is an em-dash. This option is selected
379 automatically for `textile` input.
381`--base-header-level=`*NUMBER*
383: Specify the base level for headers (defaults to 1).
385`--indented-code-classes=`*CLASSES*
387: Specify classes to use for indented code blocks--for example,
388 `perl,numberLines` or `haskell`. Multiple classes may be separated
391`--default-image-extension=`*EXTENSION*
393: Specify a default extension to use when image paths/URLs have no
394 extension. This allows you to use the same source for formats that
395 require different kinds of images. Currently this option only affects
396 the markdown and LaTeX readers.
398`--filter=`*EXECUTABLE*
400: Specify an executable to be used as a filter transforming the
401 Pandoc AST after the input is parsed and before the output is
402 written. The executable should read JSON from stdin and write
403 JSON to stdout. The JSON must be formatted like pandoc's own
404 JSON input and output. The name of the output format will be
405 passed to the filter as the first argument. Hence,
407 pandoc --filter ./caps.py -t latex
411 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
413 The latter form may be useful for debugging filters.
415 Filters may be written in any language. `Text.Pandoc.JSON`
416 exports `toJSONFilter` to facilitate writing filters in Haskell.
417 Those who would prefer to write filters in python can use the
418 module [`pandocfilters`], installable from PyPI. There are also
419 pandoc filter libraries in [PHP], [perl], and [javascript/node.js].
421 Note that the *EXECUTABLE* will be sought in the user's
422 `PATH`, and not in the working directory, if no directory is
423 provided. If you want to run a script in the working directory,
424 preface the filename with `./`.
426`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]
428: Set the metadata field *KEY* to the value *VAL*. A value specified
429 on the command line overrides a value specified in the document.
430 Values will be parsed as YAML boolean or string values. If no value is
431 specified, the value will be treated as Boolean true. Like
432 `--variable`, `--metadata` causes template variables to be set.
433 But unlike `--variable`, `--metadata` affects the metadata of the
434 underlying document (which is accessible from filters and may be
435 printed in some output formats).
439: Normalize the document after reading: merge adjacent
440 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
442`-p`, `--preserve-tabs`
444: Preserve tabs instead of converting them to spaces (the default).
445 Note that this will only affect tabs in literal code spans and code
446 blocks; tabs in regular text will be treated as spaces.
450: Specify the number of spaces per tab (default is 4).
452`--track-changes=accept`|`reject`|`all`
454: Specifies what to do with insertions and deletions produced by the MS
455 Word "Track Changes" feature. `accept` (the default), inserts all
456 insertions, and ignores all deletions. `reject` inserts all
457 deletions and ignores insertions. `all` puts in both insertions
458 and deletions, wrapped in spans with `insertion` and `deletion`
459 classes, respectively. The author and time of change is
460 included. `all` is useful for scripting: only accepting changes
461 from a certain reviewer, say, or before a certain date. This
462 option only affects the docx reader.
464`--extract-media=`*DIR*
466: Extract images and other media contained in a docx or epub container
467 to the path *DIR*, creating it if necessary, and adjust the images
468 references in the document so they point to the extracted files.
469 This option only affects the docx and epub readers.
471[`pandocfilters`]: https://github.com/jgm/pandocfilters
472[PHP]: https://github.com/vinai/pandocfilters-php
473[perl]: https://metacpan.org/pod/Pandoc::Filter
474[javascript/node.js]: https://github.com/mvhenderson/pandoc-filter-node
476General writer options
477----------------------
481: Produce output with an appropriate header and footer (e.g. a
482 standalone HTML, LaTeX, or RTF file, not a fragment). This option
483 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
488: Use *FILE* as a custom template for the generated document. Implies
489 `--standalone`. See [Templates], below, for a description
490 of template syntax. If no extension is specified, an extension
491 corresponding to the writer will be added, so that `--template=special`
492 looks for `special.html` for HTML output. If the template is not
493 found, pandoc will search for it in the `templates` subdirectory of
494 the user data directory (see `--data-dir`). If this option is not used,
495 a default template appropriate for the output format will be used (see
496 `-D/--print-default-template`).
498`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`:`*VAL*]
500: Set the template variable *KEY* to the value *VAL* when rendering the
501 document in standalone mode. This is generally only useful when the
502 `--template` option is used to specify a custom template, since
503 pandoc automatically sets the variables used in the default
504 templates. If no *VAL* is specified, the key will be given the
507`-D` *FORMAT*, `--print-default-template=`*FORMAT*
509: Print the system default template for an output *FORMAT*. (See `-t`
510 for a list of possible *FORMAT*s.) Templates in the user data
511 directory are ignored.
513`--print-default-data-file=`*FILE*
515: Print a system default data file. Files in the user data directory
520: Disable text wrapping in output. By default, text is wrapped
521 appropriately for the output format.
525: Specify length of lines in characters (for text wrapping).
527`--toc`, `--table-of-contents`
529: Include an automatically generated table of contents (or, in
530 the case of `latex`, `context`, and `rst`, an instruction to create
531 one) in the output document. This option has no effect on `man`,
532 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
534`--toc-depth=`*NUMBER*
536: Specify the number of section levels to include in the table
537 of contents. The default is 3 (which means that level 1, 2, and 3
538 headers will be listed in the contents).
542: Disables syntax highlighting for code blocks and inlines, even when
543 a language attribute is given.
545`--highlight-style=`*STYLE*
547: Specifies the coloring style to be used in highlighted source code.
548 Options are `pygments` (the default), `kate`, `monochrome`,
549 `espresso`, `zenburn`, `haddock`, and `tango`. For more information
550 on syntax highlighting in pandoc, see [Syntax highlighting], below.
552`-H` *FILE*, `--include-in-header=`*FILE*
554: Include contents of *FILE*, verbatim, at the end of the header.
555 This can be used, for example, to include special
556 CSS or javascript in HTML documents. This option can be used
557 repeatedly to include multiple files in the header. They will be
558 included in the order specified. Implies `--standalone`.
560`-B` *FILE*, `--include-before-body=`*FILE*
562: Include contents of *FILE*, verbatim, at the beginning of the
563 document body (e.g. after the `<body>` tag in HTML, or the
564 `\begin{document}` command in LaTeX). This can be used to include
565 navigation bars or banners in HTML documents. This option can be
566 used repeatedly to include multiple files. They will be included in
567 the order specified. Implies `--standalone`.
569`-A` *FILE*, `--include-after-body=`*FILE*
571: Include contents of *FILE*, verbatim, at the end of the document
572 body (before the `</body>` tag in HTML, or the
573 `\end{document}` command in LaTeX). This option can be be used
574 repeatedly to include multiple files. They will be included in the
575 order specified. Implies `--standalone`.
577Options affecting specific writers
578----------------------------------
582: Produce a standalone HTML file with no external dependencies, using
583 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
584 images, and videos. The resulting file should be "self-contained,"
585 in the sense that it needs no external files and no net access to be
586 displayed properly by a browser. This option works only with HTML output
587 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
588 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
589 stylesheets at absolute URLs will be downloaded; those at relative URLs
590 will be sought relative to the working directory (if the first source
591 file is local) or relative to the base URL (if the first source
592 file is remote). `--self-contained` does not work with `--mathjax`.
596: Deprecated synonym for `--self-contained`.
600: Produce HTML5 instead of HTML4. This option has no effect for writers
601 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
605: Use `<q>` tags for quotes in HTML.
609: Use only ascii characters in output. Currently supported only
610 for HTML output (which uses numerical entities instead of
611 UTF-8 when this option is selected).
615: Use reference-style links, rather than inline links, in writing markdown
616 or reStructuredText. By default inline links are used.
620: Use ATX-style headers in markdown and asciidoc output. The default is
621 to use setext-style headers for levels 1-2, and then ATX headers.
625: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
626 output. When the LaTeX document class is set to `report`, `book`, or
627 `memoir`, this option is implied. If `beamer` is the output
628 format, top-level headers will become `\part{..}`.
630`-N`, `--number-sections`
632: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
633 By default, sections are not numbered. Sections with class
634 `unnumbered` will never be numbered, even if `--number-sections`
637`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]
639: Offset for section headings in HTML output (ignored in other
640 output formats). The first number is added to the section number for
641 top-level headers, the second for second-level headers, and so on.
642 So, for example, if you want the first top-level header in your
643 document to be numbered "6", specify `--number-offset=5`.
644 If your document starts with a level-2 header which you want to
645 be numbered "1.5", specify `--number-offset=1,4`.
646 Offsets are 0 by default. Implies `--number-sections`.
650: Do not convert quotation marks, apostrophes, and dashes to
651 the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
652 use literal unicode characters. This is needed for using advanced
653 OpenType features with `xelatex` and `lualatex`. Note: normally
654 `--smart` is selected automatically for LaTeX and ConTeXt
655 output, but it must be specified explicitly if `--no-tex-ligatures`
656 is selected. If you use literal curly quotes, dashes, and ellipses
657 in your source, then you may want to use `--no-tex-ligatures`
662: Use the [`listings`] package for LaTeX code blocks
666: Make list items in slide shows display incrementally (one by one).
667 The default is for lists to be displayed all at once.
669`--slide-level=`*NUMBER*
671: Specifies that headers with the specified level create
672 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
673 above this level in the hierarchy are used to divide the
674 slide show into sections; headers below this level create
675 subheads within a slide. The default is to set the slide level
676 based on the contents of the document; see
677 [Structuring the slide show].
681: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
682 and attach identifiers to the enclosing `<div>` (or `<section>`)
683 rather than the header itself. See
684 [Header identifiers], below.
686`--email-obfuscation=none`|`javascript`|`references`
688: Specify a method for obfuscating `mailto:` links in HTML documents.
689 `none` leaves `mailto:` links as they are. `javascript` obfuscates
690 them using javascript. `references` obfuscates them by printing their
691 letters as decimal or hexadecimal character references.
693`--id-prefix=`*STRING*
695: Specify a prefix to be added to all automatically generated identifiers
696 in HTML and DocBook output, and to footnote numbers in markdown output.
697 This is useful for preventing duplicate identifiers when generating
698 fragments to be included in other pages.
700`-T` *STRING*, `--title-prefix=`*STRING*
702: Specify *STRING* as a prefix at the beginning of the title
703 that appears in the HTML header (but not in the title as it
704 appears at the beginning of the HTML body). Implies
707`-c` *URL*, `--css=`*URL*
709: Link to a CSS style sheet. This option can be be used repeatedly to
710 include multiple files. They will be included in the order specified.
712`--reference-odt=`*FILE*
714: Use the specified file as a style reference in producing an ODT.
715 For best results, the reference ODT should be a modified version
716 of an ODT produced using pandoc. The contents of the reference ODT
717 are ignored, but its stylesheets are used in the new ODT. If no
718 reference ODT is specified on the command line, pandoc will look
719 for a file `reference.odt` in the user data directory (see
720 `--data-dir`). If this is not found either, sensible defaults will be
723`--reference-docx=`*FILE*
725: Use the specified file as a style reference in producing a docx file.
726 For best results, the reference docx should be a modified version
727 of a docx file produced using pandoc. The contents of the reference docx
728 are ignored, but its stylesheets and document properties (including
729 margins, page size, header, and footer) are used in the new docx. If no
730 reference docx is specified on the command line, pandoc will look
731 for a file `reference.docx` in the user data directory (see
732 `--data-dir`). If this is not found either, sensible defaults will be
733 used. The following styles are used by pandoc: [paragraph]
734 Normal, Body Text, First Paragraph, Compact, Title, Subtitle, Author, Date,
735 Abstract, Bibliography, Heading 1, Heading 2, Heading 3, Heading 4,
736 Heading 5, Heading 6, Block Text, Footnote Text, Definition Term,
737 Definition, Caption, Table Caption, Image Caption, Figure,
738 Figure With Caption, TOC Heading;
739 [character] Default Paragraph Font, Body Text Char, Verbatim Char,
740 Footnote Reference, Hyperlink; [table] Normal Table.
742`--epub-stylesheet=`*FILE*
744: Use the specified CSS file to style the EPUB. If no stylesheet
745 is specified, pandoc will look for a file `epub.css` in the
746 user data directory (see `--data-dir`). If it is not
747 found there, sensible defaults will be used.
749`--epub-cover-image=`*FILE*
751: Use the specified image as the EPUB cover. It is recommended
752 that the image be less than 1000px in width and height. Note that
753 in a markdown source document you can also specify `cover-image`
754 in a YAML metadata block (see [EPUB Metadata], below).
756`--epub-metadata=`*FILE*
758: Look in the specified XML file for metadata for the EPUB.
759 The file should contain a series of [Dublin Core elements].
762 <dc:rights>Creative Commons</dc:rights>
763 <dc:language>es-AR</dc:language>
765 By default, pandoc will include the following metadata elements:
766 `<dc:title>` (from the document title), `<dc:creator>` (from the
767 document authors), `<dc:date>` (from the document date, which should
768 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
769 variable, or, if is not set, the locale), and `<dc:identifier
770 id="BookId">` (a randomly generated UUID). Any of these may be
771 overridden by elements in the metadata file.
773 Note: if the source document is markdown, a YAML metadata block
774 in the document can be used instead. See below under
777`--epub-embed-font=`*FILE*
779: Embed the specified font in the EPUB. This option can be repeated
780 to embed multiple fonts. Wildcards can also be used: for example,
781 `DejaVuSans-*.ttf`. However, if you use wildcards on the command
782 line, be sure to escape them or put the whole filename in single quotes,
783 to prevent them from being interpreted by the shell. To use the
784 embedded fonts, you will need to add declarations like the following
785 to your CSS (see `--epub-stylesheet`):
788 font-family: DejaVuSans;
791 src:url("DejaVuSans-Regular.ttf");
794 font-family: DejaVuSans;
797 src:url("DejaVuSans-Bold.ttf");
800 font-family: DejaVuSans;
803 src:url("DejaVuSans-Oblique.ttf");
806 font-family: DejaVuSans;
809 src:url("DejaVuSans-BoldOblique.ttf");
811 body { font-family: "DejaVuSans"; }
813`--epub-chapter-level=`*NUMBER*
815: Specify the header level at which to split the EPUB into separate
816 "chapter" files. The default is to split into chapters at level 1
817 headers. This option only affects the internal composition of the
818 EPUB, not the way chapters and sections are displayed to users. Some
819 readers may be slow if the chapter files are too large, so for large
820 documents with few level 1 headers, one might want to use a chapter
823`--latex-engine=pdflatex`|`lualatex`|`xelatex`
825: Use the specified LaTeX engine when producing PDF output.
826 The default is `pdflatex`. If the engine is not in your PATH,
827 the full path of the engine may be specified here.
829`--latex-engine-opt=`*STRING*
831: Use the given string as a command-line argument to the `latex-engine`.
832 If used multiple times, the arguments are provided with spaces between
833 them. Note that no check for duplicate options is done.
835[Dublin Core elements]: http://dublincore.org/documents/dces/
836[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
841`--bibliography=`*FILE*
843: Set the `bibliography` field in the document's metadata to *FILE*,
844 overriding any value set in the metadata, and process citations
845 using `pandoc-citeproc`. (This is equivalent to
846 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
847 If `--natbib` or `--biblatex` is also supplied, `pandoc-citeproc` is not
848 used, making this equivalent to `--metadata bibliography=FILE`.
849 If you supply this argument multiple times, each *FILE* will be added
854: Set the `csl` field in the document's metadata to *FILE*,
855 overriding any value set in the metadata. (This is equivalent to
856 `--metadata csl=FILE`.)
857 This option is only relevant with `pandoc-citeproc`.
859`--citation-abbreviations=`*FILE*
861: Set the `citation-abbreviations` field in the document's metadata to
862 *FILE*, overriding any value set in the metadata. (This is equivalent to
863 `--metadata citation-abbreviations=FILE`.)
864 This option is only relevant with `pandoc-citeproc`.
868: Use [`natbib`] for citations in LaTeX output. This option is not for use
869 with the `pandoc-citeproc` filter or with PDF output. It is intended for
870 use in producing a LaTeX file that can be processed with [`bibtex`].
874: Use [`biblatex`] for citations in LaTeX output. This option is not for use
875 with the `pandoc-citeproc` filter or with PDF output. It is intended for
876 use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
878Math rendering in HTML
879----------------------
881`-m` [*URL*], `--latexmathml`[`=`*URL*]
883: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
884 To insert a link to a local copy of the `LaTeXMathML.js` script,
885 provide a *URL*. If no *URL* is provided, the contents of the
886 script will be inserted directly into the HTML header, preserving
887 portability at the price of efficiency. If you plan to use math on
888 several pages, it is much better to link to a copy of the script,
893: Convert TeX math to [MathML] (in `docbook` as well as `html` and `html5`).
894 In standalone `html` output, a small javascript (or a link to such a
895 script if a *URL* is supplied) will be inserted that allows the MathML to
896 be viewed on some browsers.
900: Use [jsMath] to display embedded TeX math in HTML output.
901 The *URL* should point to the jsMath load script (e.g.
902 `jsMath/easy/load.js`); if provided, it will be linked to in
903 the header of standalone HTML documents. If a *URL* is not provided,
904 no link to the jsMath load script will be inserted; it is then
905 up to the author to provide such a link in the HTML template.
909: Use [MathJax] to display embedded TeX math in HTML output.
910 The *URL* should point to the `MathJax.js` load script.
911 If a *URL* is not provided, a link to the MathJax CDN will
916: Enclose TeX math in `<eq>` tags in HTML output. These can then
917 be processed by [gladTeX] to produce links to images of the typeset
922: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
923 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
927: Render TeX formulas using an external script that converts TeX
928 formulas to images. The formula will be concatenated with the URL
929 provided. If *URL* is not specified, the Google Chart API will be used.
933: Use [KaTeX] to display embedded TeX math in HTML output.
934 The *URL* should point to the `katex.js` load script. If a *URL* is
935 not provided, a link to the KaTeX CDN will be inserted.
937`--katex-stylesheet=`*URL*
939: The *URL* should point to the `katex.css` stylesheet. If this option is
940 not specified, a link to the KaTeX CDN will be inserted. Note that this
941 option does not imply `--katex`.
943[MathML]: http://www.w3.org/Math/
944[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
945[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
946[MathJax]: https://www.mathjax.org
947[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
948[mimeTeX]: http://www.forkosh.com/mimetex.html
949[KaTeX]: https://github.com/Khan/KaTeX
951Options for wrapper scripts
952---------------------------
956: Print information about command-line arguments to *stdout*, then exit.
957 This option is intended primarily for use in wrapper scripts.
958 The first line of output contains the name of the output file specified
959 with the `-o` option, or `-` (for *stdout*) if no output file was
960 specified. The remaining lines contain the command-line arguments,
961 one per line, in the order they appear. These do not include regular
962 Pandoc options and their arguments, but do include any options appearing
963 after a `--` separator at the end of the line.
967: Ignore command-line arguments (for use in wrapper scripts).
968 Regular Pandoc options are not ignored. Thus, for example,
970 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
974 pandoc -o foo.html -s
979When the `-s/--standalone` option is used, pandoc uses a template to
980add header and footer material that is needed for a self-standing
981document. To see the default template that is used, just type
985where *FORMAT* is the name of the output format. A custom template
986can be specified using the `--template` option. You can also override
987the system default templates for a given output format *FORMAT*
988by putting a file `templates/default.*FORMAT*` in the user data
989directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
990customize the `default.opendocument` template. For `pdf` output,
991customize the `default.latex` template.
993Templates contain *variables*, which allow for the inclusion of
994arbitrary information at any point in the file. Variables may be set
995within the document using [YAML metadata blocks][Extension: `yaml_metadata_block`].
996They may also be set at the
997command line using the `-V/--variable` option: variables set in this
998way override metadata fields with the same name.
1000Variables set by pandoc
1001-----------------------
1003Some variables are set automatically by pandoc. These vary somewhat
1004depending on the output format, but include metadata fields as well as the following:
1006`title`, `author`, `date`
1007: allow identification of basic aspects of the document.
1008 Included in PDF metadata through LaTeX.
1009 These can be set through a [pandoc title block][Extension: `pandoc_title_block`],
1010 which allows for multiple authors, or through a YAML metadata block:
1019: allows for specification of document summary in LaTeX and Word docx
1022: contents specified by `-H/--include-in-header` (may have multiple
1026: non-null value if `--toc/--table-of-contents` was specified
1029: contents specified by `-B/--include-before-body` (may have
1033: contents specified by `-A/--include-after-body` (may have
1043: identifies the main language of the document,
1044 using a code according to [BCP 47] (e.g. `en` or `en-GB`).
1045 For some output formats, pandoc will convert it to an appropriate
1046 format stored in the additional variables `babel-lang`,
1047 `polyglossia-lang` (LaTeX) and `context-lang` (ConTeXt).
1050: a list of other languages used in the document
1051 in the YAML metadata, according to [BCP 47]. For example:
1052 `otherlangs: [en-GB, fr]`.
1053 Currently only used by `xelatex` through the generated
1054 `polyglossia-otherlangs` variable.
1057: the base direction of the document, either `rtl` (right-to-left)
1058 or `ltr` (left-to-right).
1060 For bidirectional documents, native pandoc `span`s and `div`s
1061 with the `dir` attribute (value `rtl` or `ltr`) can be used to
1062 override the base direction in some output formats.
1063 This may not always be necessary if the final renderer
1064 (e.g. the browser, when generating HTML) supports the
1065 [Unicode Bidirectional Algorithm].
1067 LaTeX and ConTeXt assume by default that all text is left-to-right.
1068 Setting `dir: ltr` enables bidirectional text handling in a document
1069 whose base direction is left-to-right but contains some right-to-left script.
1071 When using LaTeX for bidirectional documents, only the `xelatex` engine
1072 is fully supported (use `--latex-engine=xelatex`).
1074[BCP 47]: https://tools.ietf.org/html/bcp47
1075[Unicode Bidirectional Algorithm]: http://www.w3.org/International/articles/inline-bidi-markup/uba-basics
1081: base URL for Slidy documents (defaults to
1082 `http://www.w3.org/Talks/Tools/Slidy2`)
1085: base URL for Slideous documents (defaults to `slideous`)
1088: base URL for S5 documents (defaults to `s5/default`)
1091: base URL for reveal.js documents (defaults to `reveal.js`)
1094: reveal.js or LaTeX beamer theme
1097: reveal.js transition: `cube`, `page`, `concave`, `zoom`, `linear`, `fade`, or `none`
1100: enables vertical centering of slides in reveal.js
1103: bounds for smallest/largest possible content scale in reveal.js (default: 1.5)
1106: enables display of the page number of the current slide in reveal.js
1108`colortheme`, `fonttheme`, `innertheme`, `outertheme`
1109: themes for LaTeX [`beamer`] documents
1115: font size (e.g. `10pt`, `12pt`) for LaTeX documents
1118: document class for LaTeX documents, e.g. [`article`], [`report`], [`book`], [`memoir`]
1121: option for LaTeX document class, e.g. `oneside`; may be repeated
1122 for multiple options
1125: option for LaTeX [`geometry`] package, e.g. `margin=1in`;
1126 may be repeated for multiple options
1129: adjusts line spacing in LaTeX documents using the [`setspace`]
1130 package, e.g. `1.25`, `1.5`
1133: font package for LaTeX documents (with `pdflatex`):
1134 [TeX Live] includes many options, documented in the [LaTeX Font Catalogue].
1135 The default is [Latin Modern][`lm`].
1138: options for package used as `fontfamily`: e.g. `osf,sc` with
1139 `fontfamily` set to [`mathpazo`] provides Palatino with old-style
1140 figures and true small caps
1142`mainfont`, `sansfont`, `monofont`, `mathfont`, `CJKmainfont`
1143: fonts for LaTeX documents (works only with `xelatex` and
1144 `lualatex`): takes the name of any system font, using the
1145 [`fontspec`] package. Note that if `CJKmainfont` is used,
1146 the [`xecjk`] package must be available.
1148`mainfontoptions`, `sansfontoptions`, `monofontoptions`, `mathfontoptions`, `CJKoptions`
1149: options to use with `mainfont`, `sansfont`, `monofont`, `mathfont`,
1150 `CJKmainfont` in `xelatex` and `lualatex`. Allows for any choices
1151 available through [`fontspec`], such as the OpenType features
1152 `Numbers=OldStyle,Numbers=Proportional`.
1154`linkcolor`, `toccolor`, `urlcolor`, `citecolor`
1155: color for internal links, links in table of contents, external links,
1156 and citation links in LaTeX documents, using options available through
1157 [`color`] package, e.g. `red`, `green`, `magenta`, `cyan`, `blue`, `black`
1160: causes links to be printed as footnotes in LaTeX documents
1163: include table of contents in LaTeX documents
1166: level of section to include in table of contents in LaTeX documents
1169: title of table of contents (works only with EPUB and docx)
1172: include list of figures in LaTeX documents
1175: include list of tables in LaTeX documents
1178: bibliography to use for resolving references
1181: bibliography style in LaTeX, when used with `--natbib`
1183[`article`]: https://ctan.org/pkg/article
1184[`report`]: https://ctan.org/pkg/report
1185[`book`]: https://ctan.org/pkg/book
1186[`memoir`]: https://ctan.org/pkg/memoir
1187[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
1188[`mathpazo`]: https://ctan.org/pkg/mathpazo
1190Variables for man pages
1191-----------------------
1194: section number in man pages
1197: header in man pages
1200: footer in man pages
1203: adjusts text to left (`l`), right (`r`), center (`c`),
1204 or both (`b`) margins
1207: if `true` (the default), hyphenation will be used
1209Using variables in templates
1210----------------------------
1212Variable names are sequences of alphanumerics, `-`, and `_`,
1213starting with a letter. A variable name surrounded by `$` signs
1214will be replaced by its value. For example, the string `$title$` in
1216 <title>$title$</title>
1218will be replaced by the document title.
1220To write a literal `$` in a template, use `$$`.
1222Templates may contain conditionals. The syntax is as follows:
1230This will include `X` in the template if `variable` has a non-null
1231value; otherwise it will include `Y`. `X` and `Y` are placeholders for
1232any valid template text, and may include interpolated variables or other
1233conditionals. The `$else$` section may be omitted.
1235When variables can have multiple values (for example, `author` in
1236a multi-author document), you can use the `$for$` keyword:
1239 <meta name="author" content="$author$" />
1242You can optionally specify a separator to be used between
1245 $for(author)$$author$$sep$, $endfor$
1247A dot can be used to select a field of a variable that takes
1248an object as its value. So, for example:
1250 $author.name$ ($author.affiliation$)
1252If you use custom templates, you may need to revise them as pandoc
1253changes. We recommend tracking the changes in the default templates,
1254and modifying your custom templates accordingly. An easy way to do this
1255is to fork the [pandoc-templates] repository and merge in changes after each
1258[pandoc-templates]: https://github.com/jgm/pandoc-templates
1263Pandoc understands an extended and slightly revised version of
1264John Gruber's [markdown] syntax. This document explains the syntax,
1265noting differences from standard markdown. Except where noted, these
1266differences can be suppressed by using the `markdown_strict` format instead
1267of `markdown`. An extensions can be enabled by adding `+EXTENSION`
1268to the format name and disabled by adding `-EXTENSION`. For example,
1269`markdown_strict+footnotes` is strict markdown with footnotes
1270enabled, while `markdown-footnotes-pipe_tables` is pandoc's
1271markdown without footnotes or pipe tables.
1276Markdown is designed to be easy to write, and, even more importantly,
1279> A Markdown-formatted document should be publishable as-is, as plain
1280> text, without looking like it's been marked up with tags or formatting
1282> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
1284This principle has guided pandoc's decisions in finding syntax for
1285tables, footnotes, and other extensions.
1287There is, however, one respect in which pandoc's aims are different
1288from the original aims of markdown. Whereas markdown was originally
1289designed with HTML generation in mind, pandoc is designed for multiple
1290output formats. Thus, while pandoc allows the embedding of raw HTML,
1291it discourages it, and provides other, non-HTMLish ways of representing
1292important document elements like definition lists, tables, mathematics, and
1298A paragraph is one or more lines of text followed by one or more blank lines.
1299Newlines are treated as spaces, so you can reflow your paragraphs as you like.
1300If you need a hard line break, put two or more spaces at the end of a line.
1302#### Extension: `escaped_line_breaks` ####
1304A backslash followed by a newline is also a hard line break.
1305Note: in multiline and grid table cells, this is the only way
1306to create a hard line break, since trailing spaces in the cells
1312There are two kinds of headers: Setext and ATX.
1314### Setext-style headers ###
1316A setext-style header is a line of text "underlined" with a row of `=` signs
1317(for a level one header) or `-` signs (for a level two header):
1325The header text can contain inline formatting, such as emphasis (see
1326[Inline formatting], below).
1329### ATX-style headers ###
1331An ATX-style header consists of one to six `#` signs and a line of
1332text, optionally followed by any number of `#` signs. The number of
1333`#` signs at the beginning of the line is the header level:
1335 ## A level-two header
1337 ### A level-three header ###
1339As with setext-style headers, the header text can contain formatting:
1341 # A level-one header with a [link](/url) and *emphasis*
1343#### Extension: `blank_before_header` ####
1345Standard markdown syntax does not require a blank line before a header.
1346Pandoc does require this (except, of course, at the beginning of the
1347document). The reason for the requirement is that it is all too easy for a
1348`#` to end up at the beginning of a line by accident (perhaps through line
1349wrapping). Consider, for example:
1351 I like several of their flavors of ice cream:
1352 #22, for example, and #5.
1355### Header identifiers ###
1357#### Extension: `header_attributes` ####
1359Headers can be assigned attributes using this syntax at the end
1360of the line containing the header text:
1362 {#identifier .class .class key=value key=value}
1364Thus, for example, the following headers will all be assigned the identifier
1369 ## My header ## {#foo}
1371 My other header {#foo}
1374(This syntax is compatible with [PHP Markdown Extra].)
1376Note that although this syntax allows assignment of classes and key/value
1377attributes, writers generally don't use all of this information. Identifiers,
1378classes, and key/value attributes are used in HTML and HTML-based formats such
1379as EPUB and slidy. Identifiers are used for labels and link anchors in the
1380LaTeX, ConTeXt, Textile, and AsciiDoc writers.
1382Headers with the class `unnumbered` will not be numbered, even if
1383`--number-sections` is specified. A single hyphen (`-`) in an attribute
1384context is equivalent to `.unnumbered`, and preferable in non-English
1391 # My header {.unnumbered}
1393#### Extension: `auto_identifiers` ####
1395A header without an explicitly specified identifier will be
1396automatically assigned a unique identifier based on the header text.
1397To derive the identifier from the header text,
1399 - Remove all formatting, links, etc.
1400 - Remove all footnotes.
1401 - Remove all punctuation, except underscores, hyphens, and periods.
1402 - Replace all spaces and newlines with hyphens.
1403 - Convert all alphabetic characters to lowercase.
1404 - Remove everything up to the first letter (identifiers may
1405 not begin with a number or punctuation mark).
1406 - If nothing is left after this, use the identifier `section`.
1411 ------------------------------- ----------------------------
1412 Header identifiers in HTML `header-identifiers-in-html`
1413 *Dogs*?--in *my* house? `dogs--in-my-house`
1414 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1415 3. Applications `applications`
1418These rules should, in most cases, allow one to determine the identifier
1419from the header text. The exception is when several headers have the
1420same text; in this case, the first will get an identifier as described
1421above; the second will get the same identifier with `-1` appended; the
1422third with `-2`; and so on.
1424These identifiers are used to provide link targets in the table of
1425contents generated by the `--toc|--table-of-contents` option. They
1426also make it easy to provide links from one section of a document to
1427another. A link to this section, for example, might look like this:
1430 [header identifiers](#header-identifiers-in-html-latex-and-context).
1432Note, however, that this method of providing links to sections works
1433only in HTML, LaTeX, and ConTeXt formats.
1435If the `--section-divs` option is specified, then each section will
1436be wrapped in a `div` (or a `section`, if `--html5` was specified),
1437and the identifier will be attached to the enclosing `<div>`
1438(or `<section>`) tag rather than the header itself. This allows entire
1439sections to be manipulated using javascript or treated differently in
1442#### Extension: `implicit_header_references` ####
1444Pandoc behaves as if reference links have been defined for each header.
1447 [header identifiers](#header-identifiers-in-html)
1451 [header identifiers]
1455 [header identifiers][]
1459 [the section on header identifiers][header identifiers]
1461If there are multiple headers with identical text, the corresponding
1462reference will link to the first one only, and you will need to use explicit
1463links to link to the others, as described above.
1465Like regular reference links, these references are case-insensitive.
1467Explicit link reference definitions always take priority over
1468implicit header references. So, in the following example, the
1469link will point to `bar`, not to `#foo`:
1480Markdown uses email conventions for quoting blocks of text.
1481A block quotation is one or more paragraphs or other block elements
1482(such as lists or headers), with each line preceded by a `>` character
1483and an optional space. (The `>` need not start at the left margin, but
1484it should not be indented more than three spaces.)
1486 > This is a block quote. This
1487 > paragraph has two lines.
1489 > 1. This is a list inside a block quote.
1492A "lazy" form, which requires the `>` character only on the first
1493line of each block, is also allowed:
1495 > This is a block quote. This
1496 paragraph has two lines.
1498 > 1. This is a list inside a block quote.
1501Among the block elements that can be contained in a block quote are
1502other block quotes. That is, block quotes can be nested:
1504 > This is a block quote.
1506 > > A block quote within a block quote.
1508If the `>` character is followed by an optional space, that space
1509will be considered part of the block quote marker and not part of
1510the indentation of the contents. Thus, to put an indented code
1511block in a block quote, you need five spaces after the `>`:
1515#### Extension: `blank_before_blockquote` ####
1517Standard markdown syntax does not require a blank line before a block
1518quote. Pandoc does require this (except, of course, at the beginning of the
1519document). The reason for the requirement is that it is all too easy for a
1520`>` to end up at the beginning of a line by accident (perhaps through line
1521wrapping). So, unless the `markdown_strict` format is used, the following does
1522not produce a nested block quote in pandoc:
1524 > This is a block quote.
1528Verbatim (code) blocks
1529----------------------
1531### Indented code blocks ###
1533A block of text indented four spaces (or one tab) is treated as verbatim
1534text: that is, special characters do not trigger special formatting,
1535and all spaces and line breaks are preserved. For example,
1538 moveShip(5 * gravity, DOWN);
1541The initial (four space or one tab) indentation is not considered part
1542of the verbatim text, and is removed in the output.
1544Note: blank lines in the verbatim text need not begin with four spaces.
1547### Fenced code blocks ###
1549#### Extension: `fenced_code_blocks` ####
1551In addition to standard indented code blocks, Pandoc supports
1552*fenced* code blocks. These begin with a row of three or more
1553tildes (`~`) and end with a row of tildes that must be at least as long as
1554the starting row. Everything between these lines is treated as code. No
1555indentation is necessary:
1559 moveShip(5 * gravity, DOWN);
1563Like regular code blocks, fenced code blocks must be separated
1564from surrounding text by blank lines.
1566If the code itself contains a row of tildes or backticks, just use a longer
1567row of tildes or backticks at the start and end:
1571 code including tildes
1575#### Extension: `backtick_code_blocks` ####
1577Same as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes
1580#### Extension: `fenced_code_attributes` ####
1582Optionally, you may attach attributes to fenced or backtick code block using
1585 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1587 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1588 qsort (filter (>= x) xs)
1589 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1591Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1592`startFrom` is an attribute with value `100`. Some output formats can use this
1593information to do syntax highlighting. Currently, the only output formats
1594that uses this information are HTML and LaTeX. If highlighting is supported
1595for your output format and language, then the code block above will appear
1596highlighted, with numbered lines. (To see which languages are supported, do
1597`pandoc --version`.) Otherwise, the code block above will appear as follows:
1599 <pre id="mycode" class="haskell numberLines" startFrom="100">
1605A shortcut form can also be used for specifying the language of
1612This is equivalent to:
1618If the `fenced_code_attributes` extension is disabled, but
1619input contains class attribute(s) for the codeblock, the first
1620class attribute will be printed after the opening fence as a bare
1623To prevent all highlighting, use the `--no-highlight` flag.
1624To set the highlighting style, use `--highlight-style`.
1625For more information on highlighting, see [Syntax highlighting],
1631#### Extension: `line_blocks` ####
1633A line block is a sequence of lines beginning with a vertical bar (`|`)
1634followed by a space. The division into lines will be preserved in
1635the output, as will any leading spaces; otherwise, the lines will
1636be formatted as markdown. This is useful for verse and addresses:
1638 | The limerick packs laughs anatomical
1639 | In space that is quite economical.
1640 | But the good ones I've seen
1641 | So seldom are clean
1642 | And the clean ones so seldom are comical
1645 | Berkeley, CA 94718
1647The lines can be hard-wrapped if needed, but the continuation
1648line must begin with a space.
1650 | The Right Honorable Most Venerable and Righteous Samuel L.
1653 | Berkeley, CA 94718
1655This syntax is borrowed from [reStructuredText].
1662A bullet list is a list of bulleted list items. A bulleted list
1663item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1670This will produce a "compact" list. If you want a "loose" list, in which
1671each item is formatted as a paragraph, put spaces between the items:
1679The bullets need not be flush with the left margin; they may be
1680indented one, two, or three spaces. The bullet must be followed
1683List items look best if subsequent lines are flush with the first
1684line (after the bullet):
1690But markdown also allows a "lazy" format:
1696### The four-space rule ###
1698A list item may contain multiple paragraphs and other block-level
1699content. However, subsequent paragraphs must be preceded by a blank line
1700and indented four spaces or a tab. The list will look better if the first
1701paragraph is aligned with the rest:
1707 * Second paragraph. With a code block, which must be indented
1712List items may include other lists. In this case the preceding blank
1713line is optional. The nested list must be indented four spaces or
1726As noted above, markdown allows you to write list items "lazily," instead of
1727indenting continuation lines. However, if there are multiple paragraphs or
1728other blocks in a list item, the first line of each must be indented.
1730 + A lazy, lazy, list
1733 + Another one; this looks
1736 Second paragraph of second
1739**Note:** Although the four-space rule for continuation paragraphs
1740comes from the official [markdown syntax guide], the reference implementation,
1741`Markdown.pl`, does not follow it. So pandoc will give different results than
1742`Markdown.pl` when authors have indented continuation paragraphs fewer than
1745The [markdown syntax guide] is not explicit whether the four-space
1746rule applies to *all* block-level content in a list item; it only
1747mentions paragraphs and code blocks. But it implies that the rule
1748applies to all block-level content (including nested lists), and
1749pandoc interprets it that way.
1751 [markdown syntax guide]:
1752 http://daringfireball.net/projects/markdown/syntax#list
1754### Ordered lists ###
1756Ordered lists work just like bulleted lists, except that the items
1757begin with enumerators rather than bullets.
1759In standard markdown, enumerators are decimal numbers followed
1760by a period and a space. The numbers themselves are ignored, so
1761there is no difference between this list:
1773#### Extension: `fancy_lists` ####
1775Unlike standard markdown, Pandoc allows ordered list items to be marked
1776with uppercase and lowercase letters and roman numerals, in addition to
1777arabic numerals. List markers may be enclosed in parentheses or followed by a
1778single right-parentheses or period. They must be separated from the
1779text that follows by at least one space, and, if the list marker is a
1780capital letter with a period, by at least two spaces.[^2]
1782[^2]: The point of this rule is to ensure that normal paragraphs
1783 starting with people's initials, like
1785 B. Russell was an English philosopher.
1787 do not get treated as list items.
1789 This rule will not prevent
1793 from being interpreted as a list item. In this case, a backslash
1798The `fancy_lists` extension also allows '`#`' to be used as an
1799ordered list marker in place of a numeral:
1804#### Extension: `startnum` ####
1806Pandoc also pays attention to the type of list marker used, and to the
1807starting number, and both of these are preserved where possible in the
1808output format. Thus, the following yields a list with numbers followed
1809by a single parenthesis, starting with 9, and a sublist with lowercase
1819Pandoc will start a new list each time a different type of list
1820marker is used. So, the following will create three lists:
1827If default list markers are desired, use `#.`:
1834### Definition lists ###
1836#### Extension: `definition_lists` ####
1838Pandoc supports definition lists, using the syntax of
1839[PHP Markdown Extra] with some extensions.[^3]
1845 Term 2 with *inline markup*
1849 { some code, part of Definition 2 }
1851 Third paragraph of definition 2.
1853Each term must fit on one line, which may optionally be followed by
1854a blank line, and must be followed by one or more definitions.
1855A definition begins with a colon or tilde, which may be indented one
1858A term may have multiple definitions, and each definition may consist of one or
1859more block elements (paragraph, code block, list, etc.), each indented four
1860spaces or one tab stop. The body of the definition (including the first line,
1861aside from the colon or tilde) should be indented four spaces. However,
1862as with other markdown lists, you can "lazily" omit indentation except
1863at the beginning of a paragraph or other block element:
1868 with lazy continuation.
1870 Second paragraph of the definition.
1872If you leave space before the definition (as in the example above),
1873the text of the definition will be treated as a paragraph. In some
1874output formats, this will mean greater spacing between term/definition
1875pairs. For a more compact definition list, omit the space before the
1885Note that space between items in a definition list is required.
1886(A variant that loosens this requirement, but disallows "lazy"
1887hard wrapping, can be activated with `compact_definition_lists`: see
1888[Non-pandoc extensions], below.)
1890[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1892### Numbered example lists ###
1894#### Extension: `example_lists` ####
1896The special list marker `@` can be used for sequentially numbered
1897examples. The first list item with a `@` marker will be numbered '1',
1898the next '2', and so on, throughout the document. The numbered examples
1899need not occur in a single list; each new list using `@` will take up
1900where the last stopped. So, for example:
1902 (@) My first example will be numbered (1).
1903 (@) My second example will be numbered (2).
1905 Explanation of examples.
1907 (@) My third example will be numbered (3).
1909Numbered examples can be labeled and referred to elsewhere in the
1912 (@good) This is a good example.
1914 As (@good) illustrates, ...
1916The label can be any string of alphanumeric characters, underscores,
1920### Compact and loose lists ###
1922Pandoc behaves differently from `Markdown.pl` on some "edge
1923cases" involving lists. Consider this source:
1933Pandoc transforms this into a "compact list" (with no `<p>` tags around
1934"First", "Second", or "Third"), while markdown puts `<p>` tags around
1935"Second" and "Third" (but not "First"), because of the blank space
1936around "Third". Pandoc follows a simple rule: if the text is followed by
1937a blank line, it is treated as a paragraph. Since "Second" is followed
1938by a list, and not a blank line, it isn't treated as a paragraph. The
1939fact that the list is followed by a blank line is irrelevant. (Note:
1940Pandoc works this way even when the `markdown_strict` format is specified. This
1941behavior is consistent with the official markdown syntax description,
1942even though it is different from that of `Markdown.pl`.)
1945### Ending a list ###
1947What if you want to put an indented code block after a list?
1954Trouble! Here pandoc (like other markdown implementations) will treat
1955`{ my code block }` as the second paragraph of item two, and not as
1958To "cut off" the list after item two, you can insert some non-indented
1959content, like an HTML comment, which won't produce visible output in
1965 <!-- end of list -->
1969You can use the same trick if you want two consecutive lists instead
1985A line containing a row of three or more `*`, `-`, or `_` characters
1986(optionally separated by spaces) produces a horizontal rule:
1996Four kinds of tables may be used. The first three kinds presuppose the use of
1997a fixed-width font, such as Courier. The fourth kind can be used with
1998proportionally spaced fonts, as it does not require lining up columns.
2000#### Extension: `table_captions` ####
2002A caption may optionally be provided with all 4 kinds of tables (as
2003illustrated in the examples below). A caption is a paragraph beginning
2004with the string `Table:` (or just `:`), which will be stripped off.
2005It may appear either before or after the table.
2007#### Extension: `simple_tables` ####
2009Simple tables look like this:
2011 Right Left Center Default
2012 ------- ------ ---------- -------
2017 Table: Demonstration of simple table syntax.
2019The headers and table rows must each fit on one line. Column
2020alignments are determined by the position of the header text relative
2021to the dashed line below it:[^4]
2023 - If the dashed line is flush with the header text on the right side
2024 but extends beyond it on the left, the column is right-aligned.
2025 - If the dashed line is flush with the header text on the left side
2026 but extends beyond it on the right, the column is left-aligned.
2027 - If the dashed line extends beyond the header text on both sides,
2028 the column is centered.
2029 - If the dashed line is flush with the header text on both sides,
2030 the default alignment is used (in most cases, this will be left).
2032[^4]: This scheme is due to Michel Fortin, who proposed it on the
2033 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
2035The table must end with a blank line, or a line of dashes followed by
2038The column headers may be omitted, provided a dashed line is used
2039to end the table. For example:
2041 ------- ------ ---------- -------
2045 ------- ------ ---------- -------
2047When headers are omitted, column alignments are determined on the basis
2048of the first line of the table body. So, in the tables above, the columns
2049would be right, left, center, and right aligned, respectively.
2051#### Extension: `multiline_tables` ####
2053Multiline tables allow headers and table rows to span multiple lines
2054of text (but cells that span multiple columns or rows of the table are
2055not supported). Here is an example:
2057 -------------------------------------------------------------
2058 Centered Default Right Left
2059 Header Aligned Aligned Aligned
2060 ----------- ------- --------------- -------------------------
2061 First row 12.0 Example of a row that
2062 spans multiple lines.
2064 Second row 5.0 Here's another one. Note
2065 the blank line between
2067 -------------------------------------------------------------
2069 Table: Here's the caption. It, too, may span
2072These work like simple tables, but with the following differences:
2074 - They must begin with a row of dashes, before the header text
2075 (unless the headers are omitted).
2076 - They must end with a row of dashes, then a blank line.
2077 - The rows must be separated by blank lines.
2079In multiline tables, the table parser pays attention to the widths of
2080the columns, and the writers try to reproduce these relative widths in
2081the output. So, if you find that one of the columns is too narrow in the
2082output, try widening it in the markdown source.
2084Headers may be omitted in multiline tables as well as simple tables:
2086 ----------- ------- --------------- -------------------------
2087 First row 12.0 Example of a row that
2088 spans multiple lines.
2090 Second row 5.0 Here's another one. Note
2091 the blank line between
2093 ----------- ------- --------------- -------------------------
2095 : Here's a multiline table without headers.
2097It is possible for a multiline table to have just one row, but the row
2098should be followed by a blank line (and then the row of dashes that ends
2099the table), or the table may be interpreted as a simple table.
2101#### Extension: `grid_tables` ####
2103Grid tables look like this:
2105 : Sample grid table.
2107 +---------------+---------------+--------------------+
2108 | Fruit | Price | Advantages |
2109 +===============+===============+====================+
2110 | Bananas | $1.34 | - built-in wrapper |
2111 | | | - bright color |
2112 +---------------+---------------+--------------------+
2113 | Oranges | $2.10 | - cures scurvy |
2115 +---------------+---------------+--------------------+
2117The row of `=`s separates the header from the table body, and can be
2118omitted for a headerless table. The cells of grid tables may contain
2119arbitrary block elements (multiple paragraphs, code blocks, lists,
2120etc.). Alignments are not supported, nor are cells that span multiple
2121columns or rows. Grid tables can be created easily using [Emacs table mode].
2123[Emacs table mode]: http://table.sourceforge.net/
2125#### Extension: `pipe_tables` ####
2127Pipe tables look like this:
2129 | Right | Left | Default | Center |
2130 |------:|:-----|---------|:------:|
2131 | 12 | 12 | 12 | 12 |
2132 | 123 | 123 | 123 | 123 |
2135 : Demonstration of pipe table syntax.
2137The syntax is identical to [PHP Markdown Extra tables]. The beginning and
2138ending pipe characters are optional, but pipes are required between all
2139columns. The colons indicate column alignment as shown. The header
2140cannot be omitted. To simulate a headerless table, include a header
2143Since the pipes indicate column boundaries, columns need not be vertically
2144aligned, as they are in the above example. So, this is a perfectly
2145legal (though ugly) pipe table:
2153The cells of pipe tables cannot contain block elements like paragraphs
2154and lists, and cannot span multiple lines. Note also that in LaTeX/PDF
2155output, the cells produced by pipe tables will not wrap, since there
2156is no information available about relative widths. If you want content
2157to wrap within cells, use multiline or grid tables.
2159Note: Pandoc also recognizes pipe tables of the following
2160form, as can be produced by Emacs' orgtbl-mode:
2167The difference is that `+` is used instead of `|`. Other orgtbl features
2168are not supported. In particular, to get non-default column alignment,
2169you'll need to add colons as above.
2171[PHP Markdown Extra tables]: https://michelf.ca/projects/php-markdown/extra/#table
2176#### Extension: `pandoc_title_block` ####
2178If the file begins with a title block
2181 % author(s) (separated by semicolons)
2184it will be parsed as bibliographic information, not regular text. (It
2185will be used, for example, in the title of standalone LaTeX or HTML
2186output.) The block may contain just a title, a title and an author,
2187or all three elements. If you want to include an author but no
2188title, or a title and a date but no author, you need a blank line:
2197The title may occupy multiple lines, but continuation lines must
2198begin with leading space, thus:
2203If a document has multiple authors, the authors may be put on
2204separate lines with leading space, or separated by semicolons, or
2205both. So, all of the following are equivalent:
2210 % Author One; Author Two
2215The date must fit on one line.
2217All three metadata fields may contain standard inline formatting
2218(italics, links, footnotes, etc.).
2220Title blocks will always be parsed, but they will affect the output only
2221when the `--standalone` (`-s`) option is chosen. In HTML output, titles
2222will appear twice: once in the document head -- this is the title that
2223will appear at the top of the window in a browser -- and once at the
2224beginning of the document body. The title in the document head can have
2225an optional prefix attached (`--title-prefix` or `-T` option). The title
2226in the body appears as an H1 element with class "title", so it can be
2227suppressed or reformatted with CSS. If a title prefix is specified with
2228`-T` and no title block appears in the document, the title prefix will
2229be used by itself as the HTML title.
2231The man page writer extracts a title, man page section number, and
2232other header and footer information from the title line. The title
2233is assumed to be the first word on the title line, which may optionally
2234end with a (single-digit) section number in parentheses. (There should
2235be no space between the title and the parentheses.) Anything after
2236this is assumed to be additional footer and header text. A single pipe
2237character (`|`) should be used to separate the footer text from the header
2242will yield a man page with the title `PANDOC` and section 1.
2244 % PANDOC(1) Pandoc User Manuals
2246will also have "Pandoc User Manuals" in the footer.
2248 % PANDOC(1) Pandoc User Manuals | Version 4.0
2250will also have "Version 4.0" in the header.
2252#### Extension: `yaml_metadata_block` ####
2254A YAML metadata block is a valid YAML object, delimited by a line of three
2255hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
2256(`...`) at the bottom. A YAML metadata block may occur anywhere in the
2257document, but if it is not at the beginning, it must be preceded by a blank
2258line. (Note that, because of the way pandoc concatenates input files when
2259several are provided, you may also keep the metadata in a separate YAML file
2260and pass it to pandoc as an argument, along with your markdown files:
2262 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
2264Just be sure that the YAML file begins with `---` and ends with `---` or
2267Metadata will be taken from the fields of the YAML object and added to any
2268existing document metadata. Metadata can contain lists and objects (nested
2269arbitrarily), but all string scalars will be interpreted as markdown. Fields
2270with names ending in an underscore will be ignored by pandoc. (They may be
2271given a role by external processors.)
2273A document may contain multiple metadata blocks. The metadata fields will
2274be combined through a *left-biased union*: if two metadata blocks attempt
2275to set the same field, the value from the first block will be taken.
2277When pandoc is used with `-t markdown` to create a markdown document,
2278a YAML metadata block will be produced only if the `-s/--standalone`
2279option is used. All of the metadata will appear in a single block
2280at the beginning of the document.
2282Note that YAML escaping rules must be followed. Thus, for example,
2283if a title contains a colon, it must be quoted. The pipe character
2284(`|`) can be used to begin an indented block that will be interpreted
2285literally, without need for escaping. This form is necessary
2286when the field contains blank lines:
2289 title: 'This is the title: it contains a colon'
2292 affiliation: University of Somewhere
2294 affiliation: University of Nowhere
2295 tags: [nothing, nothingness]
2297 This is the abstract.
2299 It consists of two paragraphs.
2302Template variables will be set automatically from the metadata. Thus, for
2303example, in writing HTML, the variable `abstract` will be set to the HTML
2304equivalent of the markdown in the `abstract` field:
2306 <p>This is the abstract.</p>
2307 <p>It consists of two paragraphs.</p>
2309Note: The `author` variable in the default templates expects a simple list or
2310string. To use the structured authors in the example, you would need a
2311custom template. For example:
2315 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
2325#### Extension: `all_symbols_escapable` ####
2327Except inside a code block or inline code, any punctuation or space
2328character preceded by a backslash will be treated literally, even if it
2329would normally indicate formatting. Thus, for example, if one writes
2339 <strong>hello</strong>
2341This rule is easier to remember than standard markdown's rule,
2342which allows only the following characters to be backslash-escaped:
2346(However, if the `markdown_strict` format is used, the standard markdown rule
2349A backslash-escaped space is parsed as a nonbreaking space. It will
2350appear in TeX output as `~` and in HTML and XML as `\ ` or
2353A backslash-escaped newline (i.e. a backslash occurring at the end of
2354a line) is parsed as a hard line break. It will appear in TeX output as
2355`\\` and in HTML as `<br />`. This is a nice alternative to
2356markdown's "invisible" way of indicating hard line breaks using
2357two trailing spaces on a line.
2359Backslash escapes do not work in verbatim contexts.
2366If the `--smart` option is specified, pandoc will produce typographically
2367correct output, converting straight quotes to curly quotes, `---` to
2368em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
2369are inserted after certain abbreviations, such as "Mr."
2371Note: if your LaTeX template calls for the [`csquotes`] package, pandoc will
2372detect this automatically and use `\enquote{...}` for quoted text.
2379To *emphasize* some text, surround it with `*`s or `_`, like this:
2381 This text is _emphasized with underscores_, and this
2382 is *emphasized with asterisks*.
2384Double `*` or `_` produces **strong emphasis**:
2386 This is **strong emphasis** and __with underscores__.
2388A `*` or `_` character surrounded by spaces, or backslash-escaped,
2389will not trigger emphasis:
2391 This is * not emphasized *, and \*neither is this\*.
2393#### Extension: `intraword_underscores` ####
2395Because `_` is sometimes used inside words and identifiers,
2396pandoc does not interpret a `_` surrounded by alphanumeric
2397characters as an emphasis marker. If you want to emphasize
2398just part of a word, use `*`:
2400 feas*ible*, not feas*able*.
2405#### Extension: `strikeout` ####
2407To strikeout a section of text with a horizontal line, begin and end it
2408with `~~`. Thus, for example,
2410 This ~~is deleted text.~~
2413### Superscripts and subscripts ###
2415#### Extension: `superscript`, `subscript` ####
2417Superscripts may be written by surrounding the superscripted text by `^`
2418characters; subscripts may be written by surrounding the subscripted
2419text by `~` characters. Thus, for example,
2421 H~2~O is a liquid. 2^10^ is 1024.
2423If the superscripted or subscripted text contains spaces, these spaces
2424must be escaped with backslashes. (This is to prevent accidental
2425superscripting and subscripting through the ordinary use of `~` and `^`.)
2426Thus, if you want the letter P with 'a cat' in subscripts, use
2427`P~a\ cat~`, not `P~a cat~`.
2432To make a short span of text verbatim, put it inside backticks:
2434 What is the difference between `>>=` and `>>`?
2436If the verbatim text includes a backtick, use double backticks:
2438 Here is a literal backtick `` ` ``.
2440(The spaces after the opening backticks and before the closing
2441backticks will be ignored.)
2443The general rule is that a verbatim span starts with a string
2444of consecutive backticks (optionally followed by a space)
2445and ends with a string of the same number of backticks (optionally
2446preceded by a space).
2448Note that backslash-escapes (and other markdown constructs) do not
2449work in verbatim contexts:
2451 This is a backslash followed by an asterisk: `\*`.
2453#### Extension: `inline_code_attributes` ####
2455Attributes can be attached to verbatim text, just as with
2456[fenced code blocks]:
2462To write small caps, you can use an HTML span tag:
2464 <span style="font-variant:small-caps;">Small caps</span>
2466(The semicolon is optional and there may be space after the
2467colon.) This will work in all output formats that support small caps.
2472#### Extension: `tex_math_dollars` ####
2474Anything between two `$` characters will be treated as TeX math. The
2475opening `$` must have a non-space character immediately to its right,
2476while the closing `$` must have a non-space character immediately to its
2477left, and must not be followed immediately by a digit. Thus,
2478`$20,000 and $30,000` won't parse as math. If for some reason
2479you need to enclose text in literal `$` characters, backslash-escape
2480them and they won't be treated as math delimiters.
2482TeX math will be printed in all output formats. How it is rendered
2483depends on the output format:
2485Markdown, LaTeX, Emacs Org mode, ConTeXt
2486 ~ It will appear verbatim between `$` characters.
2489 ~ It will be rendered using an [interpreted text role `:math:`].
2492 ~ It will be rendered as `latexmath:[...]`.
2495 ~ It will be rendered inside a `@math` command.
2498 ~ It will be rendered verbatim without `$`'s.
2501 ~ It will be rendered inside `<math>` tags.
2504 ~ It will be rendered inside `<span class="math">` tags.
2506RTF, OpenDocument, ODT
2507 ~ It will be rendered, if possible, using unicode characters,
2508 and will otherwise appear verbatim.
2511 ~ If the `--mathml` flag is used, it will be rendered using MathML
2512 in an `inlineequation` or `informalequation` tag. Otherwise it
2513 will be rendered, if possible, using unicode characters.
2516 ~ It will be rendered using OMML math markup.
2519 ~ If the `--webtex` option is used, formulas are rendered as images
2520 using Google Charts or other compatible web service, downloaded
2521 and embedded in the e-book. Otherwise, they will appear verbatim.
2523HTML, Slidy, DZSlides, S5, EPUB
2524 ~ The way math is rendered in HTML will depend on the
2525 command-line options selected:
2527 1. The default is to render TeX math as far as possible using unicode
2528 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2529 are put inside a `span` with `class="math"`, so that they may be
2530 styled differently from the surrounding text if needed.
2532 2. If the `--latexmathml` option is used, TeX math will be displayed
2533 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2534 The [LaTeXMathML] script will be used to render it as formulas.
2535 (This trick does not work in all browsers, but it works in Firefox.
2536 In browsers that do not support LaTeXMathML, TeX math will appear
2537 verbatim between `$` characters.)
2539 3. If the `--jsmath` option is used, TeX math will be put inside
2540 `<span>` tags (for inline math) or `<div>` tags (for display math)
2541 with class `math`. The [jsMath] script will be used to render
2544 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2545 be called to generate images for each TeX formula. This should
2546 work in all browsers. The `--mimetex` option takes an optional URL
2547 as argument. If no URL is specified, it will be assumed that the
2548 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2550 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2551 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2552 be processed by [gladTeX], which will produce image files for each
2553 formula and an HTML file with links to these images. So, the
2556 pandoc -s --gladtex myfile.txt -o myfile.htex
2557 gladtex -d myfile-images myfile.htex
2558 # produces myfile.html and images in myfile-images
2560 6. If the `--webtex` option is used, TeX formulas will be converted
2561 to `<img>` tags that link to an external script that converts
2562 formulas to images. The formula will be URL-encoded and concatenated
2563 with the URL provided. If no URL is specified, the Google Chart
2564 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2566 7. If the `--mathjax` option is used, TeX math will be displayed
2567 between `\(...\)` (for inline math) or `\[...\]` (for display
2568 math) and put in `<span>` tags with class `math`.
2569 The [MathJax] script will be used to render it as formulas.
2571[interpreted text role `:math:`]: http://docutils.sourceforge.net/docs/ref/rst/roles.html#math
2576#### Extension: `raw_html` ####
2578Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2579(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2580literally). (Technically this is not an extension, since standard
2581markdown allows it, but it has been made an extension so that it can
2582be disabled if desired.)
2584The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2585DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2588#### Extension: `markdown_in_html_blocks` ####
2590Standard markdown allows you to include HTML "blocks": blocks
2591of HTML between balanced tags that are separated from the surrounding text
2592with blank lines, and start and end at the left margin. Within
2593these blocks, everything is interpreted as HTML, not markdown;
2594so (for example), `*` does not signify emphasis.
2596Pandoc behaves this way when the `markdown_strict` format is used; but
2597by default, pandoc interprets material between HTML block tags as markdown.
2598Thus, for example, Pandoc will turn
2603 <td>[a link](http://google.com)</td>
2611 <td><em>one</em></td>
2612 <td><a href="http://google.com">a link</a></td>
2616whereas `Markdown.pl` will preserve it as is.
2618There is one exception to this rule: text between `<script>` and
2619`<style>` tags is not interpreted as markdown.
2621This departure from standard markdown should make it easier to mix
2622markdown with HTML block elements. For example, one can surround
2623a block of markdown text with `<div>` tags without preventing it
2624from being interpreted as markdown.
2626#### Extension: `native_divs` ####
2628Use native pandoc `Div` blocks for content inside `<div>` tags.
2629For the most part this should give the same output as
2630`markdown_in_html_blocks`, but it makes it easier to write pandoc
2631filters to manipulate groups of blocks.
2633#### Extension: `native_spans` ####
2635Use native pandoc `Span` blocks for content inside `<span>` tags.
2636For the most part this should give the same output as `raw_html`,
2637but it makes it easier to write pandoc filters to manipulate groups
2643#### Extension: `raw_tex` ####
2645In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2646included in a document. Inline TeX commands will be preserved and passed
2647unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2648LaTeX to include BibTeX citations:
2650 This result was proved in \cite{jones.1967}.
2652Note that in LaTeX environments, like
2654 \begin{tabular}{|l|l|}\hline
2655 Age & Frequency \\ \hline
2658 36--45 & 22 \\ \hline
2661the material between the begin and end tags will be interpreted as raw
2662LaTeX, not as markdown.
2664Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2670#### Extension: `latex_macros` ####
2672For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2673`\renewcommand` definitions and apply the resulting macros to all LaTeX
2674math. So, for example, the following will work in all output formats,
2677 \newcommand{\tuple}[1]{\langle #1 \rangle}
2681In LaTeX output, the `\newcommand` definition will simply be passed
2682unchanged to the output.
2688Markdown allows links to be specified in several ways.
2690### Automatic links ###
2692If you enclose a URL or email address in pointy brackets, it
2696 <sam@green.eggs.ham>
2700An inline link consists of the link text in square brackets,
2701followed by the URL in parentheses. (Optionally, the URL can
2702be followed by a link title, in quotes.)
2704 This is an [inline link](/url), and here's [one with
2705 a title](http://fsf.org "click here for a good time!").
2707There can be no space between the bracketed part and the parenthesized part.
2708The link text can contain formatting (such as emphasis), but the title cannot.
2710Email addresses in inline links are not autodetected, so they have to be
2711prefixed with `mailto`:
2713 [Write me!](mailto:sam@green.eggs.ham)
2715### Reference links ###
2717An *explicit* reference link has two parts, the link itself and the link
2718definition, which may occur elsewhere in the document (either
2719before or after the link).
2721The link consists of link text in square brackets, followed by a label in
2722square brackets. (There can be space between the two.) The link definition
2723consists of the bracketed label, followed by a colon and a space, followed by
2724the URL, and optionally (after a space) a link title either in quotes or in
2725parentheses. The label must not be parseable as a citation (assuming
2726the `citations` extension is enabled): citations take precedence over
2729Here are some examples:
2731 [my label 1]: /foo/bar.html "My title, optional"
2733 [my label 3]: http://fsf.org (The free software foundation)
2734 [my label 4]: /bar#special 'A title in single quotes'
2736The URL may optionally be surrounded by angle brackets:
2738 [my label 5]: <http://foo.bar.baz>
2740The title may go on the next line:
2742 [my label 3]: http://fsf.org
2743 "The free software foundation"
2745Note that link labels are not case sensitive. So, this will work:
2747 Here is [my link][FOO]
2751In an *implicit* reference link, the second pair of brackets is
2756 [my website]: http://foo.bar.baz
2758Note: In `Markdown.pl` and most other markdown implementations,
2759reference link definitions cannot occur in nested constructions
2760such as list items or block quotes. Pandoc lifts this arbitrary
2761seeming restriction. So the following is fine in pandoc, though
2762not in most other implementations:
2768#### Extension: `shortcut_reference_links` ####
2770In a *shortcut* reference link, the second pair of brackets may
2775 [my website]: http://foo.bar.baz
2777### Internal links ###
2779To link to another section of the same document, use the automatically
2780generated identifier (see [Header identifiers]). For example:
2782 See the [Introduction](#introduction).
2786 See the [Introduction].
2788 [Introduction]: #introduction
2790Internal links are currently supported for HTML formats (including
2791HTML slide shows and EPUB), LaTeX, and ConTeXt.
2796A link immediately preceded by a `!` will be treated as an image.
2797The link text will be used as the image's alt text:
2799 
2803 [movie reel]: movie.gif
2805#### Extension: `implicit_figures` ####
2807An image occurring by itself in a paragraph will be rendered as
2808a figure with a caption.[^5] (In LaTeX, a figure environment will be
2809used; in HTML, the image will be placed in a `div` with class
2810`figure`, together with a caption in a `p` with class `caption`.)
2811The image's alt text will be used as the caption.
2813 
2815[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2816 ODT. In those formats, you'll just get an image in a paragraph by
2817 itself, with no caption.
2819If you just want a regular inline image, just make sure it is not
2820the only thing in the paragraph. One way to do this is to insert a
2821nonbreaking space after the image:
2823 \
2829#### Extension: `footnotes` ####
2831Pandoc's markdown allows footnotes, using the following syntax:
2833 Here is a footnote reference,[^1] and another.[^longnote]
2835 [^1]: Here is the footnote.
2837 [^longnote]: Here's one with multiple blocks.
2839 Subsequent paragraphs are indented to show that they
2840 belong to the previous footnote.
2844 The whole paragraph can be indented, or just the first
2845 line. In this way, multi-paragraph footnotes work like
2846 multi-paragraph list items.
2848 This paragraph won't be part of the note, because it
2851The identifiers in footnote references may not contain spaces, tabs,
2852or newlines. These identifiers are used only to correlate the
2853footnote reference with the note itself; in the output, footnotes
2854will be numbered sequentially.
2856The footnotes themselves need not be placed at the end of the
2857document. They may appear anywhere except inside other block elements
2858(lists, block quotes, tables, etc.).
2860#### Extension: `inline_notes` ####
2862Inline footnotes are also allowed (though, unlike regular notes,
2863they cannot contain multiple paragraphs). The syntax is as follows:
2865 Here is an inline note.^[Inlines notes are easier to write, since
2866 you don't have to pick an identifier and move down to type the
2869Inline and regular footnotes may be mixed freely.
2875#### Extension: `citations` ####
2877Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2878citations and a bibliography in a number of styles. Basic usage is
2880 pandoc --filter pandoc-citeproc myinput.txt
2882In order to use this feature, you will need to specify a bibliography file
2883using the `bibliography` metadata field in a YAML metadata section, or
2884`--bibliography` command line argument. You can supply multiple `--bibliography`
2885arguments or set `bibliography` metadata field to YAML array, if you want to
2886use multiple bibliography files.
2887The bibliography may have any of these formats:
2889 Format File extension
2890 ------------ --------------
2903Note that `.bib` can be used with both BibTeX and BibLaTeX files;
2904use `.bibtex` to force BibTeX.
2906Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`
2907can produce `.json` and `.yaml` files from any of the supported formats.
2909In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc parses
2910a subset of LaTeX markup; in CSL YAML databases, pandoc markdown; and in CSL JSON databases, an [HTML-like markup][CSL markup specs]:
2918`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`
2927`<span class="nocase">...</span>`
2928: prevent a phrase from being capitalized as title case
2930`pandoc-citeproc -j` and `-y` interconvert the CSL JSON
2931and CSL YAML formats as far as possible.
2933As an alternative to specifying a bibliography file, you can include
2934the citation data directly in the `references` field of the
2935document's YAML metadata. The field should contain an array of
2936YAML-encoded references, for example:
2940 - type: article-journal
2952 title: 'Molecular structure of nucleic acids: a structure for deoxyribose
2954 title-short: Molecular structure of nucleic acids
2955 container-title: Nature
2959 DOI: 10.1038/171737a0
2960 URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
2964(`pandoc-citeproc --bib2yaml` can produce these from a bibliography file in one
2965of the supported formats.)
2967Citations and references can be formatted using any style supported by the
2968[Citation Style Language], listed in the [Zotero Style Repository].
2969These files are specified using the `--csl` option or the `csl` metadata field.
2970By default, `pandoc-citeproc` will use the [Chicago Manual of Style] author-date
2971format. The CSL project provides further information on [finding and editing styles].
2973Citations go inside square brackets and are separated by semicolons.
2974Each citation must have a key, composed of '@' + the citation
2975identifier from the database, and may optionally have a prefix,
2976a locator, and a suffix. The citation key must begin with a letter, digit,
2977or `_`, and may contain alphanumerics, `_`, and internal punctuation
2978characters (`:.#$%&-+?<>~/`). Here are some examples:
2980 Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
2982 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2984 Blah blah [@smith04; @doe99].
2986`pandoc-citeproc` detects locator terms in the [CSL locale files].
2987Either abbreviated or unabbreviated forms are accepted. In the `en-US`
2988locale, locator terms can be written in either singular or plural forms,
2989as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
2990`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`, `fol.`/`fols.`;
2991`number`, `no.`/`nos.`; `line`, `l.`/`ll.`; `note`, `n.`/`nn.`; `opus`,
2992`op.`/`opp.`; `page`, `p.`/`pp.`; `paragraph`, `para.`/`paras.`; `part`,
2993`pt.`/`pts.`; `section`, `sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`;
2994`verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
2995locator term is used, "page" is assumed.
2997A minus sign (`-`) before the `@` will suppress mention of
2998the author in the citation. This can be useful when the
2999author is already mentioned in the text:
3001 Smith says blah [-@smith04].
3003You can also write an in-text citation, as follows:
3007 @smith04 [p. 33] says blah.
3009If the style calls for a list of works cited, it will be placed
3010at the end of the document. Normally, you will want to end your
3011document with an appropriate header:
3017The bibliography will be inserted after this header. Note that
3018the `unnumbered` class will be added to this header, so that the
3019section will not be numbered.
3021If you want to include items in the bibliography without actually
3022citing them in the body text, you can define a dummy `nocite` metadata
3023field and put the citations there:
3032In this example, the document will contain a citation for `item3`
3033only, but the bibliography will contain entries for `item1`, `item2`, and
3036For LaTeX or PDF output, you can also use [`natbib`] or [`biblatex`]
3037to render bibliography. In order to do so, specify bibliography files as
3038outlined above, and add `--natbib` or `--biblatex` argument to `pandoc`
3039invocation. Bear in mind that bibliography files have to be in respective
3040format (either BibTeX or BibLaTeX).
3042[CSL markup specs]: http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
3043[Chicago Manual of Style]: http://chicagomanualofstyle.org
3044[Citation Style Language]: http://citationstyles.org
3045[Zotero Style Repository]: https://www.zotero.org/styles
3046[finding and editing styles]: http://citationstyles.org/styles/
3047[CSL locale files]: https://github.com/citation-style-language/locales
3049Non-pandoc extensions
3050---------------------
3052The following markdown syntax extensions are not enabled by default
3053in pandoc, but may be enabled by adding `+EXTENSION` to the format
3054name, where `EXTENSION` is the name of the extension. Thus, for
3055example, `markdown+hard_line_breaks` is markdown with hard line breaks.
3057#### Extension: `lists_without_preceding_blankline` ####
3059Allow a list to occur right after a paragraph, with no intervening
3062#### Extension: `hard_line_breaks` ####
3064Causes all newlines within a paragraph to be interpreted as hard line
3065breaks instead of spaces.
3067#### Extension: `ignore_line_breaks` ####
3069Causes newlines within a paragraph to be ignored, rather than being
3070treated as spaces or as hard line breaks. This option is intended for
3071use with East Asian languages where spaces are not used between words,
3072but text is divided into lines for readability.
3074#### Extension: `tex_math_single_backslash` ####
3076Causes anything between `\(` and `\)` to be interpreted as inline
3077TeX math, and anything between `\[` and `\]` to be interpreted
3078as display TeX math. Note: a drawback of this extension is that
3079it precludes escaping `(` and `[`.
3081#### Extension: `tex_math_double_backslash` ####
3083Causes anything between `\\(` and `\\)` to be interpreted as inline
3084TeX math, and anything between `\\[` and `\\]` to be interpreted
3087#### Extension: `markdown_attribute` ####
3089By default, pandoc interprets material inside block-level tags as markdown.
3090This extension changes the behavior so that markdown is only parsed
3091inside block-level tags if the tags have the attribute `markdown=1`.
3093#### Extension: `mmd_title_block` ####
3095Enables a [MultiMarkdown] style title block at the top of
3096the document, for example:
3100 Date: September 1, 2008
3101 Comment: This is a sample mmd title block, with
3102 a field spanning multiple lines.
3104See the MultiMarkdown documentation for details. If `pandoc_title_block` or
3105`yaml_metadata_block` is enabled, it will take precedence over
3108[MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
3110#### Extension: `abbreviations` ####
3112Parses PHP Markdown Extra abbreviation keys, like
3114 *[HTML]: Hypertext Markup Language
3116Note that the pandoc document model does not support
3117abbreviations, so if this extension is enabled, abbreviation keys are
3118simply skipped (as opposed to being parsed as paragraphs).
3120#### Extension: `autolink_bare_uris` ####
3122Makes all absolute URIs into links, even when not surrounded by
3123pointy braces `<...>`.
3125#### Extension: `ascii_identifiers` ####
3127Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
3128Accents are stripped off of accented latin letters, and non-latin
3131#### Extension: `link_attributes` ####
3133Parses multimarkdown style key-value attributes on link and image references.
3134Note that pandoc's internal document model provides nowhere to put
3135these, so they are presently just ignored.
3137#### Extension: `mmd_header_identifiers` ####
3139Parses multimarkdown style header identifiers (in square brackets,
3140after the header but before any trailing `#`s in an ATX header).
3142#### Extension: `compact_definition_lists` ####
3144Activates the definition list syntax of pandoc 1.12.x and earlier.
3145This syntax differs from the one described above under [Definition lists]
3148 - No blank line is required between consecutive items of the
3150 - To get a "tight" or "compact" list, omit space between consecutive
3151 items; the space between a term and its definition does not affect
3153 - Lazy wrapping of paragraphs is not allowed: the entire definition must
3154 be indented four spaces.[^6]
3156[^6]: To see why laziness is incompatible with relaxing the requirement
3157 of a blank line between items, consider the following example:
3164 Is this a single list item with two definitions of "bar," the first of
3165 which is lazily wrapped, or two list items? To remove the ambiguity
3166 we must either disallow lazy wrapping or require a blank line between
3172In addition to pandoc's extended markdown, the following markdown
3173variants are supported:
3175`markdown_phpextra` (PHP Markdown Extra)
3176: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
3177 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
3178 `header_attributes`, `abbreviations`, `shortcut_reference_links`.
3180`markdown_github` (GitHub-Flavored Markdown)
3181: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
3182 `fenced_code_blocks`, `auto_identifiers`,
3183 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
3184 `intraword_underscores`, `strikeout`, `hard_line_breaks`,
3185 `shortcut_reference_links`.
3187`markdown_mmd` (MultiMarkdown)
3188: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
3189 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
3190 `mmd_title_block`, `footnotes`, `definition_lists`,
3191 `all_symbols_escapable`, `implicit_header_references`,
3192 `auto_identifiers`, `mmd_header_identifiers`,
3193 `shortcut_reference_links`.
3195`markdown_strict` (Markdown.pl)
3198Extensions with formats other than markdown
3199-------------------------------------------
3201Some of the extensions discussed above can be used with formats
3204* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
3205 and `textile` input (and is used by default).
3207* `tex_math_dollars`, `tex_math_single_backslash`, and
3208 `tex_math_double_backslash` can be used with `html` input.
3209 (This is handy for reading web pages formatted using MathJax,
3212Producing slide shows with Pandoc
3213=================================
3215You can use Pandoc to produce an HTML + javascript slide presentation
3216that can be viewed via a web browser. There are five ways to do this,
3217using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
3218You can also produce a PDF slide show using LaTeX [`beamer`].
3220Here's the markdown source for a simple slide show, `habits.txt`:
3247 
3254To produce an HTML/javascript slide show, simply type
3256 pandoc -t FORMAT -s habits.txt -o habits.html
3258where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
3260For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
3261`-s/--standalone` option embeds a link to javascripts and CSS files, which are
3262assumed to be available at the relative path `s5/default` (for S5), `slideous`
3263(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
3264`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
3265`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
3266above.) For DZSlides, the (relatively short) javascript and css are included in
3269With all HTML slide formats, the `--self-contained` option can be used to
3270produce a single file that contains all of the data necessary to display the
3271slide show, including linked scripts, stylesheets, images, and videos.
3273To produce a PDF slide show using beamer, type
3275 pandoc -t beamer habits.txt -o habits.pdf
3277Note that a reveal.js slide show can also be converted to a PDF
3278by printing it to a file from the browser.
3280Structuring the slide show
3281--------------------------
3283By default, the *slide level* is the highest header level in
3284the hierarchy that is followed immediately by content, and not another
3285header, somewhere in the document. In the example above, level 1 headers
3286are always followed by level 2 headers, which are followed by content,
3287so 2 is the slide level. This default can be overridden using
3288the `--slide-level` option.
3290The document is carved up into slides according to the following
3293 * A horizontal rule always starts a new slide.
3295 * A header at the slide level always starts a new slide.
3297 * Headers *below* the slide level in the hierarchy create
3298 headers *within* a slide.
3300 * Headers *above* the slide level in the hierarchy create
3301 "title slides," which just contain the section title
3302 and help to break the slide show into sections.
3304 * A title page is constructed automatically from the document's title
3305 block, if present. (In the case of beamer, this can be disabled
3306 by commenting out some lines in the default template.)
3308These rules are designed to support many different styles of slide show. If
3309you don't care about structuring your slides into sections and subsections,
3310you can just use level 1 headers for all each slide. (In that case, level 1
3311will be the slide level.) But you can also structure the slide show into
3312sections, as in the example above.
3314Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
3315layout will be produced, with level 1 headers building horizontally
3316and level 2 headers building vertically. It is not recommended that
3317you use deeper nesting of section levels with reveal.js.
3322By default, these writers produce lists that display "all at once."
3323If you want your lists to display incrementally (one item at a time),
3324use the `-i` option. If you want a particular list to depart from the
3325default (that is, to display incrementally without the `-i` option and
3326all at once with the `-i` option), put it in a block quote:
3331In this way incremental and nonincremental lists can be mixed in
3337You can add "pauses" within a slide by including a paragraph containing
3338three dots, separated by spaces:
3340 # Slide with a pause
3342 content before the pause
3346 content after the pause
3351You can change the style of HTML slides by putting customized CSS files
3352in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
3353or `$DATADIR/slideous` (for Slideous),
3354where `$DATADIR` is the user data directory (see `--data-dir`, above).
3355The originals may be found in pandoc's system data directory (generally
3356`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
3357files it does not find in the user data directory.
3359For dzslides, the CSS is included in the HTML file itself, and may
3362For reveal.js, themes can be used by setting the `theme` variable,
3367Or you can specify a custom stylesheet using the `--css` option.
3369To style beamer slides, you can specify a beamer "theme" or "colortheme"
3370using the `-V` option:
3372 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
3374Note that header attributes will turn into slide attributes
3375(on a `<div>` or `<section>`) in HTML slide formats, allowing you
3376to style individual slides. In beamer, the only header attribute
3377that affects slides is the `allowframebreaks` class, which sets the
3378`allowframebreaks` option, causing multiple slides to be created
3379if the content overfills the frame. This is recommended especially for
3382 # References {.allowframebreaks}
3387reveal.js has good support for speaker notes. You can add notes to your
3388markdown document thus:
3393 - It can contain markdown
3398To show the notes window, press `s` while viewing the presentation.
3399Notes are not yet supported for other slide formats, but the notes
3400will not appear on the slides themselves.
3402Marking frames "fragile" in beamer
3403----------------------------------
3405Sometimes it is necessary to add the LaTeX `[fragile]` option to
3406a frame in beamer (for example, when using the `minted` environment).
3407This can be forced by adding the `fragile` class to the header
3408introducing the slide:
3410 # Fragile slide {.fragile}
3415EPUB metadata may be specified using the `--epub-metadata` option, but
3416if the source document is markdown, it is better to use a [YAML metadata
3417block][Extension: `yaml_metadata_block`]. Here is an example:
3424 text: An investigation of metadata
3432 text: doi:10.234234.234/33
3434 rights: © 2007 John Smith, CC BY-NC
3437The following fields are recognized:
3440 ~ Either a string value or an object with fields `text` and
3441 `scheme`. Valid values for `scheme` are `ISBN-10`,
3442 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
3443 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
3444 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
3447 ~ Either a string value, or an object with fields `file-as` and
3448 `type`, or a list of such objects. Valid values for `type` are
3449 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
3452 ~ Either a string value, or an object with fields `role`, `file-as`,
3453 and `text`, or a list of such objects. Valid values for `role` are
3454 [MARC relators], but
3455 pandoc will attempt to translate the human-readable versions
3456 (like "author" and "editor") to the appropriate marc relators.
3459 ~ Same format as `creator`.
3462 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
3463 Pandoc will attempt to convert other common date formats.
3465`lang` (or legacy: `language`)
3466 ~ A string value in [BCP 47] format. Pandoc will default to the local
3467 language if nothing is specified.
3470 ~ A string value or a list of such values.
3491 ~ A string value (path to cover image).
3494 ~ A string value (path to CSS stylesheet).
3496`page-progression-direction`
3497 ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`
3498 attribute for the [`spine` element].
3500[MARC relators]: http://loc.gov/marc/relators/relaterm.html
3501[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
3503Literate Haskell support
3504========================
3506If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
3507format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
3508`beamer`, `html` or `html5` for output only), pandoc will treat the document as
3509literate Haskell source. This means that
3511 - In markdown input, "bird track" sections will be parsed as Haskell
3512 code rather than block quotations. Text between `\begin{code}`
3513 and `\end{code}` will also be treated as Haskell code. For
3514 ATX-style headers the character '=' will be used instead of '#'.
3516 - In markdown output, code blocks with classes `haskell` and `literate`
3517 will be rendered using bird tracks, and block quotations will be
3518 indented one space, so they will not be treated as Haskell code.
3519 In addition, headers will be rendered setext-style (with underlines)
3520 rather than ATX-style (with '#' characters). (This is because ghc
3521 treats '#' characters in column 1 as introducing line numbers.)
3523 - In restructured text input, "bird track" sections will be parsed
3526 - In restructured text output, code blocks with class `haskell` will
3527 be rendered using bird tracks.
3529 - In LaTeX input, text in `code` environments will be parsed as
3532 - In LaTeX output, code blocks with class `haskell` will be rendered
3533 inside `code` environments.
3535 - In HTML output, code blocks with class `haskell` will be rendered
3536 with class `literatehaskell` and bird tracks.
3540 pandoc -f markdown+lhs -t html
3542reads literate Haskell source formatted with markdown conventions and writes
3543ordinary HTML (without bird tracks).
3545 pandoc -f markdown+lhs -t html+lhs
3547writes HTML with the Haskell code in bird tracks, so it can be copied
3548and pasted as literate Haskell source.
3553Pandoc will automatically highlight syntax in [fenced code blocks] that
3554are marked with a language name. The Haskell library [highlighting-kate] is used for
3555highlighting, which works in HTML, Docx, and LaTeX/PDF output.
3556The color scheme can be selected using the `--highlight-style` option.
3557The default color scheme is `pygments`, which imitates the default color
3558scheme used by the Python library pygments, but pygments is not actually
3559used to do the highlighting.
3561To see a list of language names that pandoc will recognize, type
3564To disable highlighting, use the `--no-highlight` option.
3566[highlighting-kate]: https://github.com/jgm/highlighting-kate
3571Pandoc can be extended with custom writers written in [lua]. (Pandoc
3572includes a lua interpreter, so lua need not be installed separately.)
3574To use a custom writer, simply specify the path to the lua script
3575in place of the output format. For example:
3577 pandoc -t data/sample.lua
3579Creating a custom writer requires writing a lua function for each
3580possible element in a pandoc document. To get a documented example
3581which you can modify according to your needs, do
3583 pandoc --print-default-data-file sample.lua
3585[lua]: http://www.lua.org
3590© 2006-2015 John MacFarlane (jgm@berkeley.edu). Released under the
3591[GPL], version 2 or greater. This software carries no warranty of
3592any kind. (See COPYRIGHT for full copyright and warranty notices.)
3597Alexander Kondratskiy,
3599Alexander V Vershilov,
3600Alfred Wechselberger,
3607Beni Cherniavsky-Paskin,
3615Christoffer Ackelman,
3645Jaime Marquínez Ferrándiz,
3674Matthias C. M. Troffaes,
3720[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