git.iko.soy/typeable/pandoc
on 28debcd help sign in
3098 lines 111 kB history raw
1% Pandoc User's Guide
2% John MacFarlane
3% May 16, 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], [Haddock markup], [OPML], [Emacs
17Org-mode], [DocBook], and [Word docx]; and it can write plain text,
18[markdown], [reStructuredText], [XHTML], [HTML 5], [LaTeX] (including
19[beamer] slide shows), [ConTeXt], [RTF], [OPML], [DocBook],
20[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],
21[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3), [FictionBook2],
22[Textile], [groff man] pages, [Emacs Org-Mode], [AsciiDoc], [InDesign ICML],
23and [Slidy], [Slideous], [DZSlides], [reveal.js] or [S5] HTML slide shows.
24It can also produce [PDF] output on systems where LaTeX is installed.
26Pandoc's enhanced version of markdown includes syntax for footnotes,
27tables, flexible ordered lists, definition lists, fenced code blocks,
28superscript, subscript, strikeout, title blocks, automatic tables of
29contents, embedded LaTeX math, citations, and markdown inside HTML block
30elements. (These enhancements, described below under
31[Pandoc's markdown](#pandocs-markdown), can be disabled using the
32`markdown_strict` input or output format.)
34In contrast to most existing tools for converting markdown to HTML, which
35use regex substitutions, Pandoc has a modular design: it consists of a
36set of readers, which parse text in a given format and produce a native
37representation of the document, and a set of writers, which convert
38this native representation into a target format. Thus, adding an input
39or output format requires only adding a reader or writer.
41Using `pandoc`
42--------------
44If no *input-file* is specified, input is read from *stdin*.
45Otherwise, the *input-files* are concatenated (with a blank
46line between each) and used as input. Output goes to *stdout* by
47default (though output to *stdout* is disabled for the `odt`, `docx`,
48`epub`, and `epub3` output formats). For output to a file, use the
49`-o` option:
51 pandoc -o output.html input.txt
53Instead of a file, an absolute URI may be given. In this case
54pandoc will fetch the content using HTTP:
56 pandoc -f html -t markdown http://www.fsf.org
58If multiple input files are given, `pandoc` will concatenate them all (with
59blank lines between them) before parsing.
61The format of the input and output can be specified explicitly using
62command-line options. The input format can be specified using the
63`-r/--read` or `-f/--from` options, the output format using the
64`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
65markdown to LaTeX, you could type:
67 pandoc -f markdown -t latex hello.txt
69To convert `hello.html` from html to markdown:
71 pandoc -f html -t markdown hello.html
73Supported output formats are listed below under the `-t/--to` option.
74Supported input formats are listed below under the `-f/--from` option. Note
75that the `rst`, `textile`, `latex`, and `html` readers are not complete;
76there are some constructs that they do not parse.
78If the input or output format is not specified explicitly, `pandoc`
79will attempt to guess it from the extensions of
80the input and output filenames. Thus, for example,
82 pandoc -o hello.tex hello.txt
84will convert `hello.txt` from markdown to LaTeX. If no output file
85is specified (so that output goes to *stdout*), or if the output file's
86extension is unknown, the output format will default to HTML.
87If no input file is specified (so that input comes from *stdin*), or
88if the input files' extensions are unknown, the input format will
89be assumed to be markdown unless explicitly specified.
91Pandoc uses the UTF-8 character encoding for both input and output.
92If your local character encoding is not UTF-8, you
93should pipe input and output through `iconv`:
95 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
97Creating a PDF
98--------------
100Earlier versions of pandoc came with a program, `markdown2pdf`, that
101used pandoc and pdflatex to produce a PDF. This is no longer needed,
102since `pandoc` can now produce `pdf` output itself. To produce a PDF, simply
103specify an output file with a `.pdf` extension. Pandoc will create a latex
104file and use pdflatex (or another engine, see `--latex-engine`) to convert it
105to PDF:
107 pandoc test.txt -o test.pdf
109Production of a PDF requires that a LaTeX engine be installed (see
110`--latex-engine`, below), and assumes that the following LaTeX packages are
111available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the
112`--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`,
113`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),
114`fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra`
115and `xunicode` (if `xelatex` is used).
117`hsmarkdown`
118------------
120A user who wants a drop-in replacement for `Markdown.pl` may create
121a symbolic link to the `pandoc` executable called `hsmarkdown`. When
122invoked under the name `hsmarkdown`, `pandoc` will behave as if
123invoked with `-f markdown_strict --email-obfuscation=references`,
124and all command-line options will be treated as regular arguments.
125However, this approach does not work under Cygwin, due to problems with
126its simulation of symbolic links.
128[Cygwin]: http://www.cygwin.com/
129[`iconv`]: http://www.gnu.org/software/libiconv/
130[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
131[TeX Live]: http://www.tug.org/texlive/
132[MacTeX]: http://www.tug.org/mactex/
134Options
135=======
137General options
138---------------
140`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
141: Specify input format. *FORMAT* can be `native` (native Haskell),
142 `json` (JSON version of native AST), `markdown` (pandoc's
143 extended markdown), `markdown_strict` (original unextended markdown),
144 `markdown_phpextra` (PHP Markdown Extra extended markdown),
145 `markdown_github` (github extended markdown),
146 `textile` (Textile), `rst` (reStructuredText), `html` (HTML),
147 `docbook` (DocBook), `opml` (OPML), `org` (Emacs Org-mode),
148 `mediawiki` (MediaWiki markup), `haddock` (Haddock markup), or
149 `latex` (LaTeX). If `+lhs` is appended to `markdown`, `rst`,
150 `latex`, or `html`, the input will be treated as literate Haskell
151 source: see [Literate Haskell support](#literate-haskell-support),
152 below. Markdown syntax extensions can be individually enabled or
153 disabled by appending `+EXTENSION` or `-EXTENSION` to the format
154 name. So, for example, `markdown_strict+footnotes+definition_lists`
155 is strict markdown with footnotes and definition lists enabled,
156 and `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown
157 without pipe tables and with hard line breaks. See [Pandoc's
158 markdown](#pandocs-markdown), below, for a list of extensions and
159 their names.
161`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
162: Specify output format. *FORMAT* can be `native` (native Haskell),
163 `json` (JSON version of native AST), `plain` (plain text),
164 `markdown` (pandoc's extended markdown), `markdown_strict` (original
165 unextended markdown), `markdown_phpextra` (PHP Markdown extra
166 extended markdown), `markdown_github` (github extended markdown),
167 `rst` (reStructuredText), `html` (XHTML 1), `html5` (HTML 5),
168 `latex` (LaTeX), `beamer` (LaTeX beamer slide show),
169 `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),
170 `dokuwiki` (DokuWiki markup),
171 `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),
172 `opml` (OPML), `docbook` (DocBook), `opendocument` (OpenDocument), `odt`
173 (OpenOffice text document), `docx` (Word docx), `haddock` (Haddock
174 markup), `rtf` (rich text format), `epub` (EPUB v2 book), `epub3`
175 (EPUB v3), `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc),
176 `icml` (InDesign ICML), `slidy` (Slidy HTML and javascript slide show),
177 `slideous` (Slideous HTML and javascript slide show), `dzslides`
178 (DZSlides HTML5 + javascript slide show), `revealjs` (reveal.js
179 HTML5 + javascript slide show), `s5` (S5 HTML and javascript slide show),
180 or the path of a custom lua writer (see [Custom writers](#custom-writers),
181 below). Note that `odt`, `epub`, and `epub3` output will not be directed
182 to *stdout*; an output filename must be specified using the `-o/--output`
183 option. If `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
184 `html`, or `html5`, the output will be rendered as literate Haskell
185 source: see [Literate Haskell support](#literate-haskell-support), below.
186 Markdown syntax extensions can be individually enabled or disabled by
187 appending `+EXTENSION` or `-EXTENSION` to the format name, as described
188 above under `-f`.
190`-o` *FILE*, `--output=`*FILE*
191: Write output to *FILE* instead of *stdout*. If *FILE* is
192 `-`, output will go to *stdout*. (Exception: if the output
193 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
195`--data-dir=`*DIRECTORY*
196: Specify the user data directory to search for pandoc data files.
197 If this option is not specified, the default user data directory
198 will be used. This is
200 $HOME/.pandoc
202 in unix,
204 C:\Documents And Settings\USERNAME\Application Data\pandoc
206 in Windows XP, and
208 C:\Users\USERNAME\AppData\Roaming\pandoc
210 in Windows 7. (You can find the default user data directory
211 on your system by looking at the output of `pandoc --version`.)
212 A `reference.odt`, `reference.docx`, `default.csl`,
213 `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory
214 placed in this directory will override pandoc's normal defaults.
216`-v`, `--version`
217: Print version.
219`-h`, `--help`
220: Show usage message.
222Reader options
223--------------
225`-R`, `--parse-raw`
226: Parse untranslatable HTML codes and LaTeX environments as raw HTML
227 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
228 input. Raw HTML can be printed in markdown, reStructuredText, HTML,
229 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
230 can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
231 The default is for the readers to omit untranslatable HTML codes and
232 LaTeX environments. (The LaTeX reader does pass through untranslatable
233 LaTeX *commands*, even if `-R` is not specified.)
235`-S`, `--smart`
236: Produce typographically correct output, converting straight quotes
237 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
238 `...` to ellipses. Nonbreaking spaces are inserted after certain
239 abbreviations, such as "Mr." (Note: This option is significant only when
240 the input format is `markdown`, `markdown_strict`, or `textile`. It
241 is selected automatically when the input format is `textile` or the
242 output format is `latex` or `context`, unless `--no-tex-ligatures`
243 is used.)
245`--old-dashes`
246: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
247 a numeral is an en-dash, and `--` is an em-dash. This option is selected
248 automatically for `textile` input.
250`--base-header-level=`*NUMBER*
251: Specify the base level for headers (defaults to 1).
253`--indented-code-classes=`*CLASSES*
254: Specify classes to use for indented code blocks--for example,
255 `perl,numberLines` or `haskell`. Multiple classes may be separated
256 by spaces or commas.
258`--default-image-extension=`*EXTENSION*
259: Specify a default extension to use when image paths/URLs have no
260 extension. This allows you to use the same source for formats that
261 require different kinds of images. Currently this option only affects
262 the markdown and LaTeX readers.
264`--filter=`*EXECUTABLE*
265: Specify an executable to be used as a filter transforming the
266 Pandoc AST after the input is parsed and before the output is
267 written. The executable should read JSON from stdin and write
268 JSON to stdout. The JSON must be formatted like pandoc's own
269 JSON input and output. The name of the output format will be
270 passed to the filter as the first argument. Hence,
272 pandoc --filter ./caps.py -t latex
274 is equivalent to
276 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
278 The latter form may be useful for debugging filters.
280 Filters may be written in any language. `Text.Pandoc.JSON`
281 exports `toJSONFilter` to facilitate writing filters in Haskell.
282 Those who would prefer to write filters in python can use the
283 module `pandocfilters`, installable from PyPI. See
284 <http://github.com/jgm/pandocfilters> for the module and several
285 examples. Note that the *EXECUTABLE* will be sought in the user's
286 `PATH`, and not in the working directory, if no directory is
287 provided. If you want to run a script in the working directory,
288 preface the filename with `./`.
290`-M` *KEY[=VAL]*, `--metadata=`*KEY[:VAL]*
291: Set the metadata field *KEY* to the value *VAL*. A value specified
292 on the command line overrides a value specified in the document.
293 Values will be parsed as YAML boolean or string values. If no value is
294 specified, the value will be treated as Boolean true. Like
295 `--variable`, `--metadata` causes template variables to be set.
296 But unlike `--variable`, `--metadata` affects the metadata of the
297 underlying document (which is accessible from filters and may be
298 printed in some output formats).
300`--normalize`
301: Normalize the document after reading: merge adjacent
302 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
304`-p`, `--preserve-tabs`
305: Preserve tabs instead of converting them to spaces (the default).
306 Note that this will only affect tabs in literal code spans and code
307 blocks; tabs in regular text will be treated as spaces.
309`--tab-stop=`*NUMBER*
310: Specify the number of spaces per tab (default is 4).
312`--track-changes=`*accept|reject|all*
313: Specifies what to do with insertions and deletions produced by the MS
314 Word "track-changes" feature. *accept* (the default), inserts all
315 insertions, and ignores all deletions. *reject* inserts all
316 deletions and ignores insertions. *all* puts in both insertions
317 and deletions, wrapped in spans with `insertion` and `deletion`
318 classes, respectively. The author and time of change is
319 included. *all* is useful for scripting: only accepting changes
320 from a certain reviewer, say, or before a certain date. This
321 option only affects the Docx reader.
323General writer options
324----------------------
326`-s`, `--standalone`
327: Produce output with an appropriate header and footer (e.g. a
328 standalone HTML, LaTeX, or RTF file, not a fragment). This option
329 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
330 output.
332`--template=`*FILE*
333: Use *FILE* as a custom template for the generated document. Implies
334 `--standalone`. See [Templates](#templates) below for a description
335 of template syntax. If no extension is specified, an extension
336 corresponding to the writer will be added, so that `--template=special`
337 looks for `special.html` for HTML output. If the template is not
338 found, pandoc will search for it in the user data directory
339 (see `--data-dir`). If this option is not used, a default
340 template appropriate for the output format will be used (see
341 `-D/--print-default-template`).
343`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*
344: Set the template variable *KEY* to the value *VAL* when rendering the
345 document in standalone mode. This is generally only useful when the
346 `--template` option is used to specify a custom template, since
347 pandoc automatically sets the variables used in the default
348 templates. If no *VAL* is specified, the key will be given the
349 value `true`.
351`-D` *FORMAT*, `--print-default-template=`*FORMAT*
352: Print the default template for an output *FORMAT*. (See `-t`
353 for a list of possible *FORMAT*s.)
355`--print-default-data-file=`*FILE*
356: Print a default data file.
358`--no-wrap`
359: Disable text wrapping in output. By default, text is wrapped
360 appropriately for the output format.
362`--columns`=*NUMBER*
363: Specify length of lines in characters (for text wrapping).
365`--toc`, `--table-of-contents`
366: Include an automatically generated table of contents (or, in
367 the case of `latex`, `context`, and `rst`, an instruction to create
368 one) in the output document. This option has no effect on `man`,
369 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
371`--toc-depth=`*NUMBER*
372: Specify the number of section levels to include in the table
373 of contents. The default is 3 (which means that level 1, 2, and 3
374 headers will be listed in the contents).
376`--no-highlight`
377: Disables syntax highlighting for code blocks and inlines, even when
378 a language attribute is given.
380`--highlight-style`=*STYLE*
381: Specifies the coloring style to be used in highlighted source code.
382 Options are `pygments` (the default), `kate`, `monochrome`,
383 `espresso`, `zenburn`, `haddock`, and `tango`.
385`-H` *FILE*, `--include-in-header=`*FILE*
386: Include contents of *FILE*, verbatim, at the end of the header.
387 This can be used, for example, to include special
388 CSS or javascript in HTML documents. This option can be used
389 repeatedly to include multiple files in the header. They will be
390 included in the order specified. Implies `--standalone`.
392`-B` *FILE*, `--include-before-body=`*FILE*
393: Include contents of *FILE*, verbatim, at the beginning of the
394 document body (e.g. after the `<body>` tag in HTML, or the
395 `\begin{document}` command in LaTeX). This can be used to include
396 navigation bars or banners in HTML documents. This option can be
397 used repeatedly to include multiple files. They will be included in
398 the order specified. Implies `--standalone`.
400`-A` *FILE*, `--include-after-body=`*FILE*
401: Include contents of *FILE*, verbatim, at the end of the document
402 body (before the `</body>` tag in HTML, or the
403 `\end{document}` command in LaTeX). This option can be be used
404 repeatedly to include multiple files. They will be included in the
405 order specified. Implies `--standalone`.
407Options affecting specific writers
408----------------------------------
410`--self-contained`
411: Produce a standalone HTML file with no external dependencies, using
412 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
413 images, and videos. The resulting file should be "self-contained,"
414 in the sense that it needs no external files and no net access to be
415 displayed properly by a browser. This option works only with HTML output
416 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
417 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
418 stylesheets at absolute URLs will be downloaded; those at relative URLs
419 will be sought first relative to the working directory, then relative to
420 the user data directory (see `--data-dir`), and finally relative to
421 pandoc's default data directory. `--self-contained` does not
422 work with `--mathjax`.
424`--offline`
425: Deprecated synonym for `--self-contained`.
427`-5`, `--html5`
428: Produce HTML5 instead of HTML4. This option has no effect for writers
429 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
431`--html-q-tags`
432: Use `<q>` tags for quotes in HTML.
434`--ascii`
435: Use only ascii characters in output. Currently supported only
436 for HTML output (which uses numerical entities instead of
437 UTF-8 when this option is selected).
439`--reference-links`
440: Use reference-style links, rather than inline links, in writing markdown
441 or reStructuredText. By default inline links are used.
443`--atx-headers`
444: Use ATX style headers in markdown and asciidoc output. The default is
445 to use setext-style headers for levels 1-2, and then ATX headers.
447`--chapters`
448: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
449 output. When the LaTeX template uses the report, book, or
450 memoir class, this option is implied. If `beamer` is the output
451 format, top-level headers will become `\part{..}`.
453`-N`, `--number-sections`
454: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
455 By default, sections are not numbered. Sections with class
456 `unnumbered` will never be numbered, even if `--number-sections`
457 is specified.
459`--number-offset`=*NUMBER[,NUMBER,...]*,
460: Offset for section headings in HTML output (ignored in other
461 output formats). The first number is added to the section number for
462 top-level headers, the second for second-level headers, and so on.
463 So, for example, if you want the first top-level header in your
464 document to be numbered "6", specify `--number-offset=5`.
465 If your document starts with a level-2 header which you want to
466 be numbered "1.5", specify `--number-offset=1,4`.
467 Offsets are 0 by default. Implies `--number-sections`.
469`--no-tex-ligatures`
470: Do not convert quotation marks, apostrophes, and dashes to
471 the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
472 use literal unicode characters. This is needed for using advanced
473 OpenType features with XeLaTeX and LuaLaTeX. Note: normally
474 `--smart` is selected automatically for LaTeX and ConTeXt
475 output, but it must be specified explicitly if `--no-tex-ligatures`
476 is selected. If you use literal curly quotes, dashes, and ellipses
477 in your source, then you may want to use `--no-tex-ligatures`
478 without `--smart`.
480`--listings`
481: Use listings package for LaTeX code blocks
483`-i`, `--incremental`
484: Make list items in slide shows display incrementally (one by one).
485 The default is for lists to be displayed all at once.
487`--slide-level`=*NUMBER*
488: Specifies that headers with the specified level create
489 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
490 above this level in the hierarchy are used to divide the
491 slide show into sections; headers below this level create
492 subheads within a slide. The default is to set the slide level
493 based on the contents of the document; see
494 [Structuring the slide show](#structuring-the-slide-show), below.
496`--section-divs`
497: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
498 and attach identifiers to the enclosing `<div>` (or `<section>`)
499 rather than the header itself.
500 See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.
502`--email-obfuscation=`*none|javascript|references*
503: Specify a method for obfuscating `mailto:` links in HTML documents.
504 *none* leaves `mailto:` links as they are. *javascript* obfuscates
505 them using javascript. *references* obfuscates them by printing their
506 letters as decimal or hexadecimal character references.
508`--id-prefix`=*STRING*
509: Specify a prefix to be added to all automatically generated identifiers
510 in HTML and DocBook output, and to footnote numbers in markdown output.
511 This is useful for preventing duplicate identifiers when generating
512 fragments to be included in other pages.
514`-T` *STRING*, `--title-prefix=`*STRING*
515: Specify *STRING* as a prefix at the beginning of the title
516 that appears in the HTML header (but not in the title as it
517 appears at the beginning of the HTML body). Implies
518 `--standalone`.
520`-c` *URL*, `--css=`*URL*
521: Link to a CSS style sheet. This option can be be used repeatedly to
522 include multiple files. They will be included in the order specified.
524`--reference-odt=`*FILE*
525: Use the specified file as a style reference in producing an ODT.
526 For best results, the reference ODT should be a modified version
527 of an ODT produced using pandoc. The contents of the reference ODT
528 are ignored, but its stylesheets are used in the new ODT. If no
529 reference ODT is specified on the command line, pandoc will look
530 for a file `reference.odt` in the user data directory (see
531 `--data-dir`). If this is not found either, sensible defaults will be
532 used.
534`--reference-docx=`*FILE*
535: Use the specified file as a style reference in producing a docx file.
536 For best results, the reference docx should be a modified version
537 of a docx file produced using pandoc. The contents of the reference docx
538 are ignored, but its stylesheets and document properties (including
539 margins, page size, header, and footer) are used in the new docx. If no
540 reference docx is specified on the command line, pandoc will look
541 for a file `reference.docx` in the user data directory (see
542 `--data-dir`). If this is not found either, sensible defaults will be
543 used. The following styles are used by pandoc: [paragraph]
544 Normal, Compact, Title, Authors, Date, Heading 1, Heading 2, Heading 3,
545 Heading 4, Heading 5, Block Quote, Definition Term, Definition,
546 Body Text, Table Caption, Image Caption; [character] Default
547 Paragraph Font, Body Text Char, Verbatim Char, Footnote Ref,
548 Link.
550`--epub-stylesheet=`*FILE*
551: Use the specified CSS file to style the EPUB. If no stylesheet
552 is specified, pandoc will look for a file `epub.css` in the
553 user data directory (see `--data-dir`). If it is not
554 found there, sensible defaults will be used.
556`--epub-cover-image=`*FILE*
557: Use the specified image as the EPUB cover. It is recommended
558 that the image be less than 1000px in width and height. Note that
559 in a markdown source document you can also specify `cover-image`
560 in a YAML metadata block (see [EPUB Metadata], below).
562`--epub-metadata=`*FILE*
563: Look in the specified XML file for metadata for the EPUB.
564 The file should contain a series of Dublin Core elements,
565 as documented at <http://dublincore.org/documents/dces/>.
566 For example:
568 <dc:rights>Creative Commons</dc:rights>
569 <dc:language>es-AR</dc:language>
571 By default, pandoc will include the following metadata elements:
572 `<dc:title>` (from the document title), `<dc:creator>` (from the
573 document authors), `<dc:date>` (from the document date, which should
574 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
575 variable, or, if is not set, the locale), and `<dc:identifier
576 id="BookId">` (a randomly generated UUID). Any of these may be
577 overridden by elements in the metadata file.
579 Note: if the source document is markdown, a YAML metadata block
580 in the document can be used instead. See below under
581 [EPUB Metadata].
583`--epub-embed-font=`*FILE*
584: Embed the specified font in the EPUB. This option can be repeated
585 to embed multiple fonts. To use embedded fonts, you
586 will need to add declarations like the following to your CSS (see
587 `--epub-stylesheet`):
589 @font-face {
590 font-family: DejaVuSans;
591 font-style: normal;
592 font-weight: normal;
593 src:url("DejaVuSans-Regular.ttf");
594 }
595 @font-face {
596 font-family: DejaVuSans;
597 font-style: normal;
598 font-weight: bold;
599 src:url("DejaVuSans-Bold.ttf");
600 }
601 @font-face {
602 font-family: DejaVuSans;
603 font-style: italic;
604 font-weight: normal;
605 src:url("DejaVuSans-Oblique.ttf");
606 }
607 @font-face {
608 font-family: DejaVuSans;
609 font-style: italic;
610 font-weight: bold;
611 src:url("DejaVuSans-BoldOblique.ttf");
612 }
613 body { font-family: "DejaVuSans"; }
615`--epub-chapter-level=`*NUMBER*
616: Specify the header level at which to split the EPUB into separate
617 "chapter" files. The default is to split into chapters at level 1
618 headers. This option only affects the internal composition of the
619 EPUB, not the way chapters and sections are displayed to users. Some
620 readers may be slow if the chapter files are too large, so for large
621 documents with few level 1 headers, one might want to use a chapter
622 level of 2 or 3.
624`--latex-engine=`*pdflatex|lualatex|xelatex*
625: Use the specified LaTeX engine when producing PDF output.
626 The default is `pdflatex`. If the engine is not in your PATH,
627 the full path of the engine may be specified here.
629Citation rendering
630------------------
632`--bibliography=`*FILE*
633: Set the `bibliography` field in the document's metadata to *FILE*,
634 overriding any value set in the metadata, and process citations
635 using `pandoc-citeproc`. (This is equivalent to
636 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
638`--csl=`*FILE*
639: Set the `csl` field in the document's metadata to *FILE*,
640 overriding any value set in the metadata. (This is equivalent to
641 `--metadata csl=FILE`.)
643`--citation-abbreviations=`*FILE*
644: Set the `citation-abbreviations` field in the document's metadata to
645 *FILE*, overriding any value set in the metadata. (This is equivalent to
646 `--metadata citation-abbreviations=FILE`.)
648`--natbib`
649: Use natbib for citations in LaTeX output. This option is not for use
650 with the `pandoc-citeproc` filter or with PDF output. It is intended for
651 use in producing a LaTeX file that can be processed with pdflatex and
652 bibtex.
654`--biblatex`
655: Use biblatex for citations in LaTeX output. This option is not for use
656 with the `pandoc-citeproc` filter or with PDF output. It is intended for
657 use in producing a LaTeX file that can be processed with pdflatex and
658 bibtex or biber.
660Math rendering in HTML
661----------------------
663`-m` [*URL*], `--latexmathml`[=*URL*]
664: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
665 To insert a link to a local copy of the `LaTeXMathML.js` script,
666 provide a *URL*. If no *URL* is provided, the contents of the
667 script will be inserted directly into the HTML header, preserving
668 portability at the price of efficiency. If you plan to use math on
669 several pages, it is much better to link to a copy of the script,
670 so it can be cached.
672`--mathml`[=*URL*]
673: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
674 In standalone `html` output, a small javascript (or a link to such a
675 script if a *URL* is supplied) will be inserted that allows the MathML to
676 be viewed on some browsers.
678`--jsmath`[=*URL*]
679: Use [jsMath] to display embedded TeX math in HTML output.
680 The *URL* should point to the jsMath load script (e.g.
681 `jsMath/easy/load.js`); if provided, it will be linked to in
682 the header of standalone HTML documents. If a *URL* is not provided,
683 no link to the jsMath load script will be inserted; it is then
684 up to the author to provide such a link in the HTML template.
686`--mathjax`[=*URL*]
687: Use [MathJax] to display embedded TeX math in HTML output.
688 The *URL* should point to the `MathJax.js` load script.
689 If a *URL* is not provided, a link to the MathJax CDN will
690 be inserted.
692`--gladtex`
693: Enclose TeX math in `<eq>` tags in HTML output. These can then
694 be processed by [gladTeX] to produce links to images of the typeset
695 formulas.
697`--mimetex`[=*URL*]
698: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
699 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
701`--webtex`[=*URL*]
702: Render TeX formulas using an external script that converts TeX
703 formulas to images. The formula will be concatenated with the URL
704 provided. If *URL* is not specified, the Google Chart API will be used.
706Options for wrapper scripts
707---------------------------
709`--dump-args`
710: Print information about command-line arguments to *stdout*, then exit.
711 This option is intended primarily for use in wrapper scripts.
712 The first line of output contains the name of the output file specified
713 with the `-o` option, or `-` (for *stdout*) if no output file was
714 specified. The remaining lines contain the command-line arguments,
715 one per line, in the order they appear. These do not include regular
716 Pandoc options and their arguments, but do include any options appearing
717 after a `--` separator at the end of the line.
719`--ignore-args`
720: Ignore command-line arguments (for use in wrapper scripts).
721 Regular Pandoc options are not ignored. Thus, for example,
723 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
725 is equivalent to
727 pandoc -o foo.html -s
729[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
730[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
731[MathJax]: http://www.mathjax.org/
732[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
733[mimeTeX]: http://www.forkosh.com/mimetex.html
734[CSL]: http://CitationStyles.org
736Templates
737=========
739When the `-s/--standalone` option is used, pandoc uses a template to
740add header and footer material that is needed for a self-standing
741document. To see the default template that is used, just type
743 pandoc -D FORMAT
745where `FORMAT` is the name of the output format. A custom template
746can be specified using the `--template` option. You can also override
747the system default templates for a given output format `FORMAT`
748by putting a file `templates/default.FORMAT` in the user data
749directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
750customize the `default.opendocument` template. For `pdf` output,
751customize the `default.latex` template.
753Templates may contain *variables*. Variable names are sequences of
754alphanumerics, `-`, and `_`, starting with a letter. A variable name
755surrounded by `$` signs will be replaced by its value. For example,
756the string `$title$` in
758 <title>$title$</title>
760will be replaced by the document title.
762To write a literal `$` in a template, use `$$`.
764Some variables are set automatically by pandoc. These vary somewhat
765depending on the output format, but include metadata fields (such
766as `title`, `author`, and `date`) as well as the following:
768`header-includes`
769: contents specified by `-H/--include-in-header` (may have multiple
770 values)
771`toc`
772: non-null value if `--toc/--table-of-contents` was specified
773`include-before`
774: contents specified by `-B/--include-before-body` (may have
775 multiple values)
776`include-after`
777: contents specified by `-A/--include-after-body` (may have
778 multiple values)
779`body`
780: body of document
781`lang`
782: language code for HTML or LaTeX documents
783`slidy-url`
784: base URL for Slidy documents (defaults to
785 `http://www.w3.org/Talks/Tools/Slidy2`)
786`slideous-url`
787: base URL for Slideous documents (defaults to `slideous`)
788`s5-url`
789: base URL for S5 documents (defaults to `s5/default`)
790`revealjs-url`
791: base URL for reveal.js documents (defaults to `reveal.js`)
792`theme`
793: reveal.js or LaTeX beamer theme
794`transition`
795: reveal.js transition
796`fontsize`
797: font size (10pt, 11pt, 12pt) for LaTeX documents
798`documentclass`
799: document class for LaTeX documents
800`classoption`
801: option for LaTeX documentclass, e.g. `oneside`; may be repeated
802 for multiple options
803`geometry`
804: options for LaTeX `geometry` class, e.g. `margin=1in`;
805 may be repeated for multiple options
806`linestretch`
807: adjusts line spacing (requires the `setspace` package)
808`fontfamily`
809: font package to use for LaTeX documents (with pdflatex):
810 TeXLive has `bookman` (Bookman), `utopia` or `fourier` (Utopia),
811 `fouriernc` (New Century Schoolbook), `times` or `txfonts` (Times),
812 `mathpazo` or `pxfonts` or `mathpple` (Palatino),
813 `libertine` (Linux Libertine), `arev` (Arev Sans),
814 and the default `lmodern`, among others.
815`mainfont`, `sansfont`, `monofont`, `mathfont`
816: fonts for LaTeX documents (works only with xelatex
817 and lualatex)
818`colortheme`
819: colortheme for LaTeX beamer documents
820`fonttheme`
821: fonttheme for LaTeX beamer documents
822`linkcolor`
823: color for internal links in LaTeX documents (`red`, `green`,
824 `magenta`, `cyan`, `blue`, `black`)
825`urlcolor`
826: color for external links in LaTeX documents
827`citecolor`
828: color for citation links in LaTeX documents
829`links-as-notes`
830: causes links to be printed as footnotes in LaTeX documents
831`toc`
832: include table of contents in LaTeX documents
833`toc-depth`
834: level of section to include in table of contents in LaTeX documents
835`lof`
836: include list of figures in LaTeX documents
837`lot`
838: include list of tables in LaTeX documents
839`biblio-style`
840: bibliography style in LaTeX, when used with `--natbib`
841`biblio-files`
842: bibliography files to use in LaTeX, with `--natbib` or `--biblatex`
843`section`
844: section number in man pages
845`header`
846: header in man pages
847`footer`
848: footer in man pages
850Variables may be set at the command line using the `-V/--variable`
851option. Variables set in this way override metadata fields with
852the same name.
854Templates may contain conditionals. The syntax is as follows:
856 $if(variable)$
857 X
858 $else$
859 Y
860 $endif$
862This will include `X` in the template if `variable` has a non-null
863value; otherwise it will include `Y`. `X` and `Y` are placeholders for
864any valid template text, and may include interpolated variables or other
865conditionals. The `$else$` section may be omitted.
867When variables can have multiple values (for example, `author` in
868a multi-author document), you can use the `$for$` keyword:
870 $for(author)$
871 <meta name="author" content="$author$" />
872 $endfor$
874You can optionally specify a separator to be used between
875consecutive items:
877 $for(author)$$author$$sep$, $endfor$
879A dot can be used to select a field of a variable that takes
880an object as its value. So, for example:
882 $author.name$ ($author.affiliation$)
884If you use custom templates, you may need to revise them as pandoc
885changes. We recommend tracking the changes in the default templates,
886and modifying your custom templates accordingly. An easy way to do this
887is to fork the pandoc-templates repository
888(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
889pandoc release.
891Pandoc's markdown
892=================
894Pandoc understands an extended and slightly revised version of
895John Gruber's [markdown] syntax. This document explains the syntax,
896noting differences from standard markdown. Except where noted, these
897differences can be suppressed by using the `markdown_strict` format instead
898of `markdown`. An extensions can be enabled by adding `+EXTENSION`
899to the format name and disabled by adding `-EXTENSION`. For example,
900`markdown_strict+footnotes` is strict markdown with footnotes
901enabled, while `markdown-footnotes-pipe_tables` is pandoc's
902markdown without footnotes or pipe tables.
904Philosophy
905----------
907Markdown is designed to be easy to write, and, even more importantly,
908easy to read:
910> A Markdown-formatted document should be publishable as-is, as plain
911> text, without looking like it's been marked up with tags or formatting
912> instructions.
913> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
915This principle has guided pandoc's decisions in finding syntax for
916tables, footnotes, and other extensions.
918There is, however, one respect in which pandoc's aims are different
919from the original aims of markdown. Whereas markdown was originally
920designed with HTML generation in mind, pandoc is designed for multiple
921output formats. Thus, while pandoc allows the embedding of raw HTML,
922it discourages it, and provides other, non-HTMLish ways of representing
923important document elements like definition lists, tables, mathematics, and
924footnotes.
926Paragraphs
927----------
929A paragraph is one or more lines of text followed by one or more blank line.
930Newlines are treated as spaces, so you can reflow your paragraphs as you like.
931If you need a hard line break, put two or more spaces at the end of a line.
933### Extension: `escaped_line_breaks` ###
935A backslash followed by a newline is also a hard line break.
936Note: in multiline and grid table cells, this is the only way
937to create a hard line break, since trailing spaces in the cells
938are ignored.
940Headers
941-------
943There are two kinds of headers, Setext and atx.
945### Setext-style headers ###
947A setext-style header is a line of text "underlined" with a row of `=` signs
948(for a level one header) or `-` signs (for a level two header):
950 A level-one header
951 ==================
953 A level-two header
954 ------------------
956The header text can contain inline formatting, such as emphasis (see
957[Inline formatting](#inline-formatting), below).
960### Atx-style headers ###
962An Atx-style header consists of one to six `#` signs and a line of
963text, optionally followed by any number of `#` signs. The number of
964`#` signs at the beginning of the line is the header level:
966 ## A level-two header
968 ### A level-three header ###
970As with setext-style headers, the header text can contain formatting:
972 # A level-one header with a [link](/url) and *emphasis*
974#### Extension: `blank_before_header` ####
976Standard markdown syntax does not require a blank line before a header.
977Pandoc does require this (except, of course, at the beginning of the
978document). The reason for the requirement is that it is all too easy for a
979`#` to end up at the beginning of a line by accident (perhaps through line
980wrapping). Consider, for example:
982 I like several of their flavors of ice cream:
983 #22, for example, and #5.
986### Header identifiers in HTML, LaTeX, and ConTeXt ###
988#### Extension: `header_attributes` ####
990Headers can be assigned attributes using this syntax at the end
991of the line containing the header text:
993 {#identifier .class .class key=value key=value}
995Thus, for example, the following headers will all be assigned the identifier
996`foo`:
998 # My header {#foo}
1000 ## My header ## {#foo}
1002 My other header {#foo}
1003 ---------------
1005(This syntax is compatible with [PHP Markdown Extra].)
1007Note that although this syntax allows assignment of classes and key/value
1008attributes, writers generally don't use all of this information. Identifiers,
1009classes, and key/value attributes are used in HTML and HTML-based formats such
1010as EPUB and slidy. Identifiers are used for labels and link anchors in the
1011LaTeX, ConTeXt, Textile, and AsciiDoc writers.
1013Headers with the class `unnumbered` will not be numbered, even if
1014`--number-sections` is specified. A single hyphen (`-`) in an attribute
1015context is equivalent to `.unnumbered`, and preferable in non-English
1016documents. So,
1018 # My header {-}
1020is just the same as
1022 # My header {.unnumbered}
1024#### Extension: `auto_identifiers` ####
1026A header without an explicitly specified identifier will be
1027automatically assigned a unique identifier based on the header text.
1028To derive the identifier from the header text,
1030 - Remove all formatting, links, etc.
1031 - Remove all footnotes.
1032 - Remove all punctuation, except underscores, hyphens, and periods.
1033 - Replace all spaces and newlines with hyphens.
1034 - Convert all alphabetic characters to lowercase.
1035 - Remove everything up to the first letter (identifiers may
1036 not begin with a number or punctuation mark).
1037 - If nothing is left after this, use the identifier `section`.
1039Thus, for example,
1041 Header Identifier
1042 ------------------------------- ----------------------------
1043 Header identifiers in HTML `header-identifiers-in-html`
1044 *Dogs*?--in *my* house? `dogs--in-my-house`
1045 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1046 3. Applications `applications`
1047 33 `section`
1049These rules should, in most cases, allow one to determine the identifier
1050from the header text. The exception is when several headers have the
1051same text; in this case, the first will get an identifier as described
1052above; the second will get the same identifier with `-1` appended; the
1053third with `-2`; and so on.
1055These identifiers are used to provide link targets in the table of
1056contents generated by the `--toc|--table-of-contents` option. They
1057also make it easy to provide links from one section of a document to
1058another. A link to this section, for example, might look like this:
1060 See the section on
1061 [header identifiers](#header-identifiers-in-html-latex-and-context).
1063Note, however, that this method of providing links to sections works
1064only in HTML, LaTeX, and ConTeXt formats.
1066If the `--section-divs` option is specified, then each section will
1067be wrapped in a `div` (or a `section`, if `--html5` was specified),
1068and the identifier will be attached to the enclosing `<div>`
1069(or `<section>`) tag rather than the header itself. This allows entire
1070sections to be manipulated using javascript or treated differently in
1071CSS.
1073#### Extension: `implicit_header_references` ####
1075Pandoc behaves as if reference links have been defined for each header.
1076So, instead of
1078 [header identifiers](#header-identifiers-in-html)
1080you can simply write
1082 [header identifiers]
1086 [header identifiers][]
1090 [the section on header identifiers][header identifiers]
1092If there are multiple headers with identical text, the corresponding
1093reference will link to the first one only, and you will need to use explicit
1094links to link to the others, as described above.
1096Unlike regular reference links, these references are case-sensitive.
1098Note: if you have defined an explicit identifier for a header,
1099then implicit references to it will not work.
1101Block quotations
1102----------------
1104Markdown uses email conventions for quoting blocks of text.
1105A block quotation is one or more paragraphs or other block elements
1106(such as lists or headers), with each line preceded by a `>` character
1107and a space. (The `>` need not start at the left margin, but it should
1108not be indented more than three spaces.)
1110 > This is a block quote. This
1111 > paragraph has two lines.
1113 > 1. This is a list inside a block quote.
1114 > 2. Second item.
1116A "lazy" form, which requires the `>` character only on the first
1117line of each block, is also allowed:
1119 > This is a block quote. This
1120 paragraph has two lines.
1122 > 1. This is a list inside a block quote.
1123 2. Second item.
1125Among the block elements that can be contained in a block quote are
1126other block quotes. That is, block quotes can be nested:
1128 > This is a block quote.
1130 > > A block quote within a block quote.
1132### Extension: `blank_before_blockquote` ###
1134Standard markdown syntax does not require a blank line before a block
1135quote. Pandoc does require this (except, of course, at the beginning of the
1136document). The reason for the requirement is that it is all too easy for a
1137`>` to end up at the beginning of a line by accident (perhaps through line
1138wrapping). So, unless the `markdown_strict` format is used, the following does
1139not produce a nested block quote in pandoc:
1141 > This is a block quote.
1142 >> Nested.
1145Verbatim (code) blocks
1146----------------------
1148### Indented code blocks ###
1150A block of text indented four spaces (or one tab) is treated as verbatim
1151text: that is, special characters do not trigger special formatting,
1152and all spaces and line breaks are preserved. For example,
1154 if (a > 3) {
1155 moveShip(5 * gravity, DOWN);
1158The initial (four space or one tab) indentation is not considered part
1159of the verbatim text, and is removed in the output.
1161Note: blank lines in the verbatim text need not begin with four spaces.
1164### Fenced code blocks ###
1166#### Extension: `fenced_code_blocks` ####
1168In addition to standard indented code blocks, Pandoc supports
1169*fenced* code blocks. These begin with a row of three or more
1170tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
1171backticks that must be at least as long as the starting row. Everything
1172between these lines is treated as code. No indentation is necessary:
1174 ~~~~~~~
1175 if (a > 3) {
1176 moveShip(5 * gravity, DOWN);
1178 ~~~~~~~
1180Like regular code blocks, fenced code blocks must be separated
1181from surrounding text by blank lines.
1183If the code itself contains a row of tildes or backticks, just use a longer
1184row of tildes or backticks at the start and end:
1186 ~~~~~~~~~~~~~~~~
1187 ~~~~~~~~~~
1188 code including tildes
1189 ~~~~~~~~~~
1190 ~~~~~~~~~~~~~~~~
1192#### Extension: `fenced_code_attributes` ####
1194Optionally, you may attach attributes to the code block using
1195this syntax:
1197 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1198 qsort [] = []
1199 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1200 qsort (filter (>= x) xs)
1201 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1203Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1204`startFrom` is an attribute with value `100`. Some output formats can use this
1205information to do syntax highlighting. Currently, the only output formats
1206that uses this information are HTML and LaTeX. If highlighting is supported
1207for your output format and language, then the code block above will appear
1208highlighted, with numbered lines. (To see which languages are supported, do
1209`pandoc --version`.) Otherwise, the code block above will appear as follows:
1211 <pre id="mycode" class="haskell numberLines" startFrom="100">
1212 <code>
1213 ...
1214 </code>
1215 </pre>
1217A shortcut form can also be used for specifying the language of
1218the code block:
1220 ```haskell
1221 qsort [] = []
1222 ```
1224This is equivalent to:
1226 ``` {.haskell}
1227 qsort [] = []
1228 ```
1230If the `fenced_code_attributes` extension is disabled, but
1231input contains class attribute(s) for the codeblock, the first
1232class attribute will be printed after the opening fence as a bare
1233word.
1235To prevent all highlighting, use the `--no-highlight` flag.
1236To set the highlighting style, use `--highlight-style`.
1238Line blocks
1239-----------
1241### Extension: `line_blocks` ###
1243A line block is a sequence of lines beginning with a vertical bar (`|`)
1244followed by a space. The division into lines will be preserved in
1245the output, as will any leading spaces; otherwise, the lines will
1246be formatted as markdown. This is useful for verse and addresses:
1248 | The limerick packs laughs anatomical
1249 | In space that is quite economical.
1250 | But the good ones I've seen
1251 | So seldom are clean
1252 | And the clean ones so seldom are comical
1254 | 200 Main St.
1255 | Berkeley, CA 94718
1257The lines can be hard-wrapped if needed, but the continuation
1258line must begin with a space.
1260 | The Right Honorable Most Venerable and Righteous Samuel L.
1261 Constable, Jr.
1262 | 200 Main St.
1263 | Berkeley, CA 94718
1265This syntax is borrowed from [reStructuredText].
1267Lists
1268-----
1270### Bullet lists ###
1272A bullet list is a list of bulleted list items. A bulleted list
1273item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1274example:
1276 * one
1277 * two
1278 * three
1280This will produce a "compact" list. If you want a "loose" list, in which
1281each item is formatted as a paragraph, put spaces between the items:
1283 * one
1285 * two
1287 * three
1289The bullets need not be flush with the left margin; they may be
1290indented one, two, or three spaces. The bullet must be followed
1291by whitespace.
1293List items look best if subsequent lines are flush with the first
1294line (after the bullet):
1296 * here is my first
1297 list item.
1298 * and my second.
1300But markdown also allows a "lazy" format:
1302 * here is my first
1303 list item.
1304 * and my second.
1306### The four-space rule ###
1308A list item may contain multiple paragraphs and other block-level
1309content. However, subsequent paragraphs must be preceded by a blank line
1310and indented four spaces or a tab. The list will look better if the first
1311paragraph is aligned with the rest:
1313 * First paragraph.
1315 Continued.
1317 * Second paragraph. With a code block, which must be indented
1318 eight spaces:
1320 { code }
1322List items may include other lists. In this case the preceding blank
1323line is optional. The nested list must be indented four spaces or
1324one tab:
1326 * fruits
1327 + apples
1328 - macintosh
1329 - red delicious
1330 + pears
1331 + peaches
1332 * vegetables
1333 + broccoli
1334 + chard
1336As noted above, markdown allows you to write list items "lazily," instead of
1337indenting continuation lines. However, if there are multiple paragraphs or
1338other blocks in a list item, the first line of each must be indented.
1340 + A lazy, lazy, list
1341 item.
1343 + Another one; this looks
1344 bad but is legal.
1346 Second paragraph of second
1347 list item.
1349**Note:** Although the four-space rule for continuation paragraphs
1350comes from the official [markdown syntax guide], the reference implementation,
1351`Markdown.pl`, does not follow it. So pandoc will give different results than
1352`Markdown.pl` when authors have indented continuation paragraphs fewer than
1353four spaces.
1355The [markdown syntax guide] is not explicit whether the four-space
1356rule applies to *all* block-level content in a list item; it only
1357mentions paragraphs and code blocks. But it implies that the rule
1358applies to all block-level content (including nested lists), and
1359pandoc interprets it that way.
1361 [markdown syntax guide]:
1362 http://daringfireball.net/projects/markdown/syntax#list
1364### Ordered lists ###
1366Ordered lists work just like bulleted lists, except that the items
1367begin with enumerators rather than bullets.
1369In standard markdown, enumerators are decimal numbers followed
1370by a period and a space. The numbers themselves are ignored, so
1371there is no difference between this list:
1373 1. one
1374 2. two
1375 3. three
1377and this one:
1379 5. one
1380 7. two
1381 1. three
1383#### Extension: `fancy_lists` ####
1385Unlike standard markdown, Pandoc allows ordered list items to be marked
1386with uppercase and lowercase letters and roman numerals, in addition to
1387arabic numerals. List markers may be enclosed in parentheses or followed by a
1388single right-parentheses or period. They must be separated from the
1389text that follows by at least one space, and, if the list marker is a
1390capital letter with a period, by at least two spaces.[^2]
1392[^2]: The point of this rule is to ensure that normal paragraphs
1393 starting with people's initials, like
1395 B. Russell was an English philosopher.
1397 do not get treated as list items.
1399 This rule will not prevent
1401 (C) 2007 Joe Smith
1403 from being interpreted as a list item. In this case, a backslash
1404 escape can be used:
1406 (C\) 2007 Joe Smith
1408The `fancy_lists` extension also allows '`#`' to be used as an
1409ordered list marker in place of a numeral:
1411 #. one
1412 #. two
1414#### Extension: `startnum` ####
1416Pandoc also pays attention to the type of list marker used, and to the
1417starting number, and both of these are preserved where possible in the
1418output format. Thus, the following yields a list with numbers followed
1419by a single parenthesis, starting with 9, and a sublist with lowercase
1420roman numerals:
1422 9) Ninth
1423 10) Tenth
1424 11) Eleventh
1425 i. subone
1426 ii. subtwo
1427 iii. subthree
1429Pandoc will start a new list each time a different type of list
1430marker is used. So, the following will create three lists:
1432 (2) Two
1433 (5) Three
1434 1. Four
1435 * Five
1437If default list markers are desired, use `#.`:
1439 #. one
1440 #. two
1441 #. three
1444### Definition lists ###
1446#### Extension: `definition_lists` ####
1448Pandoc supports definition lists, using the syntax of
1449[PHP Markdown Extra] with some extensions.[^3]
1451 Term 1
1453 : Definition 1
1455 Term 2 with *inline markup*
1457 : Definition 2
1459 { some code, part of Definition 2 }
1461 Third paragraph of definition 2.
1463Each term must fit on one line, which may optionally be followed by
1464a blank line, and must be followed by one or more definitions.
1465A definition begins with a colon or tilde, which may be indented one
1466or two spaces.
1468A term may have multiple definitions, and each definition may consist of one or
1469more block elements (paragraph, code block, list, etc.), each indented four
1470spaces or one tab stop. The body of the definition (including the first line,
1471aside from the colon or tilde) should be indented four spaces. However,
1472as with other markdown lists, you can "lazily" omit indentation except
1473at the beginning of a paragraph or other block element:
1475 Term 1
1477 : Definition
1478 with lazy continuation.
1480 Second paragraph of the definition.
1482If you leave space before the definition (as in the example above),
1483the text of the definition will be treated as a paragraph. In some
1484output formats, this will mean greater spacing between term/definition
1485pairs. For a more compact definition list, omit the space before the
1486definition:
1488 Term 1
1489 ~ Definition 1
1491 Term 2
1492 ~ Definition 2a
1493 ~ Definition 2b
1495Note that space between items in a definition list is required.
1496(A variant that loosens this requirement, but disallows "lazy"
1497hard wrapping, can be activated with `compact_definition_lists`: see
1498[Non-pandoc extensions](#non-pandoc-extensions), below.)
1500[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1502[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1505### Numbered example lists ###
1507#### Extension: `example_lists` ####
1509The special list marker `@` can be used for sequentially numbered
1510examples. The first list item with a `@` marker will be numbered '1',
1511the next '2', and so on, throughout the document. The numbered examples
1512need not occur in a single list; each new list using `@` will take up
1513where the last stopped. So, for example:
1515 (@) My first example will be numbered (1).
1516 (@) My second example will be numbered (2).
1518 Explanation of examples.
1520 (@) My third example will be numbered (3).
1522Numbered examples can be labeled and referred to elsewhere in the
1523document:
1525 (@good) This is a good example.
1527 As (@good) illustrates, ...
1529The label can be any string of alphanumeric characters, underscores,
1530or hyphens.
1533### Compact and loose lists ###
1535Pandoc behaves differently from `Markdown.pl` on some "edge
1536cases" involving lists. Consider this source:
1538 + First
1539 + Second:
1540 - Fee
1541 - Fie
1542 - Foe
1544 + Third
1546Pandoc transforms this into a "compact list" (with no `<p>` tags around
1547"First", "Second", or "Third"), while markdown puts `<p>` tags around
1548"Second" and "Third" (but not "First"), because of the blank space
1549around "Third". Pandoc follows a simple rule: if the text is followed by
1550a blank line, it is treated as a paragraph. Since "Second" is followed
1551by a list, and not a blank line, it isn't treated as a paragraph. The
1552fact that the list is followed by a blank line is irrelevant. (Note:
1553Pandoc works this way even when the `markdown_strict` format is specified. This
1554behavior is consistent with the official markdown syntax description,
1555even though it is different from that of `Markdown.pl`.)
1558### Ending a list ###
1560What if you want to put an indented code block after a list?
1562 - item one
1563 - item two
1565 { my code block }
1567Trouble! Here pandoc (like other markdown implementations) will treat
1568`{ my code block }` as the second paragraph of item two, and not as
1569a code block.
1571To "cut off" the list after item two, you can insert some non-indented
1572content, like an HTML comment, which won't produce visible output in
1573any format:
1575 - item one
1576 - item two
1578 <!-- end of list -->
1580 { my code block }
1582You can use the same trick if you want two consecutive lists instead
1583of one big list:
1585 1. one
1586 2. two
1587 3. three
1589 <!-- -->
1591 1. uno
1592 2. dos
1593 3. tres
1595Horizontal rules
1596----------------
1598A line containing a row of three or more `*`, `-`, or `_` characters
1599(optionally separated by spaces) produces a horizontal rule:
1601 * * * *
1603 ---------------
1606Tables
1607------
1609Four kinds of tables may be used. The first three kinds presuppose the use of
1610a fixed-width font, such as Courier. The fourth kind can be used with
1611proportionally spaced fonts, as it does not require lining up columns.
1613### Simple tables ###
1615#### Extension: `simple_tables`, `table_captions` ####
1617Simple tables look like this:
1619 Right Left Center Default
1620 ------- ------ ---------- -------
1621 12 12 12 12
1622 123 123 123 123
1623 1 1 1 1
1625 Table: Demonstration of simple table syntax.
1627The headers and table rows must each fit on one line. Column
1628alignments are determined by the position of the header text relative
1629to the dashed line below it:[^4]
1631 - If the dashed line is flush with the header text on the right side
1632 but extends beyond it on the left, the column is right-aligned.
1633 - If the dashed line is flush with the header text on the left side
1634 but extends beyond it on the right, the column is left-aligned.
1635 - If the dashed line extends beyond the header text on both sides,
1636 the column is centered.
1637 - If the dashed line is flush with the header text on both sides,
1638 the default alignment is used (in most cases, this will be left).
1640[^4]: This scheme is due to Michel Fortin, who proposed it on the
1641 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1643The table must end with a blank line, or a line of dashes followed by
1644a blank line. A caption may optionally be provided (as illustrated in
1645the example above). A caption is a paragraph beginning with the string
1646`Table:` (or just `:`), which will be stripped off. It may appear either
1647before or after the table.
1649The column headers may be omitted, provided a dashed line is used
1650to end the table. For example:
1652 ------- ------ ---------- -------
1653 12 12 12 12
1654 123 123 123 123
1655 1 1 1 1
1656 ------- ------ ---------- -------
1658When headers are omitted, column alignments are determined on the basis
1659of the first line of the table body. So, in the tables above, the columns
1660would be right, left, center, and right aligned, respectively.
1662### Multiline tables ###
1664#### Extension: `multiline_tables`, `table_captions` ####
1666Multiline tables allow headers and table rows to span multiple lines
1667of text (but cells that span multiple columns or rows of the table are
1668not supported). Here is an example:
1670 -------------------------------------------------------------
1671 Centered Default Right Left
1672 Header Aligned Aligned Aligned
1673 ----------- ------- --------------- -------------------------
1674 First row 12.0 Example of a row that
1675 spans multiple lines.
1677 Second row 5.0 Here's another one. Note
1678 the blank line between
1679 rows.
1680 -------------------------------------------------------------
1682 Table: Here's the caption. It, too, may span
1683 multiple lines.
1685These work like simple tables, but with the following differences:
1687 - They must begin with a row of dashes, before the header text
1688 (unless the headers are omitted).
1689 - They must end with a row of dashes, then a blank line.
1690 - The rows must be separated by blank lines.
1692In multiline tables, the table parser pays attention to the widths of
1693the columns, and the writers try to reproduce these relative widths in
1694the output. So, if you find that one of the columns is too narrow in the
1695output, try widening it in the markdown source.
1697Headers may be omitted in multiline tables as well as simple tables:
1699 ----------- ------- --------------- -------------------------
1700 First row 12.0 Example of a row that
1701 spans multiple lines.
1703 Second row 5.0 Here's another one. Note
1704 the blank line between
1705 rows.
1706 ----------- ------- --------------- -------------------------
1708 : Here's a multiline table without headers.
1710It is possible for a multiline table to have just one row, but the row
1711should be followed by a blank line (and then the row of dashes that ends
1712the table), or the table may be interpreted as a simple table.
1714### Grid tables ###
1716#### Extension: `grid_tables`, `table_captions` ####
1718Grid tables look like this:
1720 : Sample grid table.
1722 +---------------+---------------+--------------------+
1723 | Fruit | Price | Advantages |
1724 +===============+===============+====================+
1725 | Bananas | $1.34 | - built-in wrapper |
1726 | | | - bright color |
1727 +---------------+---------------+--------------------+
1728 | Oranges | $2.10 | - cures scurvy |
1729 | | | - tasty |
1730 +---------------+---------------+--------------------+
1732The row of `=`s separates the header from the table body, and can be
1733omitted for a headerless table. The cells of grid tables may contain
1734arbitrary block elements (multiple paragraphs, code blocks, lists,
1735etc.). Alignments are not supported, nor are cells that span multiple
1736columns or rows. Grid tables can be created easily using [Emacs table mode].
1738 [Emacs table mode]: http://table.sourceforge.net/
1740### Pipe tables ###
1742#### Extension: `pipe_tables`, `table_captions` ####
1744Pipe tables look like this:
1746 | Right | Left | Default | Center |
1747 |------:|:-----|---------|:------:|
1748 | 12 | 12 | 12 | 12 |
1749 | 123 | 123 | 123 | 123 |
1750 | 1 | 1 | 1 | 1 |
1752 : Demonstration of simple table syntax.
1754The syntax is [the same as in PHP markdown extra]. The beginning and
1755ending pipe characters are optional, but pipes are required between all
1756columns. The colons indicate column alignment as shown. The header
1757can be omitted, but the horizontal line must still be included, as
1758it defines column alignments.
1760Since the pipes indicate column boundaries, columns need not be vertically
1761aligned, as they are in the above example. So, this is a perfectly
1762legal (though ugly) pipe table:
1764 fruit| price
1765 -----|-----:
1766 apple|2.05
1767 pear|1.37
1768 orange|3.09
1770The cells of pipe tables cannot contain block elements like paragraphs
1771and lists, and cannot span multiple lines.
1773 [the same as in PHP markdown extra]:
1774 http://michelf.ca/projects/php-markdown/extra/#table
1776Note: Pandoc also recognizes pipe tables of the following
1777form, as can produced by Emacs' orgtbl-mode:
1779 | One | Two |
1780 |-----+-------|
1781 | my | table |
1782 | is | nice |
1784The difference is that `+` is used instead of `|`. Other orgtbl features
1785are not supported. In particular, to get non-default column alignment,
1786you'll need to add colons as above.
1788Title block
1789-----------
1791### Extension: `pandoc_title_block` ###
1793If the file begins with a title block
1795 % title
1796 % author(s) (separated by semicolons)
1797 % date
1799it will be parsed as bibliographic information, not regular text. (It
1800will be used, for example, in the title of standalone LaTeX or HTML
1801output.) The block may contain just a title, a title and an author,
1802or all three elements. If you want to include an author but no
1803title, or a title and a date but no author, you need a blank line:
1806 % Author
1808 % My title
1810 % June 15, 2006
1812The title may occupy multiple lines, but continuation lines must
1813begin with leading space, thus:
1815 % My title
1816 on multiple lines
1818If a document has multiple authors, the authors may be put on
1819separate lines with leading space, or separated by semicolons, or
1820both. So, all of the following are equivalent:
1822 % Author One
1823 Author Two
1825 % Author One; Author Two
1827 % Author One;
1828 Author Two
1830The date must fit on one line.
1832All three metadata fields may contain standard inline formatting
1833(italics, links, footnotes, etc.).
1835Title blocks will always be parsed, but they will affect the output only
1836when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1837will appear twice: once in the document head -- this is the title that
1838will appear at the top of the window in a browser -- and once at the
1839beginning of the document body. The title in the document head can have
1840an optional prefix attached (`--title-prefix` or `-T` option). The title
1841in the body appears as an H1 element with class "title", so it can be
1842suppressed or reformatted with CSS. If a title prefix is specified with
1843`-T` and no title block appears in the document, the title prefix will
1844be used by itself as the HTML title.
1846The man page writer extracts a title, man page section number, and
1847other header and footer information from the title line. The title
1848is assumed to be the first word on the title line, which may optionally
1849end with a (single-digit) section number in parentheses. (There should
1850be no space between the title and the parentheses.) Anything after
1851this is assumed to be additional footer and header text. A single pipe
1852character (`|`) should be used to separate the footer text from the header
1853text. Thus,
1855 % PANDOC(1)
1857will yield a man page with the title `PANDOC` and section 1.
1859 % PANDOC(1) Pandoc User Manuals
1861will also have "Pandoc User Manuals" in the footer.
1863 % PANDOC(1) Pandoc User Manuals | Version 4.0
1865will also have "Version 4.0" in the header.
1867YAML metadata block
1868-------------------
1870### Extension: `yaml_metadata_block` ###
1872A YAML metadata block is a valid YAML object, delimited by a line of three
1873hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
1874(`...`) at the bottom. A YAML metadata block may occur anywhere in the
1875document, but if it is not at the beginning, it must be preceded by a blank
1876line. (Note that, because of the way pandoc concatenates input files when
1877several are provided, you may also keep the metadata in a separate YAML file
1878and pass it to pandoc as an argument, along with your markdown files:
1880 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
1882Just be sure that the YAML file begins with `---` and ends with `---` or
1883`...`.)
1885Metadata will be taken from the fields of the YAML object and added to any
1886existing document metadata. Metadata can contain lists and objects (nested
1887arbitrarily), but all string scalars will be interpreted as markdown. Fields
1888with names ending in an underscore will be ignored by pandoc. (They may be
1889given a role by external processors.)
1891A document may contain multiple metadata blocks. The metadata fields will
1892be combined through a *left-biased union*: if two metadata blocks attempt
1893to set the same field, the value from the first block will be taken.
1895Note that YAML escaping rules must be followed. Thus, for example,
1896if a title contains a colon, it must be quoted. The pipe character
1897(`|`) can be used to begin an indented block that will be interpreted
1898literally, without need for escaping. This form is necessary
1899when the field contains blank lines:
1901 ---
1902 title: 'This is the title: it contains a colon'
1903 author:
1904 - name: Author One
1905 affiliation: University of Somewhere
1906 - name: Author Two
1907 affiliation: University of Nowhere
1908 tags: [nothing, nothingness]
1909 abstract: |
1910 This is the abstract.
1912 It consists of two paragraphs.
1913 ...
1915Template variables will be set automatically from the metadata. Thus, for
1916example, in writing HTML, the variable `abstract` will be set to the HTML
1917equivalent of the markdown in the `abstract` field:
1919 <p>This is the abstract.</p>
1920 <p>It consists of two paragraphs.</p>
1922Note: The `author` variable in the default templates expects a simple list or
1923string. To use the structured authors in the example, you would need a
1924custom template. For example:
1926 $for(author)$
1927 $if(author.name)$
1928 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
1929 $else$
1930 $author$
1931 $endif$
1932 $endfor$
1935Backslash escapes
1936-----------------
1938### Extension: `all_symbols_escapable` ###
1940Except inside a code block or inline code, any punctuation or space
1941character preceded by a backslash will be treated literally, even if it
1942would normally indicate formatting. Thus, for example, if one writes
1944 *\*hello\**
1946one will get
1948 <em>*hello*</em>
1950instead of
1952 <strong>hello</strong>
1954This rule is easier to remember than standard markdown's rule,
1955which allows only the following characters to be backslash-escaped:
1957 \`*_{}[]()>#+-.!
1959(However, if the `markdown_strict` format is used, the standard markdown rule
1960will be used.)
1962A backslash-escaped space is parsed as a nonbreaking space. It will
1963appear in TeX output as `~` and in HTML and XML as `\&#160;` or
1964`\&nbsp;`.
1966A backslash-escaped newline (i.e. a backslash occurring at the end of
1967a line) is parsed as a hard line break. It will appear in TeX output as
1968`\\` and in HTML as `<br />`. This is a nice alternative to
1969markdown's "invisible" way of indicating hard line breaks using
1970two trailing spaces on a line.
1972Backslash escapes do not work in verbatim contexts.
1974Smart punctuation
1975-----------------
1977### Extension ###
1979If the `--smart` option is specified, pandoc will produce typographically
1980correct output, converting straight quotes to curly quotes, `---` to
1981em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
1982are inserted after certain abbreviations, such as "Mr."
1984Note: if your LaTeX template uses the `csquotes` package, pandoc will
1985detect automatically this and use `\enquote{...}` for quoted text.
1987Inline formatting
1988-----------------
1990### Emphasis ###
1992To *emphasize* some text, surround it with `*`s or `_`, like this:
1994 This text is _emphasized with underscores_, and this
1995 is *emphasized with asterisks*.
1997Double `*` or `_` produces **strong emphasis**:
1999 This is **strong emphasis** and __with underscores__.
2001A `*` or `_` character surrounded by spaces, or backslash-escaped,
2002will not trigger emphasis:
2004 This is * not emphasized *, and \*neither is this\*.
2006#### Extension: `intraword_underscores` ####
2008Because `_` is sometimes used inside words and identifiers,
2009pandoc does not interpret a `_` surrounded by alphanumeric
2010characters as an emphasis marker. If you want to emphasize
2011just part of a word, use `*`:
2013 feas*ible*, not feas*able*.
2016### Strikeout ###
2018#### Extension: `strikeout` ####
2020To strikeout a section of text with a horizontal line, begin and end it
2021with `~~`. Thus, for example,
2023 This ~~is deleted text.~~
2026### Superscripts and subscripts ###
2028#### Extension: `superscript`, `subscript` ####
2030Superscripts may be written by surrounding the superscripted text by `^`
2031characters; subscripts may be written by surrounding the subscripted
2032text by `~` characters. Thus, for example,
2034 H~2~O is a liquid. 2^10^ is 1024.
2036If the superscripted or subscripted text contains spaces, these spaces
2037must be escaped with backslashes. (This is to prevent accidental
2038superscripting and subscripting through the ordinary use of `~` and `^`.)
2039Thus, if you want the letter P with 'a cat' in subscripts, use
2040`P~a\ cat~`, not `P~a cat~`.
2043### Verbatim ###
2045To make a short span of text verbatim, put it inside backticks:
2047 What is the difference between `>>=` and `>>`?
2049If the verbatim text includes a backtick, use double backticks:
2051 Here is a literal backtick `` ` ``.
2053(The spaces after the opening backticks and before the closing
2054backticks will be ignored.)
2056The general rule is that a verbatim span starts with a string
2057of consecutive backticks (optionally followed by a space)
2058and ends with a string of the same number of backticks (optionally
2059preceded by a space).
2061Note that backslash-escapes (and other markdown constructs) do not
2062work in verbatim contexts:
2064 This is a backslash followed by an asterisk: `\*`.
2066#### Extension: `inline_code_attributes` ####
2068Attributes can be attached to verbatim text, just as with
2069[fenced code blocks](#fenced-code-blocks):
2071 `<$>`{.haskell}
2073### Small caps ###
2075To write small caps, you can use an HTML span tag:
2077 <span style="font-variant:small-caps;">Small caps</span>
2079(The semicolon is optional and there may be space after the
2080colon.) This will work in all output formats that support small caps.
2082Math
2083----
2085### Extension: `tex_math_dollars` ###
2087Anything between two `$` characters will be treated as TeX math. The
2088opening `$` must have a character immediately to its right, while the
2089closing `$` must have a character immediately to its left. Thus,
2090`$20,000 and $30,000` won't parse as math. If for some reason
2091you need to enclose text in literal `$` characters, backslash-escape
2092them and they won't be treated as math delimiters.
2094TeX math will be printed in all output formats. How it is rendered
2095depends on the output format:
2097Markdown, LaTeX, Org-Mode, ConTeXt
2098 ~ It will appear verbatim between `$` characters.
2100reStructuredText
2101 ~ It will be rendered using an interpreted text role `:math:`, as described
2102 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
2104AsciiDoc
2105 ~ It will be rendered as `latexmath:[...]`.
2107Texinfo
2108 ~ It will be rendered inside a `@math` command.
2110groff man
2111 ~ It will be rendered verbatim without `$`'s.
2113MediaWiki, DokuWiki
2114 ~ It will be rendered inside `<math>` tags.
2116Textile
2117 ~ It will be rendered inside `<span class="math">` tags.
2119RTF, OpenDocument, ODT
2120 ~ It will be rendered, if possible, using unicode characters,
2121 and will otherwise appear verbatim.
2123Docbook
2124 ~ If the `--mathml` flag is used, it will be rendered using mathml
2125 in an `inlineequation` or `informalequation` tag. Otherwise it
2126 will be rendered, if possible, using unicode characters.
2128Docx
2129 ~ It will be rendered using OMML math markup.
2131FictionBook2
2132 ~ If the `--webtex` option is used, formulas are rendered as images
2133 using Google Charts or other compatible web service, downloaded
2134 and embedded in the e-book. Otherwise, they will appear verbatim.
2136HTML, Slidy, DZSlides, S5, EPUB
2137 ~ The way math is rendered in HTML will depend on the
2138 command-line options selected:
2140 1. The default is to render TeX math as far as possible using unicode
2141 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2142 are put inside a `span` with `class="math"`, so that they may be
2143 styled differently from the surrounding text if needed.
2145 2. If the `--latexmathml` option is used, TeX math will be displayed
2146 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2147 The [LaTeXMathML] script will be used to render it as formulas.
2148 (This trick does not work in all browsers, but it works in Firefox.
2149 In browsers that do not support LaTeXMathML, TeX math will appear
2150 verbatim between `$` characters.)
2152 3. If the `--jsmath` option is used, TeX math will be put inside
2153 `<span>` tags (for inline math) or `<div>` tags (for display math)
2154 with class `math`. The [jsMath] script will be used to render
2155 it.
2157 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2158 be called to generate images for each TeX formula. This should
2159 work in all browsers. The `--mimetex` option takes an optional URL
2160 as argument. If no URL is specified, it will be assumed that the
2161 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2163 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2164 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2165 be processed by [gladTeX], which will produce image files for each
2166 formula and an `html` file with links to these images. So, the
2167 procedure is:
2169 pandoc -s --gladtex myfile.txt -o myfile.htex
2170 gladtex -d myfile-images myfile.htex
2171 # produces myfile.html and images in myfile-images
2173 6. If the `--webtex` option is used, TeX formulas will be converted
2174 to `<img>` tags that link to an external script that converts
2175 formulas to images. The formula will be URL-encoded and concatenated
2176 with the URL provided. If no URL is specified, the Google Chart
2177 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2179 7. If the `--mathjax` option is used, TeX math will be displayed
2180 between `\(...\)` (for inline math) or `\[...\]` (for display
2181 math) and put in `<span>` tags with class `math`.
2182 The [MathJax] script will be used to render it as formulas.
2184Raw HTML
2185--------
2187### Extension: `raw_html` ###
2189Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2190(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2191literally). (Technically this is not an extension, since standard
2192markdown allows it, but it has been made an extension so that it can
2193be disabled if desired.)
2195The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2196DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2197formats.
2199### Extension: `markdown_in_html_blocks` ###
2201Standard markdown allows you to include HTML "blocks": blocks
2202of HTML between balanced tags that are separated from the surrounding text
2203with blank lines, and start and end at the left margin. Within
2204these blocks, everything is interpreted as HTML, not markdown;
2205so (for example), `*` does not signify emphasis.
2207Pandoc behaves this way when the `markdown_strict` format is used; but
2208by default, pandoc interprets material between HTML block tags as markdown.
2209Thus, for example, Pandoc will turn
2211 <table>
2212 <tr>
2213 <td>*one*</td>
2214 <td>[a link](http://google.com)</td>
2215 </tr>
2216 </table>
2218into
2220 <table>
2221 <tr>
2222 <td><em>one</em></td>
2223 <td><a href="http://google.com">a link</a></td>
2224 </tr>
2225 </table>
2227whereas `Markdown.pl` will preserve it as is.
2229There is one exception to this rule: text between `<script>` and
2230`<style>` tags is not interpreted as markdown.
2232This departure from standard markdown should make it easier to mix
2233markdown with HTML block elements. For example, one can surround
2234a block of markdown text with `<div>` tags without preventing it
2235from being interpreted as markdown.
2237Raw TeX
2238-------
2240### Extension: `raw_tex` ###
2242In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2243included in a document. Inline TeX commands will be preserved and passed
2244unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2245LaTeX to include BibTeX citations:
2247 This result was proved in \cite{jones.1967}.
2249Note that in LaTeX environments, like
2251 \begin{tabular}{|l|l|}\hline
2252 Age & Frequency \\ \hline
2253 18--25 & 15 \\
2254 26--35 & 33 \\
2255 36--45 & 22 \\ \hline
2256 \end{tabular}
2258the material between the begin and end tags will be interpreted as raw
2259LaTeX, not as markdown.
2261Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2262and ConTeXt.
2264LaTeX macros
2265------------
2267### Extension: `latex_macros` ###
2269For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2270`\renewcommand` definitions and apply the resulting macros to all LaTeX
2271math. So, for example, the following will work in all output formats,
2272not just LaTeX:
2274 \newcommand{\tuple}[1]{\langle #1 \rangle}
2276 $\tuple{a, b, c}$
2278In LaTeX output, the `\newcommand` definition will simply be passed
2279unchanged to the output.
2282Links
2283-----
2285Markdown allows links to be specified in several ways.
2287### Automatic links ###
2289If you enclose a URL or email address in pointy brackets, it
2290will become a link:
2292 <http://google.com>
2293 <sam@green.eggs.ham>
2295### Inline links ###
2297An inline link consists of the link text in square brackets,
2298followed by the URL in parentheses. (Optionally, the URL can
2299be followed by a link title, in quotes.)
2301 This is an [inline link](/url), and here's [one with
2302 a title](http://fsf.org "click here for a good time!").
2304There can be no space between the bracketed part and the parenthesized part.
2305The link text can contain formatting (such as emphasis), but the title cannot.
2308### Reference links ###
2310An *explicit* reference link has two parts, the link itself and the link
2311definition, which may occur elsewhere in the document (either
2312before or after the link).
2314The link consists of link text in square brackets, followed by a label in
2315square brackets. (There can be space between the two.) The link definition
2316consists of the bracketed label, followed by a colon and a space, followed by
2317the URL, and optionally (after a space) a link title either in quotes or in
2318parentheses.
2320Here are some examples:
2322 [my label 1]: /foo/bar.html "My title, optional"
2323 [my label 2]: /foo
2324 [my label 3]: http://fsf.org (The free software foundation)
2325 [my label 4]: /bar#special 'A title in single quotes'
2327The URL may optionally be surrounded by angle brackets:
2329 [my label 5]: <http://foo.bar.baz>
2331The title may go on the next line:
2333 [my label 3]: http://fsf.org
2334 "The free software foundation"
2336Note that link labels are not case sensitive. So, this will work:
2338 Here is [my link][FOO]
2340 [Foo]: /bar/baz
2342In an *implicit* reference link, the second pair of brackets is
2343empty, or omitted entirely:
2345 See [my website][], or [my website].
2347 [my website]: http://foo.bar.baz
2349Note: In `Markdown.pl` and most other markdown implementations,
2350reference link definitions cannot occur in nested constructions
2351such as list items or block quotes. Pandoc lifts this arbitrary
2352seeming restriction. So the following is fine in pandoc, though
2353not in most other implementations:
2355 > My block [quote].
2357 > [quote]: /foo
2359### Internal links ###
2361To link to another section of the same document, use the automatically
2362generated identifier (see [Header identifiers in HTML, LaTeX, and
2363ConTeXt](#header-identifiers-in-html-latex-and-context), below).
2364For example:
2366 See the [Introduction](#introduction).
2370 See the [Introduction].
2372 [Introduction]: #introduction
2374Internal links are currently supported for HTML formats (including
2375HTML slide shows and EPUB), LaTeX, and ConTeXt.
2377Images
2378------
2380A link immediately preceded by a `!` will be treated as an image.
2381The link text will be used as the image's alt text:
2383 ![la lune](lalune.jpg "Voyage to the moon")
2385 ![movie reel]
2387 [movie reel]: movie.gif
2389### Pictures with captions ###
2391#### Extension: `implicit_figures` ####
2393An image occurring by itself in a paragraph will be rendered as
2394a figure with a caption.[^5] (In LaTeX, a figure environment will be
2395used; in HTML, the image will be placed in a `div` with class
2396`figure`, together with a caption in a `p` with class `caption`.)
2397The image's alt text will be used as the caption.
2399 ![This is the caption](/url/of/image.png)
2401[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2402 ODT. In those formats, you'll just get an image in a paragraph by
2403 itself, with no caption.
2405If you just want a regular inline image, just make sure it is not
2406the only thing in the paragraph. One way to do this is to insert a
2407nonbreaking space after the image:
2409 ![This image won't be a figure](/url/of/image.png)\
2412Footnotes
2413---------
2415### Extension: `footnotes` ###
2417Pandoc's markdown allows footnotes, using the following syntax:
2419 Here is a footnote reference,[^1] and another.[^longnote]
2421 [^1]: Here is the footnote.
2423 [^longnote]: Here's one with multiple blocks.
2425 Subsequent paragraphs are indented to show that they
2426 belong to the previous footnote.
2428 { some.code }
2430 The whole paragraph can be indented, or just the first
2431 line. In this way, multi-paragraph footnotes work like
2432 multi-paragraph list items.
2434 This paragraph won't be part of the note, because it
2435 isn't indented.
2437The identifiers in footnote references may not contain spaces, tabs,
2438or newlines. These identifiers are used only to correlate the
2439footnote reference with the note itself; in the output, footnotes
2440will be numbered sequentially.
2442The footnotes themselves need not be placed at the end of the
2443document. They may appear anywhere except inside other block elements
2444(lists, block quotes, tables, etc.).
2446### Extension: `inline_notes` ###
2448Inline footnotes are also allowed (though, unlike regular notes,
2449they cannot contain multiple paragraphs). The syntax is as follows:
2451 Here is an inline note.^[Inlines notes are easier to write, since
2452 you don't have to pick an identifier and move down to type the
2453 note.]
2455Inline and regular footnotes may be mixed freely.
2458Citations
2459---------
2461### Extension: `citations` ###
2463Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2464citations and a bibliography in a number of styles. Basic usage is
2466 pandoc --filter pandoc-citeproc myinput.txt
2468In order to use this feature, you will need to specify a bibliography file
2469using the `bibliography` metadata field in a YAML metadata section.
2470The bibliography may have any of these formats:
2472 Format File extension
2473 ------------ --------------
2474 MODS .mods
2475 BibLaTeX .bib
2476 BibTeX .bibtex
2477 RIS .ris
2478 EndNote .enl
2479 EndNote XML .xml
2480 ISI .wos
2481 MEDLINE .medline
2482 Copac .copac
2483 JSON citeproc .json
2485Note that `.bib` can generally be used with both BibTeX and BibLaTeX
2486files, but you can use `.bibtex` to force BibTeX.
2488Alternatively you can use a `references` field in the document's YAML
2489metadata. This should include an array of YAML-encoded references,
2490for example:
2492 ---
2493 references:
2494 - id: fenner2012a
2495 title: One-click science marketing
2496 author:
2497 - family: Fenner
2498 given: Martin
2499 container-title: Nature Materials
2500 volume: 11
2501 URL: 'http://dx.doi.org/10.1038/nmat3283'
2502 DOI: 10.1038/nmat3283
2503 issue: 4
2504 publisher: Nature Publishing Group
2505 page: 261-263
2506 type: article-journal
2507 issued:
2508 year: 2012
2509 month: 3
2510 ...
2512(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce
2513these from a MODS reference collection.)
2515By default, `pandoc-citeproc` will use a Chicago author-date format for
2516citations and references. To use another style, you will need to specify
2517a [CSL] 1.0 style file in the `csl` metadata field. A primer on creating and
2518modifying CSL styles can be found at
2519<http://citationstyles.org/downloads/primer.html>. A repository of CSL styles
2520can be found at <https://github.com/citation-style-language/styles>. See also
2521<http://zotero.org/styles> for easy browsing.
2523Citations go inside square brackets and are separated by semicolons.
2524Each citation must have a key, composed of '@' + the citation
2525identifier from the database, and may optionally have a prefix,
2526a locator, and a suffix. The citation key must begin with a letter
2527or `_`, and may contain alphanumerics, `_`, and internal punctuation
2528characters (`:.#$%&-+?<>~/`). Here are some examples:
2530 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
2532 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2534 Blah blah [@smith04; @doe99].
2536A minus sign (`-`) before the `@` will suppress mention of
2537the author in the citation. This can be useful when the
2538author is already mentioned in the text:
2540 Smith says blah [-@smith04].
2542You can also write an in-text citation, as follows:
2544 @smith04 says blah.
2546 @smith04 [p. 33] says blah.
2548If the style calls for a list of works cited, it will be placed
2549at the end of the document. Normally, you will want to end your
2550document with an appropriate header:
2552 last paragraph...
2554 # References
2556The bibliography will be inserted after this header. Note that
2557the `unnumbered` class will be added to this header, so that the
2558section will not be numbered.
2560If you want to include items in the bibliography without actually
2561citing them in the body text, you can define a dummy `nocite` metadata
2562field and put the citations there:
2564 ---
2565 nocite: |
2566 @item1, @item2
2567 ...
2569 @item3
2571In this example, the document will contain a citation for `item3`
2572only, but the bibliography will contain entries for `item1`, `item2`, and
2573`item3`.
2575Non-pandoc extensions
2576---------------------
2578The following markdown syntax extensions are not enabled by default
2579in pandoc, but may be enabled by adding `+EXTENSION` to the format
2580name, where `EXTENSION` is the name of the extension. Thus, for
2581example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2583### Extension: `lists_without_preceding_blankline` ###
2584Allow a list to occur right after a paragraph, with no intervening
2585blank space.
2587### Extension: `hard_line_breaks` ###
2588Causes all newlines within a paragraph to be interpreted as hard line
2589breaks instead of spaces.
2591### Extension: `ignore_line_breaks` ###
2592Causes newlines within a paragraph to be ignored, rather than being
2593treated as spaces or as hard line breaks. This option is intended for
2594use with East Asian languages where spaces are not used between words,
2595but text is divided into lines for readability.
2597### Extension: `tex_math_single_backslash` ###
2598Causes anything between `\(` and `\)` to be interpreted as inline
2599TeX math, and anything between `\[` and `\]` to be interpreted
2600as display TeX math. Note: a drawback of this extension is that
2601it precludes escaping `(` and `[`.
2603### Extension: `tex_math_double_backslash` ###
2604Causes anything between `\\(` and `\\)` to be interpreted as inline
2605TeX math, and anything between `\\[` and `\\]` to be interpreted
2606as display TeX math.
2608### Extension: `markdown_attribute` ###
2609By default, pandoc interprets material inside block-level tags as markdown.
2610This extension changes the behavior so that markdown is only parsed
2611inside block-level tags if the tags have the attribute `markdown=1`.
2613### Extension: `mmd_title_block` ###
2614Enables a [MultiMarkdown] style title block at the top of
2615the document, for example:
2617 Title: My title
2618 Author: John Doe
2619 Date: September 1, 2008
2620 Comment: This is a sample mmd title block, with
2621 a field spanning multiple lines.
2623See the MultiMarkdown documentation for details. If `pandoc_title_block` or
2624`yaml_metadata_block` is enabled, it will take precedence over
2625`mmd_title_block`.
2627 [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
2629### Extension: `abbreviations` ###
2630Parses PHP Markdown Extra abbreviation keys, like
2632 *[HTML]: Hyper Text Markup Language
2634Note that the pandoc document model does not support
2635abbreviations, so if this extension is enabled, abbreviation keys are
2636simply skipped (as opposed to being parsed as paragraphs).
2638### Extension: `autolink_bare_uris` ###
2639Makes all absolute URIs into links, even when not surrounded by
2640pointy braces `<...>`.
2642### Extension: `ascii_identifiers` ###
2643Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
2644Accents are stripped off of accented latin letters, and non-latin
2645letters are omitted.
2647### Extension: `link_attributes` ###
2648Parses multimarkdown style key-value attributes on link and image references.
2649Note that pandoc's internal document model provides nowhere to put
2650these, so they are presently just ignored.
2652### Extension: `mmd_header_identifiers` ###
2653Parses multimarkdown style header identifiers (in square brackets,
2654after the header but before any trailing `#`s in an ATX header).
2656### Extension: `compact_definition_lists` ###
2657Activates the definition list syntax of pandoc 1.12.x and earlier.
2658This syntax differs from the one described [above](#definition-lists)
2659in several respects:
2661 - No blank line is required between consecutive items of the
2662 definition list.
2663 - To get a "tight" or "compact" list, omit space between consecutive
2664 items; the space between a term and its definition does not affect
2665 anything.
2666 - Lazy wrapping of paragraphs is not allowed: the entire definition must
2667 be indented four spaces.[^6]
2669[^6]: To see why laziness is incompatible with relaxing the requirement
2670 of a blank line between items, consider the following example:
2672 bar
2673 : definition
2674 foo
2675 : definition
2677 Is this a single list item with two definitions of "bar," the first of
2678 which is lazily wrapped, or two list items? To remove the ambiguity
2679 we must either disallow lazy wrapping or require a blank line between
2680 list items.
2682Markdown variants
2683-----------------
2685In addition to pandoc's extended markdown, the following markdown
2686variants are supported:
2688`markdown_phpextra` (PHP Markdown Extra)
2689: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
2690 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
2691 `header_attributes`, `abbreviations`.
2693`markdown_github` (Github-flavored Markdown)
2694: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
2695 `fenced_code_blocks`, `auto_identifiers`,
2696 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
2697 `intraword_underscores`, `strikeout`, `hard_line_breaks`
2699`markdown_mmd` (MultiMarkdown)
2700: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
2701 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
2702 `mmd_title_block`, `footnotes`, `definition_lists`,
2703 `all_symbols_escapable`, `implicit_header_references`,
2704 `auto_identifiers`, `mmd_header_identifiers`
2706`markdown_strict` (Markdown.pl)
2707: `raw_html`
2709Extensions with formats other than markdown
2710-------------------------------------------
2712Some of the extensions discussed above can be used with formats
2713other than markdown:
2715* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
2716 and `textile` input (and is used by default).
2718* `tex_math_dollars`, `tex_math_single_backslash`, and
2719 `tex_math_double_backslash` can be used with `html` input.
2720 (This is handy for reading web pages formatted using MathJax,
2721 for example.)
2723Producing slide shows with Pandoc
2724=================================
2726You can use Pandoc to produce an HTML + javascript slide presentation
2727that can be viewed via a web browser. There are five ways to do this,
2728using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
2729You can also produce a PDF slide show using LaTeX [beamer].
2731Here's the markdown source for a simple slide show, `habits.txt`:
2733 % Habits
2734 % John Doe
2735 % March 22, 2005
2737 # In the morning
2739 ## Getting up
2741 - Turn off alarm
2742 - Get out of bed
2744 ## Breakfast
2746 - Eat eggs
2747 - Drink coffee
2749 # In the evening
2751 ## Dinner
2753 - Eat spaghetti
2754 - Drink wine
2756 ------------------
2758 ![picture of spaghetti](images/spaghetti.jpg)
2760 ## Going to sleep
2762 - Get in bed
2763 - Count sheep
2765To produce an HTML/javascript slide show, simply type
2767 pandoc -t FORMAT -s habits.txt -o habits.html
2769where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
2771For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
2772`-s/--standalone` option embeds a link to javascripts and CSS files, which are
2773assumed to be available at the relative path `s5/default` (for S5), `slideous`
2774(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
2775`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
2776`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
2777above.) For DZSlides, the (relatively short) javascript and css are included in
2778the file by default.
2780With all HTML slide formats, the `--self-contained` option can be used to
2781produce a single file that contains all of the data necessary to display the
2782slide show, including linked scripts, stylesheets, images, and videos.
2784To produce a PDF slide show using beamer, type
2786 pandoc -t beamer habits.txt -o habits.pdf
2788Note that a reveal.js slide show can also be converted to a PDF
2789by printing it to a file from the browser.
2791Structuring the slide show
2792--------------------------
2794By default, the *slide level* is the highest header level in
2795the hierarchy that is followed immediately by content, and not another
2796header, somewhere in the document. In the example above, level 1 headers
2797are always followed by level 2 headers, which are followed by content,
2798so 2 is the slide level. This default can be overridden using
2799the `--slide-level` option.
2801The document is carved up into slides according to the following
2802rules:
2804 * A horizontal rule always starts a new slide.
2806 * A header at the slide level always starts a new slide.
2808 * Headers *below* the slide level in the hierarchy create
2809 headers *within* a slide.
2811 * Headers *above* the slide level in the hierarchy create
2812 "title slides," which just contain the section title
2813 and help to break the slide show into sections.
2815 * A title page is constructed automatically from the document's title
2816 block, if present. (In the case of beamer, this can be disabled
2817 by commenting out some lines in the default template.)
2819These rules are designed to support many different styles of slide show. If
2820you don't care about structuring your slides into sections and subsections,
2821you can just use level 1 headers for all each slide. (In that case, level 1
2822will be the slide level.) But you can also structure the slide show into
2823sections, as in the example above.
2825Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
2826layout will be produced, with level 1 headers building horizontally
2827and level 2 headers building vertically. It is not recommended that
2828you use deeper nesting of section levels with reveal.js.
2830Incremental lists
2831-----------------
2833By default, these writers produces lists that display "all at once."
2834If you want your lists to display incrementally (one item at a time),
2835use the `-i` option. If you want a particular list to depart from the
2836default (that is, to display incrementally without the `-i` option and
2837all at once with the `-i` option), put it in a block quote:
2839 > - Eat spaghetti
2840 > - Drink wine
2842In this way incremental and nonincremental lists can be mixed in
2843a single document.
2845Inserting pauses
2846----------------
2848You can add "pauses" within a slide by including a paragraph containing
2849three dots, separated by spaces:
2851 # Slide with a pause
2853 content before the pause
2855 . . .
2857 content after the pause
2859Styling the slides
2860------------------
2862You can change the style of HTML slides by putting customized CSS files
2863in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
2864or `$DATADIR/slideous` (for Slideous),
2865where `$DATADIR` is the user data directory (see `--data-dir`, above).
2866The originals may be found in pandoc's system data directory (generally
2867`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2868files it does not find in the user data directory.
2870For dzslides, the CSS is included in the HTML file itself, and may
2871be modified there.
2873For reveal.js, themes can be used by setting the `theme` variable,
2874for example:
2876 -V theme=moon
2878Or you can specify a custom stylesheet using the `--css` option.
2880To style beamer slides, you can specify a beamer "theme" or "colortheme"
2881using the `-V` option:
2883 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2885Note that header attributes will turn into slide attributes
2886(on a `<div>` or `<section>`) in HTML slide formats, allowing you
2887to style individual slides. In Beamer, the only header attribute
2888that affects slides is the `allowframebreaks` class, which sets the
2889`allowframebreaks` option, causing multiple slides to be created
2890if the content overfills the frame. This is recommended especially for
2891bibliographies:
2893 # References {.allowframebreaks}
2895Speaker notes
2896-------------
2898reveal.js has good support for speaker notes. You can add notes to your
2899markdown document thus:
2901 <div class="notes">
2902 This is my note.
2904 - It can contain markdown
2905 - like this list
2907 </div>
2909To show the notes window, press `s` while viewing the presentation.
2910Notes are not yet supported for other slide formats, but the notes
2911will not appear on the slides themselves.
2913EPUB Metadata
2914=============
2916EPUB metadata may be specified using the `--epub-metadata` option, but
2917if the source document is markdown, it is better to use a YAML metadata
2918block. Here is an example:
2920 ---
2921 title:
2922 - type: main
2923 text: My Book
2924 - type: subtitle
2925 text: An investigation of metadata
2926 creator:
2927 - role: author
2928 text: John Smith
2929 - role: editor
2930 text: Sarah Jones
2931 identifier:
2932 - scheme: DOI
2933 text: doi:10.234234.234/33
2934 publisher: My Press
2935 rights: (c) 2007 John Smith, CC BY-NC
2936 ...
2938The following fields are recognized:
2940`identifier`
2941 ~ Either a string value or an object with fields `text` and
2942 `scheme`. Valid values for `scheme` are `ISBN-10`,
2943 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
2944 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
2945 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
2946`title`
2947 ~ Either a string value, or an object with fields `file-as` and
2948 `type`, or a list of such objects. Valid values for `type` are
2949 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
2950`creator`
2951 ~ Either a string value, or an object with fields `role`, `file-as`,
2952 and `text`, or a list of such objects. Valid values for `role` are
2953 [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but
2954 pandoc will attempt to translate the human-readable versions
2955 (like "author" and "editor") to the appropriate marc relators.
2956`contributor`
2957 ~ Same format as `creator`.
2958`date`
2959 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
2960 Pandoc will attempt to convert other common date formats.
2961`language`
2962 ~ A string value in [RFC5646] format. Pandoc will default to the local
2963 language if nothing is specified.
2964`subject`
2965 ~ A string value or a list of such values.
2966`description`
2967 ~ A string value.
2968`type`
2969 ~ A string value.
2970`format`
2971 ~ A string value.
2972`relation`
2973 ~ A string value.
2974`coverage`
2975 ~ A string value.
2976`rights`
2977 ~ A string value.
2978`cover-image`
2979 ~ A string value (path to cover image).
2980`stylesheet`
2981 ~ A string value (path to CSS stylesheet).
2983Literate Haskell support
2984========================
2986If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
2987format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
2988`beamer`, `html` or `html5` for output only), pandoc will treat the document as
2989literate Haskell source. This means that
2991 - In markdown input, "bird track" sections will be parsed as Haskell
2992 code rather than block quotations. Text between `\begin{code}`
2993 and `\end{code}` will also be treated as Haskell code.
2995 - In markdown output, code blocks with classes `haskell` and `literate`
2996 will be rendered using bird tracks, and block quotations will be
2997 indented one space, so they will not be treated as Haskell code.
2998 In addition, headers will be rendered setext-style (with underlines)
2999 rather than atx-style (with '#' characters). (This is because ghc
3000 treats '#' characters in column 1 as introducing line numbers.)
3002 - In restructured text input, "bird track" sections will be parsed
3003 as Haskell code.
3005 - In restructured text output, code blocks with class `haskell` will
3006 be rendered using bird tracks.
3008 - In LaTeX input, text in `code` environments will be parsed as
3009 Haskell code.
3011 - In LaTeX output, code blocks with class `haskell` will be rendered
3012 inside `code` environments.
3014 - In HTML output, code blocks with class `haskell` will be rendered
3015 with class `literatehaskell` and bird tracks.
3017Examples:
3019 pandoc -f markdown+lhs -t html
3021reads literate Haskell source formatted with markdown conventions and writes
3022ordinary HTML (without bird tracks).
3024 pandoc -f markdown+lhs -t html+lhs
3026writes HTML with the Haskell code in bird tracks, so it can be copied
3027and pasted as literate Haskell source.
3029Custom writers
3030==============
3032Pandoc can be extended with custom writers written in [lua]. (Pandoc
3033includes a lua interpreter, so lua need not be installed separately.)
3035To use a custom writer, simply specify the path to the lua script
3036in place of the output format. For example:
3038 pandoc -t data/sample.lua
3040Creating a custom writer requires writing a lua function for each
3041possible element in a pandoc document. To get a documented example
3042which you can modify according to your needs, do
3044 pandoc --print-default-data-file sample.lua
3046Authors
3047=======
3049© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the
3050[GPL], version 2 or greater. This software carries no warranty of
3051any kind. (See COPYRIGHT for full copyright and warranty notices.)
3052Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
3053Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
3054Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
3055Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
3056Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
3057Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,
3058Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,
3059Jamie F. Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse
3060Rosenthal.
3062[markdown]: http://daringfireball.net/projects/markdown/
3063[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
3064[S5]: http://meyerweb.com/eric/tools/s5/
3065[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
3066[Slideous]: http://goessner.net/articles/slideous/
3067[HTML]: http://www.w3.org/TR/html40/
3068[HTML 5]: http://www.w3.org/TR/html5/
3069[XHTML]: http://www.w3.org/TR/xhtml1/
3070[LaTeX]: http://www.latex-project.org/
3071[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
3072[ConTeXt]: http://www.pragma-ade.nl/
3073[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
3074[DocBook]: http://www.docbook.org/
3075[OPML]: http://dev.opml.org/spec2.html
3076[OpenDocument]: http://opendocument.xml.org/
3077[ODT]: http://en.wikipedia.org/wiki/OpenDocument
3078[Textile]: http://redcloth.org/textile
3079[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
3080[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
3081[Haddock markup]: http://www.haskell.org/haddock/doc/html/ch03s08.html
3082[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
3083[Haskell]: http://www.haskell.org/
3084[GNU Texinfo]: http://www.gnu.org/software/texinfo/
3085[Emacs Org-Mode]: http://orgmode.org
3086[AsciiDoc]: http://www.methods.co.nz/asciidoc/
3087[EPUB]: http://www.idpf.org/
3088[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
3089[DZSlides]: http://paulrouget.com/dzslides/
3090[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
3091[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
3092[PDF]: http://www.adobe.com/pdf/
3093[reveal.js]: http://lab.hakim.se/reveal-js/
3094[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
3095[lua]: http://www.lua.org
3096[marc relators]: http://www.loc.gov/marc/relators/relaterm.html
3097[RFC5646]: http://tools.ietf.org/html/rfc5646
3098[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf