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, ConTeXt, or `wkhtmltopdf` 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], [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[Beamer User's Guide]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf
68[ConTeXt]: http://contextgarden.net/
69[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
70[DocBook]: http://docbook.org
71[txt2tags]: http://txt2tags.org
72[EPUB]: http://idpf.org/epub
73[OPML]: http://dev.opml.org/spec2.html
74[OpenDocument]: http://opendocument.xml.org
75[ODT]: http://en.wikipedia.org/wiki/OpenDocument
76[Textile]: http://redcloth.org/textile
77[MediaWiki markup]: https://www.mediawiki.org/wiki/Help:Formatting
78[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
79[TWiki markup]: http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules
80[Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html
81[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
82[Haskell]: https://www.haskell.org
83[GNU Texinfo]: http://www.gnu.org/software/texinfo/
84[Emacs Org mode]: http://orgmode.org
85[AsciiDoc]: http://www.methods.co.nz/asciidoc/
86[DZSlides]: http://paulrouget.com/dzslides/
87[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
88[PDF]: https://www.adobe.com/pdf/
89[reveal.js]: http://lab.hakim.se/reveal-js/
90[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
91[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
96If no *input-file* is specified, input is read from *stdin*.
97Otherwise, the *input-files* are concatenated (with a blank
98line between each) and used as input. Output goes to *stdout* by
99default (though output to *stdout* is disabled for the `odt`, `docx`,
100`epub`, and `epub3` output formats). For output to a file, use the
103 pandoc -o output.html input.txt
105By default, pandoc produces a document fragment, not a standalone
106document with a proper header and footer. To produce a standalone
107document, use the `-s` or `--standalone` flag:
109 pandoc -s -o output.html input.txt
111For more information on how standalone documents are produced, see
114Instead of a file, an absolute URI may be given. In this case
115pandoc will fetch the content using HTTP:
117 pandoc -f html -t markdown http://www.fsf.org
119If multiple input files are given, `pandoc` will concatenate them all (with
120blank lines between them) before parsing. This feature is disabled for
121 binary input formats such as `EPUB`, `odt`, and `docx`.
123The format of the input and output can be specified explicitly using
124command-line options. The input format can be specified using the
125`-r/--read` or `-f/--from` options, the output format using the
126`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
127Markdown to LaTeX, you could type:
129 pandoc -f markdown -t latex hello.txt
131To convert `hello.html` from HTML to Markdown:
133 pandoc -f html -t markdown hello.html
135Supported output formats are listed below under the `-t/--to` option.
136Supported input formats are listed below under the `-f/--from` option. Note
137that the `rst`, `textile`, `latex`, and `html` readers are not complete;
138there are some constructs that they do not parse.
140If the input or output format is not specified explicitly, `pandoc`
141will attempt to guess it from the extensions of
142the input and output filenames. Thus, for example,
144 pandoc -o hello.tex hello.txt
146will convert `hello.txt` from Markdown to LaTeX. If no output file
147is specified (so that output goes to *stdout*), or if the output file's
148extension is unknown, the output format will default to HTML.
149If no input file is specified (so that input comes from *stdin*), or
150if the input files' extensions are unknown, the input format will
151be assumed to be Markdown unless explicitly specified.
153Pandoc uses the UTF-8 character encoding for both input and output.
154If your local character encoding is not UTF-8, you
155should pipe input and output through [`iconv`]:
157 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
159Note that in some output formats (such as HTML, LaTeX, ConTeXt,
160RTF, OPML, DocBook, and Texinfo), information about
161the character encoding is included in the document header, which
162will only be included if you use the `-s/--standalone` option.
164[`iconv`]: http://www.gnu.org/software/libiconv/
169To produce a PDF, specify an output file with a `.pdf` extension.
170By default, pandoc will use LaTeX to convert it to PDF:
172 pandoc test.txt -o test.pdf
174Production of a PDF requires that a LaTeX engine be installed (see
175`--latex-engine`, below), and assumes that the following LaTeX packages
176are available: [`amsfonts`], [`amsmath`], [`lm`],
177[`ifxetex`], [`ifluatex`], [`eurosym`], [`listings`] (if the
178`--listings` option is used), [`fancyvrb`], [`longtable`],
179[`booktabs`], [`graphicx`] and [`grffile`] (if the
180document contains images), [`hyperref`], [`ulem`],
181[`geometry`] (with the `geometry` variable set), [`setspace`] (with
182`linestretch`), and [`babel`] (with `lang`). The use of `xelatex` or
183`lualatex` as the LaTeX engine requires [`fontspec`]; `xelatex` uses
184[`mathspec`], [`polyglossia`] (with `lang`), [`xecjk`], and
185[`bidi`] (with the `dir` variable set). The [`upquote`] and
186[`microtype`] packages are used if available, and [`csquotes`] will
187be used for [smart punctuation] if added to the template or included in
188any header file. The [`natbib`], [`biblatex`], [`bibtex`], and [`biber`]
189packages can optionally be used for [citation rendering]. These are
190included with all recent versions of [TeX Live].
192Alternatively, pandoc can use ConTeXt or `wkhtmltopdf` to create a PDF.
193To do this, specify an output file with a `.pdf` extension,
194as before, but add `-t context` or `-t html5` to the command line.
196PDF output can be controlled using [variables for LaTeX] (if
197LaTeX is used) and [variables for ConTeXt] (if ConTeXt is used).
198If `wkhtmltopdf` is used, then the variables `margin-left`,
199`margin-right`, `margin-top`, `margin-bottom`, and `papersize`
200will affect the output, as will `--css`.
202[`amsfonts`]: https://ctan.org/pkg/amsfonts
203[`amsmath`]: https://ctan.org/pkg/amsmath
204[`lm`]: https://ctan.org/pkg/lm
205[`ifxetex`]: https://ctan.org/pkg/ifxetex
206[`ifluatex`]: https://ctan.org/pkg/ifluatex
207[`eurosym`]: https://ctan.org/pkg/eurosym
208[`listings`]: https://ctan.org/pkg/listings
209[`fancyvrb`]: https://ctan.org/pkg/fancyvrb
210[`longtable`]: https://ctan.org/pkg/longtable
211[`booktabs`]: https://ctan.org/pkg/booktabs
212[`graphicx`]: https://ctan.org/pkg/graphicx
213[`grffile`]: https://ctan.org/pkg/grffile
214[`geometry`]: https://ctan.org/pkg/geometry
215[`setspace`]: https://ctan.org/pkg/setspace
216[`xecjk`]: https://ctan.org/pkg/xecjk
217[`hyperref`]: https://ctan.org/pkg/hyperref
218[`ulem`]: https://ctan.org/pkg/ulem
219[`babel`]: https://ctan.org/pkg/babel
220[`bidi`]: https://ctan.org/pkg/bidi
221[`mathspec`]: https://ctan.org/pkg/mathspec
222[`polyglossia`]: https://ctan.org/pkg/polyglossia
223[`fontspec`]: https://ctan.org/pkg/fontspec
224[`upquote`]: https://ctan.org/pkg/upquote
225[`microtype`]: https://ctan.org/pkg/microtype
226[`csquotes`]: https://ctan.org/pkg/csquotes
227[`natbib`]: https://ctan.org/pkg/natbib
228[`biblatex`]: https://ctan.org/pkg/biblatex
229[`bibtex`]: https://ctan.org/pkg/bibtex
230[`biber`]: https://ctan.org/pkg/biber
231[TeX Live]: http://www.tug.org/texlive/
239`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
241: Specify input format. *FORMAT* can be `native` (native Haskell),
242 `json` (JSON version of native AST), `markdown` (pandoc's
243 extended Markdown), `markdown_strict` (original unextended
244 Markdown), `markdown_phpextra` (PHP Markdown Extra),
245 `markdown_github` (GitHub-Flavored Markdown),
246 `commonmark` (CommonMark Markdown), `textile` (Textile), `rst`
247 (reStructuredText), `html` (HTML), `docbook` (DocBook), `t2t`
248 (txt2tags), `docx` (docx), `odt` (ODT), `epub` (EPUB), `opml` (OPML),
249 `org` (Emacs Org mode), `mediawiki` (MediaWiki markup), `twiki` (TWiki
250 markup), `haddock` (Haddock markup), or `latex` (LaTeX). If
251 `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`, the
252 input will be treated as literate Haskell source: see [Literate
253 Haskell support], below. Markdown
254 syntax extensions can be individually enabled or disabled by
255 appending `+EXTENSION` or `-EXTENSION` to the format name. So, for
256 example, `markdown_strict+footnotes+definition_lists` is strict
257 Markdown with footnotes and definition lists enabled, and
258 `markdown-pipe_tables+hard_line_breaks` is pandoc's Markdown
259 without pipe tables and with hard line breaks. See [Pandoc's
260 Markdown], below, for a list of extensions and
263`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
265: Specify output format. *FORMAT* can be `native` (native Haskell),
266 `json` (JSON version of native AST), `plain` (plain text),
267 `markdown` (pandoc's extended Markdown), `markdown_strict`
268 (original unextended Markdown), `markdown_phpextra` (PHP Markdown
269 Extra), `markdown_github` (GitHub-Flavored
270 Markdown), `commonmark` (CommonMark Markdown), `rst`
271 (reStructuredText), `html` (XHTML), `html5` (HTML5), `latex`
272 (LaTeX), `beamer` (LaTeX beamer slide show), `context` (ConTeXt),
273 `man` (groff man), `mediawiki` (MediaWiki markup), `dokuwiki`
274 (DokuWiki markup), `textile` (Textile), `org` (Emacs Org mode),
275 `texinfo` (GNU Texinfo), `opml` (OPML), `docbook` (DocBook),
276 `opendocument` (OpenDocument), `odt` (OpenOffice text document),
277 `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text
278 format), `epub` (EPUB v2 book), `epub3` (EPUB v3), `fb2`
279 (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml` (InDesign
280 ICML), `slidy` (Slidy HTML and javascript slide show), `slideous`
281 (Slideous HTML and javascript slide show), `dzslides` (DZSlides
282 HTML5 + javascript slide show), `revealjs` (reveal.js HTML5 +
283 javascript slide show), `s5` (S5 HTML and javascript slide show),
284 or the path of a custom lua writer (see [Custom
285 writers], below). Note that `odt`, `epub`, and
286 `epub3` output will not be directed to *stdout*; an output
287 filename must be specified using the `-o/--output` option. If
288 `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
289 `html`, or `html5`, the output will be rendered as literate
290 Haskell source: see [Literate Haskell
291 support], below. Markdown syntax
292 extensions can be individually enabled or disabled by appending
293 `+EXTENSION` or `-EXTENSION` to the format name, as described
296`-o` *FILE*, `--output=`*FILE*
298: Write output to *FILE* instead of *stdout*. If *FILE* is
299 `-`, output will go to *stdout*. (Exception: if the output
300 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
302`--data-dir=`*DIRECTORY*
304: Specify the user data directory to search for pandoc data files.
305 If this option is not specified, the default user data directory
306 will be used. This is, in Unix:
312 C:\Documents And Settings\USERNAME\Application Data\pandoc
314 and in Windows Vista or later:
316 C:\Users\USERNAME\AppData\Roaming\pandoc
318 You can find the default user data directory on your system by
319 looking at the output of `pandoc --version`.
320 A `reference.odt`, `reference.docx`, `epub.css`, `templates`,
321 `slidy`, `slideous`, or `s5` directory
322 placed in this directory will override pandoc's normal defaults.
326: Generate a bash completion script. To enable bash completion
327 with pandoc, add this to your `.bashrc`:
329 eval "$(pandoc --bash-completion)"
333: Give verbose debugging output. Currently this only has an effect
349: Parse untranslatable HTML codes and LaTeX environments as raw HTML
350 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
351 input. Raw HTML can be printed in Markdown, reStructuredText, HTML,
352 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
353 can be printed in Markdown, reStructuredText, LaTeX, and ConTeXt output.
354 The default is for the readers to omit untranslatable HTML codes and
355 LaTeX environments. (The LaTeX reader does pass through untranslatable
356 LaTeX *commands*, even if `-R` is not specified.)
360: Produce typographically correct output, converting straight quotes
361 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
362 `...` to ellipses. Nonbreaking spaces are inserted after certain
363 abbreviations, such as "Mr." (Note: This option is selected automatically
364 when the output format is `latex` or `context`, unless `--no-tex-ligatures`
365 is used. It has no effect for `latex` input.)
369: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
370 a numeral is an en-dash, and `--` is an em-dash. This option is selected
371 automatically for `textile` input.
373`--base-header-level=`*NUMBER*
375: Specify the base level for headers (defaults to 1).
377`--indented-code-classes=`*CLASSES*
379: Specify classes to use for indented code blocks--for example,
380 `perl,numberLines` or `haskell`. Multiple classes may be separated
383`--default-image-extension=`*EXTENSION*
385: Specify a default extension to use when image paths/URLs have no
386 extension. This allows you to use the same source for formats that
387 require different kinds of images. Currently this option only affects
388 the Markdown and LaTeX readers.
390`--filter=`*EXECUTABLE*
392: Specify an executable to be used as a filter transforming the
393 pandoc AST after the input is parsed and before the output is
394 written. The executable should read JSON from stdin and write
395 JSON to stdout. The JSON must be formatted like pandoc's own
396 JSON input and output. The name of the output format will be
397 passed to the filter as the first argument. Hence,
399 pandoc --filter ./caps.py -t latex
403 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
405 The latter form may be useful for debugging filters.
407 Filters may be written in any language. `Text.Pandoc.JSON`
408 exports `toJSONFilter` to facilitate writing filters in Haskell.
409 Those who would prefer to write filters in python can use the
410 module [`pandocfilters`], installable from PyPI. There are also
411 pandoc filter libraries in [PHP], [perl], and [javascript/node.js].
413 Note that the *EXECUTABLE* will be sought in the user's
414 `PATH`, and not in the working directory, if no directory is
415 provided. If you want to run a script in the working directory,
416 preface the filename with `./`.
418`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]
420: Set the metadata field *KEY* to the value *VAL*. A value specified
421 on the command line overrides a value specified in the document.
422 Values will be parsed as YAML boolean or string values. If no value is
423 specified, the value will be treated as Boolean true. Like
424 `--variable`, `--metadata` causes template variables to be set.
425 But unlike `--variable`, `--metadata` affects the metadata of the
426 underlying document (which is accessible from filters and may be
427 printed in some output formats).
431: Normalize the document after reading: merge adjacent
432 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
434`-p`, `--preserve-tabs`
436: Preserve tabs instead of converting them to spaces (the default).
437 Note that this will only affect tabs in literal code spans and code
438 blocks; tabs in regular text will be treated as spaces.
442: Specify the number of spaces per tab (default is 4).
444`--track-changes=accept`|`reject`|`all`
446: Specifies what to do with insertions and deletions produced by the MS
447 Word "Track Changes" feature. `accept` (the default), inserts all
448 insertions, and ignores all deletions. `reject` inserts all
449 deletions and ignores insertions. `all` puts in both insertions
450 and deletions, wrapped in spans with `insertion` and `deletion`
451 classes, respectively. The author and time of change is
452 included. `all` is useful for scripting: only accepting changes
453 from a certain reviewer, say, or before a certain date. This
454 option only affects the docx reader.
456`--extract-media=`*DIR*
458: Extract images and other media contained in a docx or epub container
459 to the path *DIR*, creating it if necessary, and adjust the images
460 references in the document so they point to the extracted files.
461 This option only affects the docx and epub readers.
463[`pandocfilters`]: https://github.com/jgm/pandocfilters
464[PHP]: https://github.com/vinai/pandocfilters-php
465[perl]: https://metacpan.org/pod/Pandoc::Filter
466[javascript/node.js]: https://github.com/mvhenderson/pandoc-filter-node
468General writer options
469----------------------
473: Produce output with an appropriate header and footer (e.g. a
474 standalone HTML, LaTeX, or RTF file, not a fragment). This option
475 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
480: Use *FILE* as a custom template for the generated document. Implies
481 `--standalone`. See [Templates], below, for a description
482 of template syntax. If no extension is specified, an extension
483 corresponding to the writer will be added, so that `--template=special`
484 looks for `special.html` for HTML output. If the template is not
485 found, pandoc will search for it in the `templates` subdirectory of
486 the user data directory (see `--data-dir`). If this option is not used,
487 a default template appropriate for the output format will be used (see
488 `-D/--print-default-template`).
490`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`:`*VAL*]
492: Set the template variable *KEY* to the value *VAL* when rendering the
493 document in standalone mode. This is generally only useful when the
494 `--template` option is used to specify a custom template, since
495 pandoc automatically sets the variables used in the default
496 templates. If no *VAL* is specified, the key will be given the
499`-D` *FORMAT*, `--print-default-template=`*FORMAT*
501: Print the system default template for an output *FORMAT*. (See `-t`
502 for a list of possible *FORMAT*s.) Templates in the user data
503 directory are ignored.
505`--print-default-data-file=`*FILE*
507: Print a system default data file. Files in the user data directory
511: Specify the dpi (dots per inch) value for conversion from pixels
512 to inch/centimeters and vice versa. The default is 96dpi.
513 Technically, the correct term would be ppi (pixels per inch).
515`--wrap=[auto|none|preserve]`
517: Determine how text is wrapped in the output (the source
518 code, not the rendered version). With `auto` (the default),
519 pandoc will attempt to wrap lines to the column width specified by
520 `--columns` (default 80). With `none`, pandoc will not wrap
521 lines at all. With `preserve`, pandoc will attempt to
522 preserve the wrapping from the source document (that is,
523 where there are nonsemantic newlines in the source, there
524 will be nonsemantic newlines in the output as well).
528: Deprecated synonym for `--wrap=none`.
532: Specify length of lines in characters (for text wrapping).
533 This affects only the generated source code, not the layout on
536`--toc`, `--table-of-contents`
538: Include an automatically generated table of contents (or, in
539 the case of `latex`, `context`, and `rst`, an instruction to create
540 one) in the output document. This option has no effect on `man`,
541 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
543`--toc-depth=`*NUMBER*
545: Specify the number of section levels to include in the table
546 of contents. The default is 3 (which means that level 1, 2, and 3
547 headers will be listed in the contents).
551: Disables syntax highlighting for code blocks and inlines, even when
552 a language attribute is given.
554`--highlight-style=`*STYLE*
556: Specifies the coloring style to be used in highlighted source code.
557 Options are `pygments` (the default), `kate`, `monochrome`,
558 `espresso`, `zenburn`, `haddock`, and `tango`. For more information
559 on syntax highlighting in pandoc, see [Syntax highlighting], below.
561`-H` *FILE*, `--include-in-header=`*FILE*
563: Include contents of *FILE*, verbatim, at the end of the header.
564 This can be used, for example, to include special
565 CSS or javascript in HTML documents. This option can be used
566 repeatedly to include multiple files in the header. They will be
567 included in the order specified. Implies `--standalone`.
569`-B` *FILE*, `--include-before-body=`*FILE*
571: Include contents of *FILE*, verbatim, at the beginning of the
572 document body (e.g. after the `<body>` tag in HTML, or the
573 `\begin{document}` command in LaTeX). This can be used to include
574 navigation bars or banners in HTML documents. This option can be
575 used repeatedly to include multiple files. They will be included in
576 the order specified. Implies `--standalone`.
578`-A` *FILE*, `--include-after-body=`*FILE*
580: Include contents of *FILE*, verbatim, at the end of the document
581 body (before the `</body>` tag in HTML, or the
582 `\end{document}` command in LaTeX). This option can be be used
583 repeatedly to include multiple files. They will be included in the
584 order specified. Implies `--standalone`.
586Options affecting specific writers
587----------------------------------
591: Produce a standalone HTML file with no external dependencies, using
592 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
593 images, and videos. The resulting file should be "self-contained,"
594 in the sense that it needs no external files and no net access to be
595 displayed properly by a browser. This option works only with HTML output
596 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
597 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
598 stylesheets at absolute URLs will be downloaded; those at relative URLs
599 will be sought relative to the working directory (if the first source
600 file is local) or relative to the base URL (if the first source
601 file is remote). Limitation: resources that are loaded dynamically
602 through JavaScript cannot be incorporated; as a result, `--self-contained`
603 does not work with `--mathjax`, and some advanced features (e.g.
604 zoom or speaker notes) may not work in an offline "self-contained"
605 `reveal.js` slide show.
609: Use `<q>` tags for quotes in HTML.
613: Use only ascii characters in output. Currently supported only
614 for HTML output (which uses numerical entities instead of
615 UTF-8 when this option is selected).
619: Use reference-style links, rather than inline links, in writing Markdown
620 or reStructuredText. By default inline links are used.
624: Use ATX-style headers in Markdown and asciidoc output. The default is
625 to use setext-style headers for levels 1-2, and then ATX headers.
629: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
630 output. When the LaTeX document class is set to `report`, `book`, or
631 `memoir`, this option is implied. If `beamer` is the output
632 format, top-level headers will become `\part{..}`.
634`-N`, `--number-sections`
636: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
637 By default, sections are not numbered. Sections with class
638 `unnumbered` will never be numbered, even if `--number-sections`
641`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]
643: Offset for section headings in HTML output (ignored in other
644 output formats). The first number is added to the section number for
645 top-level headers, the second for second-level headers, and so on.
646 So, for example, if you want the first top-level header in your
647 document to be numbered "6", specify `--number-offset=5`.
648 If your document starts with a level-2 header which you want to
649 be numbered "1.5", specify `--number-offset=1,4`.
650 Offsets are 0 by default. Implies `--number-sections`.
654: Do not use the TeX ligatures for quotation marks, apostrophes,
655 and dashes (`` `...' ``, ` ``..'' `, `--`, `---`) when
656 writing or reading LaTeX or ConTeXt. In reading LaTeX,
657 parse the characters `` ` ``, `'`, and `-` literally, rather
658 than parsing ligatures for quotation marks and dashes. In
659 writing LaTeX or ConTeXt, print unicode quotation mark and
660 dash characters literally, rather than converting them to
661 the standard ASCII TeX ligatures. Note: normally `--smart`
662 is selected automatically for LaTeX and ConTeXt output, but
663 it must be specified explicitly if `--no-tex-ligatures` is
664 selected. If you use literal curly quotes, dashes, and
665 ellipses in your source, then you may want to use
666 `--no-tex-ligatures` without `--smart`.
670: Use the [`listings`] package for LaTeX code blocks
674: Make list items in slide shows display incrementally (one by one).
675 The default is for lists to be displayed all at once.
677`--slide-level=`*NUMBER*
679: Specifies that headers with the specified level create
680 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
681 above this level in the hierarchy are used to divide the
682 slide show into sections; headers below this level create
683 subheads within a slide. The default is to set the slide level
684 based on the contents of the document; see
685 [Structuring the slide show].
689: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
690 and attach identifiers to the enclosing `<div>` (or `<section>`)
691 rather than the header itself. See
692 [Header identifiers], below.
694`--email-obfuscation=none`|`javascript`|`references`
696: Specify a method for obfuscating `mailto:` links in HTML documents.
697 `none` leaves `mailto:` links as they are. `javascript` obfuscates
698 them using javascript. `references` obfuscates them by printing their
699 letters as decimal or hexadecimal character references. The default
702`--id-prefix=`*STRING*
704: Specify a prefix to be added to all automatically generated identifiers
705 in HTML and DocBook output, and to footnote numbers in Markdown output.
706 This is useful for preventing duplicate identifiers when generating
707 fragments to be included in other pages.
709`-T` *STRING*, `--title-prefix=`*STRING*
711: Specify *STRING* as a prefix at the beginning of the title
712 that appears in the HTML header (but not in the title as it
713 appears at the beginning of the HTML body). Implies
716`-c` *URL*, `--css=`*URL*
718: Link to a CSS style sheet. This option can be be used repeatedly to
719 include multiple files. They will be included in the order specified.
721`--reference-odt=`*FILE*
723: Use the specified file as a style reference in producing an ODT.
724 For best results, the reference ODT should be a modified version
725 of an ODT produced using pandoc. The contents of the reference ODT
726 are ignored, but its stylesheets are used in the new ODT. If no
727 reference ODT is specified on the command line, pandoc will look
728 for a file `reference.odt` in the user data directory (see
729 `--data-dir`). If this is not found either, sensible defaults will be
732`--reference-docx=`*FILE*
734: Use the specified file as a style reference in producing a docx file.
735 For best results, the reference docx should be a modified version
736 of a docx file produced using pandoc. The contents of the reference docx
737 are ignored, but its stylesheets and document properties (including
738 margins, page size, header, and footer) are used in the new docx. If no
739 reference docx is specified on the command line, pandoc will look
740 for a file `reference.docx` in the user data directory (see
741 `--data-dir`). If this is not found either, sensible defaults will be
742 used. The following styles are used by pandoc: [paragraph]
743 Normal, Body Text, First Paragraph, Compact, Title, Subtitle, Author, Date,
744 Abstract, Bibliography, Heading 1, Heading 2, Heading 3, Heading 4,
745 Heading 5, Heading 6, Block Text, Footnote Text, Definition Term,
746 Definition, Caption, Table Caption, Image Caption, Figure,
747 Figure With Caption, TOC Heading;
748 [character] Default Paragraph Font, Body Text Char, Verbatim Char,
749 Footnote Reference, Hyperlink; [table] Normal Table.
751`--epub-stylesheet=`*FILE*
753: Use the specified CSS file to style the EPUB. If no stylesheet
754 is specified, pandoc will look for a file `epub.css` in the
755 user data directory (see `--data-dir`). If it is not
756 found there, sensible defaults will be used.
758`--epub-cover-image=`*FILE*
760: Use the specified image as the EPUB cover. It is recommended
761 that the image be less than 1000px in width and height. Note that
762 in a Markdown source document you can also specify `cover-image`
763 in a YAML metadata block (see [EPUB Metadata], below).
765`--epub-metadata=`*FILE*
767: Look in the specified XML file for metadata for the EPUB.
768 The file should contain a series of [Dublin Core elements].
771 <dc:rights>Creative Commons</dc:rights>
772 <dc:language>es-AR</dc:language>
774 By default, pandoc will include the following metadata elements:
775 `<dc:title>` (from the document title), `<dc:creator>` (from the
776 document authors), `<dc:date>` (from the document date, which should
777 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
778 variable, or, if is not set, the locale), and `<dc:identifier
779 id="BookId">` (a randomly generated UUID). Any of these may be
780 overridden by elements in the metadata file.
782 Note: if the source document is Markdown, a YAML metadata block
783 in the document can be used instead. See below under
786`--epub-embed-font=`*FILE*
788: Embed the specified font in the EPUB. This option can be repeated
789 to embed multiple fonts. Wildcards can also be used: for example,
790 `DejaVuSans-*.ttf`. However, if you use wildcards on the command
791 line, be sure to escape them or put the whole filename in single quotes,
792 to prevent them from being interpreted by the shell. To use the
793 embedded fonts, you will need to add declarations like the following
794 to your CSS (see `--epub-stylesheet`):
797 font-family: DejaVuSans;
800 src:url("DejaVuSans-Regular.ttf");
803 font-family: DejaVuSans;
806 src:url("DejaVuSans-Bold.ttf");
809 font-family: DejaVuSans;
812 src:url("DejaVuSans-Oblique.ttf");
815 font-family: DejaVuSans;
818 src:url("DejaVuSans-BoldOblique.ttf");
820 body { font-family: "DejaVuSans"; }
822`--epub-chapter-level=`*NUMBER*
824: Specify the header level at which to split the EPUB into separate
825 "chapter" files. The default is to split into chapters at level 1
826 headers. This option only affects the internal composition of the
827 EPUB, not the way chapters and sections are displayed to users. Some
828 readers may be slow if the chapter files are too large, so for large
829 documents with few level 1 headers, one might want to use a chapter
832`--latex-engine=pdflatex`|`lualatex`|`xelatex`
834: Use the specified LaTeX engine when producing PDF output.
835 The default is `pdflatex`. If the engine is not in your PATH,
836 the full path of the engine may be specified here.
838`--latex-engine-opt=`*STRING*
840: Use the given string as a command-line argument to the `latex-engine`.
841 If used multiple times, the arguments are provided with spaces between
842 them. Note that no check for duplicate options is done.
844[Dublin Core elements]: http://dublincore.org/documents/dces/
845[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
850`--bibliography=`*FILE*
852: Set the `bibliography` field in the document's metadata to *FILE*,
853 overriding any value set in the metadata, and process citations
854 using `pandoc-citeproc`. (This is equivalent to
855 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
856 If `--natbib` or `--biblatex` is also supplied, `pandoc-citeproc` is not
857 used, making this equivalent to `--metadata bibliography=FILE`.
858 If you supply this argument multiple times, each *FILE* will be added
863: Set the `csl` field in the document's metadata to *FILE*,
864 overriding any value set in the metadata. (This is equivalent to
865 `--metadata csl=FILE`.)
866 This option is only relevant with `pandoc-citeproc`.
868`--citation-abbreviations=`*FILE*
870: Set the `citation-abbreviations` field in the document's metadata to
871 *FILE*, overriding any value set in the metadata. (This is equivalent to
872 `--metadata citation-abbreviations=FILE`.)
873 This option is only relevant with `pandoc-citeproc`.
877: Use [`natbib`] for citations in LaTeX output. This option is not for use
878 with the `pandoc-citeproc` filter or with PDF output. It is intended for
879 use in producing a LaTeX file that can be processed with [`bibtex`].
883: Use [`biblatex`] for citations in LaTeX output. This option is not for use
884 with the `pandoc-citeproc` filter or with PDF output. It is intended for
885 use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
887Math rendering in HTML
888----------------------
890`-m` [*URL*], `--latexmathml`[`=`*URL*]
892: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
893 To insert a link to a local copy of the `LaTeXMathML.js` script,
894 provide a *URL*. If no *URL* is provided, the contents of the
895 script will be inserted directly into the HTML header, preserving
896 portability at the price of efficiency. If you plan to use math on
897 several pages, it is much better to link to a copy of the script,
902: Convert TeX math to [MathML] (in `docbook` as well as `html` and `html5`).
903 In standalone `html` output, a small javascript (or a link to such a
904 script if a *URL* is supplied) will be inserted that allows the MathML to
905 be viewed on some browsers.
909: Use [jsMath] to display embedded TeX math in HTML output.
910 The *URL* should point to the jsMath load script (e.g.
911 `jsMath/easy/load.js`); if provided, it will be linked to in
912 the header of standalone HTML documents. If a *URL* is not provided,
913 no link to the jsMath load script will be inserted; it is then
914 up to the author to provide such a link in the HTML template.
918: Use [MathJax] to display embedded TeX math in HTML output.
919 The *URL* should point to the `MathJax.js` load script.
920 If a *URL* is not provided, a link to the MathJax CDN will
925: Enclose TeX math in `<eq>` tags in HTML output. These can then
926 be processed by [gladTeX] to produce links to images of the typeset
931: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
932 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
936: Render TeX formulas using an external script that converts TeX
937 formulas to images. The formula will be concatenated with the URL
938 provided. If *URL* is not specified, the Google Chart API will be used.
942: Use [KaTeX] to display embedded TeX math in HTML output.
943 The *URL* should point to the `katex.js` load script. If a *URL* is
944 not provided, a link to the KaTeX CDN will be inserted.
946`--katex-stylesheet=`*URL*
948: The *URL* should point to the `katex.css` stylesheet. If this option is
949 not specified, a link to the KaTeX CDN will be inserted. Note that this
950 option does not imply `--katex`.
952[MathML]: http://www.w3.org/Math/
953[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
954[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
955[MathJax]: https://www.mathjax.org
956[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
957[mimeTeX]: http://www.forkosh.com/mimetex.html
958[KaTeX]: https://github.com/Khan/KaTeX
960Options for wrapper scripts
961---------------------------
965: Print information about command-line arguments to *stdout*, then exit.
966 This option is intended primarily for use in wrapper scripts.
967 The first line of output contains the name of the output file specified
968 with the `-o` option, or `-` (for *stdout*) if no output file was
969 specified. The remaining lines contain the command-line arguments,
970 one per line, in the order they appear. These do not include regular
971 pandoc options and their arguments, but do include any options appearing
972 after a `--` separator at the end of the line.
976: Ignore command-line arguments (for use in wrapper scripts).
977 Regular pandoc options are not ignored. Thus, for example,
979 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
983 pandoc -o foo.html -s
988When the `-s/--standalone` option is used, pandoc uses a template to
989add header and footer material that is needed for a self-standing
990document. To see the default template that is used, just type
994where *FORMAT* is the name of the output format. A custom template
995can be specified using the `--template` option. You can also override
996the system default templates for a given output format *FORMAT*
997by putting a file `templates/default.*FORMAT*` in the user data
998directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
999customize the `default.opendocument` template. For `pdf` output,
1000customize the `default.latex` template.
1002Templates contain *variables*, which allow for the inclusion of
1003arbitrary information at any point in the file. Variables may be set
1004within the document using [YAML metadata blocks][Extension:
1005`yaml_metadata_block`]. They may also be set at the
1006command line using the `-V/--variable` option: variables set in this
1007way override metadata fields with the same name.
1009Variables set by pandoc
1010-----------------------
1012Some variables are set automatically by pandoc. These vary somewhat
1013depending on the output format, but include metadata fields as well
1016`title`, `author`, `date`
1017: allow identification of basic aspects of the document. Included
1018 in PDF metadata through LaTeX and ConTeXt. These can be set
1019 through a [pandoc title block][Extension: `pandoc_title_block`],
1020 which allows for multiple authors, or through a YAML metadata block:
1029: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and Word docx;
1030 renders in LaTeX only when using a document class that supports
1031 `\subtitle`, such as `beamer` or the [KOMA-Script] series (`scrartcl`,
1032 `scrreprt`, `scrbook`).[^subtitle]
1035: document summary, included in LaTeX, ConTeXt, AsciiDoc, and Word docx
1038: list of keywords to be included in HTML, PDF, and AsciiDoc metadata;
1039 may be repeated as for `author`, above
1042: contents specified by `-H/--include-in-header` (may have multiple
1046: non-null value if `--toc/--table-of-contents` was specified
1049: title of table of contents (works only with EPUB and docx)
1052: contents specified by `-B/--include-before-body` (may have
1056: contents specified by `-A/--include-after-body` (may have
1063: JSON representation of all of the document's metadata
1065[^subtitle]: To make `subtitle` work with other LaTeX
1066 document classes, you can add the following to `header-includes`:
1068 \providecommand{\subtitle}[1]{%
1069 \usepackage{titling}
1071 \par\large#1\end{center}}
1078: identifies the main language of the document,
1079 using a code according to [BCP 47] (e.g. `en` or `en-GB`).
1080 For some output formats, pandoc will convert it to an appropriate
1081 format stored in the additional variables `babel-lang`,
1082 `polyglossia-lang` (LaTeX) and `context-lang` (ConTeXt).
1084 Native pandoc `span`s and `div`s with the lang attribute
1085 (value in BCP 47) can be used to switch the language in
1089: a list of other languages used in the document
1090 in the YAML metadata, according to [BCP 47]. For example:
1091 `otherlangs: [en-GB, fr]`.
1092 This is automatically generated from the `lang` attributes
1093 in all `span`s and `div`s but can be overriden.
1094 Currently only used by LaTeX through the generated
1095 `babel-otherlangs` and `polyglossia-otherlangs` variables.
1096 The LaTeX writer outputs polyglossia commands in the text but
1097 the `babel-newcommands` variable contains mappings for them
1098 to the corresponding babel.
1101: the base direction of the document, either `rtl` (right-to-left)
1102 or `ltr` (left-to-right).
1104 For bidirectional documents, native pandoc `span`s and `div`s
1105 with the `dir` attribute (value `rtl` or `ltr`) can be used to
1106 override the base direction in some output formats.
1107 This may not always be necessary if the final renderer
1108 (e.g. the browser, when generating HTML) supports the
1109 [Unicode Bidirectional Algorithm].
1111 When using LaTeX for bidirectional documents, only the `xelatex` engine
1112 is fully supported (use `--latex-engine=xelatex`).
1114[BCP 47]: https://tools.ietf.org/html/bcp47
1115[Unicode Bidirectional Algorithm]: http://www.w3.org/International/articles/inline-bidi-markup/uba-basics
1120Variables are available for [producing slide shows with pandoc],
1121including all [reveal.js configuration options].
1124: base URL for Slidy documents (defaults to
1125 `http://www.w3.org/Talks/Tools/Slidy2`)
1128: base URL for Slideous documents (defaults to `slideous`)
1131: base URL for S5 documents (defaults to `s5/default`)
1134: base URL for reveal.js documents (defaults to `reveal.js`)
1136`theme`, `colortheme`, `fonttheme`, `innertheme`, `outertheme`
1137: themes for LaTeX [`beamer`] documents
1140: controls navigation symbols in `beamer` documents
1141 (default is `empty` for no navigation symbols; other valid values
1142 are `frame`, `vertical`, and `horizontal`).
1145: enables on "title pages" for new sections in `beamer`
1146 documents (default = true).
1148[reveal.js configuration options]: https://github.com/hakimel/reveal.js#configuration
1153LaTeX variables are used when [creating a PDF].
1156: paper size, e.g. `letter`, `A4`
1159: font size for body text (e.g. `10pt`, `12pt`)
1162: document class, e.g. [`article`], [`report`], [`book`], [`memoir`]
1165: option for document class, e.g. `oneside`; may be repeated
1166 for multiple options
1169: option for [`geometry`] package, e.g. `margin=1in`;
1170 may be repeated for multiple options
1172`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
1173: sets margins, if `geometry` is not used (otherwise `geometry`
1177: adjusts line spacing using the [`setspace`]
1178 package, e.g. `1.25`, `1.5`
1181: font package for use with `pdflatex`:
1182 [TeX Live] includes many options, documented in the [LaTeX Font Catalogue].
1183 The default is [Latin Modern][`lm`].
1186: options for package used as `fontfamily`: e.g. `osf,sc` with
1187 `fontfamily` set to [`mathpazo`] provides Palatino with old-style
1188 figures and true small caps; may be repeated for multiple options
1190`mainfont`, `sansfont`, `monofont`, `mathfont`, `CJKmainfont`
1191: font families for use with `xelatex` or
1192 `lualatex`: take the name of any system font, using the
1193 [`fontspec`] package. Note that if `CJKmainfont` is used,
1194 the [`xecjk`] package must be available.
1196`mainfontoptions`, `sansfontoptions`, `monofontoptions`, `mathfontoptions`, `CJKoptions`
1197: options to use with `mainfont`, `sansfont`, `monofont`, `mathfont`,
1198 `CJKmainfont` in `xelatex` and `lualatex`. Allow for any choices
1199 available through [`fontspec`], such as the OpenType features
1200 `Numbers=OldStyle,Numbers=Proportional`. May be repeated for multiple options.
1203: allows font encoding to be specified through `fontenc` package (with `pdflatex`);
1204 default is `T1` (see guide to [LaTeX font encodings])
1207: add color to link text; automatically enabled if any of `linkcolor`, `citecolor`,
1208 `urlcolor`, or `toccolor` are set
1210`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
1211: color for internal links, citation links, external links, and links in table of contents:
1212 uses any of the [predefined LaTeX colors]
1215: causes links to be printed as footnotes
1218: uses document class settings for indentation (the default LaTeX template
1219 otherwise removes indentation and adds space between paragraphs)
1222: disables default behavior of LaTeX template that redefines (sub)paragraphs
1223 as sections, changing the appearance of nested headings in some classes
1226: specifies contents of acknowledgments footnote after document title.
1229: include table of contents (can also be set using `--toc/--table-of-contents`)
1232: level of section to include in table of contents
1235: include list of figures, list of tables
1238: bibliography to use for resolving references
1241: bibliography style, when used with `--natbib` and
1245: list of options for biblatex.
1247[`article`]: https://ctan.org/pkg/article
1248[`report`]: https://ctan.org/pkg/report
1249[`book`]: https://ctan.org/pkg/book
1250[KOMA-Script]: https://ctan.org/pkg/koma-script
1251[`memoir`]: https://ctan.org/pkg/memoir
1252[predefined LaTeX colors]: https://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors
1253[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
1254[`mathpazo`]: https://ctan.org/pkg/mathpazo
1255[LaTeX font encodings]: https://ctan.org/pkg/encguide
1257Variables for ConTeXt
1258---------------------
1261: paper size, e.g. `letter`, `A4`, `landscape` (see [ConTeXt Paper Setup]);
1262 may be repeated for multiple options
1265: options for page margins and text arrangement (see [ConTeXt Layout]);
1266 may be repeated for multiple options
1268`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
1269: sets margins, if `layout` is not used (otherwise `layout`
1273: font size for body text (e.g. `10pt`, `12pt`)
1275`mainfont`, `sansfont`, `monofont`, `mathfont`
1276: font families: take the name of any system font (see [ConTeXt Font Switching])
1278`linkcolor`, `contrastcolor`
1279: color for links outside and inside a page, e.g. `red`, `blue` (see [ConTeXt Color])
1282: typeface style for links, e.g. `normal`, `bold`, `slanted`, `boldslanted`, `type`, `cap`, `small`
1285: controls indentation of paragraphs, e.g. `yes,small,next` (see [ConTeXt Indentation]);
1286 may be repeated for multiple options
1289: spacing between paragraphs, e.g. `none`, `small` (using [`setupwhitespace`])
1292: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);
1293 may be repeated for multiple options
1295`headertext`, `footertext`
1296: text to be placed in running header or footer (see [ConTeXt Headers and Footers]);
1297 may be repeated up to four times for different placement
1300: page number style and location (using [`setuppagenumbering`]);
1301 may be repeated for multiple options
1304: include table of contents (can also be set using `--toc/--table-of-contents`)
1307: include list of figures, list of tables
1309[ConTeXt Paper Setup]: http://wiki.contextgarden.net/PaperSetup
1310[ConTeXt Layout]: http://wiki.contextgarden.net/Layout
1311[ConTeXt Font Switching]: http://wiki.contextgarden.net/Font_Switching
1312[ConTeXt Color]: http://wiki.contextgarden.net/Color
1313[ConTeXt Headers and Footers]: http://wiki.contextgarden.net/Headers_and_Footers
1314[ConTeXt Indentation]: http://wiki.contextgarden.net/Indentation
1315[`setupwhitespace`]: http://wiki.contextgarden.net/Command/setupwhitespace
1316[`setupinterlinespace`]: http://wiki.contextgarden.net/Command/setupinterlinespace
1317[`setuppagenumbering`]: http://wiki.contextgarden.net/Command/setuppagenumbering
1319Variables for man pages
1320-----------------------
1323: section number in man pages
1326: header in man pages
1329: footer in man pages
1332: adjusts text to left (`l`), right (`r`), center (`c`),
1333 or both (`b`) margins
1336: if `true` (the default), hyphenation will be used
1338Using variables in templates
1339----------------------------
1341Variable names are sequences of alphanumerics, `-`, and `_`,
1342starting with a letter. A variable name surrounded by `$` signs
1343will be replaced by its value. For example, the string `$title$` in
1345 <title>$title$</title>
1347will be replaced by the document title.
1349To write a literal `$` in a template, use `$$`.
1351Templates may contain conditionals. The syntax is as follows:
1359This will include `X` in the template if `variable` has a non-null
1360value; otherwise it will include `Y`. `X` and `Y` are placeholders for
1361any valid template text, and may include interpolated variables or other
1362conditionals. The `$else$` section may be omitted.
1364When variables can have multiple values (for example, `author` in
1365a multi-author document), you can use the `$for$` keyword:
1368 <meta name="author" content="$author$" />
1371You can optionally specify a separator to be used between
1374 $for(author)$$author$$sep$, $endfor$
1376A dot can be used to select a field of a variable that takes
1377an object as its value. So, for example:
1379 $author.name$ ($author.affiliation$)
1381If you use custom templates, you may need to revise them as pandoc
1382changes. We recommend tracking the changes in the default templates,
1383and modifying your custom templates accordingly. An easy way to do this
1384is to fork the [pandoc-templates] repository and merge in changes after each
1387[pandoc-templates]: https://github.com/jgm/pandoc-templates
1392Pandoc understands an extended and slightly revised version of
1393John Gruber's [Markdown] syntax. This document explains the syntax,
1394noting differences from standard Markdown. Except where noted, these
1395differences can be suppressed by using the `markdown_strict` format instead
1396of `markdown`. An extensions can be enabled by adding `+EXTENSION`
1397to the format name and disabled by adding `-EXTENSION`. For example,
1398`markdown_strict+footnotes` is strict Markdown with footnotes
1399enabled, while `markdown-footnotes-pipe_tables` is pandoc's
1400Markdown without footnotes or pipe tables.
1405Markdown is designed to be easy to write, and, even more importantly,
1408> A Markdown-formatted document should be publishable as-is, as plain
1409> text, without looking like it's been marked up with tags or formatting
1411> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
1413This principle has guided pandoc's decisions in finding syntax for
1414tables, footnotes, and other extensions.
1416There is, however, one respect in which pandoc's aims are different
1417from the original aims of Markdown. Whereas Markdown was originally
1418designed with HTML generation in mind, pandoc is designed for multiple
1419output formats. Thus, while pandoc allows the embedding of raw HTML,
1420it discourages it, and provides other, non-HTMLish ways of representing
1421important document elements like definition lists, tables, mathematics, and
1427A paragraph is one or more lines of text followed by one or more blank lines.
1428Newlines are treated as spaces, so you can reflow your paragraphs as you like.
1429If you need a hard line break, put two or more spaces at the end of a line.
1431#### Extension: `escaped_line_breaks` ####
1433A backslash followed by a newline is also a hard line break.
1434Note: in multiline and grid table cells, this is the only way
1435to create a hard line break, since trailing spaces in the cells
1441There are two kinds of headers: Setext and ATX.
1443### Setext-style headers ###
1445A setext-style header is a line of text "underlined" with a row of `=` signs
1446(for a level one header) or `-` signs (for a level two header):
1454The header text can contain inline formatting, such as emphasis (see
1455[Inline formatting], below).
1458### ATX-style headers ###
1460An ATX-style header consists of one to six `#` signs and a line of
1461text, optionally followed by any number of `#` signs. The number of
1462`#` signs at the beginning of the line is the header level:
1464 ## A level-two header
1466 ### A level-three header ###
1468As with setext-style headers, the header text can contain formatting:
1470 # A level-one header with a [link](/url) and *emphasis*
1472#### Extension: `blank_before_header` ####
1474Standard Markdown syntax does not require a blank line before a header.
1475Pandoc does require this (except, of course, at the beginning of the
1476document). The reason for the requirement is that it is all too easy for a
1477`#` to end up at the beginning of a line by accident (perhaps through line
1478wrapping). Consider, for example:
1480 I like several of their flavors of ice cream:
1481 #22, for example, and #5.
1484### Header identifiers ###
1486#### Extension: `header_attributes` ####
1488Headers can be assigned attributes using this syntax at the end
1489of the line containing the header text:
1491 {#identifier .class .class key=value key=value}
1493Thus, for example, the following headers will all be assigned the identifier
1498 ## My header ## {#foo}
1500 My other header {#foo}
1503(This syntax is compatible with [PHP Markdown Extra].)
1505Note that although this syntax allows assignment of classes and key/value
1506attributes, writers generally don't use all of this information. Identifiers,
1507classes, and key/value attributes are used in HTML and HTML-based formats such
1508as EPUB and slidy. Identifiers are used for labels and link anchors in the
1509LaTeX, ConTeXt, Textile, and AsciiDoc writers.
1511Headers with the class `unnumbered` will not be numbered, even if
1512`--number-sections` is specified. A single hyphen (`-`) in an attribute
1513context is equivalent to `.unnumbered`, and preferable in non-English
1520 # My header {.unnumbered}
1522#### Extension: `auto_identifiers` ####
1524A header without an explicitly specified identifier will be
1525automatically assigned a unique identifier based on the header text.
1526To derive the identifier from the header text,
1528 - Remove all formatting, links, etc.
1529 - Remove all footnotes.
1530 - Remove all punctuation, except underscores, hyphens, and periods.
1531 - Replace all spaces and newlines with hyphens.
1532 - Convert all alphabetic characters to lowercase.
1533 - Remove everything up to the first letter (identifiers may
1534 not begin with a number or punctuation mark).
1535 - If nothing is left after this, use the identifier `section`.
1540 ------------------------------- ----------------------------
1541 `Header identifiers in HTML` `header-identifiers-in-html`
1542 `*Dogs*?--in *my* house?` `dogs--in-my-house`
1543 `[HTML], [S5], or [RTF]?` `html-s5-or-rtf`
1544 `3. Applications` `applications`
1547These rules should, in most cases, allow one to determine the identifier
1548from the header text. The exception is when several headers have the
1549same text; in this case, the first will get an identifier as described
1550above; the second will get the same identifier with `-1` appended; the
1551third with `-2`; and so on.
1553These identifiers are used to provide link targets in the table of
1554contents generated by the `--toc|--table-of-contents` option. They
1555also make it easy to provide links from one section of a document to
1556another. A link to this section, for example, might look like this:
1559 [header identifiers](#header-identifiers-in-html-latex-and-context).
1561Note, however, that this method of providing links to sections works
1562only in HTML, LaTeX, and ConTeXt formats.
1564If the `--section-divs` option is specified, then each section will
1565be wrapped in a `div` (or a `section`, if `--html5` was specified),
1566and the identifier will be attached to the enclosing `<div>`
1567(or `<section>`) tag rather than the header itself. This allows entire
1568sections to be manipulated using javascript or treated differently in
1571#### Extension: `implicit_header_references` ####
1573Pandoc behaves as if reference links have been defined for each header.
1576 [header identifiers](#header-identifiers-in-html)
1580 [header identifiers]
1584 [header identifiers][]
1588 [the section on header identifiers][header identifiers]
1590If there are multiple headers with identical text, the corresponding
1591reference will link to the first one only, and you will need to use explicit
1592links to link to the others, as described above.
1594Like regular reference links, these references are case-insensitive.
1596Explicit link reference definitions always take priority over
1597implicit header references. So, in the following example, the
1598link will point to `bar`, not to `#foo`:
1609Markdown uses email conventions for quoting blocks of text.
1610A block quotation is one or more paragraphs or other block elements
1611(such as lists or headers), with each line preceded by a `>` character
1612and an optional space. (The `>` need not start at the left margin, but
1613it should not be indented more than three spaces.)
1615 > This is a block quote. This
1616 > paragraph has two lines.
1618 > 1. This is a list inside a block quote.
1621A "lazy" form, which requires the `>` character only on the first
1622line of each block, is also allowed:
1624 > This is a block quote. This
1625 paragraph has two lines.
1627 > 1. This is a list inside a block quote.
1630Among the block elements that can be contained in a block quote are
1631other block quotes. That is, block quotes can be nested:
1633 > This is a block quote.
1635 > > A block quote within a block quote.
1637If the `>` character is followed by an optional space, that space
1638will be considered part of the block quote marker and not part of
1639the indentation of the contents. Thus, to put an indented code
1640block in a block quote, you need five spaces after the `>`:
1644#### Extension: `blank_before_blockquote` ####
1646Standard Markdown syntax does not require a blank line before a block
1647quote. Pandoc does require this (except, of course, at the beginning of the
1648document). The reason for the requirement is that it is all too easy for a
1649`>` to end up at the beginning of a line by accident (perhaps through line
1650wrapping). So, unless the `markdown_strict` format is used, the following does
1651not produce a nested block quote in pandoc:
1653 > This is a block quote.
1657Verbatim (code) blocks
1658----------------------
1660### Indented code blocks ###
1662A block of text indented four spaces (or one tab) is treated as verbatim
1663text: that is, special characters do not trigger special formatting,
1664and all spaces and line breaks are preserved. For example,
1667 moveShip(5 * gravity, DOWN);
1670The initial (four space or one tab) indentation is not considered part
1671of the verbatim text, and is removed in the output.
1673Note: blank lines in the verbatim text need not begin with four spaces.
1676### Fenced code blocks ###
1678#### Extension: `fenced_code_blocks` ####
1680In addition to standard indented code blocks, pandoc supports
1681*fenced* code blocks. These begin with a row of three or more
1682tildes (`~`) and end with a row of tildes that must be at least as long as
1683the starting row. Everything between these lines is treated as code. No
1684indentation is necessary:
1688 moveShip(5 * gravity, DOWN);
1692Like regular code blocks, fenced code blocks must be separated
1693from surrounding text by blank lines.
1695If the code itself contains a row of tildes or backticks, just use a longer
1696row of tildes or backticks at the start and end:
1700 code including tildes
1704#### Extension: `backtick_code_blocks` ####
1706Same as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes
1709#### Extension: `fenced_code_attributes` ####
1711Optionally, you may attach attributes to fenced or backtick code block using
1714 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1716 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1717 qsort (filter (>= x) xs)
1718 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1720Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1721`startFrom` is an attribute with value `100`. Some output formats can use this
1722information to do syntax highlighting. Currently, the only output formats
1723that uses this information are HTML and LaTeX. If highlighting is supported
1724for your output format and language, then the code block above will appear
1725highlighted, with numbered lines. (To see which languages are supported, do
1726`pandoc --version`.) Otherwise, the code block above will appear as follows:
1728 <pre id="mycode" class="haskell numberLines" startFrom="100">
1734A shortcut form can also be used for specifying the language of
1741This is equivalent to:
1747If the `fenced_code_attributes` extension is disabled, but
1748input contains class attribute(s) for the codeblock, the first
1749class attribute will be printed after the opening fence as a bare
1752To prevent all highlighting, use the `--no-highlight` flag.
1753To set the highlighting style, use `--highlight-style`.
1754For more information on highlighting, see [Syntax highlighting],
1760#### Extension: `line_blocks` ####
1762A line block is a sequence of lines beginning with a vertical bar (`|`)
1763followed by a space. The division into lines will be preserved in
1764the output, as will any leading spaces; otherwise, the lines will
1765be formatted as Markdown. This is useful for verse and addresses:
1767 | The limerick packs laughs anatomical
1768 | In space that is quite economical.
1769 | But the good ones I've seen
1770 | So seldom are clean
1771 | And the clean ones so seldom are comical
1774 | Berkeley, CA 94718
1776The lines can be hard-wrapped if needed, but the continuation
1777line must begin with a space.
1779 | The Right Honorable Most Venerable and Righteous Samuel L.
1782 | Berkeley, CA 94718
1784This syntax is borrowed from [reStructuredText].
1791A bullet list is a list of bulleted list items. A bulleted list
1792item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1799This will produce a "compact" list. If you want a "loose" list, in which
1800each item is formatted as a paragraph, put spaces between the items:
1808The bullets need not be flush with the left margin; they may be
1809indented one, two, or three spaces. The bullet must be followed
1812List items look best if subsequent lines are flush with the first
1813line (after the bullet):
1819But Markdown also allows a "lazy" format:
1825### The four-space rule ###
1827A list item may contain multiple paragraphs and other block-level
1828content. However, subsequent paragraphs must be preceded by a blank line
1829and indented four spaces or a tab. The list will look better if the first
1830paragraph is aligned with the rest:
1836 * Second paragraph. With a code block, which must be indented
1841List items may include other lists. In this case the preceding blank
1842line is optional. The nested list must be indented four spaces or
1855As noted above, Markdown allows you to write list items "lazily," instead of
1856indenting continuation lines. However, if there are multiple paragraphs or
1857other blocks in a list item, the first line of each must be indented.
1859 + A lazy, lazy, list
1862 + Another one; this looks
1865 Second paragraph of second
1868**Note:** Although the four-space rule for continuation paragraphs
1869comes from the official [Markdown syntax guide], the reference implementation,
1870`Markdown.pl`, does not follow it. So pandoc will give different results than
1871`Markdown.pl` when authors have indented continuation paragraphs fewer than
1874The [Markdown syntax guide] is not explicit whether the four-space
1875rule applies to *all* block-level content in a list item; it only
1876mentions paragraphs and code blocks. But it implies that the rule
1877applies to all block-level content (including nested lists), and
1878pandoc interprets it that way.
1880 [Markdown syntax guide]:
1881 http://daringfireball.net/projects/markdown/syntax#list
1883### Ordered lists ###
1885Ordered lists work just like bulleted lists, except that the items
1886begin with enumerators rather than bullets.
1888In standard Markdown, enumerators are decimal numbers followed
1889by a period and a space. The numbers themselves are ignored, so
1890there is no difference between this list:
1902#### Extension: `fancy_lists` ####
1904Unlike standard Markdown, pandoc allows ordered list items to be marked
1905with uppercase and lowercase letters and roman numerals, in addition to
1906arabic numerals. List markers may be enclosed in parentheses or followed by a
1907single right-parentheses or period. They must be separated from the
1908text that follows by at least one space, and, if the list marker is a
1909capital letter with a period, by at least two spaces.[^2]
1911[^2]: The point of this rule is to ensure that normal paragraphs
1912 starting with people's initials, like
1914 B. Russell was an English philosopher.
1916 do not get treated as list items.
1918 This rule will not prevent
1922 from being interpreted as a list item. In this case, a backslash
1927The `fancy_lists` extension also allows '`#`' to be used as an
1928ordered list marker in place of a numeral:
1933#### Extension: `startnum` ####
1935Pandoc also pays attention to the type of list marker used, and to the
1936starting number, and both of these are preserved where possible in the
1937output format. Thus, the following yields a list with numbers followed
1938by a single parenthesis, starting with 9, and a sublist with lowercase
1948Pandoc will start a new list each time a different type of list
1949marker is used. So, the following will create three lists:
1956If default list markers are desired, use `#.`:
1963### Definition lists ###
1965#### Extension: `definition_lists` ####
1967Pandoc supports definition lists, using the syntax of
1968[PHP Markdown Extra] with some extensions.[^3]
1974 Term 2 with *inline markup*
1978 { some code, part of Definition 2 }
1980 Third paragraph of definition 2.
1982Each term must fit on one line, which may optionally be followed by
1983a blank line, and must be followed by one or more definitions.
1984A definition begins with a colon or tilde, which may be indented one
1987A term may have multiple definitions, and each definition may consist of one or
1988more block elements (paragraph, code block, list, etc.), each indented four
1989spaces or one tab stop. The body of the definition (including the first line,
1990aside from the colon or tilde) should be indented four spaces. However,
1991as with other Markdown lists, you can "lazily" omit indentation except
1992at the beginning of a paragraph or other block element:
1997 with lazy continuation.
1999 Second paragraph of the definition.
2001If you leave space before the definition (as in the example above),
2002the text of the definition will be treated as a paragraph. In some
2003output formats, this will mean greater spacing between term/definition
2004pairs. For a more compact definition list, omit the space before the
2014Note that space between items in a definition list is required.
2015(A variant that loosens this requirement, but disallows "lazy"
2016hard wrapping, can be activated with `compact_definition_lists`: see
2017[Non-pandoc extensions], below.)
2019[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
2021### Numbered example lists ###
2023#### Extension: `example_lists` ####
2025The special list marker `@` can be used for sequentially numbered
2026examples. The first list item with a `@` marker will be numbered '1',
2027the next '2', and so on, throughout the document. The numbered examples
2028need not occur in a single list; each new list using `@` will take up
2029where the last stopped. So, for example:
2031 (@) My first example will be numbered (1).
2032 (@) My second example will be numbered (2).
2034 Explanation of examples.
2036 (@) My third example will be numbered (3).
2038Numbered examples can be labeled and referred to elsewhere in the
2041 (@good) This is a good example.
2043 As (@good) illustrates, ...
2045The label can be any string of alphanumeric characters, underscores,
2049### Compact and loose lists ###
2051Pandoc behaves differently from `Markdown.pl` on some "edge
2052cases" involving lists. Consider this source:
2062Pandoc transforms this into a "compact list" (with no `<p>` tags around
2063"First", "Second", or "Third"), while Markdown puts `<p>` tags around
2064"Second" and "Third" (but not "First"), because of the blank space
2065around "Third". Pandoc follows a simple rule: if the text is followed by
2066a blank line, it is treated as a paragraph. Since "Second" is followed
2067by a list, and not a blank line, it isn't treated as a paragraph. The
2068fact that the list is followed by a blank line is irrelevant. (Note:
2069Pandoc works this way even when the `markdown_strict` format is specified. This
2070behavior is consistent with the official Markdown syntax description,
2071even though it is different from that of `Markdown.pl`.)
2074### Ending a list ###
2076What if you want to put an indented code block after a list?
2083Trouble! Here pandoc (like other Markdown implementations) will treat
2084`{ my code block }` as the second paragraph of item two, and not as
2087To "cut off" the list after item two, you can insert some non-indented
2088content, like an HTML comment, which won't produce visible output in
2094 <!-- end of list -->
2098You can use the same trick if you want two consecutive lists instead
2114A line containing a row of three or more `*`, `-`, or `_` characters
2115(optionally separated by spaces) produces a horizontal rule:
2125Four kinds of tables may be used. The first three kinds presuppose the use of
2126a fixed-width font, such as Courier. The fourth kind can be used with
2127proportionally spaced fonts, as it does not require lining up columns.
2129#### Extension: `table_captions` ####
2131A caption may optionally be provided with all 4 kinds of tables (as
2132illustrated in the examples below). A caption is a paragraph beginning
2133with the string `Table:` (or just `:`), which will be stripped off.
2134It may appear either before or after the table.
2136#### Extension: `simple_tables` ####
2138Simple tables look like this:
2140 Right Left Center Default
2141 ------- ------ ---------- -------
2146 Table: Demonstration of simple table syntax.
2148The headers and table rows must each fit on one line. Column
2149alignments are determined by the position of the header text relative
2150to the dashed line below it:[^4]
2152 - If the dashed line is flush with the header text on the right side
2153 but extends beyond it on the left, the column is right-aligned.
2154 - If the dashed line is flush with the header text on the left side
2155 but extends beyond it on the right, the column is left-aligned.
2156 - If the dashed line extends beyond the header text on both sides,
2157 the column is centered.
2158 - If the dashed line is flush with the header text on both sides,
2159 the default alignment is used (in most cases, this will be left).
2161[^4]: This scheme is due to Michel Fortin, who proposed it on the
2162 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
2164The table must end with a blank line, or a line of dashes followed by
2167The column headers may be omitted, provided a dashed line is used
2168to end the table. For example:
2170 ------- ------ ---------- -------
2174 ------- ------ ---------- -------
2176When headers are omitted, column alignments are determined on the basis
2177of the first line of the table body. So, in the tables above, the columns
2178would be right, left, center, and right aligned, respectively.
2180#### Extension: `multiline_tables` ####
2182Multiline tables allow headers and table rows to span multiple lines
2183of text (but cells that span multiple columns or rows of the table are
2184not supported). Here is an example:
2186 -------------------------------------------------------------
2187 Centered Default Right Left
2188 Header Aligned Aligned Aligned
2189 ----------- ------- --------------- -------------------------
2190 First row 12.0 Example of a row that
2191 spans multiple lines.
2193 Second row 5.0 Here's another one. Note
2194 the blank line between
2196 -------------------------------------------------------------
2198 Table: Here's the caption. It, too, may span
2201These work like simple tables, but with the following differences:
2203 - They must begin with a row of dashes, before the header text
2204 (unless the headers are omitted).
2205 - They must end with a row of dashes, then a blank line.
2206 - The rows must be separated by blank lines.
2208In multiline tables, the table parser pays attention to the widths of
2209the columns, and the writers try to reproduce these relative widths in
2210the output. So, if you find that one of the columns is too narrow in the
2211output, try widening it in the Markdown source.
2213Headers may be omitted in multiline tables as well as simple tables:
2215 ----------- ------- --------------- -------------------------
2216 First row 12.0 Example of a row that
2217 spans multiple lines.
2219 Second row 5.0 Here's another one. Note
2220 the blank line between
2222 ----------- ------- --------------- -------------------------
2224 : Here's a multiline table without headers.
2226It is possible for a multiline table to have just one row, but the row
2227should be followed by a blank line (and then the row of dashes that ends
2228the table), or the table may be interpreted as a simple table.
2230#### Extension: `grid_tables` ####
2232Grid tables look like this:
2234 : Sample grid table.
2236 +---------------+---------------+--------------------+
2237 | Fruit | Price | Advantages |
2238 +===============+===============+====================+
2239 | Bananas | $1.34 | - built-in wrapper |
2240 | | | - bright color |
2241 +---------------+---------------+--------------------+
2242 | Oranges | $2.10 | - cures scurvy |
2244 +---------------+---------------+--------------------+
2246The row of `=`s separates the header from the table body, and can be
2247omitted for a headerless table. The cells of grid tables may contain
2248arbitrary block elements (multiple paragraphs, code blocks, lists,
2249etc.). Alignments are not supported, nor are cells that span multiple
2250columns or rows. Grid tables can be created easily using [Emacs table mode].
2252[Emacs table mode]: http://table.sourceforge.net/
2254#### Extension: `pipe_tables` ####
2256Pipe tables look like this:
2258 | Right | Left | Default | Center |
2259 |------:|:-----|---------|:------:|
2260 | 12 | 12 | 12 | 12 |
2261 | 123 | 123 | 123 | 123 |
2264 : Demonstration of pipe table syntax.
2266The syntax is identical to [PHP Markdown Extra tables]. The beginning and
2267ending pipe characters are optional, but pipes are required between all
2268columns. The colons indicate column alignment as shown. The header
2269cannot be omitted. To simulate a headerless table, include a header
2272Since the pipes indicate column boundaries, columns need not be vertically
2273aligned, as they are in the above example. So, this is a perfectly
2274legal (though ugly) pipe table:
2282The cells of pipe tables cannot contain block elements like paragraphs
2283and lists, and cannot span multiple lines. If a pipe table contains a
2284row whose printable content is wider than the column width (see
2285`--columns`), then the cell contents will wrap, with the
2286relative cell widths determined by the widths of the separator
2289Note: pandoc also recognizes pipe tables of the following
2290form, as can be produced by Emacs' orgtbl-mode:
2297The difference is that `+` is used instead of `|`. Other orgtbl features
2298are not supported. In particular, to get non-default column alignment,
2299you'll need to add colons as above.
2301[PHP Markdown Extra tables]: https://michelf.ca/projects/php-markdown/extra/#table
2306#### Extension: `pandoc_title_block` ####
2308If the file begins with a title block
2311 % author(s) (separated by semicolons)
2314it will be parsed as bibliographic information, not regular text. (It
2315will be used, for example, in the title of standalone LaTeX or HTML
2316output.) The block may contain just a title, a title and an author,
2317or all three elements. If you want to include an author but no
2318title, or a title and a date but no author, you need a blank line:
2327The title may occupy multiple lines, but continuation lines must
2328begin with leading space, thus:
2333If a document has multiple authors, the authors may be put on
2334separate lines with leading space, or separated by semicolons, or
2335both. So, all of the following are equivalent:
2340 % Author One; Author Two
2345The date must fit on one line.
2347All three metadata fields may contain standard inline formatting
2348(italics, links, footnotes, etc.).
2350Title blocks will always be parsed, but they will affect the output only
2351when the `--standalone` (`-s`) option is chosen. In HTML output, titles
2352will appear twice: once in the document head -- this is the title that
2353will appear at the top of the window in a browser -- and once at the
2354beginning of the document body. The title in the document head can have
2355an optional prefix attached (`--title-prefix` or `-T` option). The title
2356in the body appears as an H1 element with class "title", so it can be
2357suppressed or reformatted with CSS. If a title prefix is specified with
2358`-T` and no title block appears in the document, the title prefix will
2359be used by itself as the HTML title.
2361The man page writer extracts a title, man page section number, and
2362other header and footer information from the title line. The title
2363is assumed to be the first word on the title line, which may optionally
2364end with a (single-digit) section number in parentheses. (There should
2365be no space between the title and the parentheses.) Anything after
2366this is assumed to be additional footer and header text. A single pipe
2367character (`|`) should be used to separate the footer text from the header
2372will yield a man page with the title `PANDOC` and section 1.
2374 % PANDOC(1) Pandoc User Manuals
2376will also have "Pandoc User Manuals" in the footer.
2378 % PANDOC(1) Pandoc User Manuals | Version 4.0
2380will also have "Version 4.0" in the header.
2382#### Extension: `yaml_metadata_block` ####
2384A YAML metadata block is a valid YAML object, delimited by a line of three
2385hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
2386(`...`) at the bottom. A YAML metadata block may occur anywhere in the
2387document, but if it is not at the beginning, it must be preceded by a blank
2388line. (Note that, because of the way pandoc concatenates input files when
2389several are provided, you may also keep the metadata in a separate YAML file
2390and pass it to pandoc as an argument, along with your Markdown files:
2392 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
2394Just be sure that the YAML file begins with `---` and ends with `---` or
2397Metadata will be taken from the fields of the YAML object and added to any
2398existing document metadata. Metadata can contain lists and objects (nested
2399arbitrarily), but all string scalars will be interpreted as Markdown. Fields
2400with names ending in an underscore will be ignored by pandoc. (They may be
2401given a role by external processors.)
2403A document may contain multiple metadata blocks. The metadata fields will
2404be combined through a *left-biased union*: if two metadata blocks attempt
2405to set the same field, the value from the first block will be taken.
2407When pandoc is used with `-t markdown` to create a Markdown document,
2408a YAML metadata block will be produced only if the `-s/--standalone`
2409option is used. All of the metadata will appear in a single block
2410at the beginning of the document.
2412Note that YAML escaping rules must be followed. Thus, for example,
2413if a title contains a colon, it must be quoted. The pipe character
2414(`|`) can be used to begin an indented block that will be interpreted
2415literally, without need for escaping. This form is necessary
2416when the field contains blank lines:
2419 title: 'This is the title: it contains a colon'
2422 affiliation: University of Somewhere
2424 affiliation: University of Nowhere
2425 tags: [nothing, nothingness]
2427 This is the abstract.
2429 It consists of two paragraphs.
2432Template variables will be set automatically from the metadata. Thus, for
2433example, in writing HTML, the variable `abstract` will be set to the HTML
2434equivalent of the Markdown in the `abstract` field:
2436 <p>This is the abstract.</p>
2437 <p>It consists of two paragraphs.</p>
2439Note: The `author` variable in the default templates expects a simple list or
2440string. To use the structured authors in the example, you would need a
2441custom template. For example:
2445 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
2455#### Extension: `all_symbols_escapable` ####
2457Except inside a code block or inline code, any punctuation or space
2458character preceded by a backslash will be treated literally, even if it
2459would normally indicate formatting. Thus, for example, if one writes
2469 <strong>hello</strong>
2471This rule is easier to remember than standard Markdown's rule,
2472which allows only the following characters to be backslash-escaped:
2476(However, if the `markdown_strict` format is used, the standard Markdown rule
2479A backslash-escaped space is parsed as a nonbreaking space. It will
2480appear in TeX output as `~` and in HTML and XML as `\ ` or
2483A backslash-escaped newline (i.e. a backslash occurring at the end of
2484a line) is parsed as a hard line break. It will appear in TeX output as
2485`\\` and in HTML as `<br />`. This is a nice alternative to
2486Markdown's "invisible" way of indicating hard line breaks using
2487two trailing spaces on a line.
2489Backslash escapes do not work in verbatim contexts.
2496If the `--smart` option is specified, pandoc will produce typographically
2497correct output, converting straight quotes to curly quotes, `---` to
2498em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
2499are inserted after certain abbreviations, such as "Mr."
2501Note: if your LaTeX template or any included header file call for the
2502[`csquotes`] package, pandoc will detect this automatically and use
2503`\enquote{...}` for quoted text.
2510To *emphasize* some text, surround it with `*`s or `_`, like this:
2512 This text is _emphasized with underscores_, and this
2513 is *emphasized with asterisks*.
2515Double `*` or `_` produces **strong emphasis**:
2517 This is **strong emphasis** and __with underscores__.
2519A `*` or `_` character surrounded by spaces, or backslash-escaped,
2520will not trigger emphasis:
2522 This is * not emphasized *, and \*neither is this\*.
2524#### Extension: `intraword_underscores` ####
2526Because `_` is sometimes used inside words and identifiers,
2527pandoc does not interpret a `_` surrounded by alphanumeric
2528characters as an emphasis marker. If you want to emphasize
2529just part of a word, use `*`:
2531 feas*ible*, not feas*able*.
2536#### Extension: `strikeout` ####
2538To strikeout a section of text with a horizontal line, begin and end it
2539with `~~`. Thus, for example,
2541 This ~~is deleted text.~~
2544### Superscripts and subscripts ###
2546#### Extension: `superscript`, `subscript` ####
2548Superscripts may be written by surrounding the superscripted text by `^`
2549characters; subscripts may be written by surrounding the subscripted
2550text by `~` characters. Thus, for example,
2552 H~2~O is a liquid. 2^10^ is 1024.
2554If the superscripted or subscripted text contains spaces, these spaces
2555must be escaped with backslashes. (This is to prevent accidental
2556superscripting and subscripting through the ordinary use of `~` and `^`.)
2557Thus, if you want the letter P with 'a cat' in subscripts, use
2558`P~a\ cat~`, not `P~a cat~`.
2563To make a short span of text verbatim, put it inside backticks:
2565 What is the difference between `>>=` and `>>`?
2567If the verbatim text includes a backtick, use double backticks:
2569 Here is a literal backtick `` ` ``.
2571(The spaces after the opening backticks and before the closing
2572backticks will be ignored.)
2574The general rule is that a verbatim span starts with a string
2575of consecutive backticks (optionally followed by a space)
2576and ends with a string of the same number of backticks (optionally
2577preceded by a space).
2579Note that backslash-escapes (and other Markdown constructs) do not
2580work in verbatim contexts:
2582 This is a backslash followed by an asterisk: `\*`.
2584#### Extension: `inline_code_attributes` ####
2586Attributes can be attached to verbatim text, just as with
2587[fenced code blocks]:
2593To write small caps, you can use an HTML span tag:
2595 <span style="font-variant:small-caps;">Small caps</span>
2597(The semicolon is optional and there may be space after the
2598colon.) This will work in all output formats that support small caps.
2603#### Extension: `tex_math_dollars` ####
2605Anything between two `$` characters will be treated as TeX math. The
2606opening `$` must have a non-space character immediately to its right,
2607while the closing `$` must have a non-space character immediately to its
2608left, and must not be followed immediately by a digit. Thus,
2609`$20,000 and $30,000` won't parse as math. If for some reason
2610you need to enclose text in literal `$` characters, backslash-escape
2611them and they won't be treated as math delimiters.
2613TeX math will be printed in all output formats. How it is rendered
2614depends on the output format:
2616Markdown, LaTeX, Emacs Org mode, ConTeXt
2617 ~ It will appear verbatim between `$` characters.
2620 ~ It will be rendered using an [interpreted text role `:math:`].
2623 ~ It will be rendered as `latexmath:[...]`.
2626 ~ It will be rendered inside a `@math` command.
2629 ~ It will be rendered verbatim without `$`'s.
2632 ~ It will be rendered inside `<math>` tags.
2635 ~ It will be rendered inside `<span class="math">` tags.
2637RTF, OpenDocument, ODT
2638 ~ It will be rendered, if possible, using unicode characters,
2639 and will otherwise appear verbatim.
2642 ~ If the `--mathml` flag is used, it will be rendered using MathML
2643 in an `inlineequation` or `informalequation` tag. Otherwise it
2644 will be rendered, if possible, using unicode characters.
2647 ~ It will be rendered using OMML math markup.
2650 ~ If the `--webtex` option is used, formulas are rendered as images
2651 using Google Charts or other compatible web service, downloaded
2652 and embedded in the e-book. Otherwise, they will appear verbatim.
2654HTML, Slidy, DZSlides, S5, EPUB
2655 ~ The way math is rendered in HTML will depend on the
2656 command-line options selected:
2658 1. The default is to render TeX math as far as possible using unicode
2659 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2660 are put inside a `span` with `class="math"`, so that they may be
2661 styled differently from the surrounding text if needed.
2663 2. If the `--latexmathml` option is used, TeX math will be displayed
2664 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2665 The [LaTeXMathML] script will be used to render it as formulas.
2666 (This trick does not work in all browsers, but it works in Firefox.
2667 In browsers that do not support LaTeXMathML, TeX math will appear
2668 verbatim between `$` characters.)
2670 3. If the `--jsmath` option is used, TeX math will be put inside
2671 `<span>` tags (for inline math) or `<div>` tags (for display math)
2672 with class `math`. The [jsMath] script will be used to render
2675 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2676 be called to generate images for each TeX formula. This should
2677 work in all browsers. The `--mimetex` option takes an optional URL
2678 as argument. If no URL is specified, it will be assumed that the
2679 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2681 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2682 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2683 be processed by [gladTeX], which will produce image files for each
2684 formula and an HTML file with links to these images. So, the
2687 pandoc -s --gladtex myfile.txt -o myfile.htex
2688 gladtex -d myfile-images myfile.htex
2689 # produces myfile.html and images in myfile-images
2691 6. If the `--webtex` option is used, TeX formulas will be converted
2692 to `<img>` tags that link to an external script that converts
2693 formulas to images. The formula will be URL-encoded and concatenated
2694 with the URL provided. If no URL is specified, the Google Chart
2695 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2697 7. If the `--mathjax` option is used, TeX math will be displayed
2698 between `\(...\)` (for inline math) or `\[...\]` (for display
2699 math) and put in `<span>` tags with class `math`.
2700 The [MathJax] script will be used to render it as formulas.
2702[interpreted text role `:math:`]: http://docutils.sourceforge.net/docs/ref/rst/roles.html#math
2707#### Extension: `raw_html` ####
2709Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2710(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2711literally). (Technically this is not an extension, since standard
2712Markdown allows it, but it has been made an extension so that it can
2713be disabled if desired.)
2715The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2716DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2719#### Extension: `markdown_in_html_blocks` ####
2721Standard Markdown allows you to include HTML "blocks": blocks
2722of HTML between balanced tags that are separated from the surrounding text
2723with blank lines, and start and end at the left margin. Within
2724these blocks, everything is interpreted as HTML, not Markdown;
2725so (for example), `*` does not signify emphasis.
2727Pandoc behaves this way when the `markdown_strict` format is used; but
2728by default, pandoc interprets material between HTML block tags as Markdown.
2729Thus, for example, pandoc will turn
2734 <td>[a link](http://google.com)</td>
2742 <td><em>one</em></td>
2743 <td><a href="http://google.com">a link</a></td>
2747whereas `Markdown.pl` will preserve it as is.
2749There is one exception to this rule: text between `<script>` and
2750`<style>` tags is not interpreted as Markdown.
2752This departure from standard Markdown should make it easier to mix
2753Markdown with HTML block elements. For example, one can surround
2754a block of Markdown text with `<div>` tags without preventing it
2755from being interpreted as Markdown.
2757#### Extension: `native_divs` ####
2759Use native pandoc `Div` blocks for content inside `<div>` tags.
2760For the most part this should give the same output as
2761`markdown_in_html_blocks`, but it makes it easier to write pandoc
2762filters to manipulate groups of blocks.
2764#### Extension: `native_spans` ####
2766Use native pandoc `Span` blocks for content inside `<span>` tags.
2767For the most part this should give the same output as `raw_html`,
2768but it makes it easier to write pandoc filters to manipulate groups
2774#### Extension: `raw_tex` ####
2776In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2777included in a document. Inline TeX commands will be preserved and passed
2778unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2779LaTeX to include BibTeX citations:
2781 This result was proved in \cite{jones.1967}.
2783Note that in LaTeX environments, like
2785 \begin{tabular}{|l|l|}\hline
2786 Age & Frequency \\ \hline
2789 36--45 & 22 \\ \hline
2792the material between the begin and end tags will be interpreted as raw
2793LaTeX, not as Markdown.
2795Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2801#### Extension: `latex_macros` ####
2803For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2804`\renewcommand` definitions and apply the resulting macros to all LaTeX
2805math. So, for example, the following will work in all output formats,
2808 \newcommand{\tuple}[1]{\langle #1 \rangle}
2812In LaTeX output, the `\newcommand` definition will simply be passed
2813unchanged to the output.
2819Markdown allows links to be specified in several ways.
2821### Automatic links ###
2823If you enclose a URL or email address in pointy brackets, it
2827 <sam@green.eggs.ham>
2831An inline link consists of the link text in square brackets,
2832followed by the URL in parentheses. (Optionally, the URL can
2833be followed by a link title, in quotes.)
2835 This is an [inline link](/url), and here's [one with
2836 a title](http://fsf.org "click here for a good time!").
2838There can be no space between the bracketed part and the parenthesized part.
2839The link text can contain formatting (such as emphasis), but the title cannot.
2841Email addresses in inline links are not autodetected, so they have to be
2842prefixed with `mailto`:
2844 [Write me!](mailto:sam@green.eggs.ham)
2846### Reference links ###
2848An *explicit* reference link has two parts, the link itself and the link
2849definition, which may occur elsewhere in the document (either
2850before or after the link).
2852The link consists of link text in square brackets, followed by a label in
2853square brackets. (There can be space between the two.) The link definition
2854consists of the bracketed label, followed by a colon and a space, followed by
2855the URL, and optionally (after a space) a link title either in quotes or in
2856parentheses. The label must not be parseable as a citation (assuming
2857the `citations` extension is enabled): citations take precedence over
2860Here are some examples:
2862 [my label 1]: /foo/bar.html "My title, optional"
2864 [my label 3]: http://fsf.org (The free software foundation)
2865 [my label 4]: /bar#special 'A title in single quotes'
2867The URL may optionally be surrounded by angle brackets:
2869 [my label 5]: <http://foo.bar.baz>
2871The title may go on the next line:
2873 [my label 3]: http://fsf.org
2874 "The free software foundation"
2876Note that link labels are not case sensitive. So, this will work:
2878 Here is [my link][FOO]
2882In an *implicit* reference link, the second pair of brackets is
2887 [my website]: http://foo.bar.baz
2889Note: In `Markdown.pl` and most other Markdown implementations,
2890reference link definitions cannot occur in nested constructions
2891such as list items or block quotes. Pandoc lifts this arbitrary
2892seeming restriction. So the following is fine in pandoc, though
2893not in most other implementations:
2899#### Extension: `shortcut_reference_links` ####
2901In a *shortcut* reference link, the second pair of brackets may
2906 [my website]: http://foo.bar.baz
2908### Internal links ###
2910To link to another section of the same document, use the automatically
2911generated identifier (see [Header identifiers]). For example:
2913 See the [Introduction](#introduction).
2917 See the [Introduction].
2919 [Introduction]: #introduction
2921Internal links are currently supported for HTML formats (including
2922HTML slide shows and EPUB), LaTeX, and ConTeXt.
2927A link immediately preceded by a `!` will be treated as an image.
2928The link text will be used as the image's alt text:
2930 
2934 [movie reel]: movie.gif
2936#### Extension: `implicit_figures` ####
2938An image occurring by itself in a paragraph will be rendered as
2939a figure with a caption.[^5] (In LaTeX, a figure environment will be
2940used; in HTML, the image will be placed in a `div` with class
2941`figure`, together with a caption in a `p` with class `caption`.)
2942The image's alt text will be used as the caption.
2944 
2946[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2947 ODT. In those formats, you'll just get an image in a paragraph by
2948 itself, with no caption.
2950If you just want a regular inline image, just make sure it is not
2951the only thing in the paragraph. One way to do this is to insert a
2952nonbreaking space after the image:
2954 \
2956#### Extension: `link_attributes` ####
2958Attributes can be set on links and images:
2960 An inline {#id .class width=30 height=20px}
2961 and a reference ![image][ref] with attributes.
2963 [ref]: foo.jpg "optional title" {#id .class key=val key2="val 2"}
2965(This syntax is compatible with [PHP Markdown Extra] when only `#id`
2966and `.class` are used.)
2968For HTML and EPUB, all attributes except `width` and `height` (but
2969including `srcset` and `sizes`) are passed through as is. The other
2970writers ignore attributes that are not supported by their output
2973The `width` and `height` attributes on images are treated specially. When
2974used without a unit, the unit is assumed to be pixels. However, any of
2975the following unit identifiers can be used: `px`, `cm`, `mm`, `in`, `inch`
2976and `%`. There must not be any spaces between the number and the unit.
2980{ width=50% }
2983- Dimensions are converted to inches for output in page-based formats like
2984 LaTeX. Dimensions are converted to pixels for output in HTML-like
2985 formats. Use the `--dpi` option to specify the number of pixels per
2986 inch. The default is 96dpi.
2987- The `%` unit is generally relative to some available space.
2988 For example the above example will render to
2989 `<img href="file.jpg" style="width: 50%;" />` (HTML),
2990 `\includegraphics[width=0.5\textwidth]{file.jpg}` (LaTeX), or
2991 `\externalfigure[file.jpg][width=0.5\textwidth]` (ConTeXt).
2992- Some output formats have a notion of a class
2993 ([ConTeXt](http://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings))
2994 or a unique identifier (LaTeX `\caption`), or both (HTML).
2995- When no `width` or `height` attributes are specified, the fallback
2996 is to look at the image resolution and the dpi metadata embedded in
3003#### Extension: `footnotes` ####
3005Pandoc's Markdown allows footnotes, using the following syntax:
3007 Here is a footnote reference,[^1] and another.[^longnote]
3009 [^1]: Here is the footnote.
3011 [^longnote]: Here's one with multiple blocks.
3013 Subsequent paragraphs are indented to show that they
3014 belong to the previous footnote.
3018 The whole paragraph can be indented, or just the first
3019 line. In this way, multi-paragraph footnotes work like
3020 multi-paragraph list items.
3022 This paragraph won't be part of the note, because it
3025The identifiers in footnote references may not contain spaces, tabs,
3026or newlines. These identifiers are used only to correlate the
3027footnote reference with the note itself; in the output, footnotes
3028will be numbered sequentially.
3030The footnotes themselves need not be placed at the end of the
3031document. They may appear anywhere except inside other block elements
3032(lists, block quotes, tables, etc.).
3034#### Extension: `inline_notes` ####
3036Inline footnotes are also allowed (though, unlike regular notes,
3037they cannot contain multiple paragraphs). The syntax is as follows:
3039 Here is an inline note.^[Inlines notes are easier to write, since
3040 you don't have to pick an identifier and move down to type the
3043Inline and regular footnotes may be mixed freely.
3049#### Extension: `citations` ####
3051Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
3052citations and a bibliography in a number of styles. Basic usage is
3054 pandoc --filter pandoc-citeproc myinput.txt
3056In order to use this feature, you will need to specify a bibliography file
3057using the `bibliography` metadata field in a YAML metadata section, or
3058`--bibliography` command line argument. You can supply multiple `--bibliography`
3059arguments or set `bibliography` metadata field to YAML array, if you want to
3060use multiple bibliography files. The bibliography may have any of these
3063 Format File extension
3064 ------------ --------------
3077Note that `.bib` can be used with both BibTeX and BibLaTeX files;
3078use `.bibtex` to force BibTeX.
3080Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`
3081can produce `.json` and `.yaml` files from any of the supported formats.
3083In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc parses
3084a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown; and in CSL JSON databases, an [HTML-like markup][CSL markup specs]:
3092`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`
3101`<span class="nocase">...</span>`
3102: prevent a phrase from being capitalized as title case
3104`pandoc-citeproc -j` and `-y` interconvert the CSL JSON
3105and CSL YAML formats as far as possible.
3107As an alternative to specifying a bibliography file using `--bibliography`
3108or the YAML metadata field `bibliography`, you can include
3109the citation data directly in the `references` field of the
3110document's YAML metadata. The field should contain an array of
3111YAML-encoded references, for example:
3115 - type: article-journal
3127 title: 'Molecular structure of nucleic acids: a structure for deoxyribose
3129 title-short: Molecular structure of nucleic acids
3130 container-title: Nature
3134 DOI: 10.1038/171737a0
3135 URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
3139(`pandoc-citeproc --bib2yaml` can produce these from a bibliography file in one
3140of the supported formats.)
3142Citations and references can be formatted using any style supported by the
3143[Citation Style Language], listed in the [Zotero Style Repository].
3144These files are specified using the `--csl` option or the `csl` metadata field.
3145By default, `pandoc-citeproc` will use the [Chicago Manual of Style] author-date
3146format. The CSL project provides further information on [finding and editing styles].
3148To make your citations hyperlinks to the corresponding bibliography
3149entries, add `link-citations: true` to your YAML metadata.
3151Citations go inside square brackets and are separated by semicolons.
3152Each citation must have a key, composed of '@' + the citation
3153identifier from the database, and may optionally have a prefix,
3154a locator, and a suffix. The citation key must begin with a letter, digit,
3155or `_`, and may contain alphanumerics, `_`, and internal punctuation
3156characters (`:.#$%&-+?<>~/`). Here are some examples:
3158 Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
3160 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
3162 Blah blah [@smith04; @doe99].
3164`pandoc-citeproc` detects locator terms in the [CSL locale files].
3165Either abbreviated or unabbreviated forms are accepted. In the `en-US`
3166locale, locator terms can be written in either singular or plural forms,
3167as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
3168`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`, `fol.`/`fols.`;
3169`number`, `no.`/`nos.`; `line`, `l.`/`ll.`; `note`, `n.`/`nn.`; `opus`,
3170`op.`/`opp.`; `page`, `p.`/`pp.`; `paragraph`, `para.`/`paras.`; `part`,
3171`pt.`/`pts.`; `section`, `sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`;
3172`verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
3173locator term is used, "page" is assumed.
3175A minus sign (`-`) before the `@` will suppress mention of
3176the author in the citation. This can be useful when the
3177author is already mentioned in the text:
3179 Smith says blah [-@smith04].
3181You can also write an in-text citation, as follows:
3185 @smith04 [p. 33] says blah.
3187If the style calls for a list of works cited, it will be placed
3188at the end of the document. Normally, you will want to end your
3189document with an appropriate header:
3195The bibliography will be inserted after this header. Note that
3196the `unnumbered` class will be added to this header, so that the
3197section will not be numbered.
3199If you want to include items in the bibliography without actually
3200citing them in the body text, you can define a dummy `nocite` metadata
3201field and put the citations there:
3210In this example, the document will contain a citation for `item3`
3211only, but the bibliography will contain entries for `item1`, `item2`, and
3214For LaTeX or PDF output, you can also use [`natbib`] or [`biblatex`]
3215to render bibliography. In order to do so, specify bibliography files as
3216outlined above, and add `--natbib` or `--biblatex` argument to `pandoc`
3217invocation. Bear in mind that bibliography files have to be in respective
3218format (either BibTeX or BibLaTeX).
3220For more information, see the [pandoc-citeproc man page].
3222[CSL markup specs]: http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
3223[Chicago Manual of Style]: http://chicagomanualofstyle.org
3224[Citation Style Language]: http://citationstyles.org
3225[Zotero Style Repository]: https://www.zotero.org/styles
3226[finding and editing styles]: http://citationstyles.org/styles/
3227[CSL locale files]: https://github.com/citation-style-language/locales
3228[pandoc-citeproc man page]: https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md
3230Non-pandoc extensions
3231---------------------
3233The following Markdown syntax extensions are not enabled by default
3234in pandoc, but may be enabled by adding `+EXTENSION` to the format
3235name, where `EXTENSION` is the name of the extension. Thus, for
3236example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
3238#### Extension: `lists_without_preceding_blankline` ####
3240Allow a list to occur right after a paragraph, with no intervening
3243#### Extension: `hard_line_breaks` ####
3245Causes all newlines within a paragraph to be interpreted as hard line
3246breaks instead of spaces.
3248#### Extension: `ignore_line_breaks` ####
3250Causes newlines within a paragraph to be ignored, rather than being
3251treated as spaces or as hard line breaks. This option is intended for
3252use with East Asian languages where spaces are not used between words,
3253but text is divided into lines for readability.
3255#### Extension: `east_asian_line_breaks` ####
3257Causes newlines within a paragraph to be ignored, rather than
3258being treated as spaces or as hard line breaks, when they occur
3259between two East Asian wide characters. This is a better choice
3260than `ignore_line_breaks` for texts that include a mix of East
3261Asian wide characters and other characters.
3263##### Extension: `emoji` ####
3265Parses textual emojis like `:smile:` as Unicode emoticons.
3267#### Extension: `tex_math_single_backslash` ####
3269Causes anything between `\(` and `\)` to be interpreted as inline
3270TeX math, and anything between `\[` and `\]` to be interpreted
3271as display TeX math. Note: a drawback of this extension is that
3272it precludes escaping `(` and `[`.
3274#### Extension: `tex_math_double_backslash` ####
3276Causes anything between `\\(` and `\\)` to be interpreted as inline
3277TeX math, and anything between `\\[` and `\\]` to be interpreted
3280#### Extension: `markdown_attribute` ####
3282By default, pandoc interprets material inside block-level tags as Markdown.
3283This extension changes the behavior so that Markdown is only parsed
3284inside block-level tags if the tags have the attribute `markdown=1`.
3286#### Extension: `mmd_title_block` ####
3288Enables a [MultiMarkdown] style title block at the top of
3289the document, for example:
3293 Date: September 1, 2008
3294 Comment: This is a sample mmd title block, with
3295 a field spanning multiple lines.
3297See the MultiMarkdown documentation for details. If `pandoc_title_block` or
3298`yaml_metadata_block` is enabled, it will take precedence over
3301[MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
3303#### Extension: `abbreviations` ####
3305Parses PHP Markdown Extra abbreviation keys, like
3307 *[HTML]: Hypertext Markup Language
3309Note that the pandoc document model does not support
3310abbreviations, so if this extension is enabled, abbreviation keys are
3311simply skipped (as opposed to being parsed as paragraphs).
3313#### Extension: `autolink_bare_uris` ####
3315Makes all absolute URIs into links, even when not surrounded by
3316pointy braces `<...>`.
3318#### Extension: `ascii_identifiers` ####
3320Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
3321Accents are stripped off of accented latin letters, and non-latin
3324#### Extension: `mmd_link_attributes` ####
3326Parses multimarkdown style key-value attributes on link
3327and image references. This extension should not be confused with the
3328[`link_attributes`](#extension-link_attributes) extension.
3330 This is a reference ![image][ref] with multimarkdown attributes.
3332 [ref]: http://path.to/image "Image title" width=20px height=30px
3333 id=myId class="myClass1 myClass2"
3335#### Extension: `mmd_header_identifiers` ####
3337Parses multimarkdown style header identifiers (in square brackets,
3338after the header but before any trailing `#`s in an ATX header).
3340#### Extension: `compact_definition_lists` ####
3342Activates the definition list syntax of pandoc 1.12.x and earlier.
3343This syntax differs from the one described above under [Definition lists]
3346 - No blank line is required between consecutive items of the
3348 - To get a "tight" or "compact" list, omit space between consecutive
3349 items; the space between a term and its definition does not affect
3351 - Lazy wrapping of paragraphs is not allowed: the entire definition must
3352 be indented four spaces.[^6]
3354[^6]: To see why laziness is incompatible with relaxing the requirement
3355 of a blank line between items, consider the following example:
3362 Is this a single list item with two definitions of "bar," the first of
3363 which is lazily wrapped, or two list items? To remove the ambiguity
3364 we must either disallow lazy wrapping or require a blank line between
3370In addition to pandoc's extended Markdown, the following Markdown
3371variants are supported:
3373`markdown_phpextra` (PHP Markdown Extra)
3374: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
3375 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
3376 `header_attributes`, `link_attributes`, `abbreviations`,
3377 `shortcut_reference_links`.
3379`markdown_github` (GitHub-Flavored Markdown)
3380: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
3381 `fenced_code_blocks`, `auto_identifiers`,
3382 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
3383 `intraword_underscores`, `strikeout`, `hard_line_breaks`, `emoji`,
3384 `shortcut_reference_links`.
3386`markdown_mmd` (MultiMarkdown)
3387: `pipe_tables` `raw_html`, `markdown_attribute`, `mmd_link_attributes`,
3388 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
3389 `mmd_title_block`, `footnotes`, `definition_lists`,
3390 `all_symbols_escapable`, `implicit_header_references`,
3391 `auto_identifiers`, `mmd_header_identifiers`,
3392 `shortcut_reference_links`.
3394`markdown_strict` (Markdown.pl)
3397Extensions with formats other than Markdown
3398-------------------------------------------
3400Some of the extensions discussed above can be used with formats
3403* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
3404 and `textile` input (and is used by default).
3406* `tex_math_dollars`, `tex_math_single_backslash`, and
3407 `tex_math_double_backslash` can be used with `html` input.
3408 (This is handy for reading web pages formatted using MathJax,
3411Producing slide shows with pandoc
3412=================================
3414You can use pandoc to produce an HTML + javascript slide presentation
3415that can be viewed via a web browser. There are five ways to do this,
3416using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
3417You can also produce a PDF slide show using LaTeX [`beamer`].
3419Here's the Markdown source for a simple slide show, `habits.txt`:
3446 
3453To produce an HTML/javascript slide show, simply type
3455 pandoc -t FORMAT -s habits.txt -o habits.html
3457where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
3459For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
3460`-s/--standalone` option embeds a link to javascripts and CSS files, which are
3461assumed to be available at the relative path `s5/default` (for S5), `slideous`
3462(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
3463`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
3464`slideous-url`, `revealjs-url`, or `s5-url` variables; see [Variables for slides],
3465above.) For DZSlides, the (relatively short) javascript and css are included in
3468With all HTML slide formats, the `--self-contained` option can be used to
3469produce a single file that contains all of the data necessary to display the
3470slide show, including linked scripts, stylesheets, images, and videos.
3472To produce a PDF slide show using beamer, type
3474 pandoc -t beamer habits.txt -o habits.pdf
3476Note that a reveal.js slide show can also be converted to a PDF
3477by printing it to a file from the browser.
3479Structuring the slide show
3480--------------------------
3482By default, the *slide level* is the highest header level in
3483the hierarchy that is followed immediately by content, and not another
3484header, somewhere in the document. In the example above, level 1 headers
3485are always followed by level 2 headers, which are followed by content,
3486so 2 is the slide level. This default can be overridden using
3487the `--slide-level` option.
3489The document is carved up into slides according to the following
3492 * A horizontal rule always starts a new slide.
3494 * A header at the slide level always starts a new slide.
3496 * Headers *below* the slide level in the hierarchy create
3497 headers *within* a slide.
3499 * Headers *above* the slide level in the hierarchy create
3500 "title slides," which just contain the section title
3501 and help to break the slide show into sections.
3503 * A title page is constructed automatically from the document's title
3504 block, if present. (In the case of beamer, this can be disabled
3505 by commenting out some lines in the default template.)
3507These rules are designed to support many different styles of slide show. If
3508you don't care about structuring your slides into sections and subsections,
3509you can just use level 1 headers for all each slide. (In that case, level 1
3510will be the slide level.) But you can also structure the slide show into
3511sections, as in the example above.
3513Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
3514layout will be produced, with level 1 headers building horizontally
3515and level 2 headers building vertically. It is not recommended that
3516you use deeper nesting of section levels with reveal.js.
3521By default, these writers produce lists that display "all at once."
3522If you want your lists to display incrementally (one item at a time),
3523use the `-i` option. If you want a particular list to depart from the
3524default (that is, to display incrementally without the `-i` option and
3525all at once with the `-i` option), put it in a block quote:
3530In this way incremental and nonincremental lists can be mixed in
3536You can add "pauses" within a slide by including a paragraph containing
3537three dots, separated by spaces:
3539 # Slide with a pause
3541 content before the pause
3545 content after the pause
3550You can change the style of HTML slides by putting customized CSS files
3551in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
3552or `$DATADIR/slideous` (for Slideous),
3553where `$DATADIR` is the user data directory (see `--data-dir`, above).
3554The originals may be found in pandoc's system data directory (generally
3555`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
3556files it does not find in the user data directory.
3558For dzslides, the CSS is included in the HTML file itself, and may
3561All [reveal.js configuration options] can be set through variables.
3562For example, themes can be used by setting the `theme` variable:
3566Or you can specify a custom stylesheet using the `--css` option.
3568To style beamer slides, you can specify a `theme`, `colortheme`,
3569`fonttheme`, `innertheme`, and `outertheme`, using the `-V` option:
3571 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
3573Note that header attributes will turn into slide attributes
3574(on a `<div>` or `<section>`) in HTML slide formats, allowing you
3575to style individual slides. In beamer, the only header attribute
3576that affects slides is the `allowframebreaks` class, which sets the
3577`allowframebreaks` option, causing multiple slides to be created
3578if the content overfills the frame. This is recommended especially for
3581 # References {.allowframebreaks}
3586reveal.js has good support for speaker notes. You can add notes to your
3587Markdown document thus:
3592 - It can contain Markdown
3597To show the notes window, press `s` while viewing the presentation.
3598Notes are not yet supported for other slide formats, but the notes
3599will not appear on the slides themselves.
3601Frame attributes in beamer
3602--------------------------
3604Sometimes it is necessary to add the LaTeX `[fragile]` option to
3605a frame in beamer (for example, when using the `minted` environment).
3606This can be forced by adding the `fragile` class to the header
3607introducing the slide:
3609 # Fragile slide {.fragile}
3611All of the other frame attributes described in Section 8.1 of
3612the [Beamer User's Guide] may also be used: `allowdisplaybreaks`,
3613`allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`,
3616Creating EPUBs with pandoc
3617==========================
3622EPUB metadata may be specified using the `--epub-metadata` option, but
3623if the source document is Markdown, it is better to use a [YAML metadata
3624block][Extension: `yaml_metadata_block`]. Here is an example:
3631 text: An investigation of metadata
3639 text: doi:10.234234.234/33
3641 rights: © 2007 John Smith, CC BY-NC
3644The following fields are recognized:
3647 ~ Either a string value or an object with fields `text` and
3648 `scheme`. Valid values for `scheme` are `ISBN-10`,
3649 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
3650 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
3651 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
3654 ~ Either a string value, or an object with fields `file-as` and
3655 `type`, or a list of such objects. Valid values for `type` are
3656 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
3659 ~ Either a string value, or an object with fields `role`, `file-as`,
3660 and `text`, or a list of such objects. Valid values for `role` are
3661 [MARC relators], but
3662 pandoc will attempt to translate the human-readable versions
3663 (like "author" and "editor") to the appropriate marc relators.
3666 ~ Same format as `creator`.
3669 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
3670 Pandoc will attempt to convert other common date formats.
3672`lang` (or legacy: `language`)
3673 ~ A string value in [BCP 47] format. Pandoc will default to the local
3674 language if nothing is specified.
3677 ~ A string value or a list of such values.
3698 ~ A string value (path to cover image).
3701 ~ A string value (path to CSS stylesheet).
3703`page-progression-direction`
3704 ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`
3705 attribute for the [`spine` element].
3707[MARC relators]: http://loc.gov/marc/relators/relaterm.html
3708[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
3713By default, pandoc will download linked media (including audio and
3714video) and include it in the EPUB container, yielding a completely
3715self-contained EPUB. If you want to link to external media resources
3716instead, use raw HTML in your source and add `data-external="1"` to the tag
3717with the `src` attribute. For example:
3719 <audio controls="1">
3720 <source src="http://example.com/music/toccata.mp3"
3721 data-external="1" type="audio/mpeg">
3725Literate Haskell support
3726========================
3728If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
3729format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
3730`beamer`, `html` or `html5` for output only), pandoc will treat the document as
3731literate Haskell source. This means that
3733 - In Markdown input, "bird track" sections will be parsed as Haskell
3734 code rather than block quotations. Text between `\begin{code}`
3735 and `\end{code}` will also be treated as Haskell code. For
3736 ATX-style headers the character '=' will be used instead of '#'.
3738 - In Markdown output, code blocks with classes `haskell` and `literate`
3739 will be rendered using bird tracks, and block quotations will be
3740 indented one space, so they will not be treated as Haskell code.
3741 In addition, headers will be rendered setext-style (with underlines)
3742 rather than ATX-style (with '#' characters). (This is because ghc
3743 treats '#' characters in column 1 as introducing line numbers.)
3745 - In restructured text input, "bird track" sections will be parsed
3748 - In restructured text output, code blocks with class `haskell` will
3749 be rendered using bird tracks.
3751 - In LaTeX input, text in `code` environments will be parsed as
3754 - In LaTeX output, code blocks with class `haskell` will be rendered
3755 inside `code` environments.
3757 - In HTML output, code blocks with class `haskell` will be rendered
3758 with class `literatehaskell` and bird tracks.
3762 pandoc -f markdown+lhs -t html
3764reads literate Haskell source formatted with Markdown conventions and writes
3765ordinary HTML (without bird tracks).
3767 pandoc -f markdown+lhs -t html+lhs
3769writes HTML with the Haskell code in bird tracks, so it can be copied
3770and pasted as literate Haskell source.
3775Pandoc will automatically highlight syntax in [fenced code blocks] that
3776are marked with a language name. The Haskell library [highlighting-kate] is used for
3777highlighting, which works in HTML, Docx, and LaTeX/PDF output.
3778The color scheme can be selected using the `--highlight-style` option.
3779The default color scheme is `pygments`, which imitates the default color
3780scheme used by the Python library pygments, but pygments is not actually
3781used to do the highlighting.
3783To see a list of language names that pandoc will recognize, type
3786To disable highlighting, use the `--no-highlight` option.
3788[highlighting-kate]: https://github.com/jgm/highlighting-kate
3793Pandoc can be extended with custom writers written in [lua]. (Pandoc
3794includes a lua interpreter, so lua need not be installed separately.)
3796To use a custom writer, simply specify the path to the lua script
3797in place of the output format. For example:
3799 pandoc -t data/sample.lua
3801Creating a custom writer requires writing a lua function for each
3802possible element in a pandoc document. To get a documented example
3803which you can modify according to your needs, do
3805 pandoc --print-default-data-file sample.lua
3807[lua]: http://www.lua.org
3812© 2006-2015 John MacFarlane (jgm@berkeley.edu). Released under the
3813[GPL], version 2 or greater. This software carries no warranty of
3814any kind. (See COPYRIGHT for full copyright and warranty notices.)
3819Alexander Kondratskiy,
3821Alexander V Vershilov,
3822Alfred Wechselberger,
3830Beni Cherniavsky-Paskin,
3838Christoffer Ackelman,
3868Jaime Marquínez Ferrándiz,
3897Matthias C. M. Troffaes,
3943[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