git.iko.soy/typeable/pandoc
on eaca413 help sign in
3734 lines 129 kB history raw
1% Pandoc User's Guide
2% John MacFarlane
3% July 15, 2015
5Synopsis
6========
8`pandoc` [*options*] [*input-file*]...
10Description
11===========
13Pandoc is a [Haskell] library for converting from one markup format to
14another, and a command-line tool that uses this library. It can read
15[Markdown], [CommonMark], [PHP Markdown Extra], [GitHub-Flavored Markdown],
16and (subsets of) [Textile], [reStructuredText], [HTML], [LaTeX], [MediaWiki markup], [TWiki
17markup], [Haddock markup], [OPML], [Emacs Org mode], [DocBook],
18[txt2tags], [EPUB], [ODT] and [Word docx]; and it can write plain text,
19[Markdown], [CommonMark], [PHP Markdown Extra], [GitHub-Flavored Markdown],
20[reStructuredText], [XHTML], [HTML5], [LaTeX] (including
21[`beamer`] slide shows), [ConTeXt], [RTF], [OPML], [DocBook],
22[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],
23[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),
24[FictionBook2], [Textile], [groff man] pages, [Emacs Org mode],
25[AsciiDoc], [InDesign ICML], and [Slidy], [Slideous], [DZSlides],
26[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
27on systems where LaTeX is installed.
29Pandoc's enhanced version of markdown includes syntax for [footnotes],
30[tables], flexible [ordered lists], [definition lists], [fenced code blocks],
31[superscripts and subscripts], [strikeout], [metadata blocks], automatic tables of
32contents, [embedded LaTeX math][Math rendering in HTML], [citations], and [markdown inside HTML block
33elements][Extension: `markdown_in_html_blocks`]. (These enhancements, described below under
34[Pandoc's markdown], can be disabled using the
35`markdown_strict` input or output format.)
37In contrast to most existing tools for converting markdown to HTML, which
38use regex substitutions, Pandoc has a modular design: it consists of a
39set of readers, which parse text in a given format and produce a native
40representation of the document, and a set of writers, which convert
41this native representation into a target format. Thus, adding an input
42or output format requires only adding a reader or writer.
44Because Pandoc's intermediate representation of a document is less
45expressive than many of the formats it converts between, one should
46not expect perfect conversions between every format and every other.
47Pandoc attempts to preserve the structural elements of a document, but
48not formatting details such as margin size. And some document elements,
49such as complex tables, may not fit into Pandoc's simple document
50model. While conversions from Pandoc's Markdown to all formats aspire
51to be perfect, conversions from formats more expressive than Pandoc's
52Markdown can be expected to be lossy.
54[markdown]: http://daringfireball.net/projects/markdown/
55[CommonMark]: http://commonmark.org
56[PHP Markdown Extra]: https://michelf.ca/projects/php-markdown/extra/
57[GitHub-Flavored Markdown]: https://help.github.com/articles/github-flavored-markdown/
58[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
59[S5]: http://meyerweb.com/eric/tools/s5/
60[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
61[Slideous]: http://goessner.net/articles/slideous/
62[HTML]: http://www.w3.org/html/
63[HTML5]: http://www.w3.org/TR/html5/
64[XHTML]: http://www.w3.org/TR/xhtml1/
65[LaTeX]: http://latex-project.org
66[`beamer`]: https://ctan.org/pkg/beamer
67[Beamer User's Guide]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf
68[ConTeXt]: http://pragma-ade.nl
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
93Using `pandoc`
94--------------
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
101`-o` option:
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
112[Templates], below.
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/
166Creating a PDF
167--------------
169To produce a PDF, specify an output file with a `.pdf` extension.
170Pandoc 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`], [`url`], [`graphicx`] and [`grffile`] (if the
180document contains images), [`color`], [`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. The
188[`natbib`], [`biblatex`], [`bibtex`], and [`biber`] packages can
189optionally be used for [citation rendering]. These are included with
190all recent versions of [TeX Live].
192PDF output can be controlled using [variables for LaTeX].
194[`amsfonts`]: https://ctan.org/pkg/amsfonts
195[`amsmath`]: https://ctan.org/pkg/amsmath
196[`lm`]: https://ctan.org/pkg/lm
197[`ifxetex`]: https://ctan.org/pkg/ifxetex
198[`ifluatex`]: https://ctan.org/pkg/ifluatex
199[`eurosym`]: https://ctan.org/pkg/eurosym
200[`listings`]: https://ctan.org/pkg/listings
201[`fancyvrb`]: https://ctan.org/pkg/fancyvrb
202[`longtable`]: https://ctan.org/pkg/longtable
203[`booktabs`]: https://ctan.org/pkg/booktabs
204[`url`]: https://ctan.org/pkg/url
205[`graphicx`]: https://ctan.org/pkg/graphicx
206[`grffile`]: https://ctan.org/pkg/grffile
207[`geometry`]: https://ctan.org/pkg/geometry
208[`setspace`]: https://ctan.org/pkg/setspace
209[`color`]: http://ctan.org/pkg/color
210[`xecjk`]: https://ctan.org/pkg/xecjk
211[`hyperref`]: https://ctan.org/pkg/hyperref
212[`ulem`]: https://ctan.org/pkg/ulem
213[`babel`]: https://ctan.org/pkg/babel
214[`bidi`]: https://ctan.org/pkg/bidi
215[`mathspec`]: https://ctan.org/pkg/mathspec
216[`polyglossia`]: https://ctan.org/pkg/polyglossia
217[`fontspec`]: https://ctan.org/pkg/fontspec
218[`upquote`]: https://ctan.org/pkg/upquote
219[`microtype`]: https://ctan.org/pkg/microtype
220[`csquotes`]: https://ctan.org/pkg/csquotes
221[`natbib`]: https://ctan.org/pkg/natbib
222[`biblatex`]: https://ctan.org/pkg/biblatex
223[`bibtex`]: https://ctan.org/pkg/bibtex
224[`biber`]: https://ctan.org/pkg/biber
225[TeX Live]: http://www.tug.org/texlive/
227`hsmarkdown`
228------------
230A user who wants a drop-in replacement for `Markdown.pl` may create
231a symbolic link to the `pandoc` executable called `hsmarkdown`. When
232invoked under the name `hsmarkdown`, `pandoc` will behave as if
233invoked with `-f markdown_strict --email-obfuscation=references`,
234and all command-line options will be treated as regular arguments.
235This approach does not work under [Cygwin], due to problems with
236its simulation of symbolic links.
238[Cygwin]: https://cygwin.com
240Options
241=======
243General options
244---------------
246`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
248: Specify input format. *FORMAT* can be `native` (native Haskell),
249 `json` (JSON version of native AST), `markdown` (pandoc's
250 extended markdown), `markdown_strict` (original unextended
251 markdown), `markdown_phpextra` (PHP Markdown Extra),
252 `markdown_github` (GitHub-Flavored Markdown),
253 `commonmark` (CommonMark markdown), `textile` (Textile), `rst`
254 (reStructuredText), `html` (HTML), `docbook` (DocBook), `t2t`
255 (txt2tags), `docx` (docx), `odt` (ODT), `epub` (EPUB), `opml` (OPML),
256 `org` (Emacs Org mode), `mediawiki` (MediaWiki markup), `twiki` (TWiki
257 markup), `haddock` (Haddock markup), or `latex` (LaTeX). If
258 `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`, the
259 input will be treated as literate Haskell source: see [Literate
260 Haskell support], below. Markdown
261 syntax extensions can be individually enabled or disabled by
262 appending `+EXTENSION` or `-EXTENSION` to the format name. So, for
263 example, `markdown_strict+footnotes+definition_lists` is strict
264 markdown with footnotes and definition lists enabled, and
265 `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown
266 without pipe tables and with hard line breaks. See [Pandoc's
267 markdown], below, for a list of extensions and
268 their names.
270`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
272: Specify output format. *FORMAT* can be `native` (native Haskell),
273 `json` (JSON version of native AST), `plain` (plain text),
274 `markdown` (pandoc's extended markdown), `markdown_strict`
275 (original unextended markdown), `markdown_phpextra` (PHP Markdown
276 Extra), `markdown_github` (GitHub-Flavored
277 Markdown), `commonmark` (CommonMark markdown), `rst`
278 (reStructuredText), `html` (XHTML), `html5` (HTML5), `latex`
279 (LaTeX), `beamer` (LaTeX beamer slide show), `context` (ConTeXt),
280 `man` (groff man), `mediawiki` (MediaWiki markup), `dokuwiki`
281 (DokuWiki markup), `textile` (Textile), `org` (Emacs Org mode),
282 `texinfo` (GNU Texinfo), `opml` (OPML), `docbook` (DocBook),
283 `opendocument` (OpenDocument), `odt` (OpenOffice text document),
284 `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text
285 format), `epub` (EPUB v2 book), `epub3` (EPUB v3), `fb2`
286 (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml` (InDesign
287 ICML), `slidy` (Slidy HTML and javascript slide show), `slideous`
288 (Slideous HTML and javascript slide show), `dzslides` (DZSlides
289 HTML5 + javascript slide show), `revealjs` (reveal.js HTML5 +
290 javascript slide show), `s5` (S5 HTML and javascript slide show),
291 or the path of a custom lua writer (see [Custom
292 writers], below). Note that `odt`, `epub`, and
293 `epub3` output will not be directed to *stdout*; an output
294 filename must be specified using the `-o/--output` option. If
295 `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
296 `html`, or `html5`, the output will be rendered as literate
297 Haskell source: see [Literate Haskell
298 support], below. Markdown syntax
299 extensions can be individually enabled or disabled by appending
300 `+EXTENSION` or `-EXTENSION` to the format name, as described
301 above under `-f`.
303`-o` *FILE*, `--output=`*FILE*
305: Write output to *FILE* instead of *stdout*. If *FILE* is
306 `-`, output will go to *stdout*. (Exception: if the output
307 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
309`--data-dir=`*DIRECTORY*
311: Specify the user data directory to search for pandoc data files.
312 If this option is not specified, the default user data directory
313 will be used. This is, in Unix:
315 $HOME/.pandoc
317 in Windows XP:
319 C:\Documents And Settings\USERNAME\Application Data\pandoc
321 and in Windows Vista or later:
323 C:\Users\USERNAME\AppData\Roaming\pandoc
325 You can find the default user data directory on your system by
326 looking at the output of `pandoc --version`.
327 A `reference.odt`, `reference.docx`, `epub.css`, `templates`,
328 `slidy`, `slideous`, or `s5` directory
329 placed in this directory will override pandoc's normal defaults.
331`--bash-completion`
333: Generate a bash completion script. To enable bash completion
334 with pandoc, add this to your `.bashrc`:
336 eval "$(pandoc --bash-completion)"
338`--verbose`
340: Give verbose debugging output. Currently this only has an effect
341 with PDF output.
343`-v`, `--version`
345: Print version.
347`-h`, `--help`
349: Show usage message.
351Reader options
352--------------
354`-R`, `--parse-raw`
356: Parse untranslatable HTML codes and LaTeX environments as raw HTML
357 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
358 input. Raw HTML can be printed in markdown, reStructuredText, HTML,
359 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
360 can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
361 The default is for the readers to omit untranslatable HTML codes and
362 LaTeX environments. (The LaTeX reader does pass through untranslatable
363 LaTeX *commands*, even if `-R` is not specified.)
365`-S`, `--smart`
367: Produce typographically correct output, converting straight quotes
368 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
369 `...` to ellipses. Nonbreaking spaces are inserted after certain
370 abbreviations, such as "Mr." (Note: This option is significant only when
371 the input format is `markdown`, `markdown_strict`, `textile` or `twiki`.
372 It is selected automatically when the input format is `textile` or the
373 output format is `latex` or `context`, unless `--no-tex-ligatures`
374 is used.)
376`--old-dashes`
378: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
379 a numeral is an en-dash, and `--` is an em-dash. This option is selected
380 automatically for `textile` input.
382`--base-header-level=`*NUMBER*
384: Specify the base level for headers (defaults to 1).
386`--indented-code-classes=`*CLASSES*
388: Specify classes to use for indented code blocks--for example,
389 `perl,numberLines` or `haskell`. Multiple classes may be separated
390 by spaces or commas.
392`--default-image-extension=`*EXTENSION*
394: Specify a default extension to use when image paths/URLs have no
395 extension. This allows you to use the same source for formats that
396 require different kinds of images. Currently this option only affects
397 the markdown and LaTeX readers.
399`--filter=`*EXECUTABLE*
401: Specify an executable to be used as a filter transforming the
402 Pandoc AST after the input is parsed and before the output is
403 written. The executable should read JSON from stdin and write
404 JSON to stdout. The JSON must be formatted like pandoc's own
405 JSON input and output. The name of the output format will be
406 passed to the filter as the first argument. Hence,
408 pandoc --filter ./caps.py -t latex
410 is equivalent to
412 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
414 The latter form may be useful for debugging filters.
416 Filters may be written in any language. `Text.Pandoc.JSON`
417 exports `toJSONFilter` to facilitate writing filters in Haskell.
418 Those who would prefer to write filters in python can use the
419 module [`pandocfilters`], installable from PyPI. There are also
420 pandoc filter libraries in [PHP], [perl], and [javascript/node.js].
422 Note that the *EXECUTABLE* will be sought in the user's
423 `PATH`, and not in the working directory, if no directory is
424 provided. If you want to run a script in the working directory,
425 preface the filename with `./`.
427`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]
429: Set the metadata field *KEY* to the value *VAL*. A value specified
430 on the command line overrides a value specified in the document.
431 Values will be parsed as YAML boolean or string values. If no value is
432 specified, the value will be treated as Boolean true. Like
433 `--variable`, `--metadata` causes template variables to be set.
434 But unlike `--variable`, `--metadata` affects the metadata of the
435 underlying document (which is accessible from filters and may be
436 printed in some output formats).
438`--normalize`
440: Normalize the document after reading: merge adjacent
441 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
443`-p`, `--preserve-tabs`
445: Preserve tabs instead of converting them to spaces (the default).
446 Note that this will only affect tabs in literal code spans and code
447 blocks; tabs in regular text will be treated as spaces.
449`--tab-stop=`*NUMBER*
451: Specify the number of spaces per tab (default is 4).
453`--track-changes=accept`|`reject`|`all`
455: Specifies what to do with insertions and deletions produced by the MS
456 Word "Track Changes" feature. `accept` (the default), inserts all
457 insertions, and ignores all deletions. `reject` inserts all
458 deletions and ignores insertions. `all` puts in both insertions
459 and deletions, wrapped in spans with `insertion` and `deletion`
460 classes, respectively. The author and time of change is
461 included. `all` is useful for scripting: only accepting changes
462 from a certain reviewer, say, or before a certain date. This
463 option only affects the docx reader.
465`--extract-media=`*DIR*
467: Extract images and other media contained in a docx or epub container
468 to the path *DIR*, creating it if necessary, and adjust the images
469 references in the document so they point to the extracted files.
470 This option only affects the docx and epub readers.
472[`pandocfilters`]: https://github.com/jgm/pandocfilters
473[PHP]: https://github.com/vinai/pandocfilters-php
474[perl]: https://metacpan.org/pod/Pandoc::Filter
475[javascript/node.js]: https://github.com/mvhenderson/pandoc-filter-node
477General writer options
478----------------------
480`-s`, `--standalone`
482: Produce output with an appropriate header and footer (e.g. a
483 standalone HTML, LaTeX, or RTF file, not a fragment). This option
484 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
485 output.
487`--template=`*FILE*
489: Use *FILE* as a custom template for the generated document. Implies
490 `--standalone`. See [Templates], below, for a description
491 of template syntax. If no extension is specified, an extension
492 corresponding to the writer will be added, so that `--template=special`
493 looks for `special.html` for HTML output. If the template is not
494 found, pandoc will search for it in the `templates` subdirectory of
495 the user data directory (see `--data-dir`). If this option is not used,
496 a default template appropriate for the output format will be used (see
497 `-D/--print-default-template`).
499`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`:`*VAL*]
501: Set the template variable *KEY* to the value *VAL* when rendering the
502 document in standalone mode. This is generally only useful when the
503 `--template` option is used to specify a custom template, since
504 pandoc automatically sets the variables used in the default
505 templates. If no *VAL* is specified, the key will be given the
506 value `true`.
508`-D` *FORMAT*, `--print-default-template=`*FORMAT*
510: Print the system default template for an output *FORMAT*. (See `-t`
511 for a list of possible *FORMAT*s.) Templates in the user data
512 directory are ignored.
514`--print-default-data-file=`*FILE*
516: Print a system default data file. Files in the user data directory
517 are ignored.
519`--no-wrap`
521: Disable text wrapping in output. By default, text is wrapped
522 appropriately for the output format.
524`--columns=`*NUMBER*
526: Specify length of lines in characters (for text wrapping).
528`--toc`, `--table-of-contents`
530: Include an automatically generated table of contents (or, in
531 the case of `latex`, `context`, and `rst`, an instruction to create
532 one) in the output document. This option has no effect on `man`,
533 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
535`--toc-depth=`*NUMBER*
537: Specify the number of section levels to include in the table
538 of contents. The default is 3 (which means that level 1, 2, and 3
539 headers will be listed in the contents).
541`--no-highlight`
543: Disables syntax highlighting for code blocks and inlines, even when
544 a language attribute is given.
546`--highlight-style=`*STYLE*
548: Specifies the coloring style to be used in highlighted source code.
549 Options are `pygments` (the default), `kate`, `monochrome`,
550 `espresso`, `zenburn`, `haddock`, and `tango`. For more information
551 on syntax highlighting in pandoc, see [Syntax highlighting], below.
553`-H` *FILE*, `--include-in-header=`*FILE*
555: Include contents of *FILE*, verbatim, at the end of the header.
556 This can be used, for example, to include special
557 CSS or javascript in HTML documents. This option can be used
558 repeatedly to include multiple files in the header. They will be
559 included in the order specified. Implies `--standalone`.
561`-B` *FILE*, `--include-before-body=`*FILE*
563: Include contents of *FILE*, verbatim, at the beginning of the
564 document body (e.g. after the `<body>` tag in HTML, or the
565 `\begin{document}` command in LaTeX). This can be used to include
566 navigation bars or banners in HTML documents. This option can be
567 used repeatedly to include multiple files. They will be included in
568 the order specified. Implies `--standalone`.
570`-A` *FILE*, `--include-after-body=`*FILE*
572: Include contents of *FILE*, verbatim, at the end of the document
573 body (before the `</body>` tag in HTML, or the
574 `\end{document}` command in LaTeX). This option can be be used
575 repeatedly to include multiple files. They will be included in the
576 order specified. Implies `--standalone`.
578Options affecting specific writers
579----------------------------------
581`--self-contained`
583: Produce a standalone HTML file with no external dependencies, using
584 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
585 images, and videos. The resulting file should be "self-contained,"
586 in the sense that it needs no external files and no net access to be
587 displayed properly by a browser. This option works only with HTML output
588 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
589 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
590 stylesheets at absolute URLs will be downloaded; those at relative URLs
591 will be sought relative to the working directory (if the first source
592 file is local) or relative to the base URL (if the first source
593 file is remote). `--self-contained` does not work with `--mathjax`.
595`--offline`
597: Deprecated synonym for `--self-contained`.
599`-5`, `--html5`
601: Produce HTML5 instead of HTML4. This option has no effect for writers
602 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
604`--html-q-tags`
606: Use `<q>` tags for quotes in HTML.
608`--ascii`
610: Use only ascii characters in output. Currently supported only
611 for HTML output (which uses numerical entities instead of
612 UTF-8 when this option is selected).
614`--reference-links`
616: Use reference-style links, rather than inline links, in writing markdown
617 or reStructuredText. By default inline links are used.
619`--atx-headers`
621: Use ATX-style headers in markdown and asciidoc output. The default is
622 to use setext-style headers for levels 1-2, and then ATX headers.
624`--chapters`
626: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
627 output. When the LaTeX document class is set to `report`, `book`, or
628 `memoir`, this option is implied. If `beamer` is the output
629 format, top-level headers will become `\part{..}`.
631`-N`, `--number-sections`
633: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
634 By default, sections are not numbered. Sections with class
635 `unnumbered` will never be numbered, even if `--number-sections`
636 is specified.
638`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]
640: Offset for section headings in HTML output (ignored in other
641 output formats). The first number is added to the section number for
642 top-level headers, the second for second-level headers, and so on.
643 So, for example, if you want the first top-level header in your
644 document to be numbered "6", specify `--number-offset=5`.
645 If your document starts with a level-2 header which you want to
646 be numbered "1.5", specify `--number-offset=1,4`.
647 Offsets are 0 by default. Implies `--number-sections`.
649`--no-tex-ligatures`
651: Do not convert quotation marks, apostrophes, and dashes to
652 the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
653 use literal unicode characters. This is needed for using advanced
654 OpenType features with `xelatex` and `lualatex`. Note: normally
655 `--smart` is selected automatically for LaTeX and ConTeXt
656 output, but it must be specified explicitly if `--no-tex-ligatures`
657 is selected. If you use literal curly quotes, dashes, and ellipses
658 in your source, then you may want to use `--no-tex-ligatures`
659 without `--smart`.
661`--listings`
663: Use the [`listings`] package for LaTeX code blocks
665`-i`, `--incremental`
667: Make list items in slide shows display incrementally (one by one).
668 The default is for lists to be displayed all at once.
670`--slide-level=`*NUMBER*
672: Specifies that headers with the specified level create
673 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
674 above this level in the hierarchy are used to divide the
675 slide show into sections; headers below this level create
676 subheads within a slide. The default is to set the slide level
677 based on the contents of the document; see
678 [Structuring the slide show].
680`--section-divs`
682: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
683 and attach identifiers to the enclosing `<div>` (or `<section>`)
684 rather than the header itself. See
685 [Header identifiers], below.
687`--email-obfuscation=none`|`javascript`|`references`
689: Specify a method for obfuscating `mailto:` links in HTML documents.
690 `none` leaves `mailto:` links as they are. `javascript` obfuscates
691 them using javascript. `references` obfuscates them by printing their
692 letters as decimal or hexadecimal character references.
694`--id-prefix=`*STRING*
696: Specify a prefix to be added to all automatically generated identifiers
697 in HTML and DocBook output, and to footnote numbers in markdown output.
698 This is useful for preventing duplicate identifiers when generating
699 fragments to be included in other pages.
701`-T` *STRING*, `--title-prefix=`*STRING*
703: Specify *STRING* as a prefix at the beginning of the title
704 that appears in the HTML header (but not in the title as it
705 appears at the beginning of the HTML body). Implies
706 `--standalone`.
708`-c` *URL*, `--css=`*URL*
710: Link to a CSS style sheet. This option can be be used repeatedly to
711 include multiple files. They will be included in the order specified.
713`--reference-odt=`*FILE*
715: Use the specified file as a style reference in producing an ODT.
716 For best results, the reference ODT should be a modified version
717 of an ODT produced using pandoc. The contents of the reference ODT
718 are ignored, but its stylesheets are used in the new ODT. If no
719 reference ODT is specified on the command line, pandoc will look
720 for a file `reference.odt` in the user data directory (see
721 `--data-dir`). If this is not found either, sensible defaults will be
722 used.
724`--reference-docx=`*FILE*
726: Use the specified file as a style reference in producing a docx file.
727 For best results, the reference docx should be a modified version
728 of a docx file produced using pandoc. The contents of the reference docx
729 are ignored, but its stylesheets and document properties (including
730 margins, page size, header, and footer) are used in the new docx. If no
731 reference docx is specified on the command line, pandoc will look
732 for a file `reference.docx` in the user data directory (see
733 `--data-dir`). If this is not found either, sensible defaults will be
734 used. The following styles are used by pandoc: [paragraph]
735 Normal, Body Text, First Paragraph, Compact, Title, Subtitle, Author, Date,
736 Abstract, Bibliography, Heading 1, Heading 2, Heading 3, Heading 4,
737 Heading 5, Heading 6, Block Text, Footnote Text, Definition Term,
738 Definition, Caption, Table Caption, Image Caption, Figure,
739 Figure With Caption, TOC Heading;
740 [character] Default Paragraph Font, Body Text Char, Verbatim Char,
741 Footnote Reference, Hyperlink; [table] Normal Table.
743`--epub-stylesheet=`*FILE*
745: Use the specified CSS file to style the EPUB. If no stylesheet
746 is specified, pandoc will look for a file `epub.css` in the
747 user data directory (see `--data-dir`). If it is not
748 found there, sensible defaults will be used.
750`--epub-cover-image=`*FILE*
752: Use the specified image as the EPUB cover. It is recommended
753 that the image be less than 1000px in width and height. Note that
754 in a markdown source document you can also specify `cover-image`
755 in a YAML metadata block (see [EPUB Metadata], below).
757`--epub-metadata=`*FILE*
759: Look in the specified XML file for metadata for the EPUB.
760 The file should contain a series of [Dublin Core elements].
761 For example:
763 <dc:rights>Creative Commons</dc:rights>
764 <dc:language>es-AR</dc:language>
766 By default, pandoc will include the following metadata elements:
767 `<dc:title>` (from the document title), `<dc:creator>` (from the
768 document authors), `<dc:date>` (from the document date, which should
769 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
770 variable, or, if is not set, the locale), and `<dc:identifier
771 id="BookId">` (a randomly generated UUID). Any of these may be
772 overridden by elements in the metadata file.
774 Note: if the source document is markdown, a YAML metadata block
775 in the document can be used instead. See below under
776 [EPUB Metadata].
778`--epub-embed-font=`*FILE*
780: Embed the specified font in the EPUB. This option can be repeated
781 to embed multiple fonts. Wildcards can also be used: for example,
782 `DejaVuSans-*.ttf`. However, if you use wildcards on the command
783 line, be sure to escape them or put the whole filename in single quotes,
784 to prevent them from being interpreted by the shell. To use the
785 embedded fonts, you will need to add declarations like the following
786 to your CSS (see `--epub-stylesheet`):
788 @font-face {
789 font-family: DejaVuSans;
790 font-style: normal;
791 font-weight: normal;
792 src:url("DejaVuSans-Regular.ttf");
793 }
794 @font-face {
795 font-family: DejaVuSans;
796 font-style: normal;
797 font-weight: bold;
798 src:url("DejaVuSans-Bold.ttf");
799 }
800 @font-face {
801 font-family: DejaVuSans;
802 font-style: italic;
803 font-weight: normal;
804 src:url("DejaVuSans-Oblique.ttf");
805 }
806 @font-face {
807 font-family: DejaVuSans;
808 font-style: italic;
809 font-weight: bold;
810 src:url("DejaVuSans-BoldOblique.ttf");
811 }
812 body { font-family: "DejaVuSans"; }
814`--epub-chapter-level=`*NUMBER*
816: Specify the header level at which to split the EPUB into separate
817 "chapter" files. The default is to split into chapters at level 1
818 headers. This option only affects the internal composition of the
819 EPUB, not the way chapters and sections are displayed to users. Some
820 readers may be slow if the chapter files are too large, so for large
821 documents with few level 1 headers, one might want to use a chapter
822 level of 2 or 3.
824`--latex-engine=pdflatex`|`lualatex`|`xelatex`
826: Use the specified LaTeX engine when producing PDF output.
827 The default is `pdflatex`. If the engine is not in your PATH,
828 the full path of the engine may be specified here.
830`--latex-engine-opt=`*STRING*
832: Use the given string as a command-line argument to the `latex-engine`.
833 If used multiple times, the arguments are provided with spaces between
834 them. Note that no check for duplicate options is done.
836[Dublin Core elements]: http://dublincore.org/documents/dces/
837[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
839Citation rendering
840------------------
842`--bibliography=`*FILE*
844: Set the `bibliography` field in the document's metadata to *FILE*,
845 overriding any value set in the metadata, and process citations
846 using `pandoc-citeproc`. (This is equivalent to
847 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
848 If `--natbib` or `--biblatex` is also supplied, `pandoc-citeproc` is not
849 used, making this equivalent to `--metadata bibliography=FILE`.
850 If you supply this argument multiple times, each *FILE* will be added
851 to bibliography.
853`--csl=`*FILE*
855: Set the `csl` field in the document's metadata to *FILE*,
856 overriding any value set in the metadata. (This is equivalent to
857 `--metadata csl=FILE`.)
858 This option is only relevant with `pandoc-citeproc`.
860`--citation-abbreviations=`*FILE*
862: Set the `citation-abbreviations` field in the document's metadata to
863 *FILE*, overriding any value set in the metadata. (This is equivalent to
864 `--metadata citation-abbreviations=FILE`.)
865 This option is only relevant with `pandoc-citeproc`.
867`--natbib`
869: Use [`natbib`] for citations in LaTeX output. This option is not for use
870 with the `pandoc-citeproc` filter or with PDF output. It is intended for
871 use in producing a LaTeX file that can be processed with [`bibtex`].
873`--biblatex`
875: Use [`biblatex`] for citations in LaTeX output. This option is not for use
876 with the `pandoc-citeproc` filter or with PDF output. It is intended for
877 use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
879Math rendering in HTML
880----------------------
882`-m` [*URL*], `--latexmathml`[`=`*URL*]
884: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
885 To insert a link to a local copy of the `LaTeXMathML.js` script,
886 provide a *URL*. If no *URL* is provided, the contents of the
887 script will be inserted directly into the HTML header, preserving
888 portability at the price of efficiency. If you plan to use math on
889 several pages, it is much better to link to a copy of the script,
890 so it can be cached.
892`--mathml`[`=`*URL*]
894: Convert TeX math to [MathML] (in `docbook` as well as `html` and `html5`).
895 In standalone `html` output, a small javascript (or a link to such a
896 script if a *URL* is supplied) will be inserted that allows the MathML to
897 be viewed on some browsers.
899`--jsmath`[`=`*URL*]
901: Use [jsMath] to display embedded TeX math in HTML output.
902 The *URL* should point to the jsMath load script (e.g.
903 `jsMath/easy/load.js`); if provided, it will be linked to in
904 the header of standalone HTML documents. If a *URL* is not provided,
905 no link to the jsMath load script will be inserted; it is then
906 up to the author to provide such a link in the HTML template.
908`--mathjax`[`=`*URL*]
910: Use [MathJax] to display embedded TeX math in HTML output.
911 The *URL* should point to the `MathJax.js` load script.
912 If a *URL* is not provided, a link to the MathJax CDN will
913 be inserted.
915`--gladtex`
917: Enclose TeX math in `<eq>` tags in HTML output. These can then
918 be processed by [gladTeX] to produce links to images of the typeset
919 formulas.
921`--mimetex`[`=`*URL*]
923: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
924 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
926`--webtex`[`=`*URL*]
928: Render TeX formulas using an external script that converts TeX
929 formulas to images. The formula will be concatenated with the URL
930 provided. If *URL* is not specified, the Google Chart API will be used.
932`--katex`[`=`*URL*]
934: Use [KaTeX] to display embedded TeX math in HTML output.
935 The *URL* should point to the `katex.js` load script. If a *URL* is
936 not provided, a link to the KaTeX CDN will be inserted.
938`--katex-stylesheet=`*URL*
940: The *URL* should point to the `katex.css` stylesheet. If this option is
941 not specified, a link to the KaTeX CDN will be inserted. Note that this
942 option does not imply `--katex`.
944[MathML]: http://www.w3.org/Math/
945[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
946[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
947[MathJax]: https://www.mathjax.org
948[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
949[mimeTeX]: http://www.forkosh.com/mimetex.html
950[KaTeX]: https://github.com/Khan/KaTeX
952Options for wrapper scripts
953---------------------------
955`--dump-args`
957: Print information about command-line arguments to *stdout*, then exit.
958 This option is intended primarily for use in wrapper scripts.
959 The first line of output contains the name of the output file specified
960 with the `-o` option, or `-` (for *stdout*) if no output file was
961 specified. The remaining lines contain the command-line arguments,
962 one per line, in the order they appear. These do not include regular
963 Pandoc options and their arguments, but do include any options appearing
964 after a `--` separator at the end of the line.
966`--ignore-args`
968: Ignore command-line arguments (for use in wrapper scripts).
969 Regular Pandoc options are not ignored. Thus, for example,
971 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
973 is equivalent to
975 pandoc -o foo.html -s
977Templates
978=========
980When the `-s/--standalone` option is used, pandoc uses a template to
981add header and footer material that is needed for a self-standing
982document. To see the default template that is used, just type
984 pandoc -D *FORMAT*
986where *FORMAT* is the name of the output format. A custom template
987can be specified using the `--template` option. You can also override
988the system default templates for a given output format *FORMAT*
989by putting a file `templates/default.*FORMAT*` in the user data
990directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
991customize the `default.opendocument` template. For `pdf` output,
992customize the `default.latex` template.
994Templates contain *variables*, which allow for the inclusion of
995arbitrary information at any point in the file. Variables may be set
996within the document using [YAML metadata blocks][Extension: `yaml_metadata_block`].
997They may also be set at the
998command line using the `-V/--variable` option: variables set in this
999way override metadata fields with the same name.
1001Variables set by pandoc
1002-----------------------
1004Some variables are set automatically by pandoc. These vary somewhat
1005depending on the output format, but include metadata fields as well as the following:
1007`title`, `author`, `date`
1008: allow identification of basic aspects of the document.
1009 Included in PDF metadata through LaTeX.
1010 These can be set through a [pandoc title block][Extension: `pandoc_title_block`],
1011 which allows for multiple authors, or through a YAML metadata block:
1013 ---
1014 author:
1015 - Aristotle
1016 - Peter Abelard
1017 ...
1019`abstract`
1020: allows for specification of document summary in LaTeX and Word docx
1022`header-includes`
1023: contents specified by `-H/--include-in-header` (may have multiple
1024 values)
1026`toc`
1027: non-null value if `--toc/--table-of-contents` was specified
1029`include-before`
1030: contents specified by `-B/--include-before-body` (may have
1031 multiple values)
1033`include-after`
1034: contents specified by `-A/--include-after-body` (may have
1035 multiple values)
1037`body`
1038: body of document
1040Language variables
1041------------------
1043`lang`
1044: identifies the main language of the document,
1045 using a code according to [BCP 47] (e.g. `en` or `en-GB`).
1046 For some output formats, pandoc will convert it to an appropriate
1047 format stored in the additional variables `babel-lang`,
1048 `polyglossia-lang` (LaTeX) and `context-lang` (ConTeXt).
1050`otherlangs`
1051: a list of other languages used in the document
1052 in the YAML metadata, according to [BCP 47]. For example:
1053 `otherlangs: [en-GB, fr]`.
1054 Currently only used by `xelatex` through the generated
1055 `polyglossia-otherlangs` variable.
1057`dir`
1058: the base direction of the document, either `rtl` (right-to-left)
1059 or `ltr` (left-to-right).
1061 For bidirectional documents, native pandoc `span`s and `div`s
1062 with the `dir` attribute (value `rtl` or `ltr`) can be used to
1063 override the base direction in some output formats.
1064 This may not always be necessary if the final renderer
1065 (e.g. the browser, when generating HTML) supports the
1066 [Unicode Bidirectional Algorithm].
1068 LaTeX and ConTeXt assume by default that all text is left-to-right.
1069 Setting `dir: ltr` enables bidirectional text handling in a document
1070 whose base direction is left-to-right but contains some right-to-left script.
1072 When using LaTeX for bidirectional documents, only the `xelatex` engine
1073 is fully supported (use `--latex-engine=xelatex`).
1075[BCP 47]: https://tools.ietf.org/html/bcp47
1076[Unicode Bidirectional Algorithm]: http://www.w3.org/International/articles/inline-bidi-markup/uba-basics
1078Variables for slides
1079--------------------
1081Variables are available for [producing slide shows with pandoc],
1082including all [reveal.js configuration options].
1084`slidy-url`
1085: base URL for Slidy documents (defaults to
1086 `http://www.w3.org/Talks/Tools/Slidy2`)
1088`slideous-url`
1089: base URL for Slideous documents (defaults to `slideous`)
1091`s5-url`
1092: base URL for S5 documents (defaults to `s5/default`)
1094`revealjs-url`
1095: base URL for reveal.js documents (defaults to `reveal.js`)
1097`theme`, `colortheme`, `fonttheme`, `innertheme`, `outertheme`
1098: themes for LaTeX [`beamer`] documents
1100[reveal.js configuration options]: https://github.com/hakimel/reveal.js#configuration
1102Variables for LaTeX
1103-------------------
1105LaTeX variables are used when [creating a PDF].
1107`fontsize`
1108: font size (e.g. `10pt`, `12pt`) for LaTeX documents
1110`documentclass`
1111: document class for LaTeX documents, e.g. [`article`], [`report`], [`book`], [`memoir`]
1113`classoption`
1114: option for LaTeX document class, e.g. `oneside`; may be repeated
1115 for multiple options
1117`geometry`
1118: option for LaTeX [`geometry`] package, e.g. `margin=1in`;
1119 may be repeated for multiple options
1121`linestretch`
1122: adjusts line spacing in LaTeX documents using the [`setspace`]
1123 package, e.g. `1.25`, `1.5`
1125`fontfamily`
1126: font package for LaTeX documents (with `pdflatex`):
1127 [TeX Live] includes many options, documented in the [LaTeX Font Catalogue].
1128 The default is [Latin Modern][`lm`].
1130`fontfamilyoptions`
1131: options for package used as `fontfamily`: e.g. `osf,sc` with
1132 `fontfamily` set to [`mathpazo`] provides Palatino with old-style
1133 figures and true small caps
1135`mainfont`, `sansfont`, `monofont`, `mathfont`, `CJKmainfont`
1136: fonts for LaTeX documents (works only with `xelatex` and
1137 `lualatex`): takes the name of any system font, using the
1138 [`fontspec`] package. Note that if `CJKmainfont` is used,
1139 the [`xecjk`] package must be available.
1141`mainfontoptions`, `sansfontoptions`, `monofontoptions`, `mathfontoptions`, `CJKoptions`
1142: options to use with `mainfont`, `sansfont`, `monofont`, `mathfont`,
1143 `CJKmainfont` in `xelatex` and `lualatex`. Allows for any choices
1144 available through [`fontspec`], such as the OpenType features
1145 `Numbers=OldStyle,Numbers=Proportional`.
1147`fontenc`
1148: allows font encoding to be specified through `fontenc` package (with `pdflatex`);
1149 default is `T1` (see guide to [LaTeX font encodings])
1151`linkcolor`, `toccolor`, `urlcolor`, `citecolor`
1152: color for internal links, links in table of contents, external links,
1153 and citation links in LaTeX documents, using options available through
1154 [`color`] package, e.g. `red`, `green`, `magenta`, `cyan`, `blue`, `black`
1156`hidelinks`
1157: enables `hidelinks` option for [`hyperref`], disabling link color
1159`links-as-notes`
1160: causes links to be printed as footnotes in LaTeX documents
1162`indent`
1163: uses document class settings for indentation (the default LaTeX template
1164 otherwise removes indentation and adds space between paragraphs)
1166`subparagraph`
1167: disables default behavior of LaTeX template that redefines (sub)paragraphs
1168 as sections, changing the appearance of nested headings in some classes
1170`toc`
1171: include table of contents in LaTeX documents
1173`toc-depth`
1174: level of section to include in table of contents in LaTeX documents
1176`toc-title`
1177: title of table of contents (works only with EPUB and docx)
1179`lof`
1180: include list of figures in LaTeX documents
1182`lot`
1183: include list of tables in LaTeX documents
1185`bibliography`
1186: bibliography to use for resolving references
1188`biblio-style`
1189: bibliography style in LaTeX, when used with `--natbib`
1191[`article`]: https://ctan.org/pkg/article
1192[`report`]: https://ctan.org/pkg/report
1193[`book`]: https://ctan.org/pkg/book
1194[`memoir`]: https://ctan.org/pkg/memoir
1195[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
1196[`mathpazo`]: https://ctan.org/pkg/mathpazo
1197[LaTeX font encodings]: https://ctan.org/pkg/encguide
1199Variables for man pages
1200-----------------------
1202`section`
1203: section number in man pages
1205`header`
1206: header in man pages
1208`footer`
1209: footer in man pages
1211`adjusting`
1212: adjusts text to left (`l`), right (`r`), center (`c`),
1213 or both (`b`) margins
1215`hyphenate`
1216: if `true` (the default), hyphenation will be used
1218Using variables in templates
1219----------------------------
1221Variable names are sequences of alphanumerics, `-`, and `_`,
1222starting with a letter. A variable name surrounded by `$` signs
1223will be replaced by its value. For example, the string `$title$` in
1225 <title>$title$</title>
1227will be replaced by the document title.
1229To write a literal `$` in a template, use `$$`.
1231Templates may contain conditionals. The syntax is as follows:
1233 $if(variable)$
1235 $else$
1237 $endif$
1239This will include `X` in the template if `variable` has a non-null
1240value; otherwise it will include `Y`. `X` and `Y` are placeholders for
1241any valid template text, and may include interpolated variables or other
1242conditionals. The `$else$` section may be omitted.
1244When variables can have multiple values (for example, `author` in
1245a multi-author document), you can use the `$for$` keyword:
1247 $for(author)$
1248 <meta name="author" content="$author$" />
1249 $endfor$
1251You can optionally specify a separator to be used between
1252consecutive items:
1254 $for(author)$$author$$sep$, $endfor$
1256A dot can be used to select a field of a variable that takes
1257an object as its value. So, for example:
1259 $author.name$ ($author.affiliation$)
1261If you use custom templates, you may need to revise them as pandoc
1262changes. We recommend tracking the changes in the default templates,
1263and modifying your custom templates accordingly. An easy way to do this
1264is to fork the [pandoc-templates] repository and merge in changes after each
1265pandoc release.
1267[pandoc-templates]: https://github.com/jgm/pandoc-templates
1269Pandoc's markdown
1270=================
1272Pandoc understands an extended and slightly revised version of
1273John Gruber's [markdown] syntax. This document explains the syntax,
1274noting differences from standard markdown. Except where noted, these
1275differences can be suppressed by using the `markdown_strict` format instead
1276of `markdown`. An extensions can be enabled by adding `+EXTENSION`
1277to the format name and disabled by adding `-EXTENSION`. For example,
1278`markdown_strict+footnotes` is strict markdown with footnotes
1279enabled, while `markdown-footnotes-pipe_tables` is pandoc's
1280markdown without footnotes or pipe tables.
1282Philosophy
1283----------
1285Markdown is designed to be easy to write, and, even more importantly,
1286easy to read:
1288> A Markdown-formatted document should be publishable as-is, as plain
1289> text, without looking like it's been marked up with tags or formatting
1290> instructions.
1291> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
1293This principle has guided pandoc's decisions in finding syntax for
1294tables, footnotes, and other extensions.
1296There is, however, one respect in which pandoc's aims are different
1297from the original aims of markdown. Whereas markdown was originally
1298designed with HTML generation in mind, pandoc is designed for multiple
1299output formats. Thus, while pandoc allows the embedding of raw HTML,
1300it discourages it, and provides other, non-HTMLish ways of representing
1301important document elements like definition lists, tables, mathematics, and
1302footnotes.
1304Paragraphs
1305----------
1307A paragraph is one or more lines of text followed by one or more blank lines.
1308Newlines are treated as spaces, so you can reflow your paragraphs as you like.
1309If you need a hard line break, put two or more spaces at the end of a line.
1311#### Extension: `escaped_line_breaks` ####
1313A backslash followed by a newline is also a hard line break.
1314Note: in multiline and grid table cells, this is the only way
1315to create a hard line break, since trailing spaces in the cells
1316are ignored.
1318Headers
1319-------
1321There are two kinds of headers: Setext and ATX.
1323### Setext-style headers ###
1325A setext-style header is a line of text "underlined" with a row of `=` signs
1326(for a level one header) or `-` signs (for a level two header):
1328 A level-one header
1329 ==================
1331 A level-two header
1332 ------------------
1334The header text can contain inline formatting, such as emphasis (see
1335[Inline formatting], below).
1338### ATX-style headers ###
1340An ATX-style header consists of one to six `#` signs and a line of
1341text, optionally followed by any number of `#` signs. The number of
1342`#` signs at the beginning of the line is the header level:
1344 ## A level-two header
1346 ### A level-three header ###
1348As with setext-style headers, the header text can contain formatting:
1350 # A level-one header with a [link](/url) and *emphasis*
1352#### Extension: `blank_before_header` ####
1354Standard markdown syntax does not require a blank line before a header.
1355Pandoc does require this (except, of course, at the beginning of the
1356document). The reason for the requirement is that it is all too easy for a
1357`#` to end up at the beginning of a line by accident (perhaps through line
1358wrapping). Consider, for example:
1360 I like several of their flavors of ice cream:
1361 #22, for example, and #5.
1364### Header identifiers ###
1366#### Extension: `header_attributes` ####
1368Headers can be assigned attributes using this syntax at the end
1369of the line containing the header text:
1371 {#identifier .class .class key=value key=value}
1373Thus, for example, the following headers will all be assigned the identifier
1374`foo`:
1376 # My header {#foo}
1378 ## My header ## {#foo}
1380 My other header {#foo}
1381 ---------------
1383(This syntax is compatible with [PHP Markdown Extra].)
1385Note that although this syntax allows assignment of classes and key/value
1386attributes, writers generally don't use all of this information. Identifiers,
1387classes, and key/value attributes are used in HTML and HTML-based formats such
1388as EPUB and slidy. Identifiers are used for labels and link anchors in the
1389LaTeX, ConTeXt, Textile, and AsciiDoc writers.
1391Headers with the class `unnumbered` will not be numbered, even if
1392`--number-sections` is specified. A single hyphen (`-`) in an attribute
1393context is equivalent to `.unnumbered`, and preferable in non-English
1394documents. So,
1396 # My header {-}
1398is just the same as
1400 # My header {.unnumbered}
1402#### Extension: `auto_identifiers` ####
1404A header without an explicitly specified identifier will be
1405automatically assigned a unique identifier based on the header text.
1406To derive the identifier from the header text,
1408 - Remove all formatting, links, etc.
1409 - Remove all footnotes.
1410 - Remove all punctuation, except underscores, hyphens, and periods.
1411 - Replace all spaces and newlines with hyphens.
1412 - Convert all alphabetic characters to lowercase.
1413 - Remove everything up to the first letter (identifiers may
1414 not begin with a number or punctuation mark).
1415 - If nothing is left after this, use the identifier `section`.
1417Thus, for example,
1419 Header Identifier
1420 ------------------------------- ----------------------------
1421 Header identifiers in HTML `header-identifiers-in-html`
1422 *Dogs*?--in *my* house? `dogs--in-my-house`
1423 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1424 3. Applications `applications`
1425 33 `section`
1427These rules should, in most cases, allow one to determine the identifier
1428from the header text. The exception is when several headers have the
1429same text; in this case, the first will get an identifier as described
1430above; the second will get the same identifier with `-1` appended; the
1431third with `-2`; and so on.
1433These identifiers are used to provide link targets in the table of
1434contents generated by the `--toc|--table-of-contents` option. They
1435also make it easy to provide links from one section of a document to
1436another. A link to this section, for example, might look like this:
1438 See the section on
1439 [header identifiers](#header-identifiers-in-html-latex-and-context).
1441Note, however, that this method of providing links to sections works
1442only in HTML, LaTeX, and ConTeXt formats.
1444If the `--section-divs` option is specified, then each section will
1445be wrapped in a `div` (or a `section`, if `--html5` was specified),
1446and the identifier will be attached to the enclosing `<div>`
1447(or `<section>`) tag rather than the header itself. This allows entire
1448sections to be manipulated using javascript or treated differently in
1449CSS.
1451#### Extension: `implicit_header_references` ####
1453Pandoc behaves as if reference links have been defined for each header.
1454So, instead of
1456 [header identifiers](#header-identifiers-in-html)
1458you can simply write
1460 [header identifiers]
1464 [header identifiers][]
1468 [the section on header identifiers][header identifiers]
1470If there are multiple headers with identical text, the corresponding
1471reference will link to the first one only, and you will need to use explicit
1472links to link to the others, as described above.
1474Like regular reference links, these references are case-insensitive.
1476Explicit link reference definitions always take priority over
1477implicit header references. So, in the following example, the
1478link will point to `bar`, not to `#foo`:
1480 # Foo
1482 [foo]: bar
1484 See [foo]
1486Block quotations
1487----------------
1489Markdown uses email conventions for quoting blocks of text.
1490A block quotation is one or more paragraphs or other block elements
1491(such as lists or headers), with each line preceded by a `>` character
1492and an optional space. (The `>` need not start at the left margin, but
1493it should not be indented more than three spaces.)
1495 > This is a block quote. This
1496 > paragraph has two lines.
1498 > 1. This is a list inside a block quote.
1499 > 2. Second item.
1501A "lazy" form, which requires the `>` character only on the first
1502line of each block, is also allowed:
1504 > This is a block quote. This
1505 paragraph has two lines.
1507 > 1. This is a list inside a block quote.
1508 2. Second item.
1510Among the block elements that can be contained in a block quote are
1511other block quotes. That is, block quotes can be nested:
1513 > This is a block quote.
1515 > > A block quote within a block quote.
1517If the `>` character is followed by an optional space, that space
1518will be considered part of the block quote marker and not part of
1519the indentation of the contents. Thus, to put an indented code
1520block in a block quote, you need five spaces after the `>`:
1522 > code
1524#### Extension: `blank_before_blockquote` ####
1526Standard markdown syntax does not require a blank line before a block
1527quote. Pandoc does require this (except, of course, at the beginning of the
1528document). The reason for the requirement is that it is all too easy for a
1529`>` to end up at the beginning of a line by accident (perhaps through line
1530wrapping). So, unless the `markdown_strict` format is used, the following does
1531not produce a nested block quote in pandoc:
1533 > This is a block quote.
1534 >> Nested.
1537Verbatim (code) blocks
1538----------------------
1540### Indented code blocks ###
1542A block of text indented four spaces (or one tab) is treated as verbatim
1543text: that is, special characters do not trigger special formatting,
1544and all spaces and line breaks are preserved. For example,
1546 if (a > 3) {
1547 moveShip(5 * gravity, DOWN);
1550The initial (four space or one tab) indentation is not considered part
1551of the verbatim text, and is removed in the output.
1553Note: blank lines in the verbatim text need not begin with four spaces.
1556### Fenced code blocks ###
1558#### Extension: `fenced_code_blocks` ####
1560In addition to standard indented code blocks, Pandoc supports
1561*fenced* code blocks. These begin with a row of three or more
1562tildes (`~`) and end with a row of tildes that must be at least as long as
1563the starting row. Everything between these lines is treated as code. No
1564indentation is necessary:
1566 ~~~~~~~
1567 if (a > 3) {
1568 moveShip(5 * gravity, DOWN);
1570 ~~~~~~~
1572Like regular code blocks, fenced code blocks must be separated
1573from surrounding text by blank lines.
1575If the code itself contains a row of tildes or backticks, just use a longer
1576row of tildes or backticks at the start and end:
1578 ~~~~~~~~~~~~~~~~
1579 ~~~~~~~~~~
1580 code including tildes
1581 ~~~~~~~~~~
1582 ~~~~~~~~~~~~~~~~
1584#### Extension: `backtick_code_blocks` ####
1586Same as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes
1587(`~`).
1589#### Extension: `fenced_code_attributes` ####
1591Optionally, you may attach attributes to fenced or backtick code block using
1592this syntax:
1594 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1595 qsort [] = []
1596 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1597 qsort (filter (>= x) xs)
1598 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1600Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1601`startFrom` is an attribute with value `100`. Some output formats can use this
1602information to do syntax highlighting. Currently, the only output formats
1603that uses this information are HTML and LaTeX. If highlighting is supported
1604for your output format and language, then the code block above will appear
1605highlighted, with numbered lines. (To see which languages are supported, do
1606`pandoc --version`.) Otherwise, the code block above will appear as follows:
1608 <pre id="mycode" class="haskell numberLines" startFrom="100">
1609 <code>
1610 ...
1611 </code>
1612 </pre>
1614A shortcut form can also be used for specifying the language of
1615the code block:
1617 ```haskell
1618 qsort [] = []
1619 ```
1621This is equivalent to:
1623 ``` {.haskell}
1624 qsort [] = []
1625 ```
1627If the `fenced_code_attributes` extension is disabled, but
1628input contains class attribute(s) for the codeblock, the first
1629class attribute will be printed after the opening fence as a bare
1630word.
1632To prevent all highlighting, use the `--no-highlight` flag.
1633To set the highlighting style, use `--highlight-style`.
1634For more information on highlighting, see [Syntax highlighting],
1635below.
1637Line blocks
1638-----------
1640#### Extension: `line_blocks` ####
1642A line block is a sequence of lines beginning with a vertical bar (`|`)
1643followed by a space. The division into lines will be preserved in
1644the output, as will any leading spaces; otherwise, the lines will
1645be formatted as markdown. This is useful for verse and addresses:
1647 | The limerick packs laughs anatomical
1648 | In space that is quite economical.
1649 | But the good ones I've seen
1650 | So seldom are clean
1651 | And the clean ones so seldom are comical
1653 | 200 Main St.
1654 | Berkeley, CA 94718
1656The lines can be hard-wrapped if needed, but the continuation
1657line must begin with a space.
1659 | The Right Honorable Most Venerable and Righteous Samuel L.
1660 Constable, Jr.
1661 | 200 Main St.
1662 | Berkeley, CA 94718
1664This syntax is borrowed from [reStructuredText].
1666Lists
1667-----
1669### Bullet lists ###
1671A bullet list is a list of bulleted list items. A bulleted list
1672item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1673example:
1675 * one
1676 * two
1677 * three
1679This will produce a "compact" list. If you want a "loose" list, in which
1680each item is formatted as a paragraph, put spaces between the items:
1682 * one
1684 * two
1686 * three
1688The bullets need not be flush with the left margin; they may be
1689indented one, two, or three spaces. The bullet must be followed
1690by whitespace.
1692List items look best if subsequent lines are flush with the first
1693line (after the bullet):
1695 * here is my first
1696 list item.
1697 * and my second.
1699But markdown also allows a "lazy" format:
1701 * here is my first
1702 list item.
1703 * and my second.
1705### The four-space rule ###
1707A list item may contain multiple paragraphs and other block-level
1708content. However, subsequent paragraphs must be preceded by a blank line
1709and indented four spaces or a tab. The list will look better if the first
1710paragraph is aligned with the rest:
1712 * First paragraph.
1714 Continued.
1716 * Second paragraph. With a code block, which must be indented
1717 eight spaces:
1719 { code }
1721List items may include other lists. In this case the preceding blank
1722line is optional. The nested list must be indented four spaces or
1723one tab:
1725 * fruits
1726 + apples
1727 - macintosh
1728 - red delicious
1729 + pears
1730 + peaches
1731 * vegetables
1732 + broccoli
1733 + chard
1735As noted above, markdown allows you to write list items "lazily," instead of
1736indenting continuation lines. However, if there are multiple paragraphs or
1737other blocks in a list item, the first line of each must be indented.
1739 + A lazy, lazy, list
1740 item.
1742 + Another one; this looks
1743 bad but is legal.
1745 Second paragraph of second
1746 list item.
1748**Note:** Although the four-space rule for continuation paragraphs
1749comes from the official [markdown syntax guide], the reference implementation,
1750`Markdown.pl`, does not follow it. So pandoc will give different results than
1751`Markdown.pl` when authors have indented continuation paragraphs fewer than
1752four spaces.
1754The [markdown syntax guide] is not explicit whether the four-space
1755rule applies to *all* block-level content in a list item; it only
1756mentions paragraphs and code blocks. But it implies that the rule
1757applies to all block-level content (including nested lists), and
1758pandoc interprets it that way.
1760 [markdown syntax guide]:
1761 http://daringfireball.net/projects/markdown/syntax#list
1763### Ordered lists ###
1765Ordered lists work just like bulleted lists, except that the items
1766begin with enumerators rather than bullets.
1768In standard markdown, enumerators are decimal numbers followed
1769by a period and a space. The numbers themselves are ignored, so
1770there is no difference between this list:
1772 1. one
1773 2. two
1774 3. three
1776and this one:
1778 5. one
1779 7. two
1780 1. three
1782#### Extension: `fancy_lists` ####
1784Unlike standard markdown, Pandoc allows ordered list items to be marked
1785with uppercase and lowercase letters and roman numerals, in addition to
1786arabic numerals. List markers may be enclosed in parentheses or followed by a
1787single right-parentheses or period. They must be separated from the
1788text that follows by at least one space, and, if the list marker is a
1789capital letter with a period, by at least two spaces.[^2]
1791[^2]: The point of this rule is to ensure that normal paragraphs
1792 starting with people's initials, like
1794 B. Russell was an English philosopher.
1796 do not get treated as list items.
1798 This rule will not prevent
1800 (C) 2007 Joe Smith
1802 from being interpreted as a list item. In this case, a backslash
1803 escape can be used:
1805 (C\) 2007 Joe Smith
1807The `fancy_lists` extension also allows '`#`' to be used as an
1808ordered list marker in place of a numeral:
1810 #. one
1811 #. two
1813#### Extension: `startnum` ####
1815Pandoc also pays attention to the type of list marker used, and to the
1816starting number, and both of these are preserved where possible in the
1817output format. Thus, the following yields a list with numbers followed
1818by a single parenthesis, starting with 9, and a sublist with lowercase
1819roman numerals:
1821 9) Ninth
1822 10) Tenth
1823 11) Eleventh
1824 i. subone
1825 ii. subtwo
1826 iii. subthree
1828Pandoc will start a new list each time a different type of list
1829marker is used. So, the following will create three lists:
1831 (2) Two
1832 (5) Three
1833 1. Four
1834 * Five
1836If default list markers are desired, use `#.`:
1838 #. one
1839 #. two
1840 #. three
1843### Definition lists ###
1845#### Extension: `definition_lists` ####
1847Pandoc supports definition lists, using the syntax of
1848[PHP Markdown Extra] with some extensions.[^3]
1850 Term 1
1852 : Definition 1
1854 Term 2 with *inline markup*
1856 : Definition 2
1858 { some code, part of Definition 2 }
1860 Third paragraph of definition 2.
1862Each term must fit on one line, which may optionally be followed by
1863a blank line, and must be followed by one or more definitions.
1864A definition begins with a colon or tilde, which may be indented one
1865or two spaces.
1867A term may have multiple definitions, and each definition may consist of one or
1868more block elements (paragraph, code block, list, etc.), each indented four
1869spaces or one tab stop. The body of the definition (including the first line,
1870aside from the colon or tilde) should be indented four spaces. However,
1871as with other markdown lists, you can "lazily" omit indentation except
1872at the beginning of a paragraph or other block element:
1874 Term 1
1876 : Definition
1877 with lazy continuation.
1879 Second paragraph of the definition.
1881If you leave space before the definition (as in the example above),
1882the text of the definition will be treated as a paragraph. In some
1883output formats, this will mean greater spacing between term/definition
1884pairs. For a more compact definition list, omit the space before the
1885definition:
1887 Term 1
1888 ~ Definition 1
1890 Term 2
1891 ~ Definition 2a
1892 ~ Definition 2b
1894Note that space between items in a definition list is required.
1895(A variant that loosens this requirement, but disallows "lazy"
1896hard wrapping, can be activated with `compact_definition_lists`: see
1897[Non-pandoc extensions], below.)
1899[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1901### Numbered example lists ###
1903#### Extension: `example_lists` ####
1905The special list marker `@` can be used for sequentially numbered
1906examples. The first list item with a `@` marker will be numbered '1',
1907the next '2', and so on, throughout the document. The numbered examples
1908need not occur in a single list; each new list using `@` will take up
1909where the last stopped. So, for example:
1911 (@) My first example will be numbered (1).
1912 (@) My second example will be numbered (2).
1914 Explanation of examples.
1916 (@) My third example will be numbered (3).
1918Numbered examples can be labeled and referred to elsewhere in the
1919document:
1921 (@good) This is a good example.
1923 As (@good) illustrates, ...
1925The label can be any string of alphanumeric characters, underscores,
1926or hyphens.
1929### Compact and loose lists ###
1931Pandoc behaves differently from `Markdown.pl` on some "edge
1932cases" involving lists. Consider this source:
1934 + First
1935 + Second:
1936 - Fee
1937 - Fie
1938 - Foe
1940 + Third
1942Pandoc transforms this into a "compact list" (with no `<p>` tags around
1943"First", "Second", or "Third"), while markdown puts `<p>` tags around
1944"Second" and "Third" (but not "First"), because of the blank space
1945around "Third". Pandoc follows a simple rule: if the text is followed by
1946a blank line, it is treated as a paragraph. Since "Second" is followed
1947by a list, and not a blank line, it isn't treated as a paragraph. The
1948fact that the list is followed by a blank line is irrelevant. (Note:
1949Pandoc works this way even when the `markdown_strict` format is specified. This
1950behavior is consistent with the official markdown syntax description,
1951even though it is different from that of `Markdown.pl`.)
1954### Ending a list ###
1956What if you want to put an indented code block after a list?
1958 - item one
1959 - item two
1961 { my code block }
1963Trouble! Here pandoc (like other markdown implementations) will treat
1964`{ my code block }` as the second paragraph of item two, and not as
1965a code block.
1967To "cut off" the list after item two, you can insert some non-indented
1968content, like an HTML comment, which won't produce visible output in
1969any format:
1971 - item one
1972 - item two
1974 <!-- end of list -->
1976 { my code block }
1978You can use the same trick if you want two consecutive lists instead
1979of one big list:
1981 1. one
1982 2. two
1983 3. three
1985 <!-- -->
1987 1. uno
1988 2. dos
1989 3. tres
1991Horizontal rules
1992----------------
1994A line containing a row of three or more `*`, `-`, or `_` characters
1995(optionally separated by spaces) produces a horizontal rule:
1997 * * * *
1999 ---------------
2002Tables
2003------
2005Four kinds of tables may be used. The first three kinds presuppose the use of
2006a fixed-width font, such as Courier. The fourth kind can be used with
2007proportionally spaced fonts, as it does not require lining up columns.
2009#### Extension: `table_captions` ####
2011A caption may optionally be provided with all 4 kinds of tables (as
2012illustrated in the examples below). A caption is a paragraph beginning
2013with the string `Table:` (or just `:`), which will be stripped off.
2014It may appear either before or after the table.
2016#### Extension: `simple_tables` ####
2018Simple tables look like this:
2020 Right Left Center Default
2021 ------- ------ ---------- -------
2022 12 12 12 12
2023 123 123 123 123
2024 1 1 1 1
2026 Table: Demonstration of simple table syntax.
2028The headers and table rows must each fit on one line. Column
2029alignments are determined by the position of the header text relative
2030to the dashed line below it:[^4]
2032 - If the dashed line is flush with the header text on the right side
2033 but extends beyond it on the left, the column is right-aligned.
2034 - If the dashed line is flush with the header text on the left side
2035 but extends beyond it on the right, the column is left-aligned.
2036 - If the dashed line extends beyond the header text on both sides,
2037 the column is centered.
2038 - If the dashed line is flush with the header text on both sides,
2039 the default alignment is used (in most cases, this will be left).
2041[^4]: This scheme is due to Michel Fortin, who proposed it on the
2042 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
2044The table must end with a blank line, or a line of dashes followed by
2045a blank line.
2047The column headers may be omitted, provided a dashed line is used
2048to end the table. For example:
2050 ------- ------ ---------- -------
2051 12 12 12 12
2052 123 123 123 123
2053 1 1 1 1
2054 ------- ------ ---------- -------
2056When headers are omitted, column alignments are determined on the basis
2057of the first line of the table body. So, in the tables above, the columns
2058would be right, left, center, and right aligned, respectively.
2060#### Extension: `multiline_tables` ####
2062Multiline tables allow headers and table rows to span multiple lines
2063of text (but cells that span multiple columns or rows of the table are
2064not supported). Here is an example:
2066 -------------------------------------------------------------
2067 Centered Default Right Left
2068 Header Aligned Aligned Aligned
2069 ----------- ------- --------------- -------------------------
2070 First row 12.0 Example of a row that
2071 spans multiple lines.
2073 Second row 5.0 Here's another one. Note
2074 the blank line between
2075 rows.
2076 -------------------------------------------------------------
2078 Table: Here's the caption. It, too, may span
2079 multiple lines.
2081These work like simple tables, but with the following differences:
2083 - They must begin with a row of dashes, before the header text
2084 (unless the headers are omitted).
2085 - They must end with a row of dashes, then a blank line.
2086 - The rows must be separated by blank lines.
2088In multiline tables, the table parser pays attention to the widths of
2089the columns, and the writers try to reproduce these relative widths in
2090the output. So, if you find that one of the columns is too narrow in the
2091output, try widening it in the markdown source.
2093Headers may be omitted in multiline tables as well as simple tables:
2095 ----------- ------- --------------- -------------------------
2096 First row 12.0 Example of a row that
2097 spans multiple lines.
2099 Second row 5.0 Here's another one. Note
2100 the blank line between
2101 rows.
2102 ----------- ------- --------------- -------------------------
2104 : Here's a multiline table without headers.
2106It is possible for a multiline table to have just one row, but the row
2107should be followed by a blank line (and then the row of dashes that ends
2108the table), or the table may be interpreted as a simple table.
2110#### Extension: `grid_tables` ####
2112Grid tables look like this:
2114 : Sample grid table.
2116 +---------------+---------------+--------------------+
2117 | Fruit | Price | Advantages |
2118 +===============+===============+====================+
2119 | Bananas | $1.34 | - built-in wrapper |
2120 | | | - bright color |
2121 +---------------+---------------+--------------------+
2122 | Oranges | $2.10 | - cures scurvy |
2123 | | | - tasty |
2124 +---------------+---------------+--------------------+
2126The row of `=`s separates the header from the table body, and can be
2127omitted for a headerless table. The cells of grid tables may contain
2128arbitrary block elements (multiple paragraphs, code blocks, lists,
2129etc.). Alignments are not supported, nor are cells that span multiple
2130columns or rows. Grid tables can be created easily using [Emacs table mode].
2132[Emacs table mode]: http://table.sourceforge.net/
2134#### Extension: `pipe_tables` ####
2136Pipe tables look like this:
2138 | Right | Left | Default | Center |
2139 |------:|:-----|---------|:------:|
2140 | 12 | 12 | 12 | 12 |
2141 | 123 | 123 | 123 | 123 |
2142 | 1 | 1 | 1 | 1 |
2144 : Demonstration of pipe table syntax.
2146The syntax is identical to [PHP Markdown Extra tables]. The beginning and
2147ending pipe characters are optional, but pipes are required between all
2148columns. The colons indicate column alignment as shown. The header
2149cannot be omitted. To simulate a headerless table, include a header
2150with blank cells.
2152Since the pipes indicate column boundaries, columns need not be vertically
2153aligned, as they are in the above example. So, this is a perfectly
2154legal (though ugly) pipe table:
2156 fruit| price
2157 -----|-----:
2158 apple|2.05
2159 pear|1.37
2160 orange|3.09
2162The cells of pipe tables cannot contain block elements like paragraphs
2163and lists, and cannot span multiple lines. Note also that in LaTeX/PDF
2164output, the cells produced by pipe tables will not wrap, since there
2165is no information available about relative widths. If you want content
2166to wrap within cells, use multiline or grid tables.
2168Note: Pandoc also recognizes pipe tables of the following
2169form, as can be produced by Emacs' orgtbl-mode:
2171 | One | Two |
2172 |-----+-------|
2173 | my | table |
2174 | is | nice |
2176The difference is that `+` is used instead of `|`. Other orgtbl features
2177are not supported. In particular, to get non-default column alignment,
2178you'll need to add colons as above.
2180[PHP Markdown Extra tables]: https://michelf.ca/projects/php-markdown/extra/#table
2182Metadata blocks
2183---------------
2185#### Extension: `pandoc_title_block` ####
2187If the file begins with a title block
2189 % title
2190 % author(s) (separated by semicolons)
2191 % date
2193it will be parsed as bibliographic information, not regular text. (It
2194will be used, for example, in the title of standalone LaTeX or HTML
2195output.) The block may contain just a title, a title and an author,
2196or all three elements. If you want to include an author but no
2197title, or a title and a date but no author, you need a blank line:
2200 % Author
2202 % My title
2204 % June 15, 2006
2206The title may occupy multiple lines, but continuation lines must
2207begin with leading space, thus:
2209 % My title
2210 on multiple lines
2212If a document has multiple authors, the authors may be put on
2213separate lines with leading space, or separated by semicolons, or
2214both. So, all of the following are equivalent:
2216 % Author One
2217 Author Two
2219 % Author One; Author Two
2221 % Author One;
2222 Author Two
2224The date must fit on one line.
2226All three metadata fields may contain standard inline formatting
2227(italics, links, footnotes, etc.).
2229Title blocks will always be parsed, but they will affect the output only
2230when the `--standalone` (`-s`) option is chosen. In HTML output, titles
2231will appear twice: once in the document head -- this is the title that
2232will appear at the top of the window in a browser -- and once at the
2233beginning of the document body. The title in the document head can have
2234an optional prefix attached (`--title-prefix` or `-T` option). The title
2235in the body appears as an H1 element with class "title", so it can be
2236suppressed or reformatted with CSS. If a title prefix is specified with
2237`-T` and no title block appears in the document, the title prefix will
2238be used by itself as the HTML title.
2240The man page writer extracts a title, man page section number, and
2241other header and footer information from the title line. The title
2242is assumed to be the first word on the title line, which may optionally
2243end with a (single-digit) section number in parentheses. (There should
2244be no space between the title and the parentheses.) Anything after
2245this is assumed to be additional footer and header text. A single pipe
2246character (`|`) should be used to separate the footer text from the header
2247text. Thus,
2249 % PANDOC(1)
2251will yield a man page with the title `PANDOC` and section 1.
2253 % PANDOC(1) Pandoc User Manuals
2255will also have "Pandoc User Manuals" in the footer.
2257 % PANDOC(1) Pandoc User Manuals | Version 4.0
2259will also have "Version 4.0" in the header.
2261#### Extension: `yaml_metadata_block` ####
2263A YAML metadata block is a valid YAML object, delimited by a line of three
2264hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
2265(`...`) at the bottom. A YAML metadata block may occur anywhere in the
2266document, but if it is not at the beginning, it must be preceded by a blank
2267line. (Note that, because of the way pandoc concatenates input files when
2268several are provided, you may also keep the metadata in a separate YAML file
2269and pass it to pandoc as an argument, along with your markdown files:
2271 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
2273Just be sure that the YAML file begins with `---` and ends with `---` or
2274`...`.)
2276Metadata will be taken from the fields of the YAML object and added to any
2277existing document metadata. Metadata can contain lists and objects (nested
2278arbitrarily), but all string scalars will be interpreted as markdown. Fields
2279with names ending in an underscore will be ignored by pandoc. (They may be
2280given a role by external processors.)
2282A document may contain multiple metadata blocks. The metadata fields will
2283be combined through a *left-biased union*: if two metadata blocks attempt
2284to set the same field, the value from the first block will be taken.
2286When pandoc is used with `-t markdown` to create a markdown document,
2287a YAML metadata block will be produced only if the `-s/--standalone`
2288option is used. All of the metadata will appear in a single block
2289at the beginning of the document.
2291Note that YAML escaping rules must be followed. Thus, for example,
2292if a title contains a colon, it must be quoted. The pipe character
2293(`|`) can be used to begin an indented block that will be interpreted
2294literally, without need for escaping. This form is necessary
2295when the field contains blank lines:
2297 ---
2298 title: 'This is the title: it contains a colon'
2299 author:
2300 - name: Author One
2301 affiliation: University of Somewhere
2302 - name: Author Two
2303 affiliation: University of Nowhere
2304 tags: [nothing, nothingness]
2305 abstract: |
2306 This is the abstract.
2308 It consists of two paragraphs.
2309 ...
2311Template variables will be set automatically from the metadata. Thus, for
2312example, in writing HTML, the variable `abstract` will be set to the HTML
2313equivalent of the markdown in the `abstract` field:
2315 <p>This is the abstract.</p>
2316 <p>It consists of two paragraphs.</p>
2318Note: The `author` variable in the default templates expects a simple list or
2319string. To use the structured authors in the example, you would need a
2320custom template. For example:
2322 $for(author)$
2323 $if(author.name)$
2324 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
2325 $else$
2326 $author$
2327 $endif$
2328 $endfor$
2331Backslash escapes
2332-----------------
2334#### Extension: `all_symbols_escapable` ####
2336Except inside a code block or inline code, any punctuation or space
2337character preceded by a backslash will be treated literally, even if it
2338would normally indicate formatting. Thus, for example, if one writes
2340 *\*hello\**
2342one will get
2344 <em>*hello*</em>
2346instead of
2348 <strong>hello</strong>
2350This rule is easier to remember than standard markdown's rule,
2351which allows only the following characters to be backslash-escaped:
2353 \`*_{}[]()>#+-.!
2355(However, if the `markdown_strict` format is used, the standard markdown rule
2356will be used.)
2358A backslash-escaped space is parsed as a nonbreaking space. It will
2359appear in TeX output as `~` and in HTML and XML as `\&#160;` or
2360`\&nbsp;`.
2362A backslash-escaped newline (i.e. a backslash occurring at the end of
2363a line) is parsed as a hard line break. It will appear in TeX output as
2364`\\` and in HTML as `<br />`. This is a nice alternative to
2365markdown's "invisible" way of indicating hard line breaks using
2366two trailing spaces on a line.
2368Backslash escapes do not work in verbatim contexts.
2370Smart punctuation
2371-----------------
2373#### Extension ####
2375If the `--smart` option is specified, pandoc will produce typographically
2376correct output, converting straight quotes to curly quotes, `---` to
2377em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
2378are inserted after certain abbreviations, such as "Mr."
2380Note: if your LaTeX template calls for the [`csquotes`] package, pandoc will
2381detect this automatically and use `\enquote{...}` for quoted text.
2383Inline formatting
2384-----------------
2386### Emphasis ###
2388To *emphasize* some text, surround it with `*`s or `_`, like this:
2390 This text is _emphasized with underscores_, and this
2391 is *emphasized with asterisks*.
2393Double `*` or `_` produces **strong emphasis**:
2395 This is **strong emphasis** and __with underscores__.
2397A `*` or `_` character surrounded by spaces, or backslash-escaped,
2398will not trigger emphasis:
2400 This is * not emphasized *, and \*neither is this\*.
2402#### Extension: `intraword_underscores` ####
2404Because `_` is sometimes used inside words and identifiers,
2405pandoc does not interpret a `_` surrounded by alphanumeric
2406characters as an emphasis marker. If you want to emphasize
2407just part of a word, use `*`:
2409 feas*ible*, not feas*able*.
2412### Strikeout ###
2414#### Extension: `strikeout` ####
2416To strikeout a section of text with a horizontal line, begin and end it
2417with `~~`. Thus, for example,
2419 This ~~is deleted text.~~
2422### Superscripts and subscripts ###
2424#### Extension: `superscript`, `subscript` ####
2426Superscripts may be written by surrounding the superscripted text by `^`
2427characters; subscripts may be written by surrounding the subscripted
2428text by `~` characters. Thus, for example,
2430 H~2~O is a liquid. 2^10^ is 1024.
2432If the superscripted or subscripted text contains spaces, these spaces
2433must be escaped with backslashes. (This is to prevent accidental
2434superscripting and subscripting through the ordinary use of `~` and `^`.)
2435Thus, if you want the letter P with 'a cat' in subscripts, use
2436`P~a\ cat~`, not `P~a cat~`.
2439### Verbatim ###
2441To make a short span of text verbatim, put it inside backticks:
2443 What is the difference between `>>=` and `>>`?
2445If the verbatim text includes a backtick, use double backticks:
2447 Here is a literal backtick `` ` ``.
2449(The spaces after the opening backticks and before the closing
2450backticks will be ignored.)
2452The general rule is that a verbatim span starts with a string
2453of consecutive backticks (optionally followed by a space)
2454and ends with a string of the same number of backticks (optionally
2455preceded by a space).
2457Note that backslash-escapes (and other markdown constructs) do not
2458work in verbatim contexts:
2460 This is a backslash followed by an asterisk: `\*`.
2462#### Extension: `inline_code_attributes` ####
2464Attributes can be attached to verbatim text, just as with
2465[fenced code blocks]:
2467 `<$>`{.haskell}
2469### Small caps ###
2471To write small caps, you can use an HTML span tag:
2473 <span style="font-variant:small-caps;">Small caps</span>
2475(The semicolon is optional and there may be space after the
2476colon.) This will work in all output formats that support small caps.
2478Math
2479----
2481#### Extension: `tex_math_dollars` ####
2483Anything between two `$` characters will be treated as TeX math. The
2484opening `$` must have a non-space character immediately to its right,
2485while the closing `$` must have a non-space character immediately to its
2486left, and must not be followed immediately by a digit. Thus,
2487`$20,000 and $30,000` won't parse as math. If for some reason
2488you need to enclose text in literal `$` characters, backslash-escape
2489them and they won't be treated as math delimiters.
2491TeX math will be printed in all output formats. How it is rendered
2492depends on the output format:
2494Markdown, LaTeX, Emacs Org mode, ConTeXt
2495 ~ It will appear verbatim between `$` characters.
2497reStructuredText
2498 ~ It will be rendered using an [interpreted text role `:math:`].
2500AsciiDoc
2501 ~ It will be rendered as `latexmath:[...]`.
2503Texinfo
2504 ~ It will be rendered inside a `@math` command.
2506groff man
2507 ~ It will be rendered verbatim without `$`'s.
2509MediaWiki, DokuWiki
2510 ~ It will be rendered inside `<math>` tags.
2512Textile
2513 ~ It will be rendered inside `<span class="math">` tags.
2515RTF, OpenDocument, ODT
2516 ~ It will be rendered, if possible, using unicode characters,
2517 and will otherwise appear verbatim.
2519DocBook
2520 ~ If the `--mathml` flag is used, it will be rendered using MathML
2521 in an `inlineequation` or `informalequation` tag. Otherwise it
2522 will be rendered, if possible, using unicode characters.
2524Docx
2525 ~ It will be rendered using OMML math markup.
2527FictionBook2
2528 ~ If the `--webtex` option is used, formulas are rendered as images
2529 using Google Charts or other compatible web service, downloaded
2530 and embedded in the e-book. Otherwise, they will appear verbatim.
2532HTML, Slidy, DZSlides, S5, EPUB
2533 ~ The way math is rendered in HTML will depend on the
2534 command-line options selected:
2536 1. The default is to render TeX math as far as possible using unicode
2537 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2538 are put inside a `span` with `class="math"`, so that they may be
2539 styled differently from the surrounding text if needed.
2541 2. If the `--latexmathml` option is used, TeX math will be displayed
2542 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2543 The [LaTeXMathML] script will be used to render it as formulas.
2544 (This trick does not work in all browsers, but it works in Firefox.
2545 In browsers that do not support LaTeXMathML, TeX math will appear
2546 verbatim between `$` characters.)
2548 3. If the `--jsmath` option is used, TeX math will be put inside
2549 `<span>` tags (for inline math) or `<div>` tags (for display math)
2550 with class `math`. The [jsMath] script will be used to render
2551 it.
2553 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2554 be called to generate images for each TeX formula. This should
2555 work in all browsers. The `--mimetex` option takes an optional URL
2556 as argument. If no URL is specified, it will be assumed that the
2557 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2559 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2560 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2561 be processed by [gladTeX], which will produce image files for each
2562 formula and an HTML file with links to these images. So, the
2563 procedure is:
2565 pandoc -s --gladtex myfile.txt -o myfile.htex
2566 gladtex -d myfile-images myfile.htex
2567 # produces myfile.html and images in myfile-images
2569 6. If the `--webtex` option is used, TeX formulas will be converted
2570 to `<img>` tags that link to an external script that converts
2571 formulas to images. The formula will be URL-encoded and concatenated
2572 with the URL provided. If no URL is specified, the Google Chart
2573 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2575 7. If the `--mathjax` option is used, TeX math will be displayed
2576 between `\(...\)` (for inline math) or `\[...\]` (for display
2577 math) and put in `<span>` tags with class `math`.
2578 The [MathJax] script will be used to render it as formulas.
2580[interpreted text role `:math:`]: http://docutils.sourceforge.net/docs/ref/rst/roles.html#math
2582Raw HTML
2583--------
2585#### Extension: `raw_html` ####
2587Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2588(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2589literally). (Technically this is not an extension, since standard
2590markdown allows it, but it has been made an extension so that it can
2591be disabled if desired.)
2593The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2594DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2595formats.
2597#### Extension: `markdown_in_html_blocks` ####
2599Standard markdown allows you to include HTML "blocks": blocks
2600of HTML between balanced tags that are separated from the surrounding text
2601with blank lines, and start and end at the left margin. Within
2602these blocks, everything is interpreted as HTML, not markdown;
2603so (for example), `*` does not signify emphasis.
2605Pandoc behaves this way when the `markdown_strict` format is used; but
2606by default, pandoc interprets material between HTML block tags as markdown.
2607Thus, for example, Pandoc will turn
2609 <table>
2610 <tr>
2611 <td>*one*</td>
2612 <td>[a link](http://google.com)</td>
2613 </tr>
2614 </table>
2616into
2618 <table>
2619 <tr>
2620 <td><em>one</em></td>
2621 <td><a href="http://google.com">a link</a></td>
2622 </tr>
2623 </table>
2625whereas `Markdown.pl` will preserve it as is.
2627There is one exception to this rule: text between `<script>` and
2628`<style>` tags is not interpreted as markdown.
2630This departure from standard markdown should make it easier to mix
2631markdown with HTML block elements. For example, one can surround
2632a block of markdown text with `<div>` tags without preventing it
2633from being interpreted as markdown.
2635#### Extension: `native_divs` ####
2637Use native pandoc `Div` blocks for content inside `<div>` tags.
2638For the most part this should give the same output as
2639`markdown_in_html_blocks`, but it makes it easier to write pandoc
2640filters to manipulate groups of blocks.
2642#### Extension: `native_spans` ####
2644Use native pandoc `Span` blocks for content inside `<span>` tags.
2645For the most part this should give the same output as `raw_html`,
2646but it makes it easier to write pandoc filters to manipulate groups
2647of inlines.
2649Raw TeX
2650-------
2652#### Extension: `raw_tex` ####
2654In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2655included in a document. Inline TeX commands will be preserved and passed
2656unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2657LaTeX to include BibTeX citations:
2659 This result was proved in \cite{jones.1967}.
2661Note that in LaTeX environments, like
2663 \begin{tabular}{|l|l|}\hline
2664 Age & Frequency \\ \hline
2665 18--25 & 15 \\
2666 26--35 & 33 \\
2667 36--45 & 22 \\ \hline
2668 \end{tabular}
2670the material between the begin and end tags will be interpreted as raw
2671LaTeX, not as markdown.
2673Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2674and ConTeXt.
2676LaTeX macros
2677------------
2679#### Extension: `latex_macros` ####
2681For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2682`\renewcommand` definitions and apply the resulting macros to all LaTeX
2683math. So, for example, the following will work in all output formats,
2684not just LaTeX:
2686 \newcommand{\tuple}[1]{\langle #1 \rangle}
2688 $\tuple{a, b, c}$
2690In LaTeX output, the `\newcommand` definition will simply be passed
2691unchanged to the output.
2694Links
2695-----
2697Markdown allows links to be specified in several ways.
2699### Automatic links ###
2701If you enclose a URL or email address in pointy brackets, it
2702will become a link:
2704 <http://google.com>
2705 <sam@green.eggs.ham>
2707### Inline links ###
2709An inline link consists of the link text in square brackets,
2710followed by the URL in parentheses. (Optionally, the URL can
2711be followed by a link title, in quotes.)
2713 This is an [inline link](/url), and here's [one with
2714 a title](http://fsf.org "click here for a good time!").
2716There can be no space between the bracketed part and the parenthesized part.
2717The link text can contain formatting (such as emphasis), but the title cannot.
2719Email addresses in inline links are not autodetected, so they have to be
2720prefixed with `mailto`:
2722 [Write me!](mailto:sam@green.eggs.ham)
2724### Reference links ###
2726An *explicit* reference link has two parts, the link itself and the link
2727definition, which may occur elsewhere in the document (either
2728before or after the link).
2730The link consists of link text in square brackets, followed by a label in
2731square brackets. (There can be space between the two.) The link definition
2732consists of the bracketed label, followed by a colon and a space, followed by
2733the URL, and optionally (after a space) a link title either in quotes or in
2734parentheses. The label must not be parseable as a citation (assuming
2735the `citations` extension is enabled): citations take precedence over
2736link labels.
2738Here are some examples:
2740 [my label 1]: /foo/bar.html "My title, optional"
2741 [my label 2]: /foo
2742 [my label 3]: http://fsf.org (The free software foundation)
2743 [my label 4]: /bar#special 'A title in single quotes'
2745The URL may optionally be surrounded by angle brackets:
2747 [my label 5]: <http://foo.bar.baz>
2749The title may go on the next line:
2751 [my label 3]: http://fsf.org
2752 "The free software foundation"
2754Note that link labels are not case sensitive. So, this will work:
2756 Here is [my link][FOO]
2758 [Foo]: /bar/baz
2760In an *implicit* reference link, the second pair of brackets is
2761empty:
2763 See [my website][].
2765 [my website]: http://foo.bar.baz
2767Note: In `Markdown.pl` and most other markdown implementations,
2768reference link definitions cannot occur in nested constructions
2769such as list items or block quotes. Pandoc lifts this arbitrary
2770seeming restriction. So the following is fine in pandoc, though
2771not in most other implementations:
2773 > My block [quote].
2775 > [quote]: /foo
2777#### Extension: `shortcut_reference_links` ####
2779In a *shortcut* reference link, the second pair of brackets may
2780be omitted entirely:
2782 See [my website].
2784 [my website]: http://foo.bar.baz
2786### Internal links ###
2788To link to another section of the same document, use the automatically
2789generated identifier (see [Header identifiers]). For example:
2791 See the [Introduction](#introduction).
2795 See the [Introduction].
2797 [Introduction]: #introduction
2799Internal links are currently supported for HTML formats (including
2800HTML slide shows and EPUB), LaTeX, and ConTeXt.
2802Images
2803------
2805A link immediately preceded by a `!` will be treated as an image.
2806The link text will be used as the image's alt text:
2808 ![la lune](lalune.jpg "Voyage to the moon")
2810 ![movie reel]
2812 [movie reel]: movie.gif
2814#### Extension: `implicit_figures` ####
2816An image occurring by itself in a paragraph will be rendered as
2817a figure with a caption.[^5] (In LaTeX, a figure environment will be
2818used; in HTML, the image will be placed in a `div` with class
2819`figure`, together with a caption in a `p` with class `caption`.)
2820The image's alt text will be used as the caption.
2822 ![This is the caption](/url/of/image.png)
2824[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2825 ODT. In those formats, you'll just get an image in a paragraph by
2826 itself, with no caption.
2828If you just want a regular inline image, just make sure it is not
2829the only thing in the paragraph. One way to do this is to insert a
2830nonbreaking space after the image:
2832 ![This image won't be a figure](/url/of/image.png)\
2835Footnotes
2836---------
2838#### Extension: `footnotes` ####
2840Pandoc's markdown allows footnotes, using the following syntax:
2842 Here is a footnote reference,[^1] and another.[^longnote]
2844 [^1]: Here is the footnote.
2846 [^longnote]: Here's one with multiple blocks.
2848 Subsequent paragraphs are indented to show that they
2849 belong to the previous footnote.
2851 { some.code }
2853 The whole paragraph can be indented, or just the first
2854 line. In this way, multi-paragraph footnotes work like
2855 multi-paragraph list items.
2857 This paragraph won't be part of the note, because it
2858 isn't indented.
2860The identifiers in footnote references may not contain spaces, tabs,
2861or newlines. These identifiers are used only to correlate the
2862footnote reference with the note itself; in the output, footnotes
2863will be numbered sequentially.
2865The footnotes themselves need not be placed at the end of the
2866document. They may appear anywhere except inside other block elements
2867(lists, block quotes, tables, etc.).
2869#### Extension: `inline_notes` ####
2871Inline footnotes are also allowed (though, unlike regular notes,
2872they cannot contain multiple paragraphs). The syntax is as follows:
2874 Here is an inline note.^[Inlines notes are easier to write, since
2875 you don't have to pick an identifier and move down to type the
2876 note.]
2878Inline and regular footnotes may be mixed freely.
2881Citations
2882---------
2884#### Extension: `citations` ####
2886Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2887citations and a bibliography in a number of styles. Basic usage is
2889 pandoc --filter pandoc-citeproc myinput.txt
2891In order to use this feature, you will need to specify a bibliography file
2892using the `bibliography` metadata field in a YAML metadata section, or
2893`--bibliography` command line argument. You can supply multiple `--bibliography`
2894arguments or set `bibliography` metadata field to YAML array, if you want to
2895use multiple bibliography files.
2896The bibliography may have any of these formats:
2898 Format File extension
2899 ------------ --------------
2900 BibLaTeX .bib
2901 BibTeX .bibtex
2902 Copac .copac
2903 CSL JSON .json
2904 CSL YAML .yaml
2905 EndNote .enl
2906 EndNote XML .xml
2907 ISI .wos
2908 MEDLINE .medline
2909 MODS .mods
2910 RIS .ris
2912Note that `.bib` can be used with both BibTeX and BibLaTeX files;
2913use `.bibtex` to force BibTeX.
2915Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`
2916can produce `.json` and `.yaml` files from any of the supported formats.
2918In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc parses
2919a subset of LaTeX markup; in CSL YAML databases, pandoc markdown; and in CSL JSON databases, an [HTML-like markup][CSL markup specs]:
2921`<i>...</i>`
2922: italics
2924`<b>...</b>`
2925: bold
2927`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`
2928: small capitals
2930`<sub>...</sub>`
2931: subscript
2933`<sup>...</sup>`
2934: superscript
2936`<span class="nocase">...</span>`
2937: prevent a phrase from being capitalized as title case
2939`pandoc-citeproc -j` and `-y` interconvert the CSL JSON
2940and CSL YAML formats as far as possible.
2942As an alternative to specifying a bibliography file, you can include
2943the citation data directly in the `references` field of the
2944document's YAML metadata. The field should contain an array of
2945YAML-encoded references, for example:
2947 ---
2948 references:
2949 - type: article-journal
2950 id: WatsonCrick1953
2951 author:
2952 - family: Watson
2953 given: J. D.
2954 - family: Crick
2955 given: F. H. C.
2956 issued:
2957 date-parts:
2958 - - 1953
2959 - 4
2960 - 25
2961 title: 'Molecular structure of nucleic acids: a structure for deoxyribose
2962 nucleic acid'
2963 title-short: Molecular structure of nucleic acids
2964 container-title: Nature
2965 volume: 171
2966 issue: 4356
2967 page: 737-738
2968 DOI: 10.1038/171737a0
2969 URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html
2970 language: en-GB
2971 ...
2973(`pandoc-citeproc --bib2yaml` can produce these from a bibliography file in one
2974of the supported formats.)
2976Citations and references can be formatted using any style supported by the
2977[Citation Style Language], listed in the [Zotero Style Repository].
2978These files are specified using the `--csl` option or the `csl` metadata field.
2979By default, `pandoc-citeproc` will use the [Chicago Manual of Style] author-date
2980format. The CSL project provides further information on [finding and editing styles].
2982Citations go inside square brackets and are separated by semicolons.
2983Each citation must have a key, composed of '@' + the citation
2984identifier from the database, and may optionally have a prefix,
2985a locator, and a suffix. The citation key must begin with a letter, digit,
2986or `_`, and may contain alphanumerics, `_`, and internal punctuation
2987characters (`:.#$%&-+?<>~/`). Here are some examples:
2989 Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
2991 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2993 Blah blah [@smith04; @doe99].
2995`pandoc-citeproc` detects locator terms in the [CSL locale files].
2996Either abbreviated or unabbreviated forms are accepted. In the `en-US`
2997locale, locator terms can be written in either singular or plural forms,
2998as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
2999`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`, `fol.`/`fols.`;
3000`number`, `no.`/`nos.`; `line`, `l.`/`ll.`; `note`, `n.`/`nn.`; `opus`,
3001`op.`/`opp.`; `page`, `p.`/`pp.`; `paragraph`, `para.`/`paras.`; `part`,
3002`pt.`/`pts.`; `section`, `sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`;
3003`verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
3004locator term is used, "page" is assumed.
3006A minus sign (`-`) before the `@` will suppress mention of
3007the author in the citation. This can be useful when the
3008author is already mentioned in the text:
3010 Smith says blah [-@smith04].
3012You can also write an in-text citation, as follows:
3014 @smith04 says blah.
3016 @smith04 [p. 33] says blah.
3018If the style calls for a list of works cited, it will be placed
3019at the end of the document. Normally, you will want to end your
3020document with an appropriate header:
3022 last paragraph...
3024 # References
3026The bibliography will be inserted after this header. Note that
3027the `unnumbered` class will be added to this header, so that the
3028section will not be numbered.
3030If you want to include items in the bibliography without actually
3031citing them in the body text, you can define a dummy `nocite` metadata
3032field and put the citations there:
3034 ---
3035 nocite: |
3036 @item1, @item2
3037 ...
3039 @item3
3041In this example, the document will contain a citation for `item3`
3042only, but the bibliography will contain entries for `item1`, `item2`, and
3043`item3`.
3045For LaTeX or PDF output, you can also use [`natbib`] or [`biblatex`]
3046to render bibliography. In order to do so, specify bibliography files as
3047outlined above, and add `--natbib` or `--biblatex` argument to `pandoc`
3048invocation. Bear in mind that bibliography files have to be in respective
3049format (either BibTeX or BibLaTeX).
3051[CSL markup specs]: http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
3052[Chicago Manual of Style]: http://chicagomanualofstyle.org
3053[Citation Style Language]: http://citationstyles.org
3054[Zotero Style Repository]: https://www.zotero.org/styles
3055[finding and editing styles]: http://citationstyles.org/styles/
3056[CSL locale files]: https://github.com/citation-style-language/locales
3058Non-pandoc extensions
3059---------------------
3061The following markdown syntax extensions are not enabled by default
3062in pandoc, but may be enabled by adding `+EXTENSION` to the format
3063name, where `EXTENSION` is the name of the extension. Thus, for
3064example, `markdown+hard_line_breaks` is markdown with hard line breaks.
3066#### Extension: `lists_without_preceding_blankline` ####
3068Allow a list to occur right after a paragraph, with no intervening
3069blank space.
3071#### Extension: `hard_line_breaks` ####
3073Causes all newlines within a paragraph to be interpreted as hard line
3074breaks instead of spaces.
3076#### Extension: `ignore_line_breaks` ####
3078Causes newlines within a paragraph to be ignored, rather than being
3079treated as spaces or as hard line breaks. This option is intended for
3080use with East Asian languages where spaces are not used between words,
3081but text is divided into lines for readability.
3083#### Extension: `tex_math_single_backslash` ####
3085Causes anything between `\(` and `\)` to be interpreted as inline
3086TeX math, and anything between `\[` and `\]` to be interpreted
3087as display TeX math. Note: a drawback of this extension is that
3088it precludes escaping `(` and `[`.
3090#### Extension: `tex_math_double_backslash` ####
3092Causes anything between `\\(` and `\\)` to be interpreted as inline
3093TeX math, and anything between `\\[` and `\\]` to be interpreted
3094as display TeX math.
3096#### Extension: `markdown_attribute` ####
3098By default, pandoc interprets material inside block-level tags as markdown.
3099This extension changes the behavior so that markdown is only parsed
3100inside block-level tags if the tags have the attribute `markdown=1`.
3102#### Extension: `mmd_title_block` ####
3104Enables a [MultiMarkdown] style title block at the top of
3105the document, for example:
3107 Title: My title
3108 Author: John Doe
3109 Date: September 1, 2008
3110 Comment: This is a sample mmd title block, with
3111 a field spanning multiple lines.
3113See the MultiMarkdown documentation for details. If `pandoc_title_block` or
3114`yaml_metadata_block` is enabled, it will take precedence over
3115`mmd_title_block`.
3117[MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
3119#### Extension: `abbreviations` ####
3121Parses PHP Markdown Extra abbreviation keys, like
3123 *[HTML]: Hypertext Markup Language
3125Note that the pandoc document model does not support
3126abbreviations, so if this extension is enabled, abbreviation keys are
3127simply skipped (as opposed to being parsed as paragraphs).
3129#### Extension: `autolink_bare_uris` ####
3131Makes all absolute URIs into links, even when not surrounded by
3132pointy braces `<...>`.
3134#### Extension: `ascii_identifiers` ####
3136Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
3137Accents are stripped off of accented latin letters, and non-latin
3138letters are omitted.
3140#### Extension: `link_attributes` ####
3142Parses multimarkdown style key-value attributes on link and image references.
3143Note that pandoc's internal document model provides nowhere to put
3144these, so they are presently just ignored.
3146#### Extension: `mmd_header_identifiers` ####
3148Parses multimarkdown style header identifiers (in square brackets,
3149after the header but before any trailing `#`s in an ATX header).
3151#### Extension: `compact_definition_lists` ####
3153Activates the definition list syntax of pandoc 1.12.x and earlier.
3154This syntax differs from the one described above under [Definition lists]
3155in several respects:
3157 - No blank line is required between consecutive items of the
3158 definition list.
3159 - To get a "tight" or "compact" list, omit space between consecutive
3160 items; the space between a term and its definition does not affect
3161 anything.
3162 - Lazy wrapping of paragraphs is not allowed: the entire definition must
3163 be indented four spaces.[^6]
3165[^6]: To see why laziness is incompatible with relaxing the requirement
3166 of a blank line between items, consider the following example:
3168 bar
3169 : definition
3170 foo
3171 : definition
3173 Is this a single list item with two definitions of "bar," the first of
3174 which is lazily wrapped, or two list items? To remove the ambiguity
3175 we must either disallow lazy wrapping or require a blank line between
3176 list items.
3178Markdown variants
3179-----------------
3181In addition to pandoc's extended markdown, the following markdown
3182variants are supported:
3184`markdown_phpextra` (PHP Markdown Extra)
3185: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
3186 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
3187 `header_attributes`, `abbreviations`, `shortcut_reference_links`.
3189`markdown_github` (GitHub-Flavored Markdown)
3190: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
3191 `fenced_code_blocks`, `auto_identifiers`,
3192 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
3193 `intraword_underscores`, `strikeout`, `hard_line_breaks`,
3194 `shortcut_reference_links`.
3196`markdown_mmd` (MultiMarkdown)
3197: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
3198 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
3199 `mmd_title_block`, `footnotes`, `definition_lists`,
3200 `all_symbols_escapable`, `implicit_header_references`,
3201 `auto_identifiers`, `mmd_header_identifiers`,
3202 `shortcut_reference_links`.
3204`markdown_strict` (Markdown.pl)
3205: `raw_html`
3207Extensions with formats other than markdown
3208-------------------------------------------
3210Some of the extensions discussed above can be used with formats
3211other than markdown:
3213* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
3214 and `textile` input (and is used by default).
3216* `tex_math_dollars`, `tex_math_single_backslash`, and
3217 `tex_math_double_backslash` can be used with `html` input.
3218 (This is handy for reading web pages formatted using MathJax,
3219 for example.)
3221Producing slide shows with Pandoc
3222=================================
3224You can use Pandoc to produce an HTML + javascript slide presentation
3225that can be viewed via a web browser. There are five ways to do this,
3226using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
3227You can also produce a PDF slide show using LaTeX [`beamer`].
3229Here's the markdown source for a simple slide show, `habits.txt`:
3231 % Habits
3232 % John Doe
3233 % March 22, 2005
3235 # In the morning
3237 ## Getting up
3239 - Turn off alarm
3240 - Get out of bed
3242 ## Breakfast
3244 - Eat eggs
3245 - Drink coffee
3247 # In the evening
3249 ## Dinner
3251 - Eat spaghetti
3252 - Drink wine
3254 ------------------
3256 ![picture of spaghetti](images/spaghetti.jpg)
3258 ## Going to sleep
3260 - Get in bed
3261 - Count sheep
3263To produce an HTML/javascript slide show, simply type
3265 pandoc -t FORMAT -s habits.txt -o habits.html
3267where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
3269For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
3270`-s/--standalone` option embeds a link to javascripts and CSS files, which are
3271assumed to be available at the relative path `s5/default` (for S5), `slideous`
3272(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
3273`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
3274`slideous-url`, `revealjs-url`, or `s5-url` variables; see [Variables for slides],
3275above.) For DZSlides, the (relatively short) javascript and css are included in
3276the file by default.
3278With all HTML slide formats, the `--self-contained` option can be used to
3279produce a single file that contains all of the data necessary to display the
3280slide show, including linked scripts, stylesheets, images, and videos.
3282To produce a PDF slide show using beamer, type
3284 pandoc -t beamer habits.txt -o habits.pdf
3286Note that a reveal.js slide show can also be converted to a PDF
3287by printing it to a file from the browser.
3289Structuring the slide show
3290--------------------------
3292By default, the *slide level* is the highest header level in
3293the hierarchy that is followed immediately by content, and not another
3294header, somewhere in the document. In the example above, level 1 headers
3295are always followed by level 2 headers, which are followed by content,
3296so 2 is the slide level. This default can be overridden using
3297the `--slide-level` option.
3299The document is carved up into slides according to the following
3300rules:
3302 * A horizontal rule always starts a new slide.
3304 * A header at the slide level always starts a new slide.
3306 * Headers *below* the slide level in the hierarchy create
3307 headers *within* a slide.
3309 * Headers *above* the slide level in the hierarchy create
3310 "title slides," which just contain the section title
3311 and help to break the slide show into sections.
3313 * A title page is constructed automatically from the document's title
3314 block, if present. (In the case of beamer, this can be disabled
3315 by commenting out some lines in the default template.)
3317These rules are designed to support many different styles of slide show. If
3318you don't care about structuring your slides into sections and subsections,
3319you can just use level 1 headers for all each slide. (In that case, level 1
3320will be the slide level.) But you can also structure the slide show into
3321sections, as in the example above.
3323Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
3324layout will be produced, with level 1 headers building horizontally
3325and level 2 headers building vertically. It is not recommended that
3326you use deeper nesting of section levels with reveal.js.
3328Incremental lists
3329-----------------
3331By default, these writers produce lists that display "all at once."
3332If you want your lists to display incrementally (one item at a time),
3333use the `-i` option. If you want a particular list to depart from the
3334default (that is, to display incrementally without the `-i` option and
3335all at once with the `-i` option), put it in a block quote:
3337 > - Eat spaghetti
3338 > - Drink wine
3340In this way incremental and nonincremental lists can be mixed in
3341a single document.
3343Inserting pauses
3344----------------
3346You can add "pauses" within a slide by including a paragraph containing
3347three dots, separated by spaces:
3349 # Slide with a pause
3351 content before the pause
3353 . . .
3355 content after the pause
3357Styling the slides
3358------------------
3360You can change the style of HTML slides by putting customized CSS files
3361in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
3362or `$DATADIR/slideous` (for Slideous),
3363where `$DATADIR` is the user data directory (see `--data-dir`, above).
3364The originals may be found in pandoc's system data directory (generally
3365`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
3366files it does not find in the user data directory.
3368For dzslides, the CSS is included in the HTML file itself, and may
3369be modified there.
3371All [reveal.js configuration options] can be set through variables.
3372For example, themes can be used by setting the `theme` variable:
3374 -V theme=moon
3376Or you can specify a custom stylesheet using the `--css` option.
3378To style beamer slides, you can specify a `theme`, `colortheme`,
3379`fonttheme`, `innertheme`, and `outertheme`, using the `-V` option:
3381 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
3383Note that header attributes will turn into slide attributes
3384(on a `<div>` or `<section>`) in HTML slide formats, allowing you
3385to style individual slides. In beamer, the only header attribute
3386that affects slides is the `allowframebreaks` class, which sets the
3387`allowframebreaks` option, causing multiple slides to be created
3388if the content overfills the frame. This is recommended especially for
3389bibliographies:
3391 # References {.allowframebreaks}
3393Speaker notes
3394-------------
3396reveal.js has good support for speaker notes. You can add notes to your
3397markdown document thus:
3399 <div class="notes">
3400 This is my note.
3402 - It can contain markdown
3403 - like this list
3405 </div>
3407To show the notes window, press `s` while viewing the presentation.
3408Notes are not yet supported for other slide formats, but the notes
3409will not appear on the slides themselves.
3411Frame attributes in beamer
3412--------------------------
3414Sometimes it is necessary to add the LaTeX `[fragile]` option to
3415a frame in beamer (for example, when using the `minted` environment).
3416This can be forced by adding the `fragile` class to the header
3417introducing the slide:
3419 # Fragile slide {.fragile}
3421All of the other frame attributes described in Section 8.1 of
3422the [Beamer User's Guide] may also be used: `allowdisplaybreaks`,
3423`allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`,
3424`shrink`.
3426EPUB Metadata
3427=============
3429EPUB metadata may be specified using the `--epub-metadata` option, but
3430if the source document is markdown, it is better to use a [YAML metadata
3431block][Extension: `yaml_metadata_block`]. Here is an example:
3433 ---
3434 title:
3435 - type: main
3436 text: My Book
3437 - type: subtitle
3438 text: An investigation of metadata
3439 creator:
3440 - role: author
3441 text: John Smith
3442 - role: editor
3443 text: Sarah Jones
3444 identifier:
3445 - scheme: DOI
3446 text: doi:10.234234.234/33
3447 publisher: My Press
3448 rights: © 2007 John Smith, CC BY-NC
3449 ...
3451The following fields are recognized:
3453`identifier`
3454 ~ Either a string value or an object with fields `text` and
3455 `scheme`. Valid values for `scheme` are `ISBN-10`,
3456 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
3457 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
3458 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
3460`title`
3461 ~ Either a string value, or an object with fields `file-as` and
3462 `type`, or a list of such objects. Valid values for `type` are
3463 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
3465`creator`
3466 ~ Either a string value, or an object with fields `role`, `file-as`,
3467 and `text`, or a list of such objects. Valid values for `role` are
3468 [MARC relators], but
3469 pandoc will attempt to translate the human-readable versions
3470 (like "author" and "editor") to the appropriate marc relators.
3472`contributor`
3473 ~ Same format as `creator`.
3475`date`
3476 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
3477 Pandoc will attempt to convert other common date formats.
3479`lang` (or legacy: `language`)
3480 ~ A string value in [BCP 47] format. Pandoc will default to the local
3481 language if nothing is specified.
3483`subject`
3484 ~ A string value or a list of such values.
3486`description`
3487 ~ A string value.
3489`type`
3490 ~ A string value.
3492`format`
3493 ~ A string value.
3495`relation`
3496 ~ A string value.
3498`coverage`
3499 ~ A string value.
3501`rights`
3502 ~ A string value.
3504`cover-image`
3505 ~ A string value (path to cover image).
3507`stylesheet`
3508 ~ A string value (path to CSS stylesheet).
3510`page-progression-direction`
3511 ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`
3512 attribute for the [`spine` element].
3514[MARC relators]: http://loc.gov/marc/relators/relaterm.html
3515[`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
3517Literate Haskell support
3518========================
3520If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
3521format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
3522`beamer`, `html` or `html5` for output only), pandoc will treat the document as
3523literate Haskell source. This means that
3525 - In markdown input, "bird track" sections will be parsed as Haskell
3526 code rather than block quotations. Text between `\begin{code}`
3527 and `\end{code}` will also be treated as Haskell code. For
3528 ATX-style headers the character '=' will be used instead of '#'.
3530 - In markdown output, code blocks with classes `haskell` and `literate`
3531 will be rendered using bird tracks, and block quotations will be
3532 indented one space, so they will not be treated as Haskell code.
3533 In addition, headers will be rendered setext-style (with underlines)
3534 rather than ATX-style (with '#' characters). (This is because ghc
3535 treats '#' characters in column 1 as introducing line numbers.)
3537 - In restructured text input, "bird track" sections will be parsed
3538 as Haskell code.
3540 - In restructured text output, code blocks with class `haskell` will
3541 be rendered using bird tracks.
3543 - In LaTeX input, text in `code` environments will be parsed as
3544 Haskell code.
3546 - In LaTeX output, code blocks with class `haskell` will be rendered
3547 inside `code` environments.
3549 - In HTML output, code blocks with class `haskell` will be rendered
3550 with class `literatehaskell` and bird tracks.
3552Examples:
3554 pandoc -f markdown+lhs -t html
3556reads literate Haskell source formatted with markdown conventions and writes
3557ordinary HTML (without bird tracks).
3559 pandoc -f markdown+lhs -t html+lhs
3561writes HTML with the Haskell code in bird tracks, so it can be copied
3562and pasted as literate Haskell source.
3564Syntax highlighting
3565===================
3567Pandoc will automatically highlight syntax in [fenced code blocks] that
3568are marked with a language name. The Haskell library [highlighting-kate] is used for
3569highlighting, which works in HTML, Docx, and LaTeX/PDF output.
3570The color scheme can be selected using the `--highlight-style` option.
3571The default color scheme is `pygments`, which imitates the default color
3572scheme used by the Python library pygments, but pygments is not actually
3573used to do the highlighting.
3575To see a list of language names that pandoc will recognize, type
3576`pandoc --version`.
3578To disable highlighting, use the `--no-highlight` option.
3580[highlighting-kate]: https://github.com/jgm/highlighting-kate
3582Custom writers
3583==============
3585Pandoc can be extended with custom writers written in [lua]. (Pandoc
3586includes a lua interpreter, so lua need not be installed separately.)
3588To use a custom writer, simply specify the path to the lua script
3589in place of the output format. For example:
3591 pandoc -t data/sample.lua
3593Creating a custom writer requires writing a lua function for each
3594possible element in a pandoc document. To get a documented example
3595which you can modify according to your needs, do
3597 pandoc --print-default-data-file sample.lua
3599[lua]: http://www.lua.org
3601Authors
3602=======
3604© 2006-2015 John MacFarlane (jgm@berkeley.edu). Released under the
3605[GPL], version 2 or greater. This software carries no warranty of
3606any kind. (See COPYRIGHT for full copyright and warranty notices.)
3608Contributors include
3609Aaron Wolen,
3610Albert Krewinkel,
3611Alexander Kondratskiy,
3612Alexander Sulfrian,
3613Alexander V Vershilov,
3614Alfred Wechselberger,
3615Andreas Lööw,
3616Andrew Dunning,
3617Antoine Latter,
3618Arlo O'Keeffe,
3619Artyom Kazak,
3620Ben Gamari,
3621Beni Cherniavsky-Paskin,
3622Bjorn Buckwalter,
3623Bradley Kuhn,
3624Brent Yorgey,
3625Bryan O'Sullivan,
3626B. Scott Michel,
3627Caleb McDaniel,
3628Calvin Beck,
3629Christoffer Ackelman,
3630Christoffer Sawicki,
3631Clare Macrae,
3632Clint Adams,
3633Conal Elliott,
3634Craig S. Bosma,
3635Daniel Bergey,
3636Daniel T. Staal,
3637David Lazar,
3638David Röthlisberger,
3639Denis Laxalde,
3640Douglas Calvert,
3641Douglas F. Calvert,
3642Eric Kow,
3643Eric Seidel,
3644Florian Eitel,
3645François Gannaz,
3646Freiric Barral,
3647Fyodor Sheremetyev,
3648Gabor Pali,
3649Gavin Beatty,
3650Greg Maslov,
3651Grégory Bataille,
3652Greg Rundlett,
3653gwern,
3654Gwern Branwen,
3655Hans-Peter Deifel,
3656Henry de Valence,
3657Ilya V. Portnov,
3658infinity0x,
3659Jaime Marquínez Ferrándiz,
3660James Aspnes,
3661Jamie F. Olson,
3662Jan Larres,
3663Jason Ronallo,
3664Jeff Arnold,
3665Jeff Runningen,
3666Jens Petersen,
3667Jérémy Bobbio,
3668Jesse Rosenthal,
3669J. Lewis Muir,
3670Joe Hillenbrand,
3671John MacFarlane,
3672Jonas Smedegaard,
3673Jonathan Daugherty,
3674Josef Svenningsson,
3675Jose Luis Duran,
3676Julien Cretel,
3677Justin Bogner,
3678Kelsey Hightower,
3679Konstantin Zudov,
3680Lars-Dominik Braun,
3681Luke Plant,
3682Mark Szepieniec,
3683Mark Wright,
3684Masayoshi Takahashi,
3685Matej Kollar,
3686Mathias Schenner,
3687Matthew Pickering,
3688Matthias C. M. Troffaes,
3689Max Bolingbroke,
3690Max Rydahl Andersen,
3691mb21,
3692Merijn Verstraaten,
3693Michael Snoyman,
3694Michael Thompson,
3695MinRK,
3696Nathan Gass,
3697Neil Mayhew,
3698Nick Bart,
3699Nicolas Kaiser,
3700Nikolay Yakimov,
3701nkalvi,
3702Paulo Tanimoto,
3703Paul Rivier,
3704Peter Wang,
3705Philippe Ombredanne,
3706Phillip Alday,
3707Puneeth Chaganti,
3708qerub,
3709Ralf Stephan,
3710Recai Oktaş,
3711rodja.trappe,
3712RyanGlScott,
3713Scott Morrison,
3714Sergei Trofimovich,
3715Sergey Astanin,
3716Shahbaz Youssefi,
3717Shaun Attfield,
3718shreevatsa.public,
3719Simon Hengel,
3720Sumit Sahrawat,
3721takahashim,
3722thsutton,
3723Tim Lin,
3724Timothy Humphries,
3725Todd Sifleet,
3726Tom Leese,
3727Uli Köhler,
3728Václav Zeman,
3729Viktor Kronvall,
3730Vincent,
3731Wikiwide, and
3732Xavier Olive.
3734[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"