git.iko.soy/typeable/pandoc
on dc16f21 help sign in
3207 lines 114 kB history raw
1% Pandoc User's Guide
2% John MacFarlane
3% August 30, 2014
5Synopsis
6========
8pandoc [*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] and (subsets of) [Textile], [reStructuredText], [HTML],
16[LaTeX], [MediaWiki markup], [TWiki markup], [Haddock markup], [OPML],
17[Emacs Org-mode], [DocBook], [txt2tags], [EPUB] and [Word docx]; and
18it can write plain text, [markdown], [reStructuredText], [XHTML],
19[HTML 5], [LaTeX] (including [beamer] slide shows), [ConTeXt], [RTF],
20[OPML], [DocBook], [OpenDocument], [ODT], [Word docx], [GNU Texinfo],
21[MediaWiki markup], [DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),
22[FictionBook2], [Textile], [groff man] pages, [Emacs Org-Mode], [AsciiDoc],
23[InDesign ICML], and [Slidy], [Slideous], [DZSlides], [reveal.js] or
24[S5] HTML slide shows. It can also produce [PDF] output on systems where
25LaTeX is installed.
27Pandoc's enhanced version of markdown includes syntax for footnotes,
28tables, flexible ordered lists, definition lists, fenced code blocks,
29superscript, subscript, strikeout, title blocks, automatic tables of
30contents, embedded LaTeX math, citations, and markdown inside HTML block
31elements. (These enhancements, described below under
32[Pandoc's markdown](#pandocs-markdown), can be disabled using the
33`markdown_strict` input or output format.)
35In contrast to most existing tools for converting markdown to HTML, which
36use regex substitutions, Pandoc has a modular design: it consists of a
37set of readers, which parse text in a given format and produce a native
38representation of the document, and a set of writers, which convert
39this native representation into a target format. Thus, adding an input
40or output format requires only adding a reader or writer.
42Using `pandoc`
43--------------
45If no *input-file* is specified, input is read from *stdin*.
46Otherwise, the *input-files* are concatenated (with a blank
47line between each) and used as input. Output goes to *stdout* by
48default (though output to *stdout* is disabled for the `odt`, `docx`,
49`epub`, and `epub3` output formats). For output to a file, use the
50`-o` option:
52 pandoc -o output.html input.txt
54By default, pandoc produces a document fragment, not a standalone
55document with a proper header and footer. To produce a standalone
56document, use the `-s` or `--standalone` flag:
58 pandoc -s -o output.html input.txt
60For more information on how standalone documents are produced, see
61[Templates](#templates), below.
63Instead of a file, an absolute URI may be given. In this case
64pandoc will fetch the content using HTTP:
66 pandoc -f html -t markdown http://www.fsf.org
68If multiple input files are given, `pandoc` will concatenate them all (with
69blank lines between them) before parsing. This feature is disabled for
70 binary input formats such as `EPUB` and `docx`.
72The format of the input and output can be specified explicitly using
73command-line options. The input format can be specified using the
74`-r/--read` or `-f/--from` options, the output format using the
75`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
76markdown to LaTeX, you could type:
78 pandoc -f markdown -t latex hello.txt
80To convert `hello.html` from html to markdown:
82 pandoc -f html -t markdown hello.html
84Supported output formats are listed below under the `-t/--to` option.
85Supported input formats are listed below under the `-f/--from` option. Note
86that the `rst`, `textile`, `latex`, and `html` readers are not complete;
87there are some constructs that they do not parse.
89If the input or output format is not specified explicitly, `pandoc`
90will attempt to guess it from the extensions of
91the input and output filenames. Thus, for example,
93 pandoc -o hello.tex hello.txt
95will convert `hello.txt` from markdown to LaTeX. If no output file
96is specified (so that output goes to *stdout*), or if the output file's
97extension is unknown, the output format will default to HTML.
98If no input file is specified (so that input comes from *stdin*), or
99if the input files' extensions are unknown, the input format will
100be assumed to be markdown unless explicitly specified.
102Pandoc uses the UTF-8 character encoding for both input and output.
103If your local character encoding is not UTF-8, you
104should pipe input and output through `iconv`:
106 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
108Note that in some output formats (such as HTML, LaTeX, ConTeXt,
109RTF, OPML, DocBook, and Texinfo), information about
110the character encoding is included in the document header, which
111will only be included if you use the `-s/--standalone` option.
113Creating a PDF
114--------------
116Earlier versions of pandoc came with a program, `markdown2pdf`, that
117used pandoc and pdflatex to produce a PDF. This is no longer needed,
118since `pandoc` can now produce `pdf` output itself. To produce a PDF, simply
119specify an output file with a `.pdf` extension. Pandoc will create a latex
120file and use pdflatex (or another engine, see `--latex-engine`) to convert it
121to PDF:
123 pandoc test.txt -o test.pdf
125Production of a PDF requires that a LaTeX engine be installed (see
126`--latex-engine`, below), and assumes that the following LaTeX packages are
127available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the
128`--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`,
129`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),
130`fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra`
131and `xunicode` (if `xelatex` is used).
133`hsmarkdown`
134------------
136A user who wants a drop-in replacement for `Markdown.pl` may create
137a symbolic link to the `pandoc` executable called `hsmarkdown`. When
138invoked under the name `hsmarkdown`, `pandoc` will behave as if
139invoked with `-f markdown_strict --email-obfuscation=references`,
140and all command-line options will be treated as regular arguments.
141However, this approach does not work under Cygwin, due to problems with
142its simulation of symbolic links.
144[Cygwin]: http://www.cygwin.com/
145[`iconv`]: http://www.gnu.org/software/libiconv/
146[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
147[TeX Live]: http://www.tug.org/texlive/
148[MacTeX]: http://www.tug.org/mactex/
150Options
151=======
153General options
154---------------
156`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
157: Specify input format. *FORMAT* can be `native` (native Haskell),
158 `json` (JSON version of native AST), `markdown` (pandoc's
159 extended markdown), `markdown_strict` (original unextended markdown),
160 `markdown_phpextra` (PHP Markdown Extra extended markdown),
161 `markdown_github` (github extended markdown),
162 `textile` (Textile), `rst` (reStructuredText), `html` (HTML),
163 `docbook` (DocBook), `t2t` (txt2tags), `docx` (docx), `epub` (EPUB),
164 `opml` (OPML), `org` (Emacs Org-mode), `mediawiki` (MediaWiki markup),
165 `twiki` (TWiki markup), `haddock` (Haddock markup), or `latex` (LaTeX).
166 If `+lhs` is appended to `markdown`, `rst`,
167 `latex`, or `html`, the input will be treated as literate Haskell
168 source: see [Literate Haskell support](#literate-haskell-support),
169 below. Markdown syntax extensions can be individually enabled or
170 disabled by appending `+EXTENSION` or `-EXTENSION` to the format
171 name. So, for example, `markdown_strict+footnotes+definition_lists`
172 is strict markdown with footnotes and definition lists enabled,
173 and `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown
174 without pipe tables and with hard line breaks. See [Pandoc's
175 markdown](#pandocs-markdown), below, for a list of extensions and
176 their names.
178`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
179: Specify output format. *FORMAT* can be `native` (native Haskell),
180 `json` (JSON version of native AST), `plain` (plain text),
181 `markdown` (pandoc's extended markdown), `markdown_strict` (original
182 unextended markdown), `markdown_phpextra` (PHP Markdown extra
183 extended markdown), `markdown_github` (github extended markdown),
184 `rst` (reStructuredText), `html` (XHTML 1), `html5` (HTML 5),
185 `latex` (LaTeX), `beamer` (LaTeX beamer slide show),
186 `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),
187 `dokuwiki` (DokuWiki markup),
188 `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),
189 `opml` (OPML), `docbook` (DocBook), `opendocument` (OpenDocument), `odt`
190 (OpenOffice text document), `docx` (Word docx), `haddock` (Haddock
191 markup), `rtf` (rich text format), `epub` (EPUB v2 book), `epub3`
192 (EPUB v3), `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc),
193 `icml` (InDesign ICML), `slidy` (Slidy HTML and javascript slide show),
194 `slideous` (Slideous HTML and javascript slide show), `dzslides`
195 (DZSlides HTML5 + javascript slide show), `revealjs` (reveal.js
196 HTML5 + javascript slide show), `s5` (S5 HTML and javascript slide show),
197 or the path of a custom lua writer (see [Custom writers](#custom-writers),
198 below). Note that `odt`, `epub`, and `epub3` output will not be directed
199 to *stdout*; an output filename must be specified using the `-o/--output`
200 option. If `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
201 `html`, or `html5`, the output will be rendered as literate Haskell
202 source: see [Literate Haskell support](#literate-haskell-support), below.
203 Markdown syntax extensions can be individually enabled or disabled by
204 appending `+EXTENSION` or `-EXTENSION` to the format name, as described
205 above under `-f`.
207`-o` *FILE*, `--output=`*FILE*
208: Write output to *FILE* instead of *stdout*. If *FILE* is
209 `-`, output will go to *stdout*. (Exception: if the output
210 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
212`--data-dir=`*DIRECTORY*
213: Specify the user data directory to search for pandoc data files.
214 If this option is not specified, the default user data directory
215 will be used. This is
217 $HOME/.pandoc
219 in unix,
221 C:\Documents And Settings\USERNAME\Application Data\pandoc
223 in Windows XP, and
225 C:\Users\USERNAME\AppData\Roaming\pandoc
227 in Windows 7. (You can find the default user data directory
228 on your system by looking at the output of `pandoc --version`.)
229 A `reference.odt`, `reference.docx`, `default.csl`,
230 `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory
231 placed in this directory will override pandoc's normal defaults.
233`-v`, `--version`
234: Print version.
236`-h`, `--help`
237: Show usage message.
239Reader options
240--------------
242`-R`, `--parse-raw`
243: Parse untranslatable HTML codes and LaTeX environments as raw HTML
244 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
245 input. Raw HTML can be printed in markdown, reStructuredText, HTML,
246 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
247 can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
248 The default is for the readers to omit untranslatable HTML codes and
249 LaTeX environments. (The LaTeX reader does pass through untranslatable
250 LaTeX *commands*, even if `-R` is not specified.)
252`-S`, `--smart`
253: Produce typographically correct output, converting straight quotes
254 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
255 `...` to ellipses. Nonbreaking spaces are inserted after certain
256 abbreviations, such as "Mr." (Note: This option is significant only when
257 the input format is `markdown`, `markdown_strict`, `textile` or `twiki`.
258 It is selected automatically when the input format is `textile` or the
259 output format is `latex` or `context`, unless `--no-tex-ligatures`
260 is used.)
262`--old-dashes`
263: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
264 a numeral is an en-dash, and `--` is an em-dash. This option is selected
265 automatically for `textile` input.
267`--base-header-level=`*NUMBER*
268: Specify the base level for headers (defaults to 1).
270`--indented-code-classes=`*CLASSES*
271: Specify classes to use for indented code blocks--for example,
272 `perl,numberLines` or `haskell`. Multiple classes may be separated
273 by spaces or commas.
275`--default-image-extension=`*EXTENSION*
276: Specify a default extension to use when image paths/URLs have no
277 extension. This allows you to use the same source for formats that
278 require different kinds of images. Currently this option only affects
279 the markdown and LaTeX readers.
281`--filter=`*EXECUTABLE*
282: Specify an executable to be used as a filter transforming the
283 Pandoc AST after the input is parsed and before the output is
284 written. The executable should read JSON from stdin and write
285 JSON to stdout. The JSON must be formatted like pandoc's own
286 JSON input and output. The name of the output format will be
287 passed to the filter as the first argument. Hence,
289 pandoc --filter ./caps.py -t latex
291 is equivalent to
293 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
295 The latter form may be useful for debugging filters.
297 Filters may be written in any language. `Text.Pandoc.JSON`
298 exports `toJSONFilter` to facilitate writing filters in Haskell.
299 Those who would prefer to write filters in python can use the
300 module `pandocfilters`, installable from PyPI. See
301 <http://github.com/jgm/pandocfilters> for the module and several
302 examples. Note that the *EXECUTABLE* will be sought in the user's
303 `PATH`, and not in the working directory, if no directory is
304 provided. If you want to run a script in the working directory,
305 preface the filename with `./`.
307`-M` *KEY[=VAL]*, `--metadata=`*KEY[:VAL]*
308: Set the metadata field *KEY* to the value *VAL*. A value specified
309 on the command line overrides a value specified in the document.
310 Values will be parsed as YAML boolean or string values. If no value is
311 specified, the value will be treated as Boolean true. Like
312 `--variable`, `--metadata` causes template variables to be set.
313 But unlike `--variable`, `--metadata` affects the metadata of the
314 underlying document (which is accessible from filters and may be
315 printed in some output formats).
317`--normalize`
318: Normalize the document after reading: merge adjacent
319 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
321`-p`, `--preserve-tabs`
322: Preserve tabs instead of converting them to spaces (the default).
323 Note that this will only affect tabs in literal code spans and code
324 blocks; tabs in regular text will be treated as spaces.
326`--tab-stop=`*NUMBER*
327: Specify the number of spaces per tab (default is 4).
329`--track-changes=`*accept|reject|all*
330: Specifies what to do with insertions and deletions produced by the MS
331 Word "track-changes" feature. *accept* (the default), inserts all
332 insertions, and ignores all deletions. *reject* inserts all
333 deletions and ignores insertions. *all* puts in both insertions
334 and deletions, wrapped in spans with `insertion` and `deletion`
335 classes, respectively. The author and time of change is
336 included. *all* is useful for scripting: only accepting changes
337 from a certain reviewer, say, or before a certain date. This
338 option only affects the docx reader.
340`--extract-media=`*DIR*
341: Extract images and other media contained in a docx or epub container
342 to the path *DIR*, creating it if necessary, and adjust the images
343 references in the document so they point to the extracted files.
344 This option only affects the docx and epub readers.
346General writer options
347----------------------
349`-s`, `--standalone`
350: Produce output with an appropriate header and footer (e.g. a
351 standalone HTML, LaTeX, or RTF file, not a fragment). This option
352 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
353 output.
355`--template=`*FILE*
356: Use *FILE* as a custom template for the generated document. Implies
357 `--standalone`. See [Templates](#templates) below for a description
358 of template syntax. If no extension is specified, an extension
359 corresponding to the writer will be added, so that `--template=special`
360 looks for `special.html` for HTML output. If the template is not
361 found, pandoc will search for it in the user data directory
362 (see `--data-dir`). If this option is not used, a default
363 template appropriate for the output format will be used (see
364 `-D/--print-default-template`).
366`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*
367: Set the template variable *KEY* to the value *VAL* when rendering the
368 document in standalone mode. This is generally only useful when the
369 `--template` option is used to specify a custom template, since
370 pandoc automatically sets the variables used in the default
371 templates. If no *VAL* is specified, the key will be given the
372 value `true`.
374`-D` *FORMAT*, `--print-default-template=`*FORMAT*
375: Print the default template for an output *FORMAT*. (See `-t`
376 for a list of possible *FORMAT*s.)
378`--print-default-data-file=`*FILE*
379: Print a default data file.
381`--no-wrap`
382: Disable text wrapping in output. By default, text is wrapped
383 appropriately for the output format.
385`--columns`=*NUMBER*
386: Specify length of lines in characters (for text wrapping).
388`--toc`, `--table-of-contents`
389: Include an automatically generated table of contents (or, in
390 the case of `latex`, `context`, and `rst`, an instruction to create
391 one) in the output document. This option has no effect on `man`,
392 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
394`--toc-depth=`*NUMBER*
395: Specify the number of section levels to include in the table
396 of contents. The default is 3 (which means that level 1, 2, and 3
397 headers will be listed in the contents).
399`--no-highlight`
400: Disables syntax highlighting for code blocks and inlines, even when
401 a language attribute is given.
403`--highlight-style`=*STYLE*
404: Specifies the coloring style to be used in highlighted source code.
405 Options are `pygments` (the default), `kate`, `monochrome`,
406 `espresso`, `zenburn`, `haddock`, and `tango`.
408`-H` *FILE*, `--include-in-header=`*FILE*
409: Include contents of *FILE*, verbatim, at the end of the header.
410 This can be used, for example, to include special
411 CSS or javascript in HTML documents. This option can be used
412 repeatedly to include multiple files in the header. They will be
413 included in the order specified. Implies `--standalone`.
415`-B` *FILE*, `--include-before-body=`*FILE*
416: Include contents of *FILE*, verbatim, at the beginning of the
417 document body (e.g. after the `<body>` tag in HTML, or the
418 `\begin{document}` command in LaTeX). This can be used to include
419 navigation bars or banners in HTML documents. This option can be
420 used repeatedly to include multiple files. They will be included in
421 the order specified. Implies `--standalone`.
423`-A` *FILE*, `--include-after-body=`*FILE*
424: Include contents of *FILE*, verbatim, at the end of the document
425 body (before the `</body>` tag in HTML, or the
426 `\end{document}` command in LaTeX). This option can be be used
427 repeatedly to include multiple files. They will be included in the
428 order specified. Implies `--standalone`.
430Options affecting specific writers
431----------------------------------
433`--self-contained`
434: Produce a standalone HTML file with no external dependencies, using
435 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
436 images, and videos. The resulting file should be "self-contained,"
437 in the sense that it needs no external files and no net access to be
438 displayed properly by a browser. This option works only with HTML output
439 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
440 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
441 stylesheets at absolute URLs will be downloaded; those at relative URLs
442 will be sought relative to the working directory (if the first source
443 file is local) or relative to the base URL (if the first source
444 file is remote). `--self-contained` does not work with `--mathjax`.
446`--offline`
447: Deprecated synonym for `--self-contained`.
449`-5`, `--html5`
450: Produce HTML5 instead of HTML4. This option has no effect for writers
451 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
453`--html-q-tags`
454: Use `<q>` tags for quotes in HTML.
456`--ascii`
457: Use only ascii characters in output. Currently supported only
458 for HTML output (which uses numerical entities instead of
459 UTF-8 when this option is selected).
461`--reference-links`
462: Use reference-style links, rather than inline links, in writing markdown
463 or reStructuredText. By default inline links are used.
465`--atx-headers`
466: Use ATX style headers in markdown and asciidoc output. The default is
467 to use setext-style headers for levels 1-2, and then ATX headers.
469`--chapters`
470: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
471 output. When the LaTeX template uses the report, book, or
472 memoir class, this option is implied. If `beamer` is the output
473 format, top-level headers will become `\part{..}`.
475`-N`, `--number-sections`
476: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
477 By default, sections are not numbered. Sections with class
478 `unnumbered` will never be numbered, even if `--number-sections`
479 is specified.
481`--number-offset`=*NUMBER[,NUMBER,...]*,
482: Offset for section headings in HTML output (ignored in other
483 output formats). The first number is added to the section number for
484 top-level headers, the second for second-level headers, and so on.
485 So, for example, if you want the first top-level header in your
486 document to be numbered "6", specify `--number-offset=5`.
487 If your document starts with a level-2 header which you want to
488 be numbered "1.5", specify `--number-offset=1,4`.
489 Offsets are 0 by default. Implies `--number-sections`.
491`--no-tex-ligatures`
492: Do not convert quotation marks, apostrophes, and dashes to
493 the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
494 use literal unicode characters. This is needed for using advanced
495 OpenType features with XeLaTeX and LuaLaTeX. Note: normally
496 `--smart` is selected automatically for LaTeX and ConTeXt
497 output, but it must be specified explicitly if `--no-tex-ligatures`
498 is selected. If you use literal curly quotes, dashes, and ellipses
499 in your source, then you may want to use `--no-tex-ligatures`
500 without `--smart`.
502`--listings`
503: Use listings package for LaTeX code blocks
505`-i`, `--incremental`
506: Make list items in slide shows display incrementally (one by one).
507 The default is for lists to be displayed all at once.
509`--slide-level`=*NUMBER*
510: Specifies that headers with the specified level create
511 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
512 above this level in the hierarchy are used to divide the
513 slide show into sections; headers below this level create
514 subheads within a slide. The default is to set the slide level
515 based on the contents of the document; see
516 [Structuring the slide show](#structuring-the-slide-show), below.
518`--section-divs`
519: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
520 and attach identifiers to the enclosing `<div>` (or `<section>`)
521 rather than the header itself.
522 See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.
524`--email-obfuscation=`*none|javascript|references*
525: Specify a method for obfuscating `mailto:` links in HTML documents.
526 *none* leaves `mailto:` links as they are. *javascript* obfuscates
527 them using javascript. *references* obfuscates them by printing their
528 letters as decimal or hexadecimal character references.
530`--id-prefix`=*STRING*
531: Specify a prefix to be added to all automatically generated identifiers
532 in HTML and DocBook output, and to footnote numbers in markdown output.
533 This is useful for preventing duplicate identifiers when generating
534 fragments to be included in other pages.
536`-T` *STRING*, `--title-prefix=`*STRING*
537: Specify *STRING* as a prefix at the beginning of the title
538 that appears in the HTML header (but not in the title as it
539 appears at the beginning of the HTML body). Implies
540 `--standalone`.
542`-c` *URL*, `--css=`*URL*
543: Link to a CSS style sheet. This option can be be used repeatedly to
544 include multiple files. They will be included in the order specified.
546`--reference-odt=`*FILE*
547: Use the specified file as a style reference in producing an ODT.
548 For best results, the reference ODT should be a modified version
549 of an ODT produced using pandoc. The contents of the reference ODT
550 are ignored, but its stylesheets are used in the new ODT. If no
551 reference ODT is specified on the command line, pandoc will look
552 for a file `reference.odt` in the user data directory (see
553 `--data-dir`). If this is not found either, sensible defaults will be
554 used.
556`--reference-docx=`*FILE*
557: Use the specified file as a style reference in producing a docx file.
558 For best results, the reference docx should be a modified version
559 of a docx file produced using pandoc. The contents of the reference docx
560 are ignored, but its stylesheets and document properties (including
561 margins, page size, header, and footer) are used in the new docx. If no
562 reference docx is specified on the command line, pandoc will look
563 for a file `reference.docx` in the user data directory (see
564 `--data-dir`). If this is not found either, sensible defaults will be
565 used. The following styles are used by pandoc: [paragraph]
566 Normal, Compact, Title, Subtitle, Authors, Date, Abstract, Heading 1,
567 Heading 2, Heading 3, Heading 4, Heading 5, Block Quote, Definition Term,
568 Definition, Bibliography, Body Text, Table Caption, Image Caption;
569 [character] Default Paragraph Font, Body Text Char, Verbatim Char,
570 Footnote Ref, Link.
572`--epub-stylesheet=`*FILE*
573: Use the specified CSS file to style the EPUB. If no stylesheet
574 is specified, pandoc will look for a file `epub.css` in the
575 user data directory (see `--data-dir`). If it is not
576 found there, sensible defaults will be used.
578`--epub-cover-image=`*FILE*
579: Use the specified image as the EPUB cover. It is recommended
580 that the image be less than 1000px in width and height. Note that
581 in a markdown source document you can also specify `cover-image`
582 in a YAML metadata block (see [EPUB Metadata], below).
584`--epub-metadata=`*FILE*
585: Look in the specified XML file for metadata for the EPUB.
586 The file should contain a series of Dublin Core elements,
587 as documented at <http://dublincore.org/documents/dces/>.
588 For example:
590 <dc:rights>Creative Commons</dc:rights>
591 <dc:language>es-AR</dc:language>
593 By default, pandoc will include the following metadata elements:
594 `<dc:title>` (from the document title), `<dc:creator>` (from the
595 document authors), `<dc:date>` (from the document date, which should
596 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
597 variable, or, if is not set, the locale), and `<dc:identifier
598 id="BookId">` (a randomly generated UUID). Any of these may be
599 overridden by elements in the metadata file.
601 Note: if the source document is markdown, a YAML metadata block
602 in the document can be used instead. See below under
603 [EPUB Metadata].
605`--epub-embed-font=`*FILE*
606: Embed the specified font in the EPUB. This option can be repeated
607 to embed multiple fonts. To use embedded fonts, you
608 will need to add declarations like the following to your CSS (see
609 `--epub-stylesheet`):
611 @font-face {
612 font-family: DejaVuSans;
613 font-style: normal;
614 font-weight: normal;
615 src:url("DejaVuSans-Regular.ttf");
616 }
617 @font-face {
618 font-family: DejaVuSans;
619 font-style: normal;
620 font-weight: bold;
621 src:url("DejaVuSans-Bold.ttf");
622 }
623 @font-face {
624 font-family: DejaVuSans;
625 font-style: italic;
626 font-weight: normal;
627 src:url("DejaVuSans-Oblique.ttf");
628 }
629 @font-face {
630 font-family: DejaVuSans;
631 font-style: italic;
632 font-weight: bold;
633 src:url("DejaVuSans-BoldOblique.ttf");
634 }
635 body { font-family: "DejaVuSans"; }
637`--epub-chapter-level=`*NUMBER*
638: Specify the header level at which to split the EPUB into separate
639 "chapter" files. The default is to split into chapters at level 1
640 headers. This option only affects the internal composition of the
641 EPUB, not the way chapters and sections are displayed to users. Some
642 readers may be slow if the chapter files are too large, so for large
643 documents with few level 1 headers, one might want to use a chapter
644 level of 2 or 3.
646`--latex-engine=`*pdflatex|lualatex|xelatex*
647: Use the specified LaTeX engine when producing PDF output.
648 The default is `pdflatex`. If the engine is not in your PATH,
649 the full path of the engine may be specified here.
651Citation rendering
652------------------
654`--bibliography=`*FILE*
655: Set the `bibliography` field in the document's metadata to *FILE*,
656 overriding any value set in the metadata, and process citations
657 using `pandoc-citeproc`. (This is equivalent to
658 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
660`--csl=`*FILE*
661: Set the `csl` field in the document's metadata to *FILE*,
662 overriding any value set in the metadata. (This is equivalent to
663 `--metadata csl=FILE`.)
665`--citation-abbreviations=`*FILE*
666: Set the `citation-abbreviations` field in the document's metadata to
667 *FILE*, overriding any value set in the metadata. (This is equivalent to
668 `--metadata citation-abbreviations=FILE`.)
670`--natbib`
671: Use natbib for citations in LaTeX output. This option is not for use
672 with the `pandoc-citeproc` filter or with PDF output. It is intended for
673 use in producing a LaTeX file that can be processed with pdflatex and
674 bibtex.
676`--biblatex`
677: Use biblatex for citations in LaTeX output. This option is not for use
678 with the `pandoc-citeproc` filter or with PDF output. It is intended for
679 use in producing a LaTeX file that can be processed with pdflatex and
680 bibtex or biber.
682Math rendering in HTML
683----------------------
685`-m` [*URL*], `--latexmathml`[=*URL*]
686: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
687 To insert a link to a local copy of the `LaTeXMathML.js` script,
688 provide a *URL*. If no *URL* is provided, the contents of the
689 script will be inserted directly into the HTML header, preserving
690 portability at the price of efficiency. If you plan to use math on
691 several pages, it is much better to link to a copy of the script,
692 so it can be cached.
694`--mathml`[=*URL*]
695: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
696 In standalone `html` output, a small javascript (or a link to such a
697 script if a *URL* is supplied) will be inserted that allows the MathML to
698 be viewed on some browsers.
700`--jsmath`[=*URL*]
701: Use [jsMath] to display embedded TeX math in HTML output.
702 The *URL* should point to the jsMath load script (e.g.
703 `jsMath/easy/load.js`); if provided, it will be linked to in
704 the header of standalone HTML documents. If a *URL* is not provided,
705 no link to the jsMath load script will be inserted; it is then
706 up to the author to provide such a link in the HTML template.
708`--mathjax`[=*URL*]
709: Use [MathJax] to display embedded TeX math in HTML output.
710 The *URL* should point to the `MathJax.js` load script.
711 If a *URL* is not provided, a link to the MathJax CDN will
712 be inserted.
714`--gladtex`
715: Enclose TeX math in `<eq>` tags in HTML output. These can then
716 be processed by [gladTeX] to produce links to images of the typeset
717 formulas.
719`--mimetex`[=*URL*]
720: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
721 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
723`--webtex`[=*URL*]
724: Render TeX formulas using an external script that converts TeX
725 formulas to images. The formula will be concatenated with the URL
726 provided. If *URL* is not specified, the Google Chart API will be used.
728`--katex`[=*URL*]
729: Use [KaTeX] to display embedded TeX math in HTML output.
730 The *URL* should point to the `katex.js` load script. If a *URL* is
731 not provided, a link to the KaTeX CDN will be inserted.
733`--katex-stylesheet=*URL*`
734: The *URL* should point to the `katex.css` stylesheet. If this option is
735 not specified, a link to the KaTeX CDN will be inserted. Note that this
736 option does not imply `--katex`.
738Options for wrapper scripts
739---------------------------
741`--dump-args`
742: Print information about command-line arguments to *stdout*, then exit.
743 This option is intended primarily for use in wrapper scripts.
744 The first line of output contains the name of the output file specified
745 with the `-o` option, or `-` (for *stdout*) if no output file was
746 specified. The remaining lines contain the command-line arguments,
747 one per line, in the order they appear. These do not include regular
748 Pandoc options and their arguments, but do include any options appearing
749 after a `--` separator at the end of the line.
751`--ignore-args`
752: Ignore command-line arguments (for use in wrapper scripts).
753 Regular Pandoc options are not ignored. Thus, for example,
755 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
757 is equivalent to
759 pandoc -o foo.html -s
761[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
762[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
763[MathJax]: http://www.mathjax.org/
764[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
765[mimeTeX]: http://www.forkosh.com/mimetex.html
766[CSL]: http://CitationStyles.org
768Templates
769=========
771When the `-s/--standalone` option is used, pandoc uses a template to
772add header and footer material that is needed for a self-standing
773document. To see the default template that is used, just type
775 pandoc -D FORMAT
777where `FORMAT` is the name of the output format. A custom template
778can be specified using the `--template` option. You can also override
779the system default templates for a given output format `FORMAT`
780by putting a file `templates/default.FORMAT` in the user data
781directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
782customize the `default.opendocument` template. For `pdf` output,
783customize the `default.latex` template.
785Templates may contain *variables*. Variable names are sequences of
786alphanumerics, `-`, and `_`, starting with a letter. A variable name
787surrounded by `$` signs will be replaced by its value. For example,
788the string `$title$` in
790 <title>$title$</title>
792will be replaced by the document title.
794To write a literal `$` in a template, use `$$`.
796Some variables are set automatically by pandoc. These vary somewhat
797depending on the output format, but include metadata fields (such
798as `title`, `author`, and `date`) as well as the following:
800`header-includes`
801: contents specified by `-H/--include-in-header` (may have multiple
802 values)
804`toc`
805: non-null value if `--toc/--table-of-contents` was specified
807`include-before`
808: contents specified by `-B/--include-before-body` (may have
809 multiple values)
811`include-after`
812: contents specified by `-A/--include-after-body` (may have
813 multiple values)
815`body`
816: body of document
818`lang`
819: language code for HTML or LaTeX documents
821`slidy-url`
822: base URL for Slidy documents (defaults to
823 `http://www.w3.org/Talks/Tools/Slidy2`)
825`slideous-url`
826: base URL for Slideous documents (defaults to `slideous`)
828`s5-url`
829: base URL for S5 documents (defaults to `s5/default`)
831`revealjs-url`
832: base URL for reveal.js documents (defaults to `reveal.js`)
834`theme`
835: reveal.js or LaTeX beamer theme
837`transition`
838: reveal.js transition
840`fontsize`
841: font size (10pt, 11pt, 12pt) for LaTeX documents
843`documentclass`
844: document class for LaTeX documents
846`classoption`
847: option for LaTeX documentclass, e.g. `oneside`; may be repeated
848 for multiple options
850`geometry`
851: options for LaTeX `geometry` class, e.g. `margin=1in`;
852 may be repeated for multiple options
854`linestretch`
855: adjusts line spacing (requires the `setspace` package)
857`fontfamily`
858: font package to use for LaTeX documents (with pdflatex):
859 TeXLive has `bookman` (Bookman), `utopia` or `fourier` (Utopia),
860 `fouriernc` (New Century Schoolbook), `times` or `txfonts` (Times),
861 `mathpazo` or `pxfonts` or `mathpple` (Palatino),
862 `libertine` (Linux Libertine), `arev` (Arev Sans),
863 and the default `lmodern`, among others.
865`mainfont`, `sansfont`, `monofont`, `mathfont`
866: fonts for LaTeX documents (works only with xelatex
867 and lualatex)
869`colortheme`
870: colortheme for LaTeX beamer documents
872`fonttheme`
873: fonttheme for LaTeX beamer documents
875`linkcolor`
876: color for internal links in LaTeX documents (`red`, `green`,
877 `magenta`, `cyan`, `blue`, `black`)
879`urlcolor`
880: color for external links in LaTeX documents
882`citecolor`
883: color for citation links in LaTeX documents
885`links-as-notes`
886: causes links to be printed as footnotes in LaTeX documents
888`toc`
889: include table of contents in LaTeX documents
891`toc-depth`
892: level of section to include in table of contents in LaTeX documents
894`lof`
895: include list of figures in LaTeX documents
897`lot`
898: include list of tables in LaTeX documents
900`biblio-style`
901: bibliography style in LaTeX, when used with `--natbib`
903`biblio-files`
904: bibliography files to use in LaTeX, with `--natbib` or `--biblatex`
906`section`
907: section number in man pages
909`header`
910: header in man pages
912`footer`
913: footer in man pages
915Variables may be set at the command line using the `-V/--variable`
916option. Variables set in this way override metadata fields with
917the same name.
919Templates may contain conditionals. The syntax is as follows:
921 $if(variable)$
922 X
923 $else$
924 Y
925 $endif$
927This will include `X` in the template if `variable` has a non-null
928value; otherwise it will include `Y`. `X` and `Y` are placeholders for
929any valid template text, and may include interpolated variables or other
930conditionals. The `$else$` section may be omitted.
932When variables can have multiple values (for example, `author` in
933a multi-author document), you can use the `$for$` keyword:
935 $for(author)$
936 <meta name="author" content="$author$" />
937 $endfor$
939You can optionally specify a separator to be used between
940consecutive items:
942 $for(author)$$author$$sep$, $endfor$
944A dot can be used to select a field of a variable that takes
945an object as its value. So, for example:
947 $author.name$ ($author.affiliation$)
949If you use custom templates, you may need to revise them as pandoc
950changes. We recommend tracking the changes in the default templates,
951and modifying your custom templates accordingly. An easy way to do this
952is to fork the pandoc-templates repository
953(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
954pandoc release.
956Pandoc's markdown
957=================
959Pandoc understands an extended and slightly revised version of
960John Gruber's [markdown] syntax. This document explains the syntax,
961noting differences from standard markdown. Except where noted, these
962differences can be suppressed by using the `markdown_strict` format instead
963of `markdown`. An extensions can be enabled by adding `+EXTENSION`
964to the format name and disabled by adding `-EXTENSION`. For example,
965`markdown_strict+footnotes` is strict markdown with footnotes
966enabled, while `markdown-footnotes-pipe_tables` is pandoc's
967markdown without footnotes or pipe tables.
969Philosophy
970----------
972Markdown is designed to be easy to write, and, even more importantly,
973easy to read:
975> A Markdown-formatted document should be publishable as-is, as plain
976> text, without looking like it's been marked up with tags or formatting
977> instructions.
978> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
980This principle has guided pandoc's decisions in finding syntax for
981tables, footnotes, and other extensions.
983There is, however, one respect in which pandoc's aims are different
984from the original aims of markdown. Whereas markdown was originally
985designed with HTML generation in mind, pandoc is designed for multiple
986output formats. Thus, while pandoc allows the embedding of raw HTML,
987it discourages it, and provides other, non-HTMLish ways of representing
988important document elements like definition lists, tables, mathematics, and
989footnotes.
991Paragraphs
992----------
994A paragraph is one or more lines of text followed by one or more blank line.
995Newlines are treated as spaces, so you can reflow your paragraphs as you like.
996If you need a hard line break, put two or more spaces at the end of a line.
998#### Extension: `escaped_line_breaks` ####
1000A backslash followed by a newline is also a hard line break.
1001Note: in multiline and grid table cells, this is the only way
1002to create a hard line break, since trailing spaces in the cells
1003are ignored.
1005Headers
1006-------
1008There are two kinds of headers, Setext and atx.
1010### Setext-style headers ###
1012A setext-style header is a line of text "underlined" with a row of `=` signs
1013(for a level one header) or `-` signs (for a level two header):
1015 A level-one header
1016 ==================
1018 A level-two header
1019 ------------------
1021The header text can contain inline formatting, such as emphasis (see
1022[Inline formatting](#inline-formatting), below).
1025### Atx-style headers ###
1027An Atx-style header consists of one to six `#` signs and a line of
1028text, optionally followed by any number of `#` signs. The number of
1029`#` signs at the beginning of the line is the header level:
1031 ## A level-two header
1033 ### A level-three header ###
1035As with setext-style headers, the header text can contain formatting:
1037 # A level-one header with a [link](/url) and *emphasis*
1039#### Extension: `blank_before_header` ####
1041Standard markdown syntax does not require a blank line before a header.
1042Pandoc does require this (except, of course, at the beginning of the
1043document). The reason for the requirement is that it is all too easy for a
1044`#` to end up at the beginning of a line by accident (perhaps through line
1045wrapping). Consider, for example:
1047 I like several of their flavors of ice cream:
1048 #22, for example, and #5.
1051### Header identifiers in HTML, LaTeX, and ConTeXt ###
1053#### Extension: `header_attributes` ####
1055Headers can be assigned attributes using this syntax at the end
1056of the line containing the header text:
1058 {#identifier .class .class key=value key=value}
1060Thus, for example, the following headers will all be assigned the identifier
1061`foo`:
1063 # My header {#foo}
1065 ## My header ## {#foo}
1067 My other header {#foo}
1068 ---------------
1070(This syntax is compatible with [PHP Markdown Extra].)
1072Note that although this syntax allows assignment of classes and key/value
1073attributes, writers generally don't use all of this information. Identifiers,
1074classes, and key/value attributes are used in HTML and HTML-based formats such
1075as EPUB and slidy. Identifiers are used for labels and link anchors in the
1076LaTeX, ConTeXt, Textile, and AsciiDoc writers.
1078Headers with the class `unnumbered` will not be numbered, even if
1079`--number-sections` is specified. A single hyphen (`-`) in an attribute
1080context is equivalent to `.unnumbered`, and preferable in non-English
1081documents. So,
1083 # My header {-}
1085is just the same as
1087 # My header {.unnumbered}
1089#### Extension: `auto_identifiers` ####
1091A header without an explicitly specified identifier will be
1092automatically assigned a unique identifier based on the header text.
1093To derive the identifier from the header text,
1095 - Remove all formatting, links, etc.
1096 - Remove all footnotes.
1097 - Remove all punctuation, except underscores, hyphens, and periods.
1098 - Replace all spaces and newlines with hyphens.
1099 - Convert all alphabetic characters to lowercase.
1100 - Remove everything up to the first letter (identifiers may
1101 not begin with a number or punctuation mark).
1102 - If nothing is left after this, use the identifier `section`.
1104Thus, for example,
1106 Header Identifier
1107 ------------------------------- ----------------------------
1108 Header identifiers in HTML `header-identifiers-in-html`
1109 *Dogs*?--in *my* house? `dogs--in-my-house`
1110 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1111 3. Applications `applications`
1112 33 `section`
1114These rules should, in most cases, allow one to determine the identifier
1115from the header text. The exception is when several headers have the
1116same text; in this case, the first will get an identifier as described
1117above; the second will get the same identifier with `-1` appended; the
1118third with `-2`; and so on.
1120These identifiers are used to provide link targets in the table of
1121contents generated by the `--toc|--table-of-contents` option. They
1122also make it easy to provide links from one section of a document to
1123another. A link to this section, for example, might look like this:
1125 See the section on
1126 [header identifiers](#header-identifiers-in-html-latex-and-context).
1128Note, however, that this method of providing links to sections works
1129only in HTML, LaTeX, and ConTeXt formats.
1131If the `--section-divs` option is specified, then each section will
1132be wrapped in a `div` (or a `section`, if `--html5` was specified),
1133and the identifier will be attached to the enclosing `<div>`
1134(or `<section>`) tag rather than the header itself. This allows entire
1135sections to be manipulated using javascript or treated differently in
1136CSS.
1138#### Extension: `implicit_header_references` ####
1140Pandoc behaves as if reference links have been defined for each header.
1141So, instead of
1143 [header identifiers](#header-identifiers-in-html)
1145you can simply write
1147 [header identifiers]
1151 [header identifiers][]
1155 [the section on header identifiers][header identifiers]
1157If there are multiple headers with identical text, the corresponding
1158reference will link to the first one only, and you will need to use explicit
1159links to link to the others, as described above.
1161Unlike regular reference links, these references are case-sensitive.
1163Note: if you have defined an explicit identifier for a header,
1164then implicit references to it will not work.
1166Block quotations
1167----------------
1169Markdown uses email conventions for quoting blocks of text.
1170A block quotation is one or more paragraphs or other block elements
1171(such as lists or headers), with each line preceded by a `>` character
1172and a space. (The `>` need not start at the left margin, but it should
1173not be indented more than three spaces.)
1175 > This is a block quote. This
1176 > paragraph has two lines.
1178 > 1. This is a list inside a block quote.
1179 > 2. Second item.
1181A "lazy" form, which requires the `>` character only on the first
1182line of each block, is also allowed:
1184 > This is a block quote. This
1185 paragraph has two lines.
1187 > 1. This is a list inside a block quote.
1188 2. Second item.
1190Among the block elements that can be contained in a block quote are
1191other block quotes. That is, block quotes can be nested:
1193 > This is a block quote.
1195 > > A block quote within a block quote.
1197#### Extension: `blank_before_blockquote` ####
1199Standard markdown syntax does not require a blank line before a block
1200quote. Pandoc does require this (except, of course, at the beginning of the
1201document). The reason for the requirement is that it is all too easy for a
1202`>` to end up at the beginning of a line by accident (perhaps through line
1203wrapping). So, unless the `markdown_strict` format is used, the following does
1204not produce a nested block quote in pandoc:
1206 > This is a block quote.
1207 >> Nested.
1210Verbatim (code) blocks
1211----------------------
1213### Indented code blocks ###
1215A block of text indented four spaces (or one tab) is treated as verbatim
1216text: that is, special characters do not trigger special formatting,
1217and all spaces and line breaks are preserved. For example,
1219 if (a > 3) {
1220 moveShip(5 * gravity, DOWN);
1223The initial (four space or one tab) indentation is not considered part
1224of the verbatim text, and is removed in the output.
1226Note: blank lines in the verbatim text need not begin with four spaces.
1229### Fenced code blocks ###
1231#### Extension: `fenced_code_blocks` ####
1233In addition to standard indented code blocks, Pandoc supports
1234*fenced* code blocks. These begin with a row of three or more
1235tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
1236backticks that must be at least as long as the starting row. Everything
1237between these lines is treated as code. No indentation is necessary:
1239 ~~~~~~~
1240 if (a > 3) {
1241 moveShip(5 * gravity, DOWN);
1243 ~~~~~~~
1245Like regular code blocks, fenced code blocks must be separated
1246from surrounding text by blank lines.
1248If the code itself contains a row of tildes or backticks, just use a longer
1249row of tildes or backticks at the start and end:
1251 ~~~~~~~~~~~~~~~~
1252 ~~~~~~~~~~
1253 code including tildes
1254 ~~~~~~~~~~
1255 ~~~~~~~~~~~~~~~~
1257#### Extension: `fenced_code_attributes` ####
1259Optionally, you may attach attributes to the code block using
1260this syntax:
1262 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1263 qsort [] = []
1264 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1265 qsort (filter (>= x) xs)
1266 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1268Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1269`startFrom` is an attribute with value `100`. Some output formats can use this
1270information to do syntax highlighting. Currently, the only output formats
1271that uses this information are HTML and LaTeX. If highlighting is supported
1272for your output format and language, then the code block above will appear
1273highlighted, with numbered lines. (To see which languages are supported, do
1274`pandoc --version`.) Otherwise, the code block above will appear as follows:
1276 <pre id="mycode" class="haskell numberLines" startFrom="100">
1277 <code>
1278 ...
1279 </code>
1280 </pre>
1282A shortcut form can also be used for specifying the language of
1283the code block:
1285 ```haskell
1286 qsort [] = []
1287 ```
1289This is equivalent to:
1291 ``` {.haskell}
1292 qsort [] = []
1293 ```
1295If the `fenced_code_attributes` extension is disabled, but
1296input contains class attribute(s) for the codeblock, the first
1297class attribute will be printed after the opening fence as a bare
1298word.
1300To prevent all highlighting, use the `--no-highlight` flag.
1301To set the highlighting style, use `--highlight-style`.
1303Line blocks
1304-----------
1306#### Extension: `line_blocks` ####
1308A line block is a sequence of lines beginning with a vertical bar (`|`)
1309followed by a space. The division into lines will be preserved in
1310the output, as will any leading spaces; otherwise, the lines will
1311be formatted as markdown. This is useful for verse and addresses:
1313 | The limerick packs laughs anatomical
1314 | In space that is quite economical.
1315 | But the good ones I've seen
1316 | So seldom are clean
1317 | And the clean ones so seldom are comical
1319 | 200 Main St.
1320 | Berkeley, CA 94718
1322The lines can be hard-wrapped if needed, but the continuation
1323line must begin with a space.
1325 | The Right Honorable Most Venerable and Righteous Samuel L.
1326 Constable, Jr.
1327 | 200 Main St.
1328 | Berkeley, CA 94718
1330This syntax is borrowed from [reStructuredText].
1332Lists
1333-----
1335### Bullet lists ###
1337A bullet list is a list of bulleted list items. A bulleted list
1338item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1339example:
1341 * one
1342 * two
1343 * three
1345This will produce a "compact" list. If you want a "loose" list, in which
1346each item is formatted as a paragraph, put spaces between the items:
1348 * one
1350 * two
1352 * three
1354The bullets need not be flush with the left margin; they may be
1355indented one, two, or three spaces. The bullet must be followed
1356by whitespace.
1358List items look best if subsequent lines are flush with the first
1359line (after the bullet):
1361 * here is my first
1362 list item.
1363 * and my second.
1365But markdown also allows a "lazy" format:
1367 * here is my first
1368 list item.
1369 * and my second.
1371### The four-space rule ###
1373A list item may contain multiple paragraphs and other block-level
1374content. However, subsequent paragraphs must be preceded by a blank line
1375and indented four spaces or a tab. The list will look better if the first
1376paragraph is aligned with the rest:
1378 * First paragraph.
1380 Continued.
1382 * Second paragraph. With a code block, which must be indented
1383 eight spaces:
1385 { code }
1387List items may include other lists. In this case the preceding blank
1388line is optional. The nested list must be indented four spaces or
1389one tab:
1391 * fruits
1392 + apples
1393 - macintosh
1394 - red delicious
1395 + pears
1396 + peaches
1397 * vegetables
1398 + broccoli
1399 + chard
1401As noted above, markdown allows you to write list items "lazily," instead of
1402indenting continuation lines. However, if there are multiple paragraphs or
1403other blocks in a list item, the first line of each must be indented.
1405 + A lazy, lazy, list
1406 item.
1408 + Another one; this looks
1409 bad but is legal.
1411 Second paragraph of second
1412 list item.
1414**Note:** Although the four-space rule for continuation paragraphs
1415comes from the official [markdown syntax guide], the reference implementation,
1416`Markdown.pl`, does not follow it. So pandoc will give different results than
1417`Markdown.pl` when authors have indented continuation paragraphs fewer than
1418four spaces.
1420The [markdown syntax guide] is not explicit whether the four-space
1421rule applies to *all* block-level content in a list item; it only
1422mentions paragraphs and code blocks. But it implies that the rule
1423applies to all block-level content (including nested lists), and
1424pandoc interprets it that way.
1426 [markdown syntax guide]:
1427 http://daringfireball.net/projects/markdown/syntax#list
1429### Ordered lists ###
1431Ordered lists work just like bulleted lists, except that the items
1432begin with enumerators rather than bullets.
1434In standard markdown, enumerators are decimal numbers followed
1435by a period and a space. The numbers themselves are ignored, so
1436there is no difference between this list:
1438 1. one
1439 2. two
1440 3. three
1442and this one:
1444 5. one
1445 7. two
1446 1. three
1448#### Extension: `fancy_lists` ####
1450Unlike standard markdown, Pandoc allows ordered list items to be marked
1451with uppercase and lowercase letters and roman numerals, in addition to
1452arabic numerals. List markers may be enclosed in parentheses or followed by a
1453single right-parentheses or period. They must be separated from the
1454text that follows by at least one space, and, if the list marker is a
1455capital letter with a period, by at least two spaces.[^2]
1457[^2]: The point of this rule is to ensure that normal paragraphs
1458 starting with people's initials, like
1460 B. Russell was an English philosopher.
1462 do not get treated as list items.
1464 This rule will not prevent
1466 (C) 2007 Joe Smith
1468 from being interpreted as a list item. In this case, a backslash
1469 escape can be used:
1471 (C\) 2007 Joe Smith
1473The `fancy_lists` extension also allows '`#`' to be used as an
1474ordered list marker in place of a numeral:
1476 #. one
1477 #. two
1479#### Extension: `startnum` ####
1481Pandoc also pays attention to the type of list marker used, and to the
1482starting number, and both of these are preserved where possible in the
1483output format. Thus, the following yields a list with numbers followed
1484by a single parenthesis, starting with 9, and a sublist with lowercase
1485roman numerals:
1487 9) Ninth
1488 10) Tenth
1489 11) Eleventh
1490 i. subone
1491 ii. subtwo
1492 iii. subthree
1494Pandoc will start a new list each time a different type of list
1495marker is used. So, the following will create three lists:
1497 (2) Two
1498 (5) Three
1499 1. Four
1500 * Five
1502If default list markers are desired, use `#.`:
1504 #. one
1505 #. two
1506 #. three
1509### Definition lists ###
1511#### Extension: `definition_lists` ####
1513Pandoc supports definition lists, using the syntax of
1514[PHP Markdown Extra] with some extensions.[^3]
1516 Term 1
1518 : Definition 1
1520 Term 2 with *inline markup*
1522 : Definition 2
1524 { some code, part of Definition 2 }
1526 Third paragraph of definition 2.
1528Each term must fit on one line, which may optionally be followed by
1529a blank line, and must be followed by one or more definitions.
1530A definition begins with a colon or tilde, which may be indented one
1531or two spaces.
1533A term may have multiple definitions, and each definition may consist of one or
1534more block elements (paragraph, code block, list, etc.), each indented four
1535spaces or one tab stop. The body of the definition (including the first line,
1536aside from the colon or tilde) should be indented four spaces. However,
1537as with other markdown lists, you can "lazily" omit indentation except
1538at the beginning of a paragraph or other block element:
1540 Term 1
1542 : Definition
1543 with lazy continuation.
1545 Second paragraph of the definition.
1547If you leave space before the definition (as in the example above),
1548the text of the definition will be treated as a paragraph. In some
1549output formats, this will mean greater spacing between term/definition
1550pairs. For a more compact definition list, omit the space before the
1551definition:
1553 Term 1
1554 ~ Definition 1
1556 Term 2
1557 ~ Definition 2a
1558 ~ Definition 2b
1560Note that space between items in a definition list is required.
1561(A variant that loosens this requirement, but disallows "lazy"
1562hard wrapping, can be activated with `compact_definition_lists`: see
1563[Non-pandoc extensions](#non-pandoc-extensions), below.)
1565[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1567[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1570### Numbered example lists ###
1572#### Extension: `example_lists` ####
1574The special list marker `@` can be used for sequentially numbered
1575examples. The first list item with a `@` marker will be numbered '1',
1576the next '2', and so on, throughout the document. The numbered examples
1577need not occur in a single list; each new list using `@` will take up
1578where the last stopped. So, for example:
1580 (@) My first example will be numbered (1).
1581 (@) My second example will be numbered (2).
1583 Explanation of examples.
1585 (@) My third example will be numbered (3).
1587Numbered examples can be labeled and referred to elsewhere in the
1588document:
1590 (@good) This is a good example.
1592 As (@good) illustrates, ...
1594The label can be any string of alphanumeric characters, underscores,
1595or hyphens.
1598### Compact and loose lists ###
1600Pandoc behaves differently from `Markdown.pl` on some "edge
1601cases" involving lists. Consider this source:
1603 + First
1604 + Second:
1605 - Fee
1606 - Fie
1607 - Foe
1609 + Third
1611Pandoc transforms this into a "compact list" (with no `<p>` tags around
1612"First", "Second", or "Third"), while markdown puts `<p>` tags around
1613"Second" and "Third" (but not "First"), because of the blank space
1614around "Third". Pandoc follows a simple rule: if the text is followed by
1615a blank line, it is treated as a paragraph. Since "Second" is followed
1616by a list, and not a blank line, it isn't treated as a paragraph. The
1617fact that the list is followed by a blank line is irrelevant. (Note:
1618Pandoc works this way even when the `markdown_strict` format is specified. This
1619behavior is consistent with the official markdown syntax description,
1620even though it is different from that of `Markdown.pl`.)
1623### Ending a list ###
1625What if you want to put an indented code block after a list?
1627 - item one
1628 - item two
1630 { my code block }
1632Trouble! Here pandoc (like other markdown implementations) will treat
1633`{ my code block }` as the second paragraph of item two, and not as
1634a code block.
1636To "cut off" the list after item two, you can insert some non-indented
1637content, like an HTML comment, which won't produce visible output in
1638any format:
1640 - item one
1641 - item two
1643 <!-- end of list -->
1645 { my code block }
1647You can use the same trick if you want two consecutive lists instead
1648of one big list:
1650 1. one
1651 2. two
1652 3. three
1654 <!-- -->
1656 1. uno
1657 2. dos
1658 3. tres
1660Horizontal rules
1661----------------
1663A line containing a row of three or more `*`, `-`, or `_` characters
1664(optionally separated by spaces) produces a horizontal rule:
1666 * * * *
1668 ---------------
1671Tables
1672------
1674Four kinds of tables may be used. The first three kinds presuppose the use of
1675a fixed-width font, such as Courier. The fourth kind can be used with
1676proportionally spaced fonts, as it does not require lining up columns.
1678#### Extension: `table_captions` ####
1680A caption may optionally be provided with all 4 kinds of tables (as
1681illustrated in the examples below). A caption is a paragraph beginning
1682with the string `Table:` (or just `:`), which will be stripped off.
1683It may appear either before or after the table.
1685#### Extension: `simple_tables` ####
1687Simple tables look like this:
1689 Right Left Center Default
1690 ------- ------ ---------- -------
1691 12 12 12 12
1692 123 123 123 123
1693 1 1 1 1
1695 Table: Demonstration of simple table syntax.
1697The headers and table rows must each fit on one line. Column
1698alignments are determined by the position of the header text relative
1699to the dashed line below it:[^4]
1701 - If the dashed line is flush with the header text on the right side
1702 but extends beyond it on the left, the column is right-aligned.
1703 - If the dashed line is flush with the header text on the left side
1704 but extends beyond it on the right, the column is left-aligned.
1705 - If the dashed line extends beyond the header text on both sides,
1706 the column is centered.
1707 - If the dashed line is flush with the header text on both sides,
1708 the default alignment is used (in most cases, this will be left).
1710[^4]: This scheme is due to Michel Fortin, who proposed it on the
1711 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1713The table must end with a blank line, or a line of dashes followed by
1714a blank line.
1716The column headers may be omitted, provided a dashed line is used
1717to end the table. For example:
1719 ------- ------ ---------- -------
1720 12 12 12 12
1721 123 123 123 123
1722 1 1 1 1
1723 ------- ------ ---------- -------
1725When headers are omitted, column alignments are determined on the basis
1726of the first line of the table body. So, in the tables above, the columns
1727would be right, left, center, and right aligned, respectively.
1729#### Extension: `multiline_tables` ####
1731Multiline tables allow headers and table rows to span multiple lines
1732of text (but cells that span multiple columns or rows of the table are
1733not supported). Here is an example:
1735 -------------------------------------------------------------
1736 Centered Default Right Left
1737 Header Aligned Aligned Aligned
1738 ----------- ------- --------------- -------------------------
1739 First row 12.0 Example of a row that
1740 spans multiple lines.
1742 Second row 5.0 Here's another one. Note
1743 the blank line between
1744 rows.
1745 -------------------------------------------------------------
1747 Table: Here's the caption. It, too, may span
1748 multiple lines.
1750These work like simple tables, but with the following differences:
1752 - They must begin with a row of dashes, before the header text
1753 (unless the headers are omitted).
1754 - They must end with a row of dashes, then a blank line.
1755 - The rows must be separated by blank lines.
1757In multiline tables, the table parser pays attention to the widths of
1758the columns, and the writers try to reproduce these relative widths in
1759the output. So, if you find that one of the columns is too narrow in the
1760output, try widening it in the markdown source.
1762Headers may be omitted in multiline tables as well as simple tables:
1764 ----------- ------- --------------- -------------------------
1765 First row 12.0 Example of a row that
1766 spans multiple lines.
1768 Second row 5.0 Here's another one. Note
1769 the blank line between
1770 rows.
1771 ----------- ------- --------------- -------------------------
1773 : Here's a multiline table without headers.
1775It is possible for a multiline table to have just one row, but the row
1776should be followed by a blank line (and then the row of dashes that ends
1777the table), or the table may be interpreted as a simple table.
1779#### Extension: `grid_tables` ####
1781Grid tables look like this:
1783 : Sample grid table.
1785 +---------------+---------------+--------------------+
1786 | Fruit | Price | Advantages |
1787 +===============+===============+====================+
1788 | Bananas | $1.34 | - built-in wrapper |
1789 | | | - bright color |
1790 +---------------+---------------+--------------------+
1791 | Oranges | $2.10 | - cures scurvy |
1792 | | | - tasty |
1793 +---------------+---------------+--------------------+
1795The row of `=`s separates the header from the table body, and can be
1796omitted for a headerless table. The cells of grid tables may contain
1797arbitrary block elements (multiple paragraphs, code blocks, lists,
1798etc.). Alignments are not supported, nor are cells that span multiple
1799columns or rows. Grid tables can be created easily using [Emacs table mode].
1801 [Emacs table mode]: http://table.sourceforge.net/
1803#### Extension: `pipe_tables` ####
1805Pipe tables look like this:
1807 | Right | Left | Default | Center |
1808 |------:|:-----|---------|:------:|
1809 | 12 | 12 | 12 | 12 |
1810 | 123 | 123 | 123 | 123 |
1811 | 1 | 1 | 1 | 1 |
1813 : Demonstration of pipe table syntax.
1815The syntax is [the same as in PHP markdown extra]. The beginning and
1816ending pipe characters are optional, but pipes are required between all
1817columns. The colons indicate column alignment as shown. The header
1818can be omitted, but the horizontal line must still be included, as
1819it defines column alignments.
1821Since the pipes indicate column boundaries, columns need not be vertically
1822aligned, as they are in the above example. So, this is a perfectly
1823legal (though ugly) pipe table:
1825 fruit| price
1826 -----|-----:
1827 apple|2.05
1828 pear|1.37
1829 orange|3.09
1831The cells of pipe tables cannot contain block elements like paragraphs
1832and lists, and cannot span multiple lines. Note also that in LaTeX/PDF
1833output, the cells produced by pipe tables will not wrap, since there
1834is no information available about relative widths. If you want content
1835to wrap within cells, use multiline or grid tables.
1837 [the same as in PHP markdown extra]:
1838 http://michelf.ca/projects/php-markdown/extra/#table
1840Note: Pandoc also recognizes pipe tables of the following
1841form, as can produced by Emacs' orgtbl-mode:
1843 | One | Two |
1844 |-----+-------|
1845 | my | table |
1846 | is | nice |
1848The difference is that `+` is used instead of `|`. Other orgtbl features
1849are not supported. In particular, to get non-default column alignment,
1850you'll need to add colons as above.
1852Metadata blocks
1853---------------
1855#### Extension: `pandoc_title_block` ####
1857If the file begins with a title block
1859 % title
1860 % author(s) (separated by semicolons)
1861 % date
1863it will be parsed as bibliographic information, not regular text. (It
1864will be used, for example, in the title of standalone LaTeX or HTML
1865output.) The block may contain just a title, a title and an author,
1866or all three elements. If you want to include an author but no
1867title, or a title and a date but no author, you need a blank line:
1870 % Author
1872 % My title
1874 % June 15, 2006
1876The title may occupy multiple lines, but continuation lines must
1877begin with leading space, thus:
1879 % My title
1880 on multiple lines
1882If a document has multiple authors, the authors may be put on
1883separate lines with leading space, or separated by semicolons, or
1884both. So, all of the following are equivalent:
1886 % Author One
1887 Author Two
1889 % Author One; Author Two
1891 % Author One;
1892 Author Two
1894The date must fit on one line.
1896All three metadata fields may contain standard inline formatting
1897(italics, links, footnotes, etc.).
1899Title blocks will always be parsed, but they will affect the output only
1900when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1901will appear twice: once in the document head -- this is the title that
1902will appear at the top of the window in a browser -- and once at the
1903beginning of the document body. The title in the document head can have
1904an optional prefix attached (`--title-prefix` or `-T` option). The title
1905in the body appears as an H1 element with class "title", so it can be
1906suppressed or reformatted with CSS. If a title prefix is specified with
1907`-T` and no title block appears in the document, the title prefix will
1908be used by itself as the HTML title.
1910The man page writer extracts a title, man page section number, and
1911other header and footer information from the title line. The title
1912is assumed to be the first word on the title line, which may optionally
1913end with a (single-digit) section number in parentheses. (There should
1914be no space between the title and the parentheses.) Anything after
1915this is assumed to be additional footer and header text. A single pipe
1916character (`|`) should be used to separate the footer text from the header
1917text. Thus,
1919 % PANDOC(1)
1921will yield a man page with the title `PANDOC` and section 1.
1923 % PANDOC(1) Pandoc User Manuals
1925will also have "Pandoc User Manuals" in the footer.
1927 % PANDOC(1) Pandoc User Manuals | Version 4.0
1929will also have "Version 4.0" in the header.
1931#### Extension: `yaml_metadata_block` ####
1933A YAML metadata block is a valid YAML object, delimited by a line of three
1934hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
1935(`...`) at the bottom. A YAML metadata block may occur anywhere in the
1936document, but if it is not at the beginning, it must be preceded by a blank
1937line. (Note that, because of the way pandoc concatenates input files when
1938several are provided, you may also keep the metadata in a separate YAML file
1939and pass it to pandoc as an argument, along with your markdown files:
1941 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
1943Just be sure that the YAML file begins with `---` and ends with `---` or
1944`...`.)
1946Metadata will be taken from the fields of the YAML object and added to any
1947existing document metadata. Metadata can contain lists and objects (nested
1948arbitrarily), but all string scalars will be interpreted as markdown. Fields
1949with names ending in an underscore will be ignored by pandoc. (They may be
1950given a role by external processors.)
1952A document may contain multiple metadata blocks. The metadata fields will
1953be combined through a *left-biased union*: if two metadata blocks attempt
1954to set the same field, the value from the first block will be taken.
1956Note that YAML escaping rules must be followed. Thus, for example,
1957if a title contains a colon, it must be quoted. The pipe character
1958(`|`) can be used to begin an indented block that will be interpreted
1959literally, without need for escaping. This form is necessary
1960when the field contains blank lines:
1962 ---
1963 title: 'This is the title: it contains a colon'
1964 author:
1965 - name: Author One
1966 affiliation: University of Somewhere
1967 - name: Author Two
1968 affiliation: University of Nowhere
1969 tags: [nothing, nothingness]
1970 abstract: |
1971 This is the abstract.
1973 It consists of two paragraphs.
1974 ...
1976Template variables will be set automatically from the metadata. Thus, for
1977example, in writing HTML, the variable `abstract` will be set to the HTML
1978equivalent of the markdown in the `abstract` field:
1980 <p>This is the abstract.</p>
1981 <p>It consists of two paragraphs.</p>
1983Note: The `author` variable in the default templates expects a simple list or
1984string. To use the structured authors in the example, you would need a
1985custom template. For example:
1987 $for(author)$
1988 $if(author.name)$
1989 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
1990 $else$
1991 $author$
1992 $endif$
1993 $endfor$
1996Backslash escapes
1997-----------------
1999#### Extension: `all_symbols_escapable` ####
2001Except inside a code block or inline code, any punctuation or space
2002character preceded by a backslash will be treated literally, even if it
2003would normally indicate formatting. Thus, for example, if one writes
2005 *\*hello\**
2007one will get
2009 <em>*hello*</em>
2011instead of
2013 <strong>hello</strong>
2015This rule is easier to remember than standard markdown's rule,
2016which allows only the following characters to be backslash-escaped:
2018 \`*_{}[]()>#+-.!
2020(However, if the `markdown_strict` format is used, the standard markdown rule
2021will be used.)
2023A backslash-escaped space is parsed as a nonbreaking space. It will
2024appear in TeX output as `~` and in HTML and XML as `\&#160;` or
2025`\&nbsp;`.
2027A backslash-escaped newline (i.e. a backslash occurring at the end of
2028a line) is parsed as a hard line break. It will appear in TeX output as
2029`\\` and in HTML as `<br />`. This is a nice alternative to
2030markdown's "invisible" way of indicating hard line breaks using
2031two trailing spaces on a line.
2033Backslash escapes do not work in verbatim contexts.
2035Smart punctuation
2036-----------------
2038#### Extension ####
2040If the `--smart` option is specified, pandoc will produce typographically
2041correct output, converting straight quotes to curly quotes, `---` to
2042em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
2043are inserted after certain abbreviations, such as "Mr."
2045Note: if your LaTeX template uses the `csquotes` package, pandoc will
2046detect automatically this and use `\enquote{...}` for quoted text.
2048Inline formatting
2049-----------------
2051### Emphasis ###
2053To *emphasize* some text, surround it with `*`s or `_`, like this:
2055 This text is _emphasized with underscores_, and this
2056 is *emphasized with asterisks*.
2058Double `*` or `_` produces **strong emphasis**:
2060 This is **strong emphasis** and __with underscores__.
2062A `*` or `_` character surrounded by spaces, or backslash-escaped,
2063will not trigger emphasis:
2065 This is * not emphasized *, and \*neither is this\*.
2067#### Extension: `intraword_underscores` ####
2069Because `_` is sometimes used inside words and identifiers,
2070pandoc does not interpret a `_` surrounded by alphanumeric
2071characters as an emphasis marker. If you want to emphasize
2072just part of a word, use `*`:
2074 feas*ible*, not feas*able*.
2077### Strikeout ###
2079#### Extension: `strikeout` ####
2081To strikeout a section of text with a horizontal line, begin and end it
2082with `~~`. Thus, for example,
2084 This ~~is deleted text.~~
2087### Superscripts and subscripts ###
2089#### Extension: `superscript`, `subscript` ####
2091Superscripts may be written by surrounding the superscripted text by `^`
2092characters; subscripts may be written by surrounding the subscripted
2093text by `~` characters. Thus, for example,
2095 H~2~O is a liquid. 2^10^ is 1024.
2097If the superscripted or subscripted text contains spaces, these spaces
2098must be escaped with backslashes. (This is to prevent accidental
2099superscripting and subscripting through the ordinary use of `~` and `^`.)
2100Thus, if you want the letter P with 'a cat' in subscripts, use
2101`P~a\ cat~`, not `P~a cat~`.
2104### Verbatim ###
2106To make a short span of text verbatim, put it inside backticks:
2108 What is the difference between `>>=` and `>>`?
2110If the verbatim text includes a backtick, use double backticks:
2112 Here is a literal backtick `` ` ``.
2114(The spaces after the opening backticks and before the closing
2115backticks will be ignored.)
2117The general rule is that a verbatim span starts with a string
2118of consecutive backticks (optionally followed by a space)
2119and ends with a string of the same number of backticks (optionally
2120preceded by a space).
2122Note that backslash-escapes (and other markdown constructs) do not
2123work in verbatim contexts:
2125 This is a backslash followed by an asterisk: `\*`.
2127#### Extension: `inline_code_attributes` ####
2129Attributes can be attached to verbatim text, just as with
2130[fenced code blocks](#fenced-code-blocks):
2132 `<$>`{.haskell}
2134### Small caps ###
2136To write small caps, you can use an HTML span tag:
2138 <span style="font-variant:small-caps;">Small caps</span>
2140(The semicolon is optional and there may be space after the
2141colon.) This will work in all output formats that support small caps.
2143Math
2144----
2146#### Extension: `tex_math_dollars` ####
2148Anything between two `$` characters will be treated as TeX math. The
2149opening `$` must have a non-space character immediately to its right,
2150while the closing `$` must have a non-space character immediately to its
2151left, and must not be followed immediately by a digit. Thus,
2152`$20,000 and $30,000` won't parse as math. If for some reason
2153you need to enclose text in literal `$` characters, backslash-escape
2154them and they won't be treated as math delimiters.
2156TeX math will be printed in all output formats. How it is rendered
2157depends on the output format:
2159Markdown, LaTeX, Org-Mode, ConTeXt
2160 ~ It will appear verbatim between `$` characters.
2162reStructuredText
2163 ~ It will be rendered using an interpreted text role `:math:`, as described
2164 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
2166AsciiDoc
2167 ~ It will be rendered as `latexmath:[...]`.
2169Texinfo
2170 ~ It will be rendered inside a `@math` command.
2172groff man
2173 ~ It will be rendered verbatim without `$`'s.
2175MediaWiki, DokuWiki
2176 ~ It will be rendered inside `<math>` tags.
2178Textile
2179 ~ It will be rendered inside `<span class="math">` tags.
2181RTF, OpenDocument, ODT
2182 ~ It will be rendered, if possible, using unicode characters,
2183 and will otherwise appear verbatim.
2185Docbook
2186 ~ If the `--mathml` flag is used, it will be rendered using mathml
2187 in an `inlineequation` or `informalequation` tag. Otherwise it
2188 will be rendered, if possible, using unicode characters.
2190Docx
2191 ~ It will be rendered using OMML math markup.
2193FictionBook2
2194 ~ If the `--webtex` option is used, formulas are rendered as images
2195 using Google Charts or other compatible web service, downloaded
2196 and embedded in the e-book. Otherwise, they will appear verbatim.
2198HTML, Slidy, DZSlides, S5, EPUB
2199 ~ The way math is rendered in HTML will depend on the
2200 command-line options selected:
2202 1. The default is to render TeX math as far as possible using unicode
2203 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2204 are put inside a `span` with `class="math"`, so that they may be
2205 styled differently from the surrounding text if needed.
2207 2. If the `--latexmathml` option is used, TeX math will be displayed
2208 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2209 The [LaTeXMathML] script will be used to render it as formulas.
2210 (This trick does not work in all browsers, but it works in Firefox.
2211 In browsers that do not support LaTeXMathML, TeX math will appear
2212 verbatim between `$` characters.)
2214 3. If the `--jsmath` option is used, TeX math will be put inside
2215 `<span>` tags (for inline math) or `<div>` tags (for display math)
2216 with class `math`. The [jsMath] script will be used to render
2217 it.
2219 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2220 be called to generate images for each TeX formula. This should
2221 work in all browsers. The `--mimetex` option takes an optional URL
2222 as argument. If no URL is specified, it will be assumed that the
2223 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2225 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2226 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2227 be processed by [gladTeX], which will produce image files for each
2228 formula and an `html` file with links to these images. So, the
2229 procedure is:
2231 pandoc -s --gladtex myfile.txt -o myfile.htex
2232 gladtex -d myfile-images myfile.htex
2233 # produces myfile.html and images in myfile-images
2235 6. If the `--webtex` option is used, TeX formulas will be converted
2236 to `<img>` tags that link to an external script that converts
2237 formulas to images. The formula will be URL-encoded and concatenated
2238 with the URL provided. If no URL is specified, the Google Chart
2239 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2241 7. If the `--mathjax` option is used, TeX math will be displayed
2242 between `\(...\)` (for inline math) or `\[...\]` (for display
2243 math) and put in `<span>` tags with class `math`.
2244 The [MathJax] script will be used to render it as formulas.
2246Raw HTML
2247--------
2249#### Extension: `raw_html` ####
2251Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2252(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2253literally). (Technically this is not an extension, since standard
2254markdown allows it, but it has been made an extension so that it can
2255be disabled if desired.)
2257The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2258DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2259formats.
2261#### Extension: `markdown_in_html_blocks` ####
2263Standard markdown allows you to include HTML "blocks": blocks
2264of HTML between balanced tags that are separated from the surrounding text
2265with blank lines, and start and end at the left margin. Within
2266these blocks, everything is interpreted as HTML, not markdown;
2267so (for example), `*` does not signify emphasis.
2269Pandoc behaves this way when the `markdown_strict` format is used; but
2270by default, pandoc interprets material between HTML block tags as markdown.
2271Thus, for example, Pandoc will turn
2273 <table>
2274 <tr>
2275 <td>*one*</td>
2276 <td>[a link](http://google.com)</td>
2277 </tr>
2278 </table>
2280into
2282 <table>
2283 <tr>
2284 <td><em>one</em></td>
2285 <td><a href="http://google.com">a link</a></td>
2286 </tr>
2287 </table>
2289whereas `Markdown.pl` will preserve it as is.
2291There is one exception to this rule: text between `<script>` and
2292`<style>` tags is not interpreted as markdown.
2294This departure from standard markdown should make it easier to mix
2295markdown with HTML block elements. For example, one can surround
2296a block of markdown text with `<div>` tags without preventing it
2297from being interpreted as markdown.
2299#### Extension: `native_divs` ####
2301Use native pandoc `Div` blocks for content inside `<div>` tags.
2302For the most part this should give the same output as
2303`markdown_in_html_blocks`, but it makes it easier to write pandoc
2304filters to manipulate groups of blocks.
2306#### Extension: `native_spans` ####
2308Use native pandoc `Span` blocks for content inside `<span>` tags.
2309For the most part this should give the same output as `raw_html`,
2310but it makes it easier to write pandoc filters to manipulate groups
2311of inlines.
2313Raw TeX
2314-------
2316#### Extension: `raw_tex` ####
2318In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2319included in a document. Inline TeX commands will be preserved and passed
2320unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2321LaTeX to include BibTeX citations:
2323 This result was proved in \cite{jones.1967}.
2325Note that in LaTeX environments, like
2327 \begin{tabular}{|l|l|}\hline
2328 Age & Frequency \\ \hline
2329 18--25 & 15 \\
2330 26--35 & 33 \\
2331 36--45 & 22 \\ \hline
2332 \end{tabular}
2334the material between the begin and end tags will be interpreted as raw
2335LaTeX, not as markdown.
2337Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2338and ConTeXt.
2340LaTeX macros
2341------------
2343#### Extension: `latex_macros` ####
2345For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2346`\renewcommand` definitions and apply the resulting macros to all LaTeX
2347math. So, for example, the following will work in all output formats,
2348not just LaTeX:
2350 \newcommand{\tuple}[1]{\langle #1 \rangle}
2352 $\tuple{a, b, c}$
2354In LaTeX output, the `\newcommand` definition will simply be passed
2355unchanged to the output.
2358Links
2359-----
2361Markdown allows links to be specified in several ways.
2363### Automatic links ###
2365If you enclose a URL or email address in pointy brackets, it
2366will become a link:
2368 <http://google.com>
2369 <sam@green.eggs.ham>
2371### Inline links ###
2373An inline link consists of the link text in square brackets,
2374followed by the URL in parentheses. (Optionally, the URL can
2375be followed by a link title, in quotes.)
2377 This is an [inline link](/url), and here's [one with
2378 a title](http://fsf.org "click here for a good time!").
2380There can be no space between the bracketed part and the parenthesized part.
2381The link text can contain formatting (such as emphasis), but the title cannot.
2384### Reference links ###
2386An *explicit* reference link has two parts, the link itself and the link
2387definition, which may occur elsewhere in the document (either
2388before or after the link).
2390The link consists of link text in square brackets, followed by a label in
2391square brackets. (There can be space between the two.) The link definition
2392consists of the bracketed label, followed by a colon and a space, followed by
2393the URL, and optionally (after a space) a link title either in quotes or in
2394parentheses.
2396Here are some examples:
2398 [my label 1]: /foo/bar.html "My title, optional"
2399 [my label 2]: /foo
2400 [my label 3]: http://fsf.org (The free software foundation)
2401 [my label 4]: /bar#special 'A title in single quotes'
2403The URL may optionally be surrounded by angle brackets:
2405 [my label 5]: <http://foo.bar.baz>
2407The title may go on the next line:
2409 [my label 3]: http://fsf.org
2410 "The free software foundation"
2412Note that link labels are not case sensitive. So, this will work:
2414 Here is [my link][FOO]
2416 [Foo]: /bar/baz
2418In an *implicit* reference link, the second pair of brackets is
2419empty, or omitted entirely:
2421 See [my website][], or [my website].
2423 [my website]: http://foo.bar.baz
2425Note: In `Markdown.pl` and most other markdown implementations,
2426reference link definitions cannot occur in nested constructions
2427such as list items or block quotes. Pandoc lifts this arbitrary
2428seeming restriction. So the following is fine in pandoc, though
2429not in most other implementations:
2431 > My block [quote].
2433 > [quote]: /foo
2435### Internal links ###
2437To link to another section of the same document, use the automatically
2438generated identifier (see [Header identifiers in HTML, LaTeX, and
2439ConTeXt](#header-identifiers-in-html-latex-and-context), below).
2440For example:
2442 See the [Introduction](#introduction).
2446 See the [Introduction].
2448 [Introduction]: #introduction
2450Internal links are currently supported for HTML formats (including
2451HTML slide shows and EPUB), LaTeX, and ConTeXt.
2453Images
2454------
2456A link immediately preceded by a `!` will be treated as an image.
2457The link text will be used as the image's alt text:
2459 ![la lune](lalune.jpg "Voyage to the moon")
2461 ![movie reel]
2463 [movie reel]: movie.gif
2465#### Extension: `implicit_figures` ####
2467An image occurring by itself in a paragraph will be rendered as
2468a figure with a caption.[^5] (In LaTeX, a figure environment will be
2469used; in HTML, the image will be placed in a `div` with class
2470`figure`, together with a caption in a `p` with class `caption`.)
2471The image's alt text will be used as the caption.
2473 ![This is the caption](/url/of/image.png)
2475[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2476 ODT. In those formats, you'll just get an image in a paragraph by
2477 itself, with no caption.
2479If you just want a regular inline image, just make sure it is not
2480the only thing in the paragraph. One way to do this is to insert a
2481nonbreaking space after the image:
2483 ![This image won't be a figure](/url/of/image.png)\
2486Footnotes
2487---------
2489#### Extension: `footnotes` ####
2491Pandoc's markdown allows footnotes, using the following syntax:
2493 Here is a footnote reference,[^1] and another.[^longnote]
2495 [^1]: Here is the footnote.
2497 [^longnote]: Here's one with multiple blocks.
2499 Subsequent paragraphs are indented to show that they
2500 belong to the previous footnote.
2502 { some.code }
2504 The whole paragraph can be indented, or just the first
2505 line. In this way, multi-paragraph footnotes work like
2506 multi-paragraph list items.
2508 This paragraph won't be part of the note, because it
2509 isn't indented.
2511The identifiers in footnote references may not contain spaces, tabs,
2512or newlines. These identifiers are used only to correlate the
2513footnote reference with the note itself; in the output, footnotes
2514will be numbered sequentially.
2516The footnotes themselves need not be placed at the end of the
2517document. They may appear anywhere except inside other block elements
2518(lists, block quotes, tables, etc.).
2520#### Extension: `inline_notes` ####
2522Inline footnotes are also allowed (though, unlike regular notes,
2523they cannot contain multiple paragraphs). The syntax is as follows:
2525 Here is an inline note.^[Inlines notes are easier to write, since
2526 you don't have to pick an identifier and move down to type the
2527 note.]
2529Inline and regular footnotes may be mixed freely.
2532Citations
2533---------
2535#### Extension: `citations` ####
2537Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2538citations and a bibliography in a number of styles. Basic usage is
2540 pandoc --filter pandoc-citeproc myinput.txt
2542In order to use this feature, you will need to specify a bibliography file
2543using the `bibliography` metadata field in a YAML metadata section.
2544The bibliography may have any of these formats:
2546 Format File extension
2547 ------------ --------------
2548 MODS .mods
2549 BibLaTeX .bib
2550 BibTeX .bibtex
2551 RIS .ris
2552 EndNote .enl
2553 EndNote XML .xml
2554 ISI .wos
2555 MEDLINE .medline
2556 Copac .copac
2557 JSON citeproc .json
2559Note that `.bib` can generally be used with both BibTeX and BibLaTeX
2560files, but you can use `.bibtex` to force BibTeX.
2562Alternatively you can use a `references` field in the document's YAML
2563metadata. This should include an array of YAML-encoded references,
2564for example:
2566 ---
2567 references:
2568 - id: fenner2012a
2569 title: One-click science marketing
2570 author:
2571 - family: Fenner
2572 given: Martin
2573 container-title: Nature Materials
2574 volume: 11
2575 URL: 'http://dx.doi.org/10.1038/nmat3283'
2576 DOI: 10.1038/nmat3283
2577 issue: 4
2578 publisher: Nature Publishing Group
2579 page: 261-263
2580 type: article-journal
2581 issued:
2582 year: 2012
2583 month: 3
2584 ...
2586(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce
2587these from a MODS reference collection.)
2589By default, `pandoc-citeproc` will use a Chicago author-date format for
2590citations and references. To use another style, you will need to specify
2591a [CSL] 1.0 style file in the `csl` metadata field. A primer on creating and
2592modifying CSL styles can be found at
2593<http://citationstyles.org/downloads/primer.html>. A repository of CSL styles
2594can be found at <https://github.com/citation-style-language/styles>. See also
2595<http://zotero.org/styles> for easy browsing.
2597Citations go inside square brackets and are separated by semicolons.
2598Each citation must have a key, composed of '@' + the citation
2599identifier from the database, and may optionally have a prefix,
2600a locator, and a suffix. The citation key must begin with a letter
2601or `_`, and may contain alphanumerics, `_`, and internal punctuation
2602characters (`:.#$%&-+?<>~/`). Here are some examples:
2604 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
2606 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2608 Blah blah [@smith04; @doe99].
2610A minus sign (`-`) before the `@` will suppress mention of
2611the author in the citation. This can be useful when the
2612author is already mentioned in the text:
2614 Smith says blah [-@smith04].
2616You can also write an in-text citation, as follows:
2618 @smith04 says blah.
2620 @smith04 [p. 33] says blah.
2622If the style calls for a list of works cited, it will be placed
2623at the end of the document. Normally, you will want to end your
2624document with an appropriate header:
2626 last paragraph...
2628 # References
2630The bibliography will be inserted after this header. Note that
2631the `unnumbered` class will be added to this header, so that the
2632section will not be numbered.
2634If you want to include items in the bibliography without actually
2635citing them in the body text, you can define a dummy `nocite` metadata
2636field and put the citations there:
2638 ---
2639 nocite: |
2640 @item1, @item2
2641 ...
2643 @item3
2645In this example, the document will contain a citation for `item3`
2646only, but the bibliography will contain entries for `item1`, `item2`, and
2647`item3`.
2649Non-pandoc extensions
2650---------------------
2652The following markdown syntax extensions are not enabled by default
2653in pandoc, but may be enabled by adding `+EXTENSION` to the format
2654name, where `EXTENSION` is the name of the extension. Thus, for
2655example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2657#### Extension: `lists_without_preceding_blankline` ####
2659Allow a list to occur right after a paragraph, with no intervening
2660blank space.
2662#### Extension: `hard_line_breaks` ####
2664Causes all newlines within a paragraph to be interpreted as hard line
2665breaks instead of spaces.
2667#### Extension: `ignore_line_breaks` ####
2669Causes newlines within a paragraph to be ignored, rather than being
2670treated as spaces or as hard line breaks. This option is intended for
2671use with East Asian languages where spaces are not used between words,
2672but text is divided into lines for readability.
2674#### Extension: `tex_math_single_backslash` ####
2676Causes anything between `\(` and `\)` to be interpreted as inline
2677TeX math, and anything between `\[` and `\]` to be interpreted
2678as display TeX math. Note: a drawback of this extension is that
2679it precludes escaping `(` and `[`.
2681#### Extension: `tex_math_double_backslash` ####
2683Causes anything between `\\(` and `\\)` to be interpreted as inline
2684TeX math, and anything between `\\[` and `\\]` to be interpreted
2685as display TeX math.
2687#### Extension: `markdown_attribute` ####
2689By default, pandoc interprets material inside block-level tags as markdown.
2690This extension changes the behavior so that markdown is only parsed
2691inside block-level tags if the tags have the attribute `markdown=1`.
2693#### Extension: `mmd_title_block` ####
2695Enables a [MultiMarkdown] style title block at the top of
2696the document, for example:
2698 Title: My title
2699 Author: John Doe
2700 Date: September 1, 2008
2701 Comment: This is a sample mmd title block, with
2702 a field spanning multiple lines.
2704See the MultiMarkdown documentation for details. If `pandoc_title_block` or
2705`yaml_metadata_block` is enabled, it will take precedence over
2706`mmd_title_block`.
2708 [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
2710#### Extension: `abbreviations` ####
2712Parses PHP Markdown Extra abbreviation keys, like
2714 *[HTML]: Hyper Text Markup Language
2716Note that the pandoc document model does not support
2717abbreviations, so if this extension is enabled, abbreviation keys are
2718simply skipped (as opposed to being parsed as paragraphs).
2720#### Extension: `autolink_bare_uris` ####
2722Makes all absolute URIs into links, even when not surrounded by
2723pointy braces `<...>`.
2725#### Extension: `ascii_identifiers` ####
2727Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
2728Accents are stripped off of accented latin letters, and non-latin
2729letters are omitted.
2731#### Extension: `link_attributes` ####
2733Parses multimarkdown style key-value attributes on link and image references.
2734Note that pandoc's internal document model provides nowhere to put
2735these, so they are presently just ignored.
2737#### Extension: `mmd_header_identifiers` ####
2739Parses multimarkdown style header identifiers (in square brackets,
2740after the header but before any trailing `#`s in an ATX header).
2742#### Extension: `compact_definition_lists` ####
2744Activates the definition list syntax of pandoc 1.12.x and earlier.
2745This syntax differs from the one described [above](#definition-lists)
2746in several respects:
2748 - No blank line is required between consecutive items of the
2749 definition list.
2750 - To get a "tight" or "compact" list, omit space between consecutive
2751 items; the space between a term and its definition does not affect
2752 anything.
2753 - Lazy wrapping of paragraphs is not allowed: the entire definition must
2754 be indented four spaces.[^6]
2756[^6]: To see why laziness is incompatible with relaxing the requirement
2757 of a blank line between items, consider the following example:
2759 bar
2760 : definition
2761 foo
2762 : definition
2764 Is this a single list item with two definitions of "bar," the first of
2765 which is lazily wrapped, or two list items? To remove the ambiguity
2766 we must either disallow lazy wrapping or require a blank line between
2767 list items.
2769Markdown variants
2770-----------------
2772In addition to pandoc's extended markdown, the following markdown
2773variants are supported:
2775`markdown_phpextra` (PHP Markdown Extra)
2776: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
2777 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
2778 `header_attributes`, `abbreviations`.
2780`markdown_github` (Github-flavored Markdown)
2781: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
2782 `fenced_code_blocks`, `auto_identifiers`,
2783 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
2784 `intraword_underscores`, `strikeout`, `hard_line_breaks`
2786`markdown_mmd` (MultiMarkdown)
2787: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
2788 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
2789 `mmd_title_block`, `footnotes`, `definition_lists`,
2790 `all_symbols_escapable`, `implicit_header_references`,
2791 `auto_identifiers`, `mmd_header_identifiers`
2793`markdown_strict` (Markdown.pl)
2794: `raw_html`
2796Extensions with formats other than markdown
2797-------------------------------------------
2799Some of the extensions discussed above can be used with formats
2800other than markdown:
2802* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
2803 and `textile` input (and is used by default).
2805* `tex_math_dollars`, `tex_math_single_backslash`, and
2806 `tex_math_double_backslash` can be used with `html` input.
2807 (This is handy for reading web pages formatted using MathJax,
2808 for example.)
2810Producing slide shows with Pandoc
2811=================================
2813You can use Pandoc to produce an HTML + javascript slide presentation
2814that can be viewed via a web browser. There are five ways to do this,
2815using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
2816You can also produce a PDF slide show using LaTeX [beamer].
2818Here's the markdown source for a simple slide show, `habits.txt`:
2820 % Habits
2821 % John Doe
2822 % March 22, 2005
2824 # In the morning
2826 ## Getting up
2828 - Turn off alarm
2829 - Get out of bed
2831 ## Breakfast
2833 - Eat eggs
2834 - Drink coffee
2836 # In the evening
2838 ## Dinner
2840 - Eat spaghetti
2841 - Drink wine
2843 ------------------
2845 ![picture of spaghetti](images/spaghetti.jpg)
2847 ## Going to sleep
2849 - Get in bed
2850 - Count sheep
2852To produce an HTML/javascript slide show, simply type
2854 pandoc -t FORMAT -s habits.txt -o habits.html
2856where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
2858For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
2859`-s/--standalone` option embeds a link to javascripts and CSS files, which are
2860assumed to be available at the relative path `s5/default` (for S5), `slideous`
2861(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
2862`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
2863`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
2864above.) For DZSlides, the (relatively short) javascript and css are included in
2865the file by default.
2867With all HTML slide formats, the `--self-contained` option can be used to
2868produce a single file that contains all of the data necessary to display the
2869slide show, including linked scripts, stylesheets, images, and videos.
2871To produce a PDF slide show using beamer, type
2873 pandoc -t beamer habits.txt -o habits.pdf
2875Note that a reveal.js slide show can also be converted to a PDF
2876by printing it to a file from the browser.
2878Structuring the slide show
2879--------------------------
2881By default, the *slide level* is the highest header level in
2882the hierarchy that is followed immediately by content, and not another
2883header, somewhere in the document. In the example above, level 1 headers
2884are always followed by level 2 headers, which are followed by content,
2885so 2 is the slide level. This default can be overridden using
2886the `--slide-level` option.
2888The document is carved up into slides according to the following
2889rules:
2891 * A horizontal rule always starts a new slide.
2893 * A header at the slide level always starts a new slide.
2895 * Headers *below* the slide level in the hierarchy create
2896 headers *within* a slide.
2898 * Headers *above* the slide level in the hierarchy create
2899 "title slides," which just contain the section title
2900 and help to break the slide show into sections.
2902 * A title page is constructed automatically from the document's title
2903 block, if present. (In the case of beamer, this can be disabled
2904 by commenting out some lines in the default template.)
2906These rules are designed to support many different styles of slide show. If
2907you don't care about structuring your slides into sections and subsections,
2908you can just use level 1 headers for all each slide. (In that case, level 1
2909will be the slide level.) But you can also structure the slide show into
2910sections, as in the example above.
2912Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
2913layout will be produced, with level 1 headers building horizontally
2914and level 2 headers building vertically. It is not recommended that
2915you use deeper nesting of section levels with reveal.js.
2917Incremental lists
2918-----------------
2920By default, these writers produces lists that display "all at once."
2921If you want your lists to display incrementally (one item at a time),
2922use the `-i` option. If you want a particular list to depart from the
2923default (that is, to display incrementally without the `-i` option and
2924all at once with the `-i` option), put it in a block quote:
2926 > - Eat spaghetti
2927 > - Drink wine
2929In this way incremental and nonincremental lists can be mixed in
2930a single document.
2932Inserting pauses
2933----------------
2935You can add "pauses" within a slide by including a paragraph containing
2936three dots, separated by spaces:
2938 # Slide with a pause
2940 content before the pause
2942 . . .
2944 content after the pause
2946Styling the slides
2947------------------
2949You can change the style of HTML slides by putting customized CSS files
2950in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
2951or `$DATADIR/slideous` (for Slideous),
2952where `$DATADIR` is the user data directory (see `--data-dir`, above).
2953The originals may be found in pandoc's system data directory (generally
2954`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2955files it does not find in the user data directory.
2957For dzslides, the CSS is included in the HTML file itself, and may
2958be modified there.
2960For reveal.js, themes can be used by setting the `theme` variable,
2961for example:
2963 -V theme=moon
2965Or you can specify a custom stylesheet using the `--css` option.
2967To style beamer slides, you can specify a beamer "theme" or "colortheme"
2968using the `-V` option:
2970 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2972Note that header attributes will turn into slide attributes
2973(on a `<div>` or `<section>`) in HTML slide formats, allowing you
2974to style individual slides. In Beamer, the only header attribute
2975that affects slides is the `allowframebreaks` class, which sets the
2976`allowframebreaks` option, causing multiple slides to be created
2977if the content overfills the frame. This is recommended especially for
2978bibliographies:
2980 # References {.allowframebreaks}
2982Speaker notes
2983-------------
2985reveal.js has good support for speaker notes. You can add notes to your
2986markdown document thus:
2988 <div class="notes">
2989 This is my note.
2991 - It can contain markdown
2992 - like this list
2994 </div>
2996To show the notes window, press `s` while viewing the presentation.
2997Notes are not yet supported for other slide formats, but the notes
2998will not appear on the slides themselves.
3000EPUB Metadata
3001=============
3003EPUB metadata may be specified using the `--epub-metadata` option, but
3004if the source document is markdown, it is better to use a YAML metadata
3005block. Here is an example:
3007 ---
3008 title:
3009 - type: main
3010 text: My Book
3011 - type: subtitle
3012 text: An investigation of metadata
3013 creator:
3014 - role: author
3015 text: John Smith
3016 - role: editor
3017 text: Sarah Jones
3018 identifier:
3019 - scheme: DOI
3020 text: doi:10.234234.234/33
3021 publisher: My Press
3022 rights: © 2007 John Smith, CC BY-NC
3023 ...
3025The following fields are recognized:
3027`identifier`
3028 ~ Either a string value or an object with fields `text` and
3029 `scheme`. Valid values for `scheme` are `ISBN-10`,
3030 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
3031 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
3032 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
3034`title`
3035 ~ Either a string value, or an object with fields `file-as` and
3036 `type`, or a list of such objects. Valid values for `type` are
3037 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
3039`creator`
3040 ~ Either a string value, or an object with fields `role`, `file-as`,
3041 and `text`, or a list of such objects. Valid values for `role` are
3042 [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but
3043 pandoc will attempt to translate the human-readable versions
3044 (like "author" and "editor") to the appropriate marc relators.
3046`contributor`
3047 ~ Same format as `creator`.
3049`date`
3050 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
3051 Pandoc will attempt to convert other common date formats.
3053`language`
3054 ~ A string value in [RFC5646] format. Pandoc will default to the local
3055 language if nothing is specified.
3057`subject`
3058 ~ A string value or a list of such values.
3060`description`
3061 ~ A string value.
3063`type`
3064 ~ A string value.
3066`format`
3067 ~ A string value.
3069`relation`
3070 ~ A string value.
3072`coverage`
3073 ~ A string value.
3075`rights`
3076 ~ A string value.
3078`cover-image`
3079 ~ A string value (path to cover image).
3081`stylesheet`
3082 ~ A string value (path to CSS stylesheet).
3084`page-progression-direction`
3085 ~ Either `ltr` or `rtl`. Specifies the `page-progression-direction`
3086 spine [attribute][EPUBspine].
3088Literate Haskell support
3089========================
3091If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
3092format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
3093`beamer`, `html` or `html5` for output only), pandoc will treat the document as
3094literate Haskell source. This means that
3096 - In markdown input, "bird track" sections will be parsed as Haskell
3097 code rather than block quotations. Text between `\begin{code}`
3098 and `\end{code}` will also be treated as Haskell code.
3100 - In markdown output, code blocks with classes `haskell` and `literate`
3101 will be rendered using bird tracks, and block quotations will be
3102 indented one space, so they will not be treated as Haskell code.
3103 In addition, headers will be rendered setext-style (with underlines)
3104 rather than atx-style (with '#' characters). (This is because ghc
3105 treats '#' characters in column 1 as introducing line numbers.)
3107 - In restructured text input, "bird track" sections will be parsed
3108 as Haskell code.
3110 - In restructured text output, code blocks with class `haskell` will
3111 be rendered using bird tracks.
3113 - In LaTeX input, text in `code` environments will be parsed as
3114 Haskell code.
3116 - In LaTeX output, code blocks with class `haskell` will be rendered
3117 inside `code` environments.
3119 - In HTML output, code blocks with class `haskell` will be rendered
3120 with class `literatehaskell` and bird tracks.
3122Examples:
3124 pandoc -f markdown+lhs -t html
3126reads literate Haskell source formatted with markdown conventions and writes
3127ordinary HTML (without bird tracks).
3129 pandoc -f markdown+lhs -t html+lhs
3131writes HTML with the Haskell code in bird tracks, so it can be copied
3132and pasted as literate Haskell source.
3134Custom writers
3135==============
3137Pandoc can be extended with custom writers written in [lua]. (Pandoc
3138includes a lua interpreter, so lua need not be installed separately.)
3140To use a custom writer, simply specify the path to the lua script
3141in place of the output format. For example:
3143 pandoc -t data/sample.lua
3145Creating a custom writer requires writing a lua function for each
3146possible element in a pandoc document. To get a documented example
3147which you can modify according to your needs, do
3149 pandoc --print-default-data-file sample.lua
3151Authors
3152=======
3154© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the
3155[GPL], version 2 or greater. This software carries no warranty of
3156any kind. (See COPYRIGHT for full copyright and warranty notices.)
3157Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
3158Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
3159Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
3160Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
3161Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
3162Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,
3163Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,
3164Jamie F. Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse
3165Rosenthal.
3167[markdown]: http://daringfireball.net/projects/markdown/
3168[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
3169[S5]: http://meyerweb.com/eric/tools/s5/
3170[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
3171[Slideous]: http://goessner.net/articles/slideous/
3172[HTML]: http://www.w3.org/TR/html40/
3173[HTML 5]: http://www.w3.org/TR/html5/
3174[XHTML]: http://www.w3.org/TR/xhtml1/
3175[LaTeX]: http://www.latex-project.org/
3176[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
3177[ConTeXt]: http://www.pragma-ade.nl/
3178[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
3179[DocBook]: http://www.docbook.org/
3180[OPML]: http://dev.opml.org/spec2.html
3181[OpenDocument]: http://opendocument.xml.org/
3182[ODT]: http://en.wikipedia.org/wiki/OpenDocument
3183[Textile]: http://redcloth.org/textile
3184[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
3185[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
3186[TWiki markup]: http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules
3187[Haddock markup]: http://www.haskell.org/haddock/doc/html/ch03s08.html
3188[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
3189[Haskell]: http://www.haskell.org/
3190[GNU Texinfo]: http://www.gnu.org/software/texinfo/
3191[Emacs Org-Mode]: http://orgmode.org
3192[AsciiDoc]: http://www.methods.co.nz/asciidoc/
3193[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
3194[DZSlides]: http://paulrouget.com/dzslides/
3195[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
3196[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
3197[PDF]: http://www.adobe.com/pdf/
3198[reveal.js]: http://lab.hakim.se/reveal-js/
3199[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
3200[lua]: http://www.lua.org
3201[marc relators]: http://www.loc.gov/marc/relators/relaterm.html
3202[RFC5646]: http://tools.ietf.org/html/rfc5646
3203[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
3204[txt2tags]: http://txt2tags.org/
3205[EPUB]: http://idpf.org/epub
3206[EPUBspine]: http://www.idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem
3207[KaTeX]: https://github.com/Khan/KaTeX