git.iko.soy/typeable/pandoc
on 438ccbe help sign in
3011 lines 108 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 Org-mode]
17and [DocBook]; and it can write plain text, [markdown],
18[reStructuredText], [XHTML], [HTML 5], [LaTeX] (including [beamer] slide
19shows), [ConTeXt], [RTF], [OPML], [DocBook], [OpenDocument], [ODT],
20[Word docx], [GNU Texinfo], [MediaWiki markup], [EPUB] (v2 or v3),
21[FictionBook2], [Textile], [groff man] pages, [Emacs Org-Mode],
22[AsciiDoc], [InDesign ICML], and [Slidy], [Slideous], [DZSlides],
23[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output
24on 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 `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),
171 `opml` (OPML), `docbook` (DocBook), `opendocument` (OpenDocument), `odt`
172 (OpenOffice text document), `docx` (Word docx),
173 `rtf` (rich text format), `epub` (EPUB v2 book), `epub3`
174 (EPUB v3), `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc),
175 `icml` (InDesign ICML), `slidy` (Slidy HTML and javascript slide show),
176 `slideous` (Slideous HTML and javascript slide show), `dzslides`
177 (DZSlides HTML5 + javascript slide show), `revealjs` (reveal.js
178 HTML5 + javascript slide show), `s5` (S5 HTML and javascript slide show),
179 or the path of a custom lua writer (see [Custom writers](#custom-writers),
180 below). Note that `odt`, `epub`, and `epub3` output will not be directed
181 to *stdout*; an output filename must be specified using the `-o/--output`
182 option. If `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
183 `html`, or `html5`, the output will be rendered as literate Haskell
184 source: see [Literate Haskell support](#literate-haskell-support), below.
185 Markdown syntax extensions can be individually enabled or disabled by
186 appending `+EXTENSION` or `-EXTENSION` to the format name, as described
187 above under `-f`.
189`-o` *FILE*, `--output=`*FILE*
190: Write output to *FILE* instead of *stdout*. If *FILE* is
191 `-`, output will go to *stdout*. (Exception: if the output
192 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
194`--data-dir=`*DIRECTORY*
195: Specify the user data directory to search for pandoc data files.
196 If this option is not specified, the default user data directory
197 will be used. This is
199 $HOME/.pandoc
201 in unix,
203 C:\Documents And Settings\USERNAME\Application Data\pandoc
205 in Windows XP, and
207 C:\Users\USERNAME\AppData\Roaming\pandoc
209 in Windows 7. (You can find the default user data directory
210 on your system by looking at the output of `pandoc --version`.)
211 A `reference.odt`, `reference.docx`, `default.csl`,
212 `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory
213 placed in this directory will override pandoc's normal defaults.
215`-v`, `--version`
216: Print version.
218`-h`, `--help`
219: Show usage message.
221Reader options
222--------------
224`-R`, `--parse-raw`
225: Parse untranslatable HTML codes and LaTeX environments as raw HTML
226 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
227 input. Raw HTML can be printed in markdown, reStructuredText, HTML,
228 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
229 can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
230 The default is for the readers to omit untranslatable HTML codes and
231 LaTeX environments. (The LaTeX reader does pass through untranslatable
232 LaTeX *commands*, even if `-R` is not specified.)
234`-S`, `--smart`
235: Produce typographically correct output, converting straight quotes
236 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
237 `...` to ellipses. Nonbreaking spaces are inserted after certain
238 abbreviations, such as "Mr." (Note: This option is significant only when
239 the input format is `markdown`, `markdown_strict`, or `textile`. It
240 is selected automatically when the input format is `textile` or the
241 output format is `latex` or `context`, unless `--no-tex-ligatures`
242 is used.)
244`--old-dashes`
245: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
246 a numeral is an en-dash, and `--` is an em-dash. This option is selected
247 automatically for `textile` input.
249`--base-header-level=`*NUMBER*
250: Specify the base level for headers (defaults to 1).
252`--indented-code-classes=`*CLASSES*
253: Specify classes to use for indented code blocks--for example,
254 `perl,numberLines` or `haskell`. Multiple classes may be separated
255 by spaces or commas.
257`--default-image-extension=`*EXTENSION*
258: Specify a default extension to use when image paths/URLs have no
259 extension. This allows you to use the same source for formats that
260 require different kinds of images. Currently this option only affects
261 the markdown and LaTeX readers.
263`--filter=`*EXECUTABLE*
264: Specify an executable to be used as a filter transforming the
265 Pandoc AST after the input is parsed and before the output is
266 written. The executable should read JSON from stdin and write
267 JSON to stdout. The JSON must be formatted like pandoc's own
268 JSON input and output. The name of the output format will be
269 passed to the filter as the first argument. Hence,
271 pandoc --filter ./caps.py -t latex
273 is equivalent to
275 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
277 The latter form may be useful for debugging filters.
279 Filters may be written in any language. `Text.Pandoc.JSON`
280 exports `toJSONFilter` to facilitate writing filters in Haskell.
281 Those who would prefer to write filters in python can use the
282 module `pandocfilters`, installable from PyPI. See
283 <http://github.com/jgm/pandocfilters> for the module and several
284 examples. Note that the *EXECUTABLE* will be sought in the user's
285 `PATH`, and not in the working directory, if no directory is
286 provided. If you want to run a script in the working directory,
287 preface the filename with `./`.
289`-M` *KEY[=VAL]*, `--metadata=`*KEY[:VAL]*
290: Set the metadata field *KEY* to the value *VAL*. A value specified
291 on the command line overrides a value specified in the document.
292 Values will be parsed as YAML boolean or string values. If no value is
293 specified, the value will be treated as Boolean true. Like
294 `--variable`, `--metadata` causes template variables to be set.
295 But unlike `--variable`, `--metadata` affects the metadata of the
296 underlying document (which is accessible from filters and may be
297 printed in some output formats).
299`--normalize`
300: Normalize the document after reading: merge adjacent
301 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
303`-p`, `--preserve-tabs`
304: Preserve tabs instead of converting them to spaces (the default).
305 Note that this will only affect tabs in literal code spans and code
306 blocks; tabs in regular text will be treated as spaces.
308`--tab-stop=`*NUMBER*
309: Specify the number of spaces per tab (default is 4).
311General writer options
312----------------------
314`-s`, `--standalone`
315: Produce output with an appropriate header and footer (e.g. a
316 standalone HTML, LaTeX, or RTF file, not a fragment). This option
317 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
318 output.
320`--template=`*FILE*
321: Use *FILE* as a custom template for the generated document. Implies
322 `--standalone`. See [Templates](#templates) below for a description
323 of template syntax. If no extension is specified, an extension
324 corresponding to the writer will be added, so that `--template=special`
325 looks for `special.html` for HTML output. If the template is not
326 found, pandoc will search for it in the user data directory
327 (see `--data-dir`). If this option is not used, a default
328 template appropriate for the output format will be used (see
329 `-D/--print-default-template`).
331`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*
332: Set the template variable *KEY* to the value *VAL* when rendering the
333 document in standalone mode. This is generally only useful when the
334 `--template` option is used to specify a custom template, since
335 pandoc automatically sets the variables used in the default
336 templates. If no *VAL* is specified, the key will be given the
337 value `true`.
339`-D` *FORMAT*, `--print-default-template=`*FORMAT*
340: Print the default template for an output *FORMAT*. (See `-t`
341 for a list of possible *FORMAT*s.)
343`--print-default-data-file=`*FILE*
344: Print a default data file.
346`--no-wrap`
347: Disable text wrapping in output. By default, text is wrapped
348 appropriately for the output format.
350`--columns`=*NUMBER*
351: Specify length of lines in characters (for text wrapping).
353`--toc`, `--table-of-contents`
354: Include an automatically generated table of contents (or, in
355 the case of `latex`, `context`, and `rst`, an instruction to create
356 one) in the output document. This option has no effect on `man`,
357 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
359`--toc-depth=`*NUMBER*
360: Specify the number of section levels to include in the table
361 of contents. The default is 3 (which means that level 1, 2, and 3
362 headers will be listed in the contents).
364`--no-highlight`
365: Disables syntax highlighting for code blocks and inlines, even when
366 a language attribute is given.
368`--highlight-style`=*STYLE*
369: Specifies the coloring style to be used in highlighted source code.
370 Options are `pygments` (the default), `kate`, `monochrome`,
371 `espresso`, `zenburn`, `haddock`, and `tango`.
373`-H` *FILE*, `--include-in-header=`*FILE*
374: Include contents of *FILE*, verbatim, at the end of the header.
375 This can be used, for example, to include special
376 CSS or javascript in HTML documents. This option can be used
377 repeatedly to include multiple files in the header. They will be
378 included in the order specified. Implies `--standalone`.
380`-B` *FILE*, `--include-before-body=`*FILE*
381: Include contents of *FILE*, verbatim, at the beginning of the
382 document body (e.g. after the `<body>` tag in HTML, or the
383 `\begin{document}` command in LaTeX). This can be used to include
384 navigation bars or banners in HTML documents. This option can be
385 used repeatedly to include multiple files. They will be included in
386 the order specified. Implies `--standalone`.
388`-A` *FILE*, `--include-after-body=`*FILE*
389: Include contents of *FILE*, verbatim, at the end of the document
390 body (before the `</body>` tag in HTML, or the
391 `\end{document}` command in LaTeX). This option can be be used
392 repeatedly to include multiple files. They will be included in the
393 order specified. Implies `--standalone`.
395Options affecting specific writers
396----------------------------------
398`--self-contained`
399: Produce a standalone HTML file with no external dependencies, using
400 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
401 images, and videos. The resulting file should be "self-contained,"
402 in the sense that it needs no external files and no net access to be
403 displayed properly by a browser. This option works only with HTML output
404 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
405 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
406 stylesheets at absolute URLs will be downloaded; those at relative URLs
407 will be sought first relative to the working directory, then relative to
408 the user data directory (see `--data-dir`), and finally relative to
409 pandoc's default data directory. `--self-contained` does not
410 work with `--mathjax`.
412`--offline`
413: Deprecated synonym for `--self-contained`.
415`-5`, `--html5`
416: Produce HTML5 instead of HTML4. This option has no effect for writers
417 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
419`--html-q-tags`
420: Use `<q>` tags for quotes in HTML.
422`--ascii`
423: Use only ascii characters in output. Currently supported only
424 for HTML output (which uses numerical entities instead of
425 UTF-8 when this option is selected).
427`--reference-links`
428: Use reference-style links, rather than inline links, in writing markdown
429 or reStructuredText. By default inline links are used.
431`--atx-headers`
432: Use ATX style headers in markdown and asciidoc output. The default is
433 to use setext-style headers for levels 1-2, and then ATX headers.
435`--chapters`
436: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
437 output. When the LaTeX template uses the report, book, or
438 memoir class, this option is implied. If `beamer` is the output
439 format, top-level headers will become `\part{..}`.
441`-N`, `--number-sections`
442: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
443 By default, sections are not numbered. Sections with class
444 `unnumbered` will never be numbered, even if `--number-sections`
445 is specified.
447`--number-offset`=*NUMBER[,NUMBER,...]*,
448: Offset for section headings in HTML output (ignored in other
449 output formats). The first number is added to the section number for
450 top-level headers, the second for second-level headers, and so on.
451 So, for example, if you want the first top-level header in your
452 document to be numbered "6", specify `--number-offset=5`.
453 If your document starts with a level-2 header which you want to
454 be numbered "1.5", specify `--number-offset=1,4`.
455 Offsets are 0 by default. Implies `--number-sections`.
457`--no-tex-ligatures`
458: Do not convert quotation marks, apostrophes, and dashes to
459 the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
460 use literal unicode characters. This is needed for using advanced
461 OpenType features with XeLaTeX and LuaLaTeX. Note: normally
462 `--smart` is selected automatically for LaTeX and ConTeXt
463 output, but it must be specified explicitly if `--no-tex-ligatures`
464 is selected. If you use literal curly quotes, dashes, and ellipses
465 in your source, then you may want to use `--no-tex-ligatures`
466 without `--smart`.
468`--listings`
469: Use listings package for LaTeX code blocks
471`-i`, `--incremental`
472: Make list items in slide shows display incrementally (one by one).
473 The default is for lists to be displayed all at once.
475`--slide-level`=*NUMBER*
476: Specifies that headers with the specified level create
477 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
478 above this level in the hierarchy are used to divide the
479 slide show into sections; headers below this level create
480 subheads within a slide. The default is to set the slide level
481 based on the contents of the document; see
482 [Structuring the slide show](#structuring-the-slide-show), below.
484`--section-divs`
485: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
486 and attach identifiers to the enclosing `<div>` (or `<section>`)
487 rather than the header itself.
488 See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.
490`--email-obfuscation=`*none|javascript|references*
491: Specify a method for obfuscating `mailto:` links in HTML documents.
492 *none* leaves `mailto:` links as they are. *javascript* obfuscates
493 them using javascript. *references* obfuscates them by printing their
494 letters as decimal or hexadecimal character references.
496`--id-prefix`=*STRING*
497: Specify a prefix to be added to all automatically generated identifiers
498 in HTML and DocBook output, and to footnote numbers in markdown output.
499 This is useful for preventing duplicate identifiers when generating
500 fragments to be included in other pages.
502`-T` *STRING*, `--title-prefix=`*STRING*
503: Specify *STRING* as a prefix at the beginning of the title
504 that appears in the HTML header (but not in the title as it
505 appears at the beginning of the HTML body). Implies
506 `--standalone`.
508`-c` *URL*, `--css=`*URL*
509: Link to a CSS style sheet. This option can be be used repeatedly to
510 include multiple files. They will be included in the order specified.
512`--reference-odt=`*FILE*
513: Use the specified file as a style reference in producing an ODT.
514 For best results, the reference ODT should be a modified version
515 of an ODT produced using pandoc. The contents of the reference ODT
516 are ignored, but its stylesheets are used in the new ODT. If no
517 reference ODT is specified on the command line, pandoc will look
518 for a file `reference.odt` in the user data directory (see
519 `--data-dir`). If this is not found either, sensible defaults will be
520 used.
522`--reference-docx=`*FILE*
523: Use the specified file as a style reference in producing a docx file.
524 For best results, the reference docx should be a modified version
525 of a docx file produced using pandoc. The contents of the reference docx
526 are ignored, but its stylesheets are used in the new docx. If no
527 reference docx is specified on the command line, pandoc will look
528 for a file `reference.docx` in the user data directory (see
529 `--data-dir`). If this is not found either, sensible defaults will be
530 used. The following styles are used by pandoc: [paragraph]
531 Normal, Compact, Title, Authors, Date, Heading 1, Heading 2, Heading 3,
532 Heading 4, Heading 5, Block Quote, Definition Term, Definition,
533 Body Text, Table Caption, Image Caption; [character] Default
534 Paragraph Font, Body Text Char, Verbatim Char, Footnote Ref,
535 Link.
537`--epub-stylesheet=`*FILE*
538: Use the specified CSS file to style the EPUB. If no stylesheet
539 is specified, pandoc will look for a file `epub.css` in the
540 user data directory (see `--data-dir`). If it is not
541 found there, sensible defaults will be used.
543`--epub-cover-image=`*FILE*
544: Use the specified image as the EPUB cover. It is recommended
545 that the image be less than 1000px in width and height. Note that
546 in a markdown source document you can also specify `cover-image`
547 in a YAML metadata block (see [EPUB Metadata], below).
549`--epub-metadata=`*FILE*
550: Look in the specified XML file for metadata for the EPUB.
551 The file should contain a series of Dublin Core elements,
552 as documented at <http://dublincore.org/documents/dces/>.
553 For example:
555 <dc:rights>Creative Commons</dc:rights>
556 <dc:language>es-AR</dc:language>
558 By default, pandoc will include the following metadata elements:
559 `<dc:title>` (from the document title), `<dc:creator>` (from the
560 document authors), `<dc:date>` (from the document date, which should
561 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
562 variable, or, if is not set, the locale), and `<dc:identifier
563 id="BookId">` (a randomly generated UUID). Any of these may be
564 overridden by elements in the metadata file.
566 Note: if the source document is markdown, a YAML metadata block
567 in the document can be used instead. See below under
568 [EPUB Metadata].
570`--epub-embed-font=`*FILE*
571: Embed the specified font in the EPUB. This option can be repeated
572 to embed multiple fonts. To use embedded fonts, you
573 will need to add declarations like the following to your CSS (see
574 `--epub-stylesheet`):
576 @font-face {
577 font-family: DejaVuSans;
578 font-style: normal;
579 font-weight: normal;
580 src:url("DejaVuSans-Regular.ttf");
581 }
582 @font-face {
583 font-family: DejaVuSans;
584 font-style: normal;
585 font-weight: bold;
586 src:url("DejaVuSans-Bold.ttf");
587 }
588 @font-face {
589 font-family: DejaVuSans;
590 font-style: italic;
591 font-weight: normal;
592 src:url("DejaVuSans-Oblique.ttf");
593 }
594 @font-face {
595 font-family: DejaVuSans;
596 font-style: italic;
597 font-weight: bold;
598 src:url("DejaVuSans-BoldOblique.ttf");
599 }
600 body { font-family: "DejaVuSans"; }
602`--epub-chapter-level=`*NUMBER*
603: Specify the header level at which to split the EPUB into separate
604 "chapter" files. The default is to split into chapters at level 1
605 headers. This option only affects the internal composition of the
606 EPUB, not the way chapters and sections are displayed to users. Some
607 readers may be slow if the chapter files are too large, so for large
608 documents with few level 1 headers, one might want to use a chapter
609 level of 2 or 3.
611`--latex-engine=`*pdflatex|lualatex|xelatex*
612: Use the specified LaTeX engine when producing PDF output.
613 The default is `pdflatex`. If the engine is not in your PATH,
614 the full path of the engine may be specified here.
616Citation rendering
617------------------
619`--bibliography=`*FILE*
620: Set the `bibliography` field in the document's metadata to *FILE*,
621 overriding any value set in the metadata, and process citations
622 using `pandoc-citeproc`. (This is equivalent to
623 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
625`--csl=`*FILE*
626: Set the `csl` field in the document's metadata to *FILE*,
627 overriding any value set in the metadata. (This is equivalent to
628 `--metadata csl=FILE`.)
630`--citation-abbreviations=`*FILE*
631: Set the `citation-abbreviations` field in the document's metadata to
632 *FILE*, overriding any value set in the metadata. (This is equivalent to
633 `--metadata citation-abbreviations=FILE`.)
635`--natbib`
636: Use natbib for citations in LaTeX output. This option is not for use
637 with the `pandoc-citeproc` filter or with PDF output. It is intended for
638 use in producing a LaTeX file that can be processed with pdflatex and
639 bibtex.
641`--biblatex`
642: Use biblatex for citations in LaTeX output. This option is not for use
643 with the `pandoc-citeproc` filter or with PDF output. It is intended for
644 use in producing a LaTeX file that can be processed with pdflatex and
645 bibtex or biber.
647Math rendering in HTML
648----------------------
650`-m` [*URL*], `--latexmathml`[=*URL*]
651: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
652 To insert a link to a local copy of the `LaTeXMathML.js` script,
653 provide a *URL*. If no *URL* is provided, the contents of the
654 script will be inserted directly into the HTML header, preserving
655 portability at the price of efficiency. If you plan to use math on
656 several pages, it is much better to link to a copy of the script,
657 so it can be cached.
659`--mathml`[=*URL*]
660: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
661 In standalone `html` output, a small javascript (or a link to such a
662 script if a *URL* is supplied) will be inserted that allows the MathML to
663 be viewed on some browsers.
665`--jsmath`[=*URL*]
666: Use [jsMath] to display embedded TeX math in HTML output.
667 The *URL* should point to the jsMath load script (e.g.
668 `jsMath/easy/load.js`); if provided, it will be linked to in
669 the header of standalone HTML documents. If a *URL* is not provided,
670 no link to the jsMath load script will be inserted; it is then
671 up to the author to provide such a link in the HTML template.
673`--mathjax`[=*URL*]
674: Use [MathJax] to display embedded TeX math in HTML output.
675 The *URL* should point to the `MathJax.js` load script.
676 If a *URL* is not provided, a link to the MathJax CDN will
677 be inserted.
679`--gladtex`
680: Enclose TeX math in `<eq>` tags in HTML output. These can then
681 be processed by [gladTeX] to produce links to images of the typeset
682 formulas.
684`--mimetex`[=*URL*]
685: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
686 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
688`--webtex`[=*URL*]
689: Render TeX formulas using an external script that converts TeX
690 formulas to images. The formula will be concatenated with the URL
691 provided. If *URL* is not specified, the Google Chart API will be used.
693Options for wrapper scripts
694---------------------------
696`--dump-args`
697: Print information about command-line arguments to *stdout*, then exit.
698 This option is intended primarily for use in wrapper scripts.
699 The first line of output contains the name of the output file specified
700 with the `-o` option, or `-` (for *stdout*) if no output file was
701 specified. The remaining lines contain the command-line arguments,
702 one per line, in the order they appear. These do not include regular
703 Pandoc options and their arguments, but do include any options appearing
704 after a `--` separator at the end of the line.
706`--ignore-args`
707: Ignore command-line arguments (for use in wrapper scripts).
708 Regular Pandoc options are not ignored. Thus, for example,
710 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
712 is equivalent to
714 pandoc -o foo.html -s
716[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
717[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
718[MathJax]: http://www.mathjax.org/
719[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
720[mimeTeX]: http://www.forkosh.com/mimetex.html
721[CSL]: http://CitationStyles.org
723Templates
724=========
726When the `-s/--standalone` option is used, pandoc uses a template to
727add header and footer material that is needed for a self-standing
728document. To see the default template that is used, just type
730 pandoc -D FORMAT
732where `FORMAT` is the name of the output format. A custom template
733can be specified using the `--template` option. You can also override
734the system default templates for a given output format `FORMAT`
735by putting a file `templates/default.FORMAT` in the user data
736directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
737customize the `default.opendocument` template. For `pdf` output,
738customize the `default.latex` template.
740Templates may contain *variables*. Variable names are sequences of
741alphanumerics, `-`, and `_`, starting with a letter. A variable name
742surrounded by `$` signs will be replaced by its value. For example,
743the string `$title$` in
745 <title>$title$</title>
747will be replaced by the document title.
749To write a literal `$` in a template, use `$$`.
751Some variables are set automatically by pandoc. These vary somewhat
752depending on the output format, but include metadata fields (such
753as `title`, `author`, and `date`) as well as the following:
755`header-includes`
756: contents specified by `-H/--include-in-header` (may have multiple
757 values)
758`toc`
759: non-null value if `--toc/--table-of-contents` was specified
760`include-before`
761: contents specified by `-B/--include-before-body` (may have
762 multiple values)
763`include-after`
764: contents specified by `-A/--include-after-body` (may have
765 multiple values)
766`body`
767: body of document
768`lang`
769: language code for HTML or LaTeX documents
770`slidy-url`
771: base URL for Slidy documents (defaults to
772 `http://www.w3.org/Talks/Tools/Slidy2`)
773`slideous-url`
774: base URL for Slideous documents (defaults to `slideous`)
775`s5-url`
776: base URL for S5 documents (defaults to `s5/default`)
777`revealjs-url`
778: base URL for reveal.js documents (defaults to `reveal.js`)
779`theme`
780: reveal.js or LaTeX beamer theme
781`transition`
782: reveal.js transition
783`fontsize`
784: font size (10pt, 11pt, 12pt) for LaTeX documents
785`documentclass`
786: document class for LaTeX documents
787`classoption`
788: option for LaTeX documentclass, e.g. `oneside`; may be repeated
789 for multiple options
790`geometry`
791: options for LaTeX `geometry` class, e.g. `margin=1in`;
792 may be repeated for multiple options
793`linestretch`
794: adjusts line spacing (requires the `setspace` package)
795`fontfamily`
796: font package to use for LaTeX documents (with pdflatex):
797 TeXLive has `bookman` (Bookman), `utopia` or `fourier` (Utopia),
798 `fouriernc` (New Century Schoolbook), `times` or `txfonts` (Times),
799 `mathpazo` or `pxfonts` or `mathpple` (Palatino),
800 `libertine` (Linux Libertine), `arev` (Arev Sans),
801 and the default `lmodern`, among others.
802`mainfont`, `sansfont`, `monofont`, `mathfont`
803: fonts for LaTeX documents (works only with xelatex
804 and lualatex)
805`colortheme`
806: colortheme for LaTeX beamer documents
807`fonttheme`
808: fonttheme for LaTeX beamer documents
809`linkcolor`
810: color for internal links in LaTeX documents (`red`, `green`,
811 `magenta`, `cyan`, `blue`, `black`)
812`urlcolor`
813: color for external links in LaTeX documents
814`citecolor`
815: color for citation links in LaTeX documents
816`links-as-notes`
817: causes links to be printed as footnotes in LaTeX documents
818`biblio-style`
819: bibliography style in LaTeX, when used with `--natbib`
820`biblio-files`
821: bibliography files to use in LaTeX, with `--natbib` or `--biblatex`
822`section`
823: section number in man pages
824`header`
825: header in man pages
826`footer`
827: footer in man pages
829Variables may be set at the command line using the `-V/--variable`
830option. Variables set in this way override metadata fields with
831the same name.
833Templates may contain conditionals. The syntax is as follows:
835 $if(variable)$
836 X
837 $else$
838 Y
839 $endif$
841This will include `X` in the template if `variable` has a non-null
842value; otherwise it will include `Y`. `X` and `Y` are placeholders for
843any valid template text, and may include interpolated variables or other
844conditionals. The `$else$` section may be omitted.
846When variables can have multiple values (for example, `author` in
847a multi-author document), you can use the `$for$` keyword:
849 $for(author)$
850 <meta name="author" content="$author$" />
851 $endfor$
853You can optionally specify a separator to be used between
854consecutive items:
856 $for(author)$$author$$sep$, $endfor$
858A dot can be used to select a field of a variable that takes
859an object as its value. So, for example:
861 $author.name$ ($author.affiliation$)
863If you use custom templates, you may need to revise them as pandoc
864changes. We recommend tracking the changes in the default templates,
865and modifying your custom templates accordingly. An easy way to do this
866is to fork the pandoc-templates repository
867(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
868pandoc release.
870Pandoc's markdown
871=================
873Pandoc understands an extended and slightly revised version of
874John Gruber's [markdown] syntax. This document explains the syntax,
875noting differences from standard markdown. Except where noted, these
876differences can be suppressed by using the `markdown_strict` format instead
877of `markdown`. An extensions can be enabled by adding `+EXTENSION`
878to the format name and disabled by adding `-EXTENSION`. For example,
879`markdown_strict+footnotes` is strict markdown with footnotes
880enabled, while `markdown-footnotes-pipe_tables` is pandoc's
881markdown without footnotes or pipe tables.
883Philosophy
884----------
886Markdown is designed to be easy to write, and, even more importantly,
887easy to read:
889> A Markdown-formatted document should be publishable as-is, as plain
890> text, without looking like it's been marked up with tags or formatting
891> instructions.
892> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
894This principle has guided pandoc's decisions in finding syntax for
895tables, footnotes, and other extensions.
897There is, however, one respect in which pandoc's aims are different
898from the original aims of markdown. Whereas markdown was originally
899designed with HTML generation in mind, pandoc is designed for multiple
900output formats. Thus, while pandoc allows the embedding of raw HTML,
901it discourages it, and provides other, non-HTMLish ways of representing
902important document elements like definition lists, tables, mathematics, and
903footnotes.
905Paragraphs
906----------
908A paragraph is one or more lines of text followed by one or more blank line.
909Newlines are treated as spaces, so you can reflow your paragraphs as you like.
910If you need a hard line break, put two or more spaces at the end of a line.
912**Extension: `escaped_line_breaks`**
914A backslash followed by a newline is also a hard line break.
915Note: in multiline and grid table cells, this is the only way
916to create a hard line break, since trailing spaces in the cells
917are ignored.
919Headers
920-------
922There are two kinds of headers, Setext and atx.
924### Setext-style headers ###
926A setext-style header is a line of text "underlined" with a row of `=` signs
927(for a level one header) or `-` signs (for a level two header):
929 A level-one header
930 ==================
932 A level-two header
933 ------------------
935The header text can contain inline formatting, such as emphasis (see
936[Inline formatting](#inline-formatting), below).
939### Atx-style headers ###
941An Atx-style header consists of one to six `#` signs and a line of
942text, optionally followed by any number of `#` signs. The number of
943`#` signs at the beginning of the line is the header level:
945 ## A level-two header
947 ### A level-three header ###
949As with setext-style headers, the header text can contain formatting:
951 # A level-one header with a [link](/url) and *emphasis*
953**Extension: `blank_before_header`**
955Standard markdown syntax does not require a blank line before a header.
956Pandoc does require this (except, of course, at the beginning of the
957document). The reason for the requirement is that it is all too easy for a
958`#` to end up at the beginning of a line by accident (perhaps through line
959wrapping). Consider, for example:
961 I like several of their flavors of ice cream:
962 #22, for example, and #5.
965### Header identifiers in HTML, LaTeX, and ConTeXt ###
967**Extension: `header_attributes`**
969Headers can be assigned attributes using this syntax at the end
970of the line containing the header text:
972 {#identifier .class .class key=value key=value}
974Thus, for example, the following headers will all be assigned the identifier
975`foo`:
977 # My header {#foo}
979 ## My header ## {#foo}
981 My other header {#foo}
982 ---------------
984(This syntax is compatible with [PHP Markdown Extra].)
986Note that although this syntax allows assignment of classes and key/value
987attributes, writers generally don't use all of this information. Identifiers,
988classes, and key/value attributes are used in HTML and HTML-based formats such
989as EPUB and slidy. Identifiers are used for labels and link anchors in the
990LaTeX, ConTeXt, Textile, and AsciiDoc writers.
992Headers with the class `unnumbered` will not be numbered, even if
993`--number-sections` is specified. A single hyphen (`-`) in an attribute
994context is equivalent to `.unnumbered`, and preferable in non-English
995documents. So,
997 # My header {-}
999is just the same as
1001 # My header {.unnumbered}
1003**Extension: `auto_identifiers`**
1005A header without an explicitly specified identifier will be
1006automatically assigned a unique identifier based on the header text.
1007To derive the identifier from the header text,
1009 - Remove all formatting, links, etc.
1010 - Remove all footnotes.
1011 - Remove all punctuation, except underscores, hyphens, and periods.
1012 - Replace all spaces and newlines with hyphens.
1013 - Convert all alphabetic characters to lowercase.
1014 - Remove everything up to the first letter (identifiers may
1015 not begin with a number or punctuation mark).
1016 - If nothing is left after this, use the identifier `section`.
1018Thus, for example,
1020 Header Identifier
1021 ------------------------------- ----------------------------
1022 Header identifiers in HTML `header-identifiers-in-html`
1023 *Dogs*?--in *my* house? `dogs--in-my-house`
1024 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1025 3. Applications `applications`
1026 33 `section`
1028These rules should, in most cases, allow one to determine the identifier
1029from the header text. The exception is when several headers have the
1030same text; in this case, the first will get an identifier as described
1031above; the second will get the same identifier with `-1` appended; the
1032third with `-2`; and so on.
1034These identifiers are used to provide link targets in the table of
1035contents generated by the `--toc|--table-of-contents` option. They
1036also make it easy to provide links from one section of a document to
1037another. A link to this section, for example, might look like this:
1039 See the section on
1040 [header identifiers](#header-identifiers-in-html-latex-and-context).
1042Note, however, that this method of providing links to sections works
1043only in HTML, LaTeX, and ConTeXt formats.
1045If the `--section-divs` option is specified, then each section will
1046be wrapped in a `div` (or a `section`, if `--html5` was specified),
1047and the identifier will be attached to the enclosing `<div>`
1048(or `<section>`) tag rather than the header itself. This allows entire
1049sections to be manipulated using javascript or treated differently in
1050CSS.
1052**Extension: `implicit_header_references`**
1054Pandoc behaves as if reference links have been defined for each header.
1055So, instead of
1057 [header identifiers](#header-identifiers-in-html)
1059you can simply write
1061 [header identifiers]
1065 [header identifiers][]
1069 [the section on header identifiers][header identifiers]
1071If there are multiple headers with identical text, the corresponding
1072reference will link to the first one only, and you will need to use explicit
1073links to link to the others, as described above.
1075Unlike regular reference links, these references are case-sensitive.
1077Note: if you have defined an explicit identifier for a header,
1078then implicit references to it will not work.
1080Block quotations
1081----------------
1083Markdown uses email conventions for quoting blocks of text.
1084A block quotation is one or more paragraphs or other block elements
1085(such as lists or headers), with each line preceded by a `>` character
1086and a space. (The `>` need not start at the left margin, but it should
1087not be indented more than three spaces.)
1089 > This is a block quote. This
1090 > paragraph has two lines.
1092 > 1. This is a list inside a block quote.
1093 > 2. Second item.
1095A "lazy" form, which requires the `>` character only on the first
1096line of each block, is also allowed:
1098 > This is a block quote. This
1099 paragraph has two lines.
1101 > 1. This is a list inside a block quote.
1102 2. Second item.
1104Among the block elements that can be contained in a block quote are
1105other block quotes. That is, block quotes can be nested:
1107 > This is a block quote.
1109 > > A block quote within a block quote.
1111**Extension: `blank_before_blockquote`**
1113Standard markdown syntax does not require a blank line before a block
1114quote. Pandoc does require this (except, of course, at the beginning of the
1115document). The reason for the requirement is that it is all too easy for a
1116`>` to end up at the beginning of a line by accident (perhaps through line
1117wrapping). So, unless the `markdown_strict` format is used, the following does
1118not produce a nested block quote in pandoc:
1120 > This is a block quote.
1121 >> Nested.
1124Verbatim (code) blocks
1125----------------------
1127### Indented code blocks ###
1129A block of text indented four spaces (or one tab) is treated as verbatim
1130text: that is, special characters do not trigger special formatting,
1131and all spaces and line breaks are preserved. For example,
1133 if (a > 3) {
1134 moveShip(5 * gravity, DOWN);
1137The initial (four space or one tab) indentation is not considered part
1138of the verbatim text, and is removed in the output.
1140Note: blank lines in the verbatim text need not begin with four spaces.
1143### Fenced code blocks ###
1145**Extension: `fenced_code_blocks`**
1147In addition to standard indented code blocks, Pandoc supports
1148*fenced* code blocks. These begin with a row of three or more
1149tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
1150backticks that must be at least as long as the starting row. Everything
1151between these lines is treated as code. No indentation is necessary:
1153 ~~~~~~~
1154 if (a > 3) {
1155 moveShip(5 * gravity, DOWN);
1157 ~~~~~~~
1159Like regular code blocks, fenced code blocks must be separated
1160from surrounding text by blank lines.
1162If the code itself contains a row of tildes or backticks, just use a longer
1163row of tildes or backticks at the start and end:
1165 ~~~~~~~~~~~~~~~~
1166 ~~~~~~~~~~
1167 code including tildes
1168 ~~~~~~~~~~
1169 ~~~~~~~~~~~~~~~~
1171Optionally, you may attach attributes to the code block using
1172this syntax:
1174 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1175 qsort [] = []
1176 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1177 qsort (filter (>= x) xs)
1178 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1180Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1181`startFrom` is an attribute with value `100`. Some output formats can use this
1182information to do syntax highlighting. Currently, the only output formats
1183that uses this information are HTML and LaTeX. If highlighting is supported
1184for your output format and language, then the code block above will appear
1185highlighted, with numbered lines. (To see which languages are supported, do
1186`pandoc --version`.) Otherwise, the code block above will appear as follows:
1188 <pre id="mycode" class="haskell numberLines" startFrom="100">
1189 <code>
1190 ...
1191 </code>
1192 </pre>
1194A shortcut form can also be used for specifying the language of
1195the code block:
1197 ```haskell
1198 qsort [] = []
1199 ```
1201This is equivalent to:
1203 ``` {.haskell}
1204 qsort [] = []
1205 ```
1207To prevent all highlighting, use the `--no-highlight` flag.
1208To set the highlighting style, use `--highlight-style`.
1210Line blocks
1211-----------
1213**Extension: `line_blocks`**
1215A line block is a sequence of lines beginning with a vertical bar (`|`)
1216followed by a space. The division into lines will be preserved in
1217the output, as will any leading spaces; otherwise, the lines will
1218be formatted as markdown. This is useful for verse and addresses:
1220 | The limerick packs laughs anatomical
1221 | In space that is quite economical.
1222 | But the good ones I've seen
1223 | So seldom are clean
1224 | And the clean ones so seldom are comical
1226 | 200 Main St.
1227 | Berkeley, CA 94718
1229The lines can be hard-wrapped if needed, but the continuation
1230line must begin with a space.
1232 | The Right Honorable Most Venerable and Righteous Samuel L.
1233 Constable, Jr.
1234 | 200 Main St.
1235 | Berkeley, CA 94718
1237This syntax is borrowed from [reStructuredText].
1239Lists
1240-----
1242### Bullet lists ###
1244A bullet list is a list of bulleted list items. A bulleted list
1245item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1246example:
1248 * one
1249 * two
1250 * three
1252This will produce a "compact" list. If you want a "loose" list, in which
1253each item is formatted as a paragraph, put spaces between the items:
1255 * one
1257 * two
1259 * three
1261The bullets need not be flush with the left margin; they may be
1262indented one, two, or three spaces. The bullet must be followed
1263by whitespace.
1265List items look best if subsequent lines are flush with the first
1266line (after the bullet):
1268 * here is my first
1269 list item.
1270 * and my second.
1272But markdown also allows a "lazy" format:
1274 * here is my first
1275 list item.
1276 * and my second.
1278### The four-space rule ###
1280A list item may contain multiple paragraphs and other block-level
1281content. However, subsequent paragraphs must be preceded by a blank line
1282and indented four spaces or a tab. The list will look better if the first
1283paragraph is aligned with the rest:
1285 * First paragraph.
1287 Continued.
1289 * Second paragraph. With a code block, which must be indented
1290 eight spaces:
1292 { code }
1294List items may include other lists. In this case the preceding blank
1295line is optional. The nested list must be indented four spaces or
1296one tab:
1298 * fruits
1299 + apples
1300 - macintosh
1301 - red delicious
1302 + pears
1303 + peaches
1304 * vegetables
1305 + broccoli
1306 + chard
1308As noted above, markdown allows you to write list items "lazily," instead of
1309indenting continuation lines. However, if there are multiple paragraphs or
1310other blocks in a list item, the first line of each must be indented.
1312 + A lazy, lazy, list
1313 item.
1315 + Another one; this looks
1316 bad but is legal.
1318 Second paragraph of second
1319 list item.
1321**Note:** Although the four-space rule for continuation paragraphs
1322comes from the official [markdown syntax guide], the reference implementation,
1323`Markdown.pl`, does not follow it. So pandoc will give different results than
1324`Markdown.pl` when authors have indented continuation paragraphs fewer than
1325four spaces.
1327The [markdown syntax guide] is not explicit whether the four-space
1328rule applies to *all* block-level content in a list item; it only
1329mentions paragraphs and code blocks. But it implies that the rule
1330applies to all block-level content (including nested lists), and
1331pandoc interprets it that way.
1333 [markdown syntax guide]:
1334 http://daringfireball.net/projects/markdown/syntax#list
1336### Ordered lists ###
1338Ordered lists work just like bulleted lists, except that the items
1339begin with enumerators rather than bullets.
1341In standard markdown, enumerators are decimal numbers followed
1342by a period and a space. The numbers themselves are ignored, so
1343there is no difference between this list:
1345 1. one
1346 2. two
1347 3. three
1349and this one:
1351 5. one
1352 7. two
1353 1. three
1355**Extension: `fancy_lists`**
1357Unlike standard markdown, Pandoc allows ordered list items to be marked
1358with uppercase and lowercase letters and roman numerals, in addition to
1359arabic numerals. List markers may be enclosed in parentheses or followed by a
1360single right-parentheses or period. They must be separated from the
1361text that follows by at least one space, and, if the list marker is a
1362capital letter with a period, by at least two spaces.[^2]
1364[^2]: The point of this rule is to ensure that normal paragraphs
1365 starting with people's initials, like
1367 B. Russell was an English philosopher.
1369 do not get treated as list items.
1371 This rule will not prevent
1373 (C) 2007 Joe Smith
1375 from being interpreted as a list item. In this case, a backslash
1376 escape can be used:
1378 (C\) 2007 Joe Smith
1380The `fancy_lists` extension also allows '`#`' to be used as an
1381ordered list marker in place of a numeral:
1383 #. one
1384 #. two
1386**Extension: `startnum`**
1388Pandoc also pays attention to the type of list marker used, and to the
1389starting number, and both of these are preserved where possible in the
1390output format. Thus, the following yields a list with numbers followed
1391by a single parenthesis, starting with 9, and a sublist with lowercase
1392roman numerals:
1394 9) Ninth
1395 10) Tenth
1396 11) Eleventh
1397 i. subone
1398 ii. subtwo
1399 iii. subthree
1401Pandoc will start a new list each time a different type of list
1402marker is used. So, the following will create three lists:
1404 (2) Two
1405 (5) Three
1406 1. Four
1407 * Five
1409If default list markers are desired, use `#.`:
1411 #. one
1412 #. two
1413 #. three
1416### Definition lists ###
1418**Extension: `definition_lists`**
1420Pandoc supports definition lists, using a syntax inspired by
1421[PHP Markdown Extra] and [reStructuredText]:[^3]
1423 Term 1
1425 : Definition 1
1427 Term 2 with *inline markup*
1429 : Definition 2
1431 { some code, part of Definition 2 }
1433 Third paragraph of definition 2.
1435Each term must fit on one line, which may optionally be followed by
1436a blank line, and must be followed by one or more definitions.
1437A definition begins with a colon or tilde, which may be indented one
1438or two spaces. The body of the definition (including the first line,
1439aside from the colon or tilde) should be indented four spaces. A term may have
1440multiple definitions, and each definition may consist of one or more block
1441elements (paragraph, code block, list, etc.), each indented four spaces or one
1442tab stop.
1444If you leave space after the definition (as in the example above),
1445the blocks of the definitions will be considered paragraphs. In some
1446output formats, this will mean greater spacing between term/definition
1447pairs. For a compact definition list, do not leave space between the
1448definition and the next term:
1450 Term 1
1451 ~ Definition 1
1452 Term 2
1453 ~ Definition 2a
1454 ~ Definition 2b
1456[^3]: I have also been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1458[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1461### Numbered example lists ###
1463**Extension: `example_lists`**
1465The special list marker `@` can be used for sequentially numbered
1466examples. The first list item with a `@` marker will be numbered '1',
1467the next '2', and so on, throughout the document. The numbered examples
1468need not occur in a single list; each new list using `@` will take up
1469where the last stopped. So, for example:
1471 (@) My first example will be numbered (1).
1472 (@) My second example will be numbered (2).
1474 Explanation of examples.
1476 (@) My third example will be numbered (3).
1478Numbered examples can be labeled and referred to elsewhere in the
1479document:
1481 (@good) This is a good example.
1483 As (@good) illustrates, ...
1485The label can be any string of alphanumeric characters, underscores,
1486or hyphens.
1489### Compact and loose lists ###
1491Pandoc behaves differently from `Markdown.pl` on some "edge
1492cases" involving lists. Consider this source:
1494 + First
1495 + Second:
1496 - Fee
1497 - Fie
1498 - Foe
1500 + Third
1502Pandoc transforms this into a "compact list" (with no `<p>` tags around
1503"First", "Second", or "Third"), while markdown puts `<p>` tags around
1504"Second" and "Third" (but not "First"), because of the blank space
1505around "Third". Pandoc follows a simple rule: if the text is followed by
1506a blank line, it is treated as a paragraph. Since "Second" is followed
1507by a list, and not a blank line, it isn't treated as a paragraph. The
1508fact that the list is followed by a blank line is irrelevant. (Note:
1509Pandoc works this way even when the `markdown_strict` format is specified. This
1510behavior is consistent with the official markdown syntax description,
1511even though it is different from that of `Markdown.pl`.)
1514### Ending a list ###
1516What if you want to put an indented code block after a list?
1518 - item one
1519 - item two
1521 { my code block }
1523Trouble! Here pandoc (like other markdown implementations) will treat
1524`{ my code block }` as the second paragraph of item two, and not as
1525a code block.
1527To "cut off" the list after item two, you can insert some non-indented
1528content, like an HTML comment, which won't produce visible output in
1529any format:
1531 - item one
1532 - item two
1534 <!-- end of list -->
1536 { my code block }
1538You can use the same trick if you want two consecutive lists instead
1539of one big list:
1541 1. one
1542 2. two
1543 3. three
1545 <!-- -->
1547 1. uno
1548 2. dos
1549 3. tres
1551Horizontal rules
1552----------------
1554A line containing a row of three or more `*`, `-`, or `_` characters
1555(optionally separated by spaces) produces a horizontal rule:
1557 * * * *
1559 ---------------
1562Tables
1563------
1565Four kinds of tables may be used. The first three kinds presuppose the use of
1566a fixed-width font, such as Courier. The fourth kind can be used with
1567proportionally spaced fonts, as it does not require lining up columns.
1569### Simple tables
1571**Extension: `simple_tables`, `table_captions`**
1573Simple tables look like this:
1575 Right Left Center Default
1576 ------- ------ ---------- -------
1577 12 12 12 12
1578 123 123 123 123
1579 1 1 1 1
1581 Table: Demonstration of simple table syntax.
1583The headers and table rows must each fit on one line. Column
1584alignments are determined by the position of the header text relative
1585to the dashed line below it:[^4]
1587 - If the dashed line is flush with the header text on the right side
1588 but extends beyond it on the left, the column is right-aligned.
1589 - If the dashed line is flush with the header text on the left side
1590 but extends beyond it on the right, the column is left-aligned.
1591 - If the dashed line extends beyond the header text on both sides,
1592 the column is centered.
1593 - If the dashed line is flush with the header text on both sides,
1594 the default alignment is used (in most cases, this will be left).
1596[^4]: This scheme is due to Michel Fortin, who proposed it on the
1597 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1599The table must end with a blank line, or a line of dashes followed by
1600a blank line. A caption may optionally be provided (as illustrated in
1601the example above). A caption is a paragraph beginning with the string
1602`Table:` (or just `:`), which will be stripped off. It may appear either
1603before or after the table.
1605The column headers may be omitted, provided a dashed line is used
1606to end the table. For example:
1608 ------- ------ ---------- -------
1609 12 12 12 12
1610 123 123 123 123
1611 1 1 1 1
1612 ------- ------ ---------- -------
1614When headers are omitted, column alignments are determined on the basis
1615of the first line of the table body. So, in the tables above, the columns
1616would be right, left, center, and right aligned, respectively.
1618### Multiline tables
1620**Extension: `multiline_tables`, `table_captions`**
1622Multiline tables allow headers and table rows to span multiple lines
1623of text (but cells that span multiple columns or rows of the table are
1624not supported). Here is an example:
1626 -------------------------------------------------------------
1627 Centered Default Right Left
1628 Header Aligned Aligned Aligned
1629 ----------- ------- --------------- -------------------------
1630 First row 12.0 Example of a row that
1631 spans multiple lines.
1633 Second row 5.0 Here's another one. Note
1634 the blank line between
1635 rows.
1636 -------------------------------------------------------------
1638 Table: Here's the caption. It, too, may span
1639 multiple lines.
1641These work like simple tables, but with the following differences:
1643 - They must begin with a row of dashes, before the header text
1644 (unless the headers are omitted).
1645 - They must end with a row of dashes, then a blank line.
1646 - The rows must be separated by blank lines.
1648In multiline tables, the table parser pays attention to the widths of
1649the columns, and the writers try to reproduce these relative widths in
1650the output. So, if you find that one of the columns is too narrow in the
1651output, try widening it in the markdown source.
1653Headers may be omitted in multiline tables as well as simple tables:
1655 ----------- ------- --------------- -------------------------
1656 First row 12.0 Example of a row that
1657 spans multiple lines.
1659 Second row 5.0 Here's another one. Note
1660 the blank line between
1661 rows.
1662 ----------- ------- --------------- -------------------------
1664 : Here's a multiline table without headers.
1666It is possible for a multiline table to have just one row, but the row
1667should be followed by a blank line (and then the row of dashes that ends
1668the table), or the table may be interpreted as a simple table.
1670### Grid tables
1672**Extension: `grid_tables`, `table_captions`**
1674Grid tables look like this:
1676 : Sample grid table.
1678 +---------------+---------------+--------------------+
1679 | Fruit | Price | Advantages |
1680 +===============+===============+====================+
1681 | Bananas | $1.34 | - built-in wrapper |
1682 | | | - bright color |
1683 +---------------+---------------+--------------------+
1684 | Oranges | $2.10 | - cures scurvy |
1685 | | | - tasty |
1686 +---------------+---------------+--------------------+
1688The row of `=`s separates the header from the table body, and can be
1689omitted for a headerless table. The cells of grid tables may contain
1690arbitrary block elements (multiple paragraphs, code blocks, lists,
1691etc.). Alignments are not supported, nor are cells that span multiple
1692columns or rows. Grid tables can be created easily using [Emacs table mode].
1694 [Emacs table mode]: http://table.sourceforge.net/
1696### Pipe tables
1698**Extension: `pipe_tables`, `table_captions`**
1700Pipe tables look like this:
1702 | Right | Left | Default | Center |
1703 |------:|:-----|---------|:------:|
1704 | 12 | 12 | 12 | 12 |
1705 | 123 | 123 | 123 | 123 |
1706 | 1 | 1 | 1 | 1 |
1708 : Demonstration of simple table syntax.
1710The syntax is [the same as in PHP markdown extra]. The beginning and
1711ending pipe characters are optional, but pipes are required between all
1712columns. The colons indicate column alignment as shown. The header
1713can be omitted, but the horizontal line must still be included, as
1714it defines column alignments.
1716Since the pipes indicate column boundaries, columns need not be vertically
1717aligned, as they are in the above example. So, this is a perfectly
1718legal (though ugly) pipe table:
1720 fruit| price
1721 -----|-----:
1722 apple|2.05
1723 pear|1.37
1724 orange|3.09
1726The cells of pipe tables cannot contain block elements like paragraphs
1727and lists, and cannot span multiple lines.
1729 [the same as in PHP markdown extra]:
1730 http://michelf.ca/projects/php-markdown/extra/#table
1732Note: Pandoc also recognizes pipe tables of the following
1733form, as can produced by Emacs' orgtbl-mode:
1735 | One | Two |
1736 |-----+-------|
1737 | my | table |
1738 | is | nice |
1740The difference is that `+` is used instead of `|`. Other orgtbl features
1741are not supported. In particular, to get non-default column alignment,
1742you'll need to add colons as above.
1744Title block
1745-----------
1747**Extension: `pandoc_title_block`**
1749If the file begins with a title block
1751 % title
1752 % author(s) (separated by semicolons)
1753 % date
1755it will be parsed as bibliographic information, not regular text. (It
1756will be used, for example, in the title of standalone LaTeX or HTML
1757output.) The block may contain just a title, a title and an author,
1758or all three elements. If you want to include an author but no
1759title, or a title and a date but no author, you need a blank line:
1762 % Author
1764 % My title
1766 % June 15, 2006
1768The title may occupy multiple lines, but continuation lines must
1769begin with leading space, thus:
1771 % My title
1772 on multiple lines
1774If a document has multiple authors, the authors may be put on
1775separate lines with leading space, or separated by semicolons, or
1776both. So, all of the following are equivalent:
1778 % Author One
1779 Author Two
1781 % Author One; Author Two
1783 % Author One;
1784 Author Two
1786The date must fit on one line.
1788All three metadata fields may contain standard inline formatting
1789(italics, links, footnotes, etc.).
1791Title blocks will always be parsed, but they will affect the output only
1792when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1793will appear twice: once in the document head -- this is the title that
1794will appear at the top of the window in a browser -- and once at the
1795beginning of the document body. The title in the document head can have
1796an optional prefix attached (`--title-prefix` or `-T` option). The title
1797in the body appears as an H1 element with class "title", so it can be
1798suppressed or reformatted with CSS. If a title prefix is specified with
1799`-T` and no title block appears in the document, the title prefix will
1800be used by itself as the HTML title.
1802The man page writer extracts a title, man page section number, and
1803other header and footer information from the title line. The title
1804is assumed to be the first word on the title line, which may optionally
1805end with a (single-digit) section number in parentheses. (There should
1806be no space between the title and the parentheses.) Anything after
1807this is assumed to be additional footer and header text. A single pipe
1808character (`|`) should be used to separate the footer text from the header
1809text. Thus,
1811 % PANDOC(1)
1813will yield a man page with the title `PANDOC` and section 1.
1815 % PANDOC(1) Pandoc User Manuals
1817will also have "Pandoc User Manuals" in the footer.
1819 % PANDOC(1) Pandoc User Manuals | Version 4.0
1821will also have "Version 4.0" in the header.
1823YAML metadata block
1824-------------------
1826**Extension: `yaml_metadata_block`**
1828A YAML metadata block is a valid YAML object, delimited by a line of three
1829hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
1830(`...`) at the bottom. A YAML metadata block may occur anywhere in the
1831document, but if it is not at the beginning, it must be preceded by a blank
1832line.
1834Metadata will be taken from the fields of the YAML object and added to any
1835existing document metadata. Metadata can contain lists and objects (nested
1836arbitrarily), but all string scalars will be interpreted as markdown. Fields
1837with names ending in an underscore will be ignored by pandoc. (They may be
1838given a role by external processors.)
1840A document may contain multiple metadata blocks. The metadata fields will
1841be combined through a *left-biased union*: if two metadata blocks attempt
1842to set the same field, the value from the first block will be taken.
1844Note that YAML escaping rules must be followed. Thus, for example,
1845if a title contains a colon, it must be quoted. The pipe character
1846(`|`) can be used to begin an indented block that will be interpreted
1847literally, without need for escaping. This form is necessary
1848when the field contains blank lines:
1850 ---
1851 title: 'This is the title: it contains a colon'
1852 author:
1853 - name: Author One
1854 affiliation: University of Somewhere
1855 - name: Author Two
1856 affiliation: University of Nowhere
1857 tags: [nothing, nothingness]
1858 abstract: |
1859 This is the abstract.
1861 It consists of two paragraphs.
1862 ...
1864Template variables will be set automatically from the metadata. Thus, for
1865example, in writing HTML, the variable `abstract` will be set to the HTML
1866equivalent of the markdown in the `abstract` field:
1868 <p>This is the abstract.</p>
1869 <p>It consists of two paragraphs.</p>
1871Note: The `author` variable in the default templates expects a simple list or
1872string. To use the structured authors in the example, you would need a
1873custom template. For example:
1875 $for(author)$
1876 $if(author.name)$
1877 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
1878 $else$
1879 $author$
1880 $endif$
1881 $endfor$
1884Backslash escapes
1885-----------------
1887**Extension: `all_symbols_escapable`**
1889Except inside a code block or inline code, any punctuation or space
1890character preceded by a backslash will be treated literally, even if it
1891would normally indicate formatting. Thus, for example, if one writes
1893 *\*hello\**
1895one will get
1897 <em>*hello*</em>
1899instead of
1901 <strong>hello</strong>
1903This rule is easier to remember than standard markdown's rule,
1904which allows only the following characters to be backslash-escaped:
1906 \`*_{}[]()>#+-.!
1908(However, if the `markdown_strict` format is used, the standard markdown rule
1909will be used.)
1911A backslash-escaped space is parsed as a nonbreaking space. It will
1912appear in TeX output as `~` and in HTML and XML as `\&#160;` or
1913`\&nbsp;`.
1915A backslash-escaped newline (i.e. a backslash occurring at the end of
1916a line) is parsed as a hard line break. It will appear in TeX output as
1917`\\` and in HTML as `<br />`. This is a nice alternative to
1918markdown's "invisible" way of indicating hard line breaks using
1919two trailing spaces on a line.
1921Backslash escapes do not work in verbatim contexts.
1923Smart punctuation
1924-----------------
1926**Extension**
1928If the `--smart` option is specified, pandoc will produce typographically
1929correct output, converting straight quotes to curly quotes, `---` to
1930em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
1931are inserted after certain abbreviations, such as "Mr."
1933Note: if your LaTeX template uses the `csquotes` package, pandoc will
1934detect automatically this and use `\enquote{...}` for quoted text.
1936Inline formatting
1937-----------------
1939### Emphasis ###
1941To *emphasize* some text, surround it with `*`s or `_`, like this:
1943 This text is _emphasized with underscores_, and this
1944 is *emphasized with asterisks*.
1946Double `*` or `_` produces **strong emphasis**:
1948 This is **strong emphasis** and __with underscores__.
1950A `*` or `_` character surrounded by spaces, or backslash-escaped,
1951will not trigger emphasis:
1953 This is * not emphasized *, and \*neither is this\*.
1955**Extension: `intraword_underscores`**
1957Because `_` is sometimes used inside words and identifiers,
1958pandoc does not interpret a `_` surrounded by alphanumeric
1959characters as an emphasis marker. If you want to emphasize
1960just part of a word, use `*`:
1962 feas*ible*, not feas*able*.
1965### Strikeout ###
1967**Extension: `strikeout`**
1969To strikeout a section of text with a horizontal line, begin and end it
1970with `~~`. Thus, for example,
1972 This ~~is deleted text.~~
1975### Superscripts and subscripts ###
1977**Extension: `superscript`, `subscript`**
1979Superscripts may be written by surrounding the superscripted text by `^`
1980characters; subscripts may be written by surrounding the subscripted
1981text by `~` characters. Thus, for example,
1983 H~2~O is a liquid. 2^10^ is 1024.
1985If the superscripted or subscripted text contains spaces, these spaces
1986must be escaped with backslashes. (This is to prevent accidental
1987superscripting and subscripting through the ordinary use of `~` and `^`.)
1988Thus, if you want the letter P with 'a cat' in subscripts, use
1989`P~a\ cat~`, not `P~a cat~`.
1992### Verbatim ###
1994To make a short span of text verbatim, put it inside backticks:
1996 What is the difference between `>>=` and `>>`?
1998If the verbatim text includes a backtick, use double backticks:
2000 Here is a literal backtick `` ` ``.
2002(The spaces after the opening backticks and before the closing
2003backticks will be ignored.)
2005The general rule is that a verbatim span starts with a string
2006of consecutive backticks (optionally followed by a space)
2007and ends with a string of the same number of backticks (optionally
2008preceded by a space).
2010Note that backslash-escapes (and other markdown constructs) do not
2011work in verbatim contexts:
2013 This is a backslash followed by an asterisk: `\*`.
2015**Extension: `inline_code_attributes`**
2017Attributes can be attached to verbatim text, just as with
2018[fenced code blocks](#fenced-code-blocks):
2020 `<$>`{.haskell}
2022Math
2023----
2025**Extension: `tex_math_dollars`**
2027Anything between two `$` characters will be treated as TeX math. The
2028opening `$` must have a character immediately to its right, while the
2029closing `$` must have a character immediately to its left. Thus,
2030`$20,000 and $30,000` won't parse as math. If for some reason
2031you need to enclose text in literal `$` characters, backslash-escape
2032them and they won't be treated as math delimiters.
2034TeX math will be printed in all output formats. How it is rendered
2035depends on the output format:
2037Markdown, LaTeX, Org-Mode, ConTeXt
2038 ~ It will appear verbatim between `$` characters.
2040reStructuredText
2041 ~ It will be rendered using an interpreted text role `:math:`, as described
2042 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
2044AsciiDoc
2045 ~ It will be rendered as `latexmath:[...]`.
2047Texinfo
2048 ~ It will be rendered inside a `@math` command.
2050groff man
2051 ~ It will be rendered verbatim without `$`'s.
2053MediaWiki
2054 ~ It will be rendered inside `<math>` tags.
2056Textile
2057 ~ It will be rendered inside `<span class="math">` tags.
2059RTF, OpenDocument, ODT
2060 ~ It will be rendered, if possible, using unicode characters,
2061 and will otherwise appear verbatim.
2063Docbook
2064 ~ If the `--mathml` flag is used, it will be rendered using mathml
2065 in an `inlineequation` or `informalequation` tag. Otherwise it
2066 will be rendered, if possible, using unicode characters.
2068Docx
2069 ~ It will be rendered using OMML math markup.
2071FictionBook2
2072 ~ If the `--webtex` option is used, formulas are rendered as images
2073 using Google Charts or other compatible web service, downloaded
2074 and embedded in the e-book. Otherwise, they will appear verbatim.
2076HTML, Slidy, DZSlides, S5, EPUB
2077 ~ The way math is rendered in HTML will depend on the
2078 command-line options selected:
2080 1. The default is to render TeX math as far as possible using unicode
2081 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2082 are put inside a `span` with `class="math"`, so that they may be
2083 styled differently from the surrounding text if needed.
2085 2. If the `--latexmathml` option is used, TeX math will be displayed
2086 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2087 The [LaTeXMathML] script will be used to render it as formulas.
2088 (This trick does not work in all browsers, but it works in Firefox.
2089 In browsers that do not support LaTeXMathML, TeX math will appear
2090 verbatim between `$` characters.)
2092 3. If the `--jsmath` option is used, TeX math will be put inside
2093 `<span>` tags (for inline math) or `<div>` tags (for display math)
2094 with class `math`. The [jsMath] script will be used to render
2095 it.
2097 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2098 be called to generate images for each TeX formula. This should
2099 work in all browsers. The `--mimetex` option takes an optional URL
2100 as argument. If no URL is specified, it will be assumed that the
2101 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2103 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2104 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2105 be processed by [gladTeX], which will produce image files for each
2106 formula and an `html` file with links to these images. So, the
2107 procedure is:
2109 pandoc -s --gladtex myfile.txt -o myfile.htex
2110 gladtex -d myfile-images myfile.htex
2111 # produces myfile.html and images in myfile-images
2113 6. If the `--webtex` option is used, TeX formulas will be converted
2114 to `<img>` tags that link to an external script that converts
2115 formulas to images. The formula will be URL-encoded and concatenated
2116 with the URL provided. If no URL is specified, the Google Chart
2117 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2119 7. If the `--mathjax` option is used, TeX math will be displayed
2120 between `\(...\)` (for inline math) or `\[...\]` (for display
2121 math) and put in `<span>` tags with class `math`.
2122 The [MathJax] script will be used to render it as formulas.
2124Raw HTML
2125--------
2127**Extension: `raw_html`**
2129Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2130(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2131literally). (Technically this is not an extension, since standard
2132markdown allows it, but it has been made an extension so that it can
2133be disabled if desired.)
2135The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2136DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2137formats.
2139**Extension: `markdown_in_html_blocks`**
2141Standard markdown allows you to include HTML "blocks": blocks
2142of HTML between balanced tags that are separated from the surrounding text
2143with blank lines, and start and end at the left margin. Within
2144these blocks, everything is interpreted as HTML, not markdown;
2145so (for example), `*` does not signify emphasis.
2147Pandoc behaves this way when the `markdown_strict` format is used; but
2148by default, pandoc interprets material between HTML block tags as markdown.
2149Thus, for example, Pandoc will turn
2151 <table>
2152 <tr>
2153 <td>*one*</td>
2154 <td>[a link](http://google.com)</td>
2155 </tr>
2156 </table>
2158into
2160 <table>
2161 <tr>
2162 <td><em>one</em></td>
2163 <td><a href="http://google.com">a link</a></td>
2164 </tr>
2165 </table>
2167whereas `Markdown.pl` will preserve it as is.
2169There is one exception to this rule: text between `<script>` and
2170`<style>` tags is not interpreted as markdown.
2172This departure from standard markdown should make it easier to mix
2173markdown with HTML block elements. For example, one can surround
2174a block of markdown text with `<div>` tags without preventing it
2175from being interpreted as markdown.
2177Raw TeX
2178-------
2180**Extension: `raw_tex`**
2182In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2183included in a document. Inline TeX commands will be preserved and passed
2184unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2185LaTeX to include BibTeX citations:
2187 This result was proved in \cite{jones.1967}.
2189Note that in LaTeX environments, like
2191 \begin{tabular}{|l|l|}\hline
2192 Age & Frequency \\ \hline
2193 18--25 & 15 \\
2194 26--35 & 33 \\
2195 36--45 & 22 \\ \hline
2196 \end{tabular}
2198the material between the begin and end tags will be interpreted as raw
2199LaTeX, not as markdown.
2201Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2202and ConTeXt.
2204LaTeX macros
2205------------
2207**Extension: `latex_macros`**
2209For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2210`\renewcommand` definitions and apply the resulting macros to all LaTeX
2211math. So, for example, the following will work in all output formats,
2212not just LaTeX:
2214 \newcommand{\tuple}[1]{\langle #1 \rangle}
2216 $\tuple{a, b, c}$
2218In LaTeX output, the `\newcommand` definition will simply be passed
2219unchanged to the output.
2222Links
2223-----
2225Markdown allows links to be specified in several ways.
2227### Automatic links ###
2229If you enclose a URL or email address in pointy brackets, it
2230will become a link:
2232 <http://google.com>
2233 <sam@green.eggs.ham>
2235### Inline links ###
2237An inline link consists of the link text in square brackets,
2238followed by the URL in parentheses. (Optionally, the URL can
2239be followed by a link title, in quotes.)
2241 This is an [inline link](/url), and here's [one with
2242 a title](http://fsf.org "click here for a good time!").
2244There can be no space between the bracketed part and the parenthesized part.
2245The link text can contain formatting (such as emphasis), but the title cannot.
2248### Reference links ###
2250An *explicit* reference link has two parts, the link itself and the link
2251definition, which may occur elsewhere in the document (either
2252before or after the link).
2254The link consists of link text in square brackets, followed by a label in
2255square brackets. (There can be space between the two.) The link definition
2256consists of the bracketed label, followed by a colon and a space, followed by
2257the URL, and optionally (after a space) a link title either in quotes or in
2258parentheses.
2260Here are some examples:
2262 [my label 1]: /foo/bar.html "My title, optional"
2263 [my label 2]: /foo
2264 [my label 3]: http://fsf.org (The free software foundation)
2265 [my label 4]: /bar#special 'A title in single quotes'
2267The URL may optionally be surrounded by angle brackets:
2269 [my label 5]: <http://foo.bar.baz>
2271The title may go on the next line:
2273 [my label 3]: http://fsf.org
2274 "The free software foundation"
2276Note that link labels are not case sensitive. So, this will work:
2278 Here is [my link][FOO]
2280 [Foo]: /bar/baz
2282In an *implicit* reference link, the second pair of brackets is
2283empty, or omitted entirely:
2285 See [my website][], or [my website].
2287 [my website]: http://foo.bar.baz
2289Note: In `Markdown.pl` and most other markdown implementations,
2290reference link definitions cannot occur in nested constructions
2291such as list items or block quotes. Pandoc lifts this arbitrary
2292seeming restriction. So the following is fine in pandoc, though
2293not in most other implementations:
2295 > My block [quote].
2297 > [quote]: /foo
2299### Internal links
2301To link to another section of the same document, use the automatically
2302generated identifier (see [Header identifiers in HTML, LaTeX, and
2303ConTeXt](#header-identifiers-in-html-latex-and-context), below).
2304For example:
2306 See the [Introduction](#introduction).
2310 See the [Introduction].
2312 [Introduction]: #introduction
2314Internal links are currently supported for HTML formats (including
2315HTML slide shows and EPUB), LaTeX, and ConTeXt.
2317Images
2318------
2320A link immediately preceded by a `!` will be treated as an image.
2321The link text will be used as the image's alt text:
2323 ![la lune](lalune.jpg "Voyage to the moon")
2325 ![movie reel]
2327 [movie reel]: movie.gif
2329### Pictures with captions ###
2331**Extension: `implicit_figures`**
2333An image occurring by itself in a paragraph will be rendered as
2334a figure with a caption.[^5] (In LaTeX, a figure environment will be
2335used; in HTML, the image will be placed in a `div` with class
2336`figure`, together with a caption in a `p` with class `caption`.)
2337The image's alt text will be used as the caption.
2339 ![This is the caption](/url/of/image.png)
2341[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2342 ODT. In those formats, you'll just get an image in a paragraph by
2343 itself, with no caption.
2345If you just want a regular inline image, just make sure it is not
2346the only thing in the paragraph. One way to do this is to insert a
2347nonbreaking space after the image:
2349 ![This image won't be a figure](/url/of/image.png)\
2352Footnotes
2353---------
2355**Extension: `footnotes`**
2357Pandoc's markdown allows footnotes, using the following syntax:
2359 Here is a footnote reference,[^1] and another.[^longnote]
2361 [^1]: Here is the footnote.
2363 [^longnote]: Here's one with multiple blocks.
2365 Subsequent paragraphs are indented to show that they
2366 belong to the previous footnote.
2368 { some.code }
2370 The whole paragraph can be indented, or just the first
2371 line. In this way, multi-paragraph footnotes work like
2372 multi-paragraph list items.
2374 This paragraph won't be part of the note, because it
2375 isn't indented.
2377The identifiers in footnote references may not contain spaces, tabs,
2378or newlines. These identifiers are used only to correlate the
2379footnote reference with the note itself; in the output, footnotes
2380will be numbered sequentially.
2382The footnotes themselves need not be placed at the end of the
2383document. They may appear anywhere except inside other block elements
2384(lists, block quotes, tables, etc.).
2386**Extension: `inline_notes`**
2388Inline footnotes are also allowed (though, unlike regular notes,
2389they cannot contain multiple paragraphs). The syntax is as follows:
2391 Here is an inline note.^[Inlines notes are easier to write, since
2392 you don't have to pick an identifier and move down to type the
2393 note.]
2395Inline and regular footnotes may be mixed freely.
2398Citations
2399---------
2401**Extension: `citations`**
2403Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2404citations and a bibliography in a number of styles. Basic usage is
2406 pandoc --filter pandoc-citeproc myinput.txt
2408In order to use this feature, you will need to specify a bibliography file
2409using the `bibliography` metadata field in a YAML metadata section.
2410The bibliography may have any of these formats:
2412 Format File extension
2413 ------------ --------------
2414 MODS .mods
2415 BibLaTeX .bib
2416 BibTeX .bibtex
2417 RIS .ris
2418 EndNote .enl
2419 EndNote XML .xml
2420 ISI .wos
2421 MEDLINE .medline
2422 Copac .copac
2423 JSON citeproc .json
2425Note that `.bib` can generally be used with both BibTeX and BibLaTeX
2426files, but you can use `.bibtex` to force BibTeX.
2428Alternatively you can use a `references` field in the document's YAML
2429metadata. This should include an array of YAML-encoded references,
2430for example:
2432 ---
2433 references:
2434 - id: fenner2012a
2435 title: One-click science marketing
2436 author:
2437 - family: Fenner
2438 given: Martin
2439 container-title: Nature Materials
2440 volume: 11
2441 URL: 'http://dx.doi.org/10.1038/nmat3283'
2442 DOI: 10.1038/nmat3283
2443 issue: 4
2444 publisher: Nature Publishing Group
2445 page: 261-263
2446 type: article-journal
2447 issued:
2448 year: 2012
2449 month: 3
2450 ...
2452(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce
2453these from a MODS reference collection.)
2455By default, `pandoc-citeproc` will use a Chicago author-date format for
2456citations and references. To use another style, you will need to specify
2457a [CSL] 1.0 style file in the `csl` metadata field. A primer on creating and
2458modifying CSL styles can be found at
2459<http://citationstyles.org/downloads/primer.html>. A repository of CSL styles
2460can be found at <https://github.com/citation-style-language/styles>. See also
2461<http://zotero.org/styles> for easy browsing.
2463Citations go inside square brackets and are separated by semicolons.
2464Each citation must have a key, composed of '@' + the citation
2465identifier from the database, and may optionally have a prefix,
2466a locator, and a suffix. The citation key must begin with a letter
2467or `_`, and may contain alphanumerics, `_`, and internal punctuation
2468characters (`:.#$%&-+?<>~/`). Here are some examples:
2470 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
2472 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2474 Blah blah [@smith04; @doe99].
2476A minus sign (`-`) before the `@` will suppress mention of
2477the author in the citation. This can be useful when the
2478author is already mentioned in the text:
2480 Smith says blah [-@smith04].
2482You can also write an in-text citation, as follows:
2484 @smith04 says blah.
2486 @smith04 [p. 33] says blah.
2488If the style calls for a list of works cited, it will be placed
2489at the end of the document. Normally, you will want to end your
2490document with an appropriate header:
2492 last paragraph...
2494 # References
2496The bibliography will be inserted after this header. Note that
2497the `unnumbered` class will be added to this header, so that the
2498section will not be numbered.
2500If you want to include items in the bibliography without actually
2501citing them in the body text, you can define a dummy `nocite` metadata
2502field and put the citations there:
2504 ---
2505 nocite: |
2506 @item1, @item2
2507 ...
2509 @item3
2511In this example, the document will contain a citation for `item3`
2512only, but the bibliography will contain entries for `item1`, `item2`, and
2513`item3`.
2515Non-pandoc extensions
2516---------------------
2518The following markdown syntax extensions are not enabled by default
2519in pandoc, but may be enabled by adding `+EXTENSION` to the format
2520name, where `EXTENSION` is the name of the extension. Thus, for
2521example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2523**Extension: `lists_without_preceding_blankline`**\
2524Allow a list to occur right after a paragraph, with no intervening
2525blank space.
2527**Extension: `hard_line_breaks`**\
2528Causes all newlines within a paragraph to be interpreted as hard line
2529breaks instead of spaces.
2531**Extension: `ignore_line_breaks`**\
2532Causes newlines within a paragraph to be ignored, rather than being
2533treated as spaces or as hard line breaks. This option is intended for
2534use with East Asian languages where spaces are not used between words,
2535but text is divided into lines for readability.
2537**Extension: `tex_math_single_backslash`**\
2538Causes anything between `\(` and `\)` to be interpreted as inline
2539TeX math, and anything between `\[` and `\]` to be interpreted
2540as display TeX math. Note: a drawback of this extension is that
2541it precludes escaping `(` and `[`.
2543**Extension: `tex_math_double_backslash`**\
2544Causes anything between `\\(` and `\\)` to be interpreted as inline
2545TeX math, and anything between `\\[` and `\\]` to be interpreted
2546as display TeX math.
2548**Extension: `markdown_attribute`**\
2549By default, pandoc interprets material inside block-level tags as markdown.
2550This extension changes the behavior so that markdown is only parsed
2551inside block-level tags if the tags have the attribute `markdown=1`.
2553**Extension: `mmd_title_block`**\
2554Enables a [MultiMarkdown] style title block at the top of
2555the document, for example:
2557 Title: My title
2558 Author: John Doe
2559 Date: September 1, 2008
2560 Comment: This is a sample mmd title block, with
2561 a field spanning multiple lines.
2563See the MultiMarkdown documentation for details. If `pandoc_title_block` or
2564`yaml_metadata_block` is enabled, it will take precedence over
2565`mmd_title_block`.
2567 [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
2569**Extension: `abbreviations`**\
2570Parses PHP Markdown Extra abbreviation keys, like
2572 *[HTML]: Hyper Text Markup Language
2574Note that the pandoc document model does not support
2575abbreviations, so if this extension is enabled, abbreviation keys are
2576simply skipped (as opposed to being parsed as paragraphs).
2578**Extension: `autolink_bare_uris`**\
2579Makes all absolute URIs into links, even when not surrounded by
2580pointy braces `<...>`.
2582**Extension: `ascii_identifiers`**\
2583Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
2584Accents are stripped off of accented latin letters, and non-latin
2585letters are omitted.
2587**Extension: `link_attributes`**\
2588Parses multimarkdown style key-value attributes on link and image references.
2589Note that pandoc's internal document model provides nowhere to put
2590these, so they are presently just ignored.
2592**Extension: `mmd_header_identifiers`**\
2593Parses multimarkdown style header identifiers (in square brackets,
2594after the header but before any trailing `#`s in an ATX header).
2596Markdown variants
2597-----------------
2599In addition to pandoc's extended markdown, the following markdown
2600variants are supported:
2602`markdown_phpextra` (PHP Markdown Extra)
2603: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
2604 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
2605 `header_attributes`, `abbreviations`.
2607`markdown_github` (Github-flavored Markdown)
2608: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
2609 `fenced_code_blocks`, `fenced_code_attributes`, `auto_identifiers`,
2610 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
2611 `intraword_underscores`, `strikeout`, `hard_line_breaks`
2613`markdown_mmd` (MultiMarkdown)
2614: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
2615 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
2616 `mmd_title_block`, `footnotes`, `definition_lists`,
2617 `all_symbols_escapable`, `implicit_header_references`,
2618 `auto_identifiers`, `mmd_header_identifiers`
2620`markdown_strict` (Markdown.pl)
2621: `raw_html`
2623Extensions with formats other than markdown
2624-------------------------------------------
2626Some of the extensions discussed above can be used with formats
2627other than markdown:
2629* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
2630 and `textile` input (and is used by default).
2632* `tex_math_dollars`, `tex_math_single_backslash`, and
2633 `tex_math_double_backslash` can be used with `html` input.
2634 (This is handy for reading web pages formatted using MathJax,
2635 for example.)
2637Producing slide shows with Pandoc
2638=================================
2640You can use Pandoc to produce an HTML + javascript slide presentation
2641that can be viewed via a web browser. There are five ways to do this,
2642using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
2643You can also produce a PDF slide show using LaTeX [beamer].
2645Here's the markdown source for a simple slide show, `habits.txt`:
2647 % Habits
2648 % John Doe
2649 % March 22, 2005
2651 # In the morning
2653 ## Getting up
2655 - Turn off alarm
2656 - Get out of bed
2658 ## Breakfast
2660 - Eat eggs
2661 - Drink coffee
2663 # In the evening
2665 ## Dinner
2667 - Eat spaghetti
2668 - Drink wine
2670 ------------------
2672 ![picture of spaghetti](images/spaghetti.jpg)
2674 ## Going to sleep
2676 - Get in bed
2677 - Count sheep
2679To produce an HTML/javascript slide show, simply type
2681 pandoc -t FORMAT -s habits.txt -o habits.html
2683where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
2685For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
2686`-s/--standalone` option embeds a link to javascripts and CSS files, which are
2687assumed to be available at the relative path `s5/default` (for S5), `slideous`
2688(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
2689`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
2690`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
2691above.) For DZSlides, the (relatively short) javascript and css are included in
2692the file by default.
2694With all HTML slide formats, the `--self-contained` option can be used to
2695produce a single file that contains all of the data necessary to display the
2696slide show, including linked scripts, stylesheets, images, and videos.
2698To produce a PDF slide show using beamer, type
2700 pandoc -t beamer habits.txt -o habits.pdf
2702Note that a reveal.js slide show can also be converted to a PDF
2703by printing it to a file from the browser.
2705Structuring the slide show
2706--------------------------
2708By default, the *slide level* is the highest header level in
2709the hierarchy that is followed immediately by content, and not another
2710header, somewhere in the document. In the example above, level 1 headers
2711are always followed by level 2 headers, which are followed by content,
2712so 2 is the slide level. This default can be overridden using
2713the `--slide-level` option.
2715The document is carved up into slides according to the following
2716rules:
2718 * A horizontal rule always starts a new slide.
2720 * A header at the slide level always starts a new slide.
2722 * Headers *below* the slide level in the hierarchy create
2723 headers *within* a slide.
2725 * Headers *above* the slide level in the hierarchy create
2726 "title slides," which just contain the section title
2727 and help to break the slide show into sections.
2729 * A title page is constructed automatically from the document's title
2730 block, if present. (In the case of beamer, this can be disabled
2731 by commenting out some lines in the default template.)
2733These rules are designed to support many different styles of slide show. If
2734you don't care about structuring your slides into sections and subsections,
2735you can just use level 1 headers for all each slide. (In that case, level 1
2736will be the slide level.) But you can also structure the slide show into
2737sections, as in the example above.
2739Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
2740layout will be produced, with level 1 headers building horizontally
2741and level 2 headers building vertically. It is not recommended that
2742you use deeper nesting of section levels with reveal.js.
2744Incremental lists
2745-----------------
2747By default, these writers produces lists that display "all at once."
2748If you want your lists to display incrementally (one item at a time),
2749use the `-i` option. If you want a particular list to depart from the
2750default (that is, to display incrementally without the `-i` option and
2751all at once with the `-i` option), put it in a block quote:
2753 > - Eat spaghetti
2754 > - Drink wine
2756In this way incremental and nonincremental lists can be mixed in
2757a single document.
2759Inserting pauses
2760----------------
2762You can add "pauses" within a slide by including a paragraph containing
2763three dots, separated by spaces:
2765 # Slide with a pause
2767 content before the pause
2769 . . .
2771 content after the pause
2773Styling the slides
2774------------------
2776You can change the style of HTML slides by putting customized CSS files
2777in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
2778or `$DATADIR/slideous` (for Slideous),
2779where `$DATADIR` is the user data directory (see `--data-dir`, above).
2780The originals may be found in pandoc's system data directory (generally
2781`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2782files it does not find in the user data directory.
2784For dzslides, the CSS is included in the HTML file itself, and may
2785be modified there.
2787For reveal.js, themes can be used by setting the `theme` variable,
2788for example:
2790 -V theme=moon
2792Or you can specify a custom stylesheet using the `--css` option.
2794To style beamer slides, you can specify a beamer "theme" or "colortheme"
2795using the `-V` option:
2797 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2799Note that header attributes will turn into slide attributes
2800(on a `<div>` or `<section>`) in HTML slide formats, allowing you
2801to style individual slides. In Beamer, the only header attribute
2802that affects slides is the `allowframebreaks` class, which sets the
2803`allowframebreaks` option, causing multiple slides to be created
2804if the content overfills the frame. This is recommended especially for
2805bibliographies:
2807 # References {.allowframebreaks}
2809Speaker notes
2810-------------
2812reveal.js has good support for speaker notes. You can add notes to your
2813markdown document thus:
2815 <div class="notes">
2816 This is my note.
2818 - It can contain markdown
2819 - like this list
2821 </div>
2823To show the notes window, press `s` while viewing the presentation.
2824Notes are not yet supported for other slide formats, but the notes
2825will not appear on the slides themselves.
2827EPUB Metadata
2828=============
2830EPUB metadata may be specified using the `--epub-metadata` option, but
2831if the source document is markdown, it is better to use a YAML metadata
2832block. Here is an example:
2834 ---
2835 title:
2836 - type: main
2837 text: My Book
2838 - type: subtitle
2839 text: An investigation of metadata
2840 creator:
2841 - role: author
2842 text: John Smith
2843 - role: editor
2844 text: Sarah Jones
2845 identifier:
2846 - scheme: DOI
2847 text: doi:10.234234.234/33
2848 publisher: My Press
2849 rights: (c) 2007 John Smith, CC BY-NC
2850 ...
2852The following fields are recognized:
2854`identifier`
2855 ~ Either a string value or an object with fields `text` and
2856 `scheme`. Valid values for `scheme` are `ISBN-10`,
2857 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
2858 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
2859 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
2860`title`
2861 ~ Either a string value, or an object with fields `file-as` and
2862 `type`, or a list of such objects. Valid values for `type` are
2863 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
2864`creator`
2865 ~ Either a string value, or an object with fields `role`, `file-as`,
2866 and `text`, or a list of such objects. Valid values for `role` are
2867 [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but
2868 pandoc will attempt to translate the human-readable versions
2869 (like "author" and "editor") to the appropriate marc relators.
2870`contributor`
2871 ~ Same format as `creator`.
2872`date`
2873 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
2874 Pandoc will attempt to convert other common date formats.
2875`language`
2876 ~ A string value in [RFC5646] format. Pandoc will default to the local
2877 language if nothing is specified.
2878`subject`
2879 ~ A string value or a list of such values.
2880`description`
2881 ~ A string value.
2882`type`
2883 ~ A string value.
2884`format`
2885 ~ A string value.
2886`relation`
2887 ~ A string value.
2888`coverage`
2889 ~ A string value.
2890`rights`
2891 ~ A string value.
2892`cover-image`
2893 ~ A string value (path to cover image).
2894`stylesheet`
2895 ~ A string value (path to CSS stylesheet).
2897Literate Haskell support
2898========================
2900If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
2901format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
2902`beamer`, `html` or `html5` for output only), pandoc will treat the document as
2903literate Haskell source. This means that
2905 - In markdown input, "bird track" sections will be parsed as Haskell
2906 code rather than block quotations. Text between `\begin{code}`
2907 and `\end{code}` will also be treated as Haskell code.
2909 - In markdown output, code blocks with classes `haskell` and `literate`
2910 will be rendered using bird tracks, and block quotations will be
2911 indented one space, so they will not be treated as Haskell code.
2912 In addition, headers will be rendered setext-style (with underlines)
2913 rather than atx-style (with '#' characters). (This is because ghc
2914 treats '#' characters in column 1 as introducing line numbers.)
2916 - In restructured text input, "bird track" sections will be parsed
2917 as Haskell code.
2919 - In restructured text output, code blocks with class `haskell` will
2920 be rendered using bird tracks.
2922 - In LaTeX input, text in `code` environments will be parsed as
2923 Haskell code.
2925 - In LaTeX output, code blocks with class `haskell` will be rendered
2926 inside `code` environments.
2928 - In HTML output, code blocks with class `haskell` will be rendered
2929 with class `literatehaskell` and bird tracks.
2931Examples:
2933 pandoc -f markdown+lhs -t html
2935reads literate Haskell source formatted with markdown conventions and writes
2936ordinary HTML (without bird tracks).
2938 pandoc -f markdown+lhs -t html+lhs
2940writes HTML with the Haskell code in bird tracks, so it can be copied
2941and pasted as literate Haskell source.
2943Custom writers
2944==============
2946Pandoc can be extended with custom writers written in [lua]. (Pandoc
2947includes a lua interpreter, so lua need not be installed separately.)
2949To use a custom writer, simply specify the path to the lua script
2950in place of the output format. For example:
2952 pandoc -t data/sample.lua
2954Creating a custom writer requires writing a lua function for each
2955possible element in a pandoc document. To get a documented example
2956which you can modify according to your needs, do
2958 pandoc --print-default-data-file sample.lua
2960Authors
2961=======
2963© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the
2964[GPL], version 2 or greater. This software carries no warranty of
2965any kind. (See COPYRIGHT for full copyright and warranty notices.)
2966Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
2967Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
2968Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
2969Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
2970Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
2971Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,
2972Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,
2973Jamie F. Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse
2974Rosenthal.
2976[markdown]: http://daringfireball.net/projects/markdown/
2977[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
2978[S5]: http://meyerweb.com/eric/tools/s5/
2979[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
2980[Slideous]: http://goessner.net/articles/slideous/
2981[HTML]: http://www.w3.org/TR/html40/
2982[HTML 5]: http://www.w3.org/TR/html5/
2983[XHTML]: http://www.w3.org/TR/xhtml1/
2984[LaTeX]: http://www.latex-project.org/
2985[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
2986[ConTeXt]: http://www.pragma-ade.nl/
2987[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
2988[DocBook]: http://www.docbook.org/
2989[OPML]: http://dev.opml.org/spec2.html
2990[OpenDocument]: http://opendocument.xml.org/
2991[ODT]: http://en.wikipedia.org/wiki/OpenDocument
2992[Textile]: http://redcloth.org/textile
2993[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
2994[Haddock markup]: http://www.haskell.org/haddock/doc/html/ch03s08.html
2995[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
2996[Haskell]: http://www.haskell.org/
2997[GNU Texinfo]: http://www.gnu.org/software/texinfo/
2998[Emacs Org-Mode]: http://orgmode.org
2999[AsciiDoc]: http://www.methods.co.nz/asciidoc/
3000[EPUB]: http://www.idpf.org/
3001[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
3002[DZSlides]: http://paulrouget.com/dzslides/
3003[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
3004[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
3005[PDF]: http://www.adobe.com/pdf/
3006[reveal.js]: http://lab.hakim.se/reveal-js/
3007[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
3008[lua]: http://www.lua.org
3009[marc relators]: http://www.loc.gov/marc/relators/relaterm.html
3010[RFC5646]: http://tools.ietf.org/html/rfc5646
3011[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf