git.iko.soy/typeable/pandoc
on e06aa97 help sign in
2987 lines 107 kB history raw
1% Pandoc User's Guide
2% John MacFarlane
3% January 19, 2013
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.
638`--biblatex`
639: Use biblatex for citations in LaTeX output.
641Math rendering in HTML
642----------------------
644`-m` [*URL*], `--latexmathml`[=*URL*]
645: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
646 To insert a link to a local copy of the `LaTeXMathML.js` script,
647 provide a *URL*. If no *URL* is provided, the contents of the
648 script will be inserted directly into the HTML header, preserving
649 portability at the price of efficiency. If you plan to use math on
650 several pages, it is much better to link to a copy of the script,
651 so it can be cached.
653`--mathml`[=*URL*]
654: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
655 In standalone `html` output, a small javascript (or a link to such a
656 script if a *URL* is supplied) will be inserted that allows the MathML to
657 be viewed on some browsers.
659`--jsmath`[=*URL*]
660: Use [jsMath] to display embedded TeX math in HTML output.
661 The *URL* should point to the jsMath load script (e.g.
662 `jsMath/easy/load.js`); if provided, it will be linked to in
663 the header of standalone HTML documents. If a *URL* is not provided,
664 no link to the jsMath load script will be inserted; it is then
665 up to the author to provide such a link in the HTML template.
667`--mathjax`[=*URL*]
668: Use [MathJax] to display embedded TeX math in HTML output.
669 The *URL* should point to the `MathJax.js` load script.
670 If a *URL* is not provided, a link to the MathJax CDN will
671 be inserted.
673`--gladtex`
674: Enclose TeX math in `<eq>` tags in HTML output. These can then
675 be processed by [gladTeX] to produce links to images of the typeset
676 formulas.
678`--mimetex`[=*URL*]
679: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
680 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
682`--webtex`[=*URL*]
683: Render TeX formulas using an external script that converts TeX
684 formulas to images. The formula will be concatenated with the URL
685 provided. If *URL* is not specified, the Google Chart API will be used.
687Options for wrapper scripts
688---------------------------
690`--dump-args`
691: Print information about command-line arguments to *stdout*, then exit.
692 This option is intended primarily for use in wrapper scripts.
693 The first line of output contains the name of the output file specified
694 with the `-o` option, or `-` (for *stdout*) if no output file was
695 specified. The remaining lines contain the command-line arguments,
696 one per line, in the order they appear. These do not include regular
697 Pandoc options and their arguments, but do include any options appearing
698 after a `--` separator at the end of the line.
700`--ignore-args`
701: Ignore command-line arguments (for use in wrapper scripts).
702 Regular Pandoc options are not ignored. Thus, for example,
704 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
706 is equivalent to
708 pandoc -o foo.html -s
710[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
711[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
712[MathJax]: http://www.mathjax.org/
713[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
714[mimeTeX]: http://www.forkosh.com/mimetex.html
715[CSL]: http://CitationStyles.org
717Templates
718=========
720When the `-s/--standalone` option is used, pandoc uses a template to
721add header and footer material that is needed for a self-standing
722document. To see the default template that is used, just type
724 pandoc -D FORMAT
726where `FORMAT` is the name of the output format. A custom template
727can be specified using the `--template` option. You can also override
728the system default templates for a given output format `FORMAT`
729by putting a file `templates/default.FORMAT` in the user data
730directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
731customize the `default.opendocument` template. For `pdf` output,
732customize the `default.latex` template.
734Templates may contain *variables*. Variable names are sequences of
735alphanumerics, `-`, and `_`, starting with a letter. A variable name
736surrounded by `$` signs will be replaced by its value. For example,
737the string `$title$` in
739 <title>$title$</title>
741will be replaced by the document title.
743To write a literal `$` in a template, use `$$`.
745Some variables are set automatically by pandoc. These vary somewhat
746depending on the output format, but include metadata fields (such
747as `title`, `author`, and `date`) as well as the following:
749`header-includes`
750: contents specified by `-H/--include-in-header` (may have multiple
751 values)
752`toc`
753: non-null value if `--toc/--table-of-contents` was specified
754`include-before`
755: contents specified by `-B/--include-before-body` (may have
756 multiple values)
757`include-after`
758: contents specified by `-A/--include-after-body` (may have
759 multiple values)
760`body`
761: body of document
762`lang`
763: language code for HTML or LaTeX documents
764`slidy-url`
765: base URL for Slidy documents (defaults to
766 `http://www.w3.org/Talks/Tools/Slidy2`)
767`slideous-url`
768: base URL for Slideous documents (defaults to `default`)
769`s5-url`
770: base URL for S5 documents (defaults to `ui/default`)
771`revealjs-url`
772: base URL for reveal.js documents (defaults to `reveal.js`)
773`theme`
774: reveal.js or LaTeX beamer theme
775`transition`
776: reveal.js transition
777`fontsize`
778: font size (10pt, 11pt, 12pt) for LaTeX documents
779`documentclass`
780: document class for LaTeX documents
781`classoption`
782: option for LaTeX documentclass, e.g. `oneside`; may be repeated
783 for multiple options
784`geometry`
785: options for LaTeX `geometry` class, e.g. `margin=1in`;
786 may be repeated for multiple options
787`mainfont`, `sansfont`, `monofont`, `mathfont`
788: fonts for LaTeX documents (works only with xelatex
789 and lualatex)
790`colortheme`
791: colortheme for LaTeX beamer documents
792`fonttheme`
793: fonttheme for LaTeX beamer documents
794`linkcolor`
795: color for internal links in LaTeX documents (`red`, `green`,
796 `magenta`, `cyan`, `blue`, `black`)
797`urlcolor`
798: color for external links in LaTeX documents
799`citecolor`
800: color for citation links in LaTeX documents
801`links-as-notes`
802: causes links to be printed as footnotes in LaTeX documents
803`biblio-style`
804: bibliography style in LaTeX, when used with `--natbib`
805`biblio-files`
806: bibliography files to use in LaTeX, with `--natbib` or `--biblatex`
807`section`
808: section number in man pages
809`header`
810: header in man pages
811`footer`
812: footer in man pages
814Variables may be set at the command line using the `-V/--variable`
815option. Variables set in this way override metadata fields with
816the same name.
818Templates may contain conditionals. The syntax is as follows:
820 $if(variable)$
821 X
822 $else$
823 Y
824 $endif$
826This will include `X` in the template if `variable` has a non-null
827value; otherwise it will include `Y`. `X` and `Y` are placeholders for
828any valid template text, and may include interpolated variables or other
829conditionals. The `$else$` section may be omitted.
831When variables can have multiple values (for example, `author` in
832a multi-author document), you can use the `$for$` keyword:
834 $for(author)$
835 <meta name="author" content="$author$" />
836 $endfor$
838You can optionally specify a separator to be used between
839consecutive items:
841 $for(author)$$author$$sep$, $endfor$
843A dot can be used to select a field of a variable that takes
844an object as its value. So, for example:
846 $author.name$ ($author.affiliation$)
848If you use custom templates, you may need to revise them as pandoc
849changes. We recommend tracking the changes in the default templates,
850and modifying your custom templates accordingly. An easy way to do this
851is to fork the pandoc-templates repository
852(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
853pandoc release.
855Pandoc's markdown
856=================
858Pandoc understands an extended and slightly revised version of
859John Gruber's [markdown] syntax. This document explains the syntax,
860noting differences from standard markdown. Except where noted, these
861differences can be suppressed by using the `markdown_strict` format instead
862of `markdown`. An extensions can be enabled by adding `+EXTENSION`
863to the format name and disabled by adding `-EXTENSION`. For example,
864`markdown_strict+footnotes` is strict markdown with footnotes
865enabled, while `markdown-footnotes-pipe_tables` is pandoc's
866markdown without footnotes or pipe tables.
868Philosophy
869----------
871Markdown is designed to be easy to write, and, even more importantly,
872easy to read:
874> A Markdown-formatted document should be publishable as-is, as plain
875> text, without looking like it's been marked up with tags or formatting
876> instructions.
877> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
879This principle has guided pandoc's decisions in finding syntax for
880tables, footnotes, and other extensions.
882There is, however, one respect in which pandoc's aims are different
883from the original aims of markdown. Whereas markdown was originally
884designed with HTML generation in mind, pandoc is designed for multiple
885output formats. Thus, while pandoc allows the embedding of raw HTML,
886it discourages it, and provides other, non-HTMLish ways of representing
887important document elements like definition lists, tables, mathematics, and
888footnotes.
890Paragraphs
891----------
893A paragraph is one or more lines of text followed by one or more blank line.
894Newlines are treated as spaces, so you can reflow your paragraphs as you like.
895If you need a hard line break, put two or more spaces at the end of a line.
897**Extension: `escaped_line_breaks`**
899A backslash followed by a newline is also a hard line break.
900Note: in multiline and grid table cells, this is the only way
901to create a hard line break, since trailing spaces in the cells
902are ignored.
904Headers
905-------
907There are two kinds of headers, Setext and atx.
909### Setext-style headers ###
911A setext-style header is a line of text "underlined" with a row of `=` signs
912(for a level one header) or `-` signs (for a level two header):
914 A level-one header
915 ==================
917 A level-two header
918 ------------------
920The header text can contain inline formatting, such as emphasis (see
921[Inline formatting](#inline-formatting), below).
924### Atx-style headers ###
926An Atx-style header consists of one to six `#` signs and a line of
927text, optionally followed by any number of `#` signs. The number of
928`#` signs at the beginning of the line is the header level:
930 ## A level-two header
932 ### A level-three header ###
934As with setext-style headers, the header text can contain formatting:
936 # A level-one header with a [link](/url) and *emphasis*
938**Extension: `blank_before_header`**
940Standard markdown syntax does not require a blank line before a header.
941Pandoc does require this (except, of course, at the beginning of the
942document). The reason for the requirement is that it is all too easy for a
943`#` to end up at the beginning of a line by accident (perhaps through line
944wrapping). Consider, for example:
946 I like several of their flavors of ice cream:
947 #22, for example, and #5.
950### Header identifiers in HTML, LaTeX, and ConTeXt ###
952**Extension: `header_attributes`**
954Headers can be assigned attributes using this syntax at the end
955of the line containing the header text:
957 {#identifier .class .class key=value key=value}
959Although this syntax allows assignment of classes and key/value attributes,
960only identifiers currently have any affect in the writers (and only in some
961writers: HTML, LaTeX, ConTeXt, Textile, AsciiDoc). Thus, for example,
962the following headers will all be assigned the identifier `foo`:
964 # My header {#foo}
966 ## My header ## {#foo}
968 My other header {#foo}
969 ---------------
971(This syntax is compatible with [PHP Markdown Extra].)
973Headers with the class `unnumbered` will not be numbered, even if
974`--number-sections` is specified. A single hyphen (`-`) in an attribute
975context is equivalent to `.unnumbered`, and preferable in non-English
976documents. So,
978 # My header {-}
980is just the same as
982 # My header {.unnumbered}
984**Extension: `auto_identifiers`**
986A header without an explicitly specified identifier will be
987automatically assigned a unique identifier based on the header text.
988To derive the identifier from the header text,
990 - Remove all formatting, links, etc.
991 - Remove all footnotes.
992 - Remove all punctuation, except underscores, hyphens, and periods.
993 - Replace all spaces and newlines with hyphens.
994 - Convert all alphabetic characters to lowercase.
995 - Remove everything up to the first letter (identifiers may
996 not begin with a number or punctuation mark).
997 - If nothing is left after this, use the identifier `section`.
999Thus, for example,
1001 Header Identifier
1002 ------------------------------- ----------------------------
1003 Header identifiers in HTML `header-identifiers-in-html`
1004 *Dogs*?--in *my* house? `dogs--in-my-house`
1005 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1006 3. Applications `applications`
1007 33 `section`
1009These rules should, in most cases, allow one to determine the identifier
1010from the header text. The exception is when several headers have the
1011same text; in this case, the first will get an identifier as described
1012above; the second will get the same identifier with `-1` appended; the
1013third with `-2`; and so on.
1015These identifiers are used to provide link targets in the table of
1016contents generated by the `--toc|--table-of-contents` option. They
1017also make it easy to provide links from one section of a document to
1018another. A link to this section, for example, might look like this:
1020 See the section on
1021 [header identifiers](#header-identifiers-in-html-latex-and-context).
1023Note, however, that this method of providing links to sections works
1024only in HTML, LaTeX, and ConTeXt formats.
1026If the `--section-divs` option is specified, then each section will
1027be wrapped in a `div` (or a `section`, if `--html5` was specified),
1028and the identifier will be attached to the enclosing `<div>`
1029(or `<section>`) tag rather than the header itself. This allows entire
1030sections to be manipulated using javascript or treated differently in
1031CSS.
1033**Extension: `implicit_header_references`**
1035Pandoc behaves as if reference links have been defined for each header.
1036So, instead of
1038 [header identifiers](#header-identifiers-in-html)
1040you can simply write
1042 [header identifiers]
1046 [header identifiers][]
1050 [the section on header identifiers][header identifiers]
1052If there are multiple headers with identical text, the corresponding
1053reference will link to the first one only, and you will need to use explicit
1054links to link to the others, as described above.
1056Unlike regular reference links, these references are case-sensitive.
1058Note: if you have defined an explicit identifier for a header,
1059then implicit references to it will not work.
1061Block quotations
1062----------------
1064Markdown uses email conventions for quoting blocks of text.
1065A block quotation is one or more paragraphs or other block elements
1066(such as lists or headers), with each line preceded by a `>` character
1067and a space. (The `>` need not start at the left margin, but it should
1068not be indented more than three spaces.)
1070 > This is a block quote. This
1071 > paragraph has two lines.
1073 > 1. This is a list inside a block quote.
1074 > 2. Second item.
1076A "lazy" form, which requires the `>` character only on the first
1077line of each block, is also allowed:
1079 > This is a block quote. This
1080 paragraph has two lines.
1082 > 1. This is a list inside a block quote.
1083 2. Second item.
1085Among the block elements that can be contained in a block quote are
1086other block quotes. That is, block quotes can be nested:
1088 > This is a block quote.
1090 > > A block quote within a block quote.
1092**Extension: `blank_before_blockquote`**
1094Standard markdown syntax does not require a blank line before a block
1095quote. Pandoc does require this (except, of course, at the beginning of the
1096document). The reason for the requirement is that it is all too easy for a
1097`>` to end up at the beginning of a line by accident (perhaps through line
1098wrapping). So, unless the `markdown_strict` format is used, the following does
1099not produce a nested block quote in pandoc:
1101 > This is a block quote.
1102 >> Nested.
1105Verbatim (code) blocks
1106----------------------
1108### Indented code blocks ###
1110A block of text indented four spaces (or one tab) is treated as verbatim
1111text: that is, special characters do not trigger special formatting,
1112and all spaces and line breaks are preserved. For example,
1114 if (a > 3) {
1115 moveShip(5 * gravity, DOWN);
1118The initial (four space or one tab) indentation is not considered part
1119of the verbatim text, and is removed in the output.
1121Note: blank lines in the verbatim text need not begin with four spaces.
1124### Fenced code blocks ###
1126**Extension: `fenced_code_blocks`**
1128In addition to standard indented code blocks, Pandoc supports
1129*fenced* code blocks. These begin with a row of three or more
1130tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
1131backticks that must be at least as long as the starting row. Everything
1132between these lines is treated as code. No indentation is necessary:
1134 ~~~~~~~
1135 if (a > 3) {
1136 moveShip(5 * gravity, DOWN);
1138 ~~~~~~~
1140Like regular code blocks, fenced code blocks must be separated
1141from surrounding text by blank lines.
1143If the code itself contains a row of tildes or backticks, just use a longer
1144row of tildes or backticks at the start and end:
1146 ~~~~~~~~~~~~~~~~
1147 ~~~~~~~~~~
1148 code including tildes
1149 ~~~~~~~~~~
1150 ~~~~~~~~~~~~~~~~
1152Optionally, you may attach attributes to the code block using
1153this syntax:
1155 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1156 qsort [] = []
1157 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1158 qsort (filter (>= x) xs)
1159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1161Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1162`startFrom` is an attribute with value `100`. Some output formats can use this
1163information to do syntax highlighting. Currently, the only output formats
1164that uses this information are HTML and LaTeX. If highlighting is supported
1165for your output format and language, then the code block above will appear
1166highlighted, with numbered lines. (To see which languages are supported, do
1167`pandoc --version`.) Otherwise, the code block above will appear as follows:
1169 <pre id="mycode" class="haskell numberLines" startFrom="100">
1170 <code>
1171 ...
1172 </code>
1173 </pre>
1175A shortcut form can also be used for specifying the language of
1176the code block:
1178 ```haskell
1179 qsort [] = []
1180 ```
1182This is equivalent to:
1184 ``` {.haskell}
1185 qsort [] = []
1186 ```
1188To prevent all highlighting, use the `--no-highlight` flag.
1189To set the highlighting style, use `--highlight-style`.
1191Line blocks
1192-----------
1194**Extension: `line_blocks`**
1196A line block is a sequence of lines beginning with a vertical bar (`|`)
1197followed by a space. The division into lines will be preserved in
1198the output, as will any leading spaces; otherwise, the lines will
1199be formatted as markdown. This is useful for verse and addresses:
1201 | The limerick packs laughs anatomical
1202 | In space that is quite economical.
1203 | But the good ones I've seen
1204 | So seldom are clean
1205 | And the clean ones so seldom are comical
1207 | 200 Main St.
1208 | Berkeley, CA 94718
1210The lines can be hard-wrapped if needed, but the continuation
1211line must begin with a space.
1213 | The Right Honorable Most Venerable and Righteous Samuel L.
1214 Constable, Jr.
1215 | 200 Main St.
1216 | Berkeley, CA 94718
1218This syntax is borrowed from [reStructuredText].
1220Lists
1221-----
1223### Bullet lists ###
1225A bullet list is a list of bulleted list items. A bulleted list
1226item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1227example:
1229 * one
1230 * two
1231 * three
1233This will produce a "compact" list. If you want a "loose" list, in which
1234each item is formatted as a paragraph, put spaces between the items:
1236 * one
1238 * two
1240 * three
1242The bullets need not be flush with the left margin; they may be
1243indented one, two, or three spaces. The bullet must be followed
1244by whitespace.
1246List items look best if subsequent lines are flush with the first
1247line (after the bullet):
1249 * here is my first
1250 list item.
1251 * and my second.
1253But markdown also allows a "lazy" format:
1255 * here is my first
1256 list item.
1257 * and my second.
1259### The four-space rule ###
1261A list item may contain multiple paragraphs and other block-level
1262content. However, subsequent paragraphs must be preceded by a blank line
1263and indented four spaces or a tab. The list will look better if the first
1264paragraph is aligned with the rest:
1266 * First paragraph.
1268 Continued.
1270 * Second paragraph. With a code block, which must be indented
1271 eight spaces:
1273 { code }
1275List items may include other lists. In this case the preceding blank
1276line is optional. The nested list must be indented four spaces or
1277one tab:
1279 * fruits
1280 + apples
1281 - macintosh
1282 - red delicious
1283 + pears
1284 + peaches
1285 * vegetables
1286 + broccoli
1287 + chard
1289As noted above, markdown allows you to write list items "lazily," instead of
1290indenting continuation lines. However, if there are multiple paragraphs or
1291other blocks in a list item, the first line of each must be indented.
1293 + A lazy, lazy, list
1294 item.
1296 + Another one; this looks
1297 bad but is legal.
1299 Second paragraph of second
1300 list item.
1302**Note:** Although the four-space rule for continuation paragraphs
1303comes from the official [markdown syntax guide], the reference implementation,
1304`Markdown.pl`, does not follow it. So pandoc will give different results than
1305`Markdown.pl` when authors have indented continuation paragraphs fewer than
1306four spaces.
1308The [markdown syntax guide] is not explicit whether the four-space
1309rule applies to *all* block-level content in a list item; it only
1310mentions paragraphs and code blocks. But it implies that the rule
1311applies to all block-level content (including nested lists), and
1312pandoc interprets it that way.
1314 [markdown syntax guide]:
1315 http://daringfireball.net/projects/markdown/syntax#list
1317### Ordered lists ###
1319Ordered lists work just like bulleted lists, except that the items
1320begin with enumerators rather than bullets.
1322In standard markdown, enumerators are decimal numbers followed
1323by a period and a space. The numbers themselves are ignored, so
1324there is no difference between this list:
1326 1. one
1327 2. two
1328 3. three
1330and this one:
1332 5. one
1333 7. two
1334 1. three
1336**Extension: `fancy_lists`**
1338Unlike standard markdown, Pandoc allows ordered list items to be marked
1339with uppercase and lowercase letters and roman numerals, in addition to
1340arabic numerals. List markers may be enclosed in parentheses or followed by a
1341single right-parentheses or period. They must be separated from the
1342text that follows by at least one space, and, if the list marker is a
1343capital letter with a period, by at least two spaces.[^2]
1345[^2]: The point of this rule is to ensure that normal paragraphs
1346 starting with people's initials, like
1348 B. Russell was an English philosopher.
1350 do not get treated as list items.
1352 This rule will not prevent
1354 (C) 2007 Joe Smith
1356 from being interpreted as a list item. In this case, a backslash
1357 escape can be used:
1359 (C\) 2007 Joe Smith
1361The `fancy_lists` extension also allows '`#`' to be used as an
1362ordered list marker in place of a numeral:
1364 #. one
1365 #. two
1367**Extension: `startnum`**
1369Pandoc also pays attention to the type of list marker used, and to the
1370starting number, and both of these are preserved where possible in the
1371output format. Thus, the following yields a list with numbers followed
1372by a single parenthesis, starting with 9, and a sublist with lowercase
1373roman numerals:
1375 9) Ninth
1376 10) Tenth
1377 11) Eleventh
1378 i. subone
1379 ii. subtwo
1380 iii. subthree
1382Pandoc will start a new list each time a different type of list
1383marker is used. So, the following will create three lists:
1385 (2) Two
1386 (5) Three
1387 1. Four
1388 * Five
1390If default list markers are desired, use `#.`:
1392 #. one
1393 #. two
1394 #. three
1397### Definition lists ###
1399**Extension: `definition_lists`**
1401Pandoc supports definition lists, using a syntax inspired by
1402[PHP Markdown Extra] and [reStructuredText]:[^3]
1404 Term 1
1406 : Definition 1
1408 Term 2 with *inline markup*
1410 : Definition 2
1412 { some code, part of Definition 2 }
1414 Third paragraph of definition 2.
1416Each term must fit on one line, which may optionally be followed by
1417a blank line, and must be followed by one or more definitions.
1418A definition begins with a colon or tilde, which may be indented one
1419or two spaces. The body of the definition (including the first line,
1420aside from the colon or tilde) should be indented four spaces. A term may have
1421multiple definitions, and each definition may consist of one or more block
1422elements (paragraph, code block, list, etc.), each indented four spaces or one
1423tab stop.
1425If you leave space after the definition (as in the example above),
1426the blocks of the definitions will be considered paragraphs. In some
1427output formats, this will mean greater spacing between term/definition
1428pairs. For a compact definition list, do not leave space between the
1429definition and the next term:
1431 Term 1
1432 ~ Definition 1
1433 Term 2
1434 ~ Definition 2a
1435 ~ Definition 2b
1437[^3]: I have also been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1439[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1442### Numbered example lists ###
1444**Extension: `example_lists`**
1446The special list marker `@` can be used for sequentially numbered
1447examples. The first list item with a `@` marker will be numbered '1',
1448the next '2', and so on, throughout the document. The numbered examples
1449need not occur in a single list; each new list using `@` will take up
1450where the last stopped. So, for example:
1452 (@) My first example will be numbered (1).
1453 (@) My second example will be numbered (2).
1455 Explanation of examples.
1457 (@) My third example will be numbered (3).
1459Numbered examples can be labeled and referred to elsewhere in the
1460document:
1462 (@good) This is a good example.
1464 As (@good) illustrates, ...
1466The label can be any string of alphanumeric characters, underscores,
1467or hyphens.
1470### Compact and loose lists ###
1472Pandoc behaves differently from `Markdown.pl` on some "edge
1473cases" involving lists. Consider this source:
1475 + First
1476 + Second:
1477 - Fee
1478 - Fie
1479 - Foe
1481 + Third
1483Pandoc transforms this into a "compact list" (with no `<p>` tags around
1484"First", "Second", or "Third"), while markdown puts `<p>` tags around
1485"Second" and "Third" (but not "First"), because of the blank space
1486around "Third". Pandoc follows a simple rule: if the text is followed by
1487a blank line, it is treated as a paragraph. Since "Second" is followed
1488by a list, and not a blank line, it isn't treated as a paragraph. The
1489fact that the list is followed by a blank line is irrelevant. (Note:
1490Pandoc works this way even when the `markdown_strict` format is specified. This
1491behavior is consistent with the official markdown syntax description,
1492even though it is different from that of `Markdown.pl`.)
1495### Ending a list ###
1497What if you want to put an indented code block after a list?
1499 - item one
1500 - item two
1502 { my code block }
1504Trouble! Here pandoc (like other markdown implementations) will treat
1505`{ my code block }` as the second paragraph of item two, and not as
1506a code block.
1508To "cut off" the list after item two, you can insert some non-indented
1509content, like an HTML comment, which won't produce visible output in
1510any format:
1512 - item one
1513 - item two
1515 <!-- end of list -->
1517 { my code block }
1519You can use the same trick if you want two consecutive lists instead
1520of one big list:
1522 1. one
1523 2. two
1524 3. three
1526 <!-- -->
1528 1. uno
1529 2. dos
1530 3. tres
1532Horizontal rules
1533----------------
1535A line containing a row of three or more `*`, `-`, or `_` characters
1536(optionally separated by spaces) produces a horizontal rule:
1538 * * * *
1540 ---------------
1543Tables
1544------
1546Four kinds of tables may be used. The first three kinds presuppose the use of
1547a fixed-width font, such as Courier. The fourth kind can be used with
1548proportionally spaced fonts, as it does not require lining up columns.
1550### Simple tables
1552**Extension: `simple_tables`, `table_captions`**
1554Simple tables look like this:
1556 Right Left Center Default
1557 ------- ------ ---------- -------
1558 12 12 12 12
1559 123 123 123 123
1560 1 1 1 1
1562 Table: Demonstration of simple table syntax.
1564The headers and table rows must each fit on one line. Column
1565alignments are determined by the position of the header text relative
1566to the dashed line below it:[^4]
1568 - If the dashed line is flush with the header text on the right side
1569 but extends beyond it on the left, the column is right-aligned.
1570 - If the dashed line is flush with the header text on the left side
1571 but extends beyond it on the right, the column is left-aligned.
1572 - If the dashed line extends beyond the header text on both sides,
1573 the column is centered.
1574 - If the dashed line is flush with the header text on both sides,
1575 the default alignment is used (in most cases, this will be left).
1577[^4]: This scheme is due to Michel Fortin, who proposed it on the
1578 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1580The table must end with a blank line, or a line of dashes followed by
1581a blank line. A caption may optionally be provided (as illustrated in
1582the example above). A caption is a paragraph beginning with the string
1583`Table:` (or just `:`), which will be stripped off. It may appear either
1584before or after the table.
1586The column headers may be omitted, provided a dashed line is used
1587to end the table. For example:
1589 ------- ------ ---------- -------
1590 12 12 12 12
1591 123 123 123 123
1592 1 1 1 1
1593 ------- ------ ---------- -------
1595When headers are omitted, column alignments are determined on the basis
1596of the first line of the table body. So, in the tables above, the columns
1597would be right, left, center, and right aligned, respectively.
1599### Multiline tables
1601**Extension: `multiline_tables`, `table_captions`**
1603Multiline tables allow headers and table rows to span multiple lines
1604of text (but cells that span multiple columns or rows of the table are
1605not supported). Here is an example:
1607 -------------------------------------------------------------
1608 Centered Default Right Left
1609 Header Aligned Aligned Aligned
1610 ----------- ------- --------------- -------------------------
1611 First row 12.0 Example of a row that
1612 spans multiple lines.
1614 Second row 5.0 Here's another one. Note
1615 the blank line between
1616 rows.
1617 -------------------------------------------------------------
1619 Table: Here's the caption. It, too, may span
1620 multiple lines.
1622These work like simple tables, but with the following differences:
1624 - They must begin with a row of dashes, before the header text
1625 (unless the headers are omitted).
1626 - They must end with a row of dashes, then a blank line.
1627 - The rows must be separated by blank lines.
1629In multiline tables, the table parser pays attention to the widths of
1630the columns, and the writers try to reproduce these relative widths in
1631the output. So, if you find that one of the columns is too narrow in the
1632output, try widening it in the markdown source.
1634Headers may be omitted in multiline tables as well as simple tables:
1636 ----------- ------- --------------- -------------------------
1637 First row 12.0 Example of a row that
1638 spans multiple lines.
1640 Second row 5.0 Here's another one. Note
1641 the blank line between
1642 rows.
1643 ----------- ------- --------------- -------------------------
1645 : Here's a multiline table without headers.
1647It is possible for a multiline table to have just one row, but the row
1648should be followed by a blank line (and then the row of dashes that ends
1649the table), or the table may be interpreted as a simple table.
1651### Grid tables
1653**Extension: `grid_tables`, `table_captions`**
1655Grid tables look like this:
1657 : Sample grid table.
1659 +---------------+---------------+--------------------+
1660 | Fruit | Price | Advantages |
1661 +===============+===============+====================+
1662 | Bananas | $1.34 | - built-in wrapper |
1663 | | | - bright color |
1664 +---------------+---------------+--------------------+
1665 | Oranges | $2.10 | - cures scurvy |
1666 | | | - tasty |
1667 +---------------+---------------+--------------------+
1669The row of `=`s separates the header from the table body, and can be
1670omitted for a headerless table. The cells of grid tables may contain
1671arbitrary block elements (multiple paragraphs, code blocks, lists,
1672etc.). Alignments are not supported, nor are cells that span multiple
1673columns or rows. Grid tables can be created easily using [Emacs table mode].
1675 [Emacs table mode]: http://table.sourceforge.net/
1677### Pipe tables
1679**Extension: `pipe_tables`, `table_captions`**
1681Pipe tables look like this:
1683 | Right | Left | Default | Center |
1684 |------:|:-----|---------|:------:|
1685 | 12 | 12 | 12 | 12 |
1686 | 123 | 123 | 123 | 123 |
1687 | 1 | 1 | 1 | 1 |
1689 : Demonstration of simple table syntax.
1691The syntax is [the same as in PHP markdown extra]. The beginning and
1692ending pipe characters are optional, but pipes are required between all
1693columns. The colons indicate column alignment as shown. The header
1694can be omitted, but the horizontal line must still be included, as
1695it defines column alignments.
1697Since the pipes indicate column boundaries, columns need not be vertically
1698aligned, as they are in the above example. So, this is a perfectly
1699legal (though ugly) pipe table:
1701 fruit| price
1702 -----|-----:
1703 apple|2.05
1704 pear|1.37
1705 orange|3.09
1707The cells of pipe tables cannot contain block elements like paragraphs
1708and lists, and cannot span multiple lines.
1710 [the same as in PHP markdown extra]:
1711 http://michelf.ca/projects/php-markdown/extra/#table
1713Note: Pandoc also recognizes pipe tables of the following
1714form, as can produced by Emacs' orgtbl-mode:
1716 | One | Two |
1717 |-----+-------|
1718 | my | table |
1719 | is | nice |
1721The difference is that `+` is used instead of `|`. Other orgtbl features
1722are not supported. In particular, to get non-default column alignment,
1723you'll need to add colons as above.
1725Title block
1726-----------
1728**Extension: `pandoc_title_block`**
1730If the file begins with a title block
1732 % title
1733 % author(s) (separated by semicolons)
1734 % date
1736it will be parsed as bibliographic information, not regular text. (It
1737will be used, for example, in the title of standalone LaTeX or HTML
1738output.) The block may contain just a title, a title and an author,
1739or all three elements. If you want to include an author but no
1740title, or a title and a date but no author, you need a blank line:
1743 % Author
1745 % My title
1747 % June 15, 2006
1749The title may occupy multiple lines, but continuation lines must
1750begin with leading space, thus:
1752 % My title
1753 on multiple lines
1755If a document has multiple authors, the authors may be put on
1756separate lines with leading space, or separated by semicolons, or
1757both. So, all of the following are equivalent:
1759 % Author One
1760 Author Two
1762 % Author One; Author Two
1764 % Author One;
1765 Author Two
1767The date must fit on one line.
1769All three metadata fields may contain standard inline formatting
1770(italics, links, footnotes, etc.).
1772Title blocks will always be parsed, but they will affect the output only
1773when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1774will appear twice: once in the document head -- this is the title that
1775will appear at the top of the window in a browser -- and once at the
1776beginning of the document body. The title in the document head can have
1777an optional prefix attached (`--title-prefix` or `-T` option). The title
1778in the body appears as an H1 element with class "title", so it can be
1779suppressed or reformatted with CSS. If a title prefix is specified with
1780`-T` and no title block appears in the document, the title prefix will
1781be used by itself as the HTML title.
1783The man page writer extracts a title, man page section number, and
1784other header and footer information from the title line. The title
1785is assumed to be the first word on the title line, which may optionally
1786end with a (single-digit) section number in parentheses. (There should
1787be no space between the title and the parentheses.) Anything after
1788this is assumed to be additional footer and header text. A single pipe
1789character (`|`) should be used to separate the footer text from the header
1790text. Thus,
1792 % PANDOC(1)
1794will yield a man page with the title `PANDOC` and section 1.
1796 % PANDOC(1) Pandoc User Manuals
1798will also have "Pandoc User Manuals" in the footer.
1800 % PANDOC(1) Pandoc User Manuals | Version 4.0
1802will also have "Version 4.0" in the header.
1804YAML metadata block
1805-------------------
1807**Extension: `yaml_metadata_block`**
1809A YAML metadata block is a valid YAML object, delimited by a line of three
1810hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
1811(`...`) at the bottom. A YAML metadata block may occur anywhere in the
1812document, but if it is not at the beginning, it must be preceded by a blank
1813line.
1815Metadata will be taken from the fields of the YAML object and added to any
1816existing document metadata. Metadata can contain lists and objects (nested
1817arbitrarily), but all string scalars will be interpreted as markdown. Fields
1818with names ending in an underscore will be ignored by pandoc. (They may be
1819given a role by external processors.)
1821A document may contain multiple metadata blocks. The metadata fields will
1822be combined through a *left-biased union*: if two metadata blocks attempt
1823to set the same field, the value from the first block will be taken.
1825Note that YAML escaping rules must be followed. Thus, for example,
1826if a title contains a colon, it must be quoted. The pipe character
1827(`|`) can be used to begin an indented block that will be interpreted
1828literally, without need for escaping. This form is necessary
1829when the field contains blank lines:
1831 ---
1832 title: 'This is the title: it contains a colon'
1833 author:
1834 - name: Author One
1835 affiliation: University of Somewhere
1836 - name: Author Two
1837 affiliation: University of Nowhere
1838 tags: [nothing, nothingness]
1839 abstract: |
1840 This is the abstract.
1842 It consists of two paragraphs.
1843 ...
1845Template variables will be set automatically from the metadata. Thus, for
1846example, in writing HTML, the variable `abstract` will be set to the HTML
1847equivalent of the markdown in the `abstract` field:
1849 <p>This is the abstract.</p>
1850 <p>It consists of two paragraphs.</p>
1852Note: The `author` variable in the default templates expects a simple list or
1853string. To use the structured authors in the example, you would need a
1854custom template. For example:
1856 $for(author)$
1857 $if(author.name)$
1858 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
1859 $else$
1860 $author$
1861 $endif$
1862 $endfor$
1865Backslash escapes
1866-----------------
1868**Extension: `all_symbols_escapable`**
1870Except inside a code block or inline code, any punctuation or space
1871character preceded by a backslash will be treated literally, even if it
1872would normally indicate formatting. Thus, for example, if one writes
1874 *\*hello\**
1876one will get
1878 <em>*hello*</em>
1880instead of
1882 <strong>hello</strong>
1884This rule is easier to remember than standard markdown's rule,
1885which allows only the following characters to be backslash-escaped:
1887 \`*_{}[]()>#+-.!
1889(However, if the `markdown_strict` format is used, the standard markdown rule
1890will be used.)
1892A backslash-escaped space is parsed as a nonbreaking space. It will
1893appear in TeX output as `~` and in HTML and XML as `\&#160;` or
1894`\&nbsp;`.
1896A backslash-escaped newline (i.e. a backslash occurring at the end of
1897a line) is parsed as a hard line break. It will appear in TeX output as
1898`\\` and in HTML as `<br />`. This is a nice alternative to
1899markdown's "invisible" way of indicating hard line breaks using
1900two trailing spaces on a line.
1902Backslash escapes do not work in verbatim contexts.
1904Smart punctuation
1905-----------------
1907**Extension**
1909If the `--smart` option is specified, pandoc will produce typographically
1910correct output, converting straight quotes to curly quotes, `---` to
1911em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
1912are inserted after certain abbreviations, such as "Mr."
1914Note: if your LaTeX template uses the `csquotes` package, pandoc will
1915detect automatically this and use `\enquote{...}` for quoted text.
1917Inline formatting
1918-----------------
1920### Emphasis ###
1922To *emphasize* some text, surround it with `*`s or `_`, like this:
1924 This text is _emphasized with underscores_, and this
1925 is *emphasized with asterisks*.
1927Double `*` or `_` produces **strong emphasis**:
1929 This is **strong emphasis** and __with underscores__.
1931A `*` or `_` character surrounded by spaces, or backslash-escaped,
1932will not trigger emphasis:
1934 This is * not emphasized *, and \*neither is this\*.
1936**Extension: `intraword_underscores`**
1938Because `_` is sometimes used inside words and identifiers,
1939pandoc does not interpret a `_` surrounded by alphanumeric
1940characters as an emphasis marker. If you want to emphasize
1941just part of a word, use `*`:
1943 feas*ible*, not feas*able*.
1946### Strikeout ###
1948**Extension: `strikeout`**
1950To strikeout a section of text with a horizontal line, begin and end it
1951with `~~`. Thus, for example,
1953 This ~~is deleted text.~~
1956### Superscripts and subscripts ###
1958**Extension: `superscript`, `subscript`**
1960Superscripts may be written by surrounding the superscripted text by `^`
1961characters; subscripts may be written by surrounding the subscripted
1962text by `~` characters. Thus, for example,
1964 H~2~O is a liquid. 2^10^ is 1024.
1966If the superscripted or subscripted text contains spaces, these spaces
1967must be escaped with backslashes. (This is to prevent accidental
1968superscripting and subscripting through the ordinary use of `~` and `^`.)
1969Thus, if you want the letter P with 'a cat' in subscripts, use
1970`P~a\ cat~`, not `P~a cat~`.
1973### Verbatim ###
1975To make a short span of text verbatim, put it inside backticks:
1977 What is the difference between `>>=` and `>>`?
1979If the verbatim text includes a backtick, use double backticks:
1981 Here is a literal backtick `` ` ``.
1983(The spaces after the opening backticks and before the closing
1984backticks will be ignored.)
1986The general rule is that a verbatim span starts with a string
1987of consecutive backticks (optionally followed by a space)
1988and ends with a string of the same number of backticks (optionally
1989preceded by a space).
1991Note that backslash-escapes (and other markdown constructs) do not
1992work in verbatim contexts:
1994 This is a backslash followed by an asterisk: `\*`.
1996**Extension: `inline_code_attributes`**
1998Attributes can be attached to verbatim text, just as with
1999[fenced code blocks](#fenced-code-blocks):
2001 `<$>`{.haskell}
2003Math
2004----
2006**Extension: `tex_math_dollars`**
2008Anything between two `$` characters will be treated as TeX math. The
2009opening `$` must have a character immediately to its right, while the
2010closing `$` must have a character immediately to its left. Thus,
2011`$20,000 and $30,000` won't parse as math. If for some reason
2012you need to enclose text in literal `$` characters, backslash-escape
2013them and they won't be treated as math delimiters.
2015TeX math will be printed in all output formats. How it is rendered
2016depends on the output format:
2018Markdown, LaTeX, Org-Mode, ConTeXt
2019 ~ It will appear verbatim between `$` characters.
2021reStructuredText
2022 ~ It will be rendered using an interpreted text role `:math:`, as described
2023 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
2025AsciiDoc
2026 ~ It will be rendered as `latexmath:[...]`.
2028Texinfo
2029 ~ It will be rendered inside a `@math` command.
2031groff man
2032 ~ It will be rendered verbatim without `$`'s.
2034MediaWiki
2035 ~ It will be rendered inside `<math>` tags.
2037Textile
2038 ~ It will be rendered inside `<span class="math">` tags.
2040RTF, OpenDocument, ODT
2041 ~ It will be rendered, if possible, using unicode characters,
2042 and will otherwise appear verbatim.
2044Docbook
2045 ~ If the `--mathml` flag is used, it will be rendered using mathml
2046 in an `inlineequation` or `informalequation` tag. Otherwise it
2047 will be rendered, if possible, using unicode characters.
2049Docx
2050 ~ It will be rendered using OMML math markup.
2052FictionBook2
2053 ~ If the `--webtex` option is used, formulas are rendered as images
2054 using Google Charts or other compatible web service, downloaded
2055 and embedded in the e-book. Otherwise, they will appear verbatim.
2057HTML, Slidy, DZSlides, S5, EPUB
2058 ~ The way math is rendered in HTML will depend on the
2059 command-line options selected:
2061 1. The default is to render TeX math as far as possible using unicode
2062 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2063 are put inside a `span` with `class="math"`, so that they may be
2064 styled differently from the surrounding text if needed.
2066 2. If the `--latexmathml` option is used, TeX math will be displayed
2067 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2068 The [LaTeXMathML] script will be used to render it as formulas.
2069 (This trick does not work in all browsers, but it works in Firefox.
2070 In browsers that do not support LaTeXMathML, TeX math will appear
2071 verbatim between `$` characters.)
2073 3. If the `--jsmath` option is used, TeX math will be put inside
2074 `<span>` tags (for inline math) or `<div>` tags (for display math)
2075 with class `math`. The [jsMath] script will be used to render
2076 it.
2078 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2079 be called to generate images for each TeX formula. This should
2080 work in all browsers. The `--mimetex` option takes an optional URL
2081 as argument. If no URL is specified, it will be assumed that the
2082 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2084 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2085 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2086 be processed by [gladTeX], which will produce image files for each
2087 formula and an `html` file with links to these images. So, the
2088 procedure is:
2090 pandoc -s --gladtex myfile.txt -o myfile.htex
2091 gladtex -d myfile-images myfile.htex
2092 # produces myfile.html and images in myfile-images
2094 6. If the `--webtex` option is used, TeX formulas will be converted
2095 to `<img>` tags that link to an external script that converts
2096 formulas to images. The formula will be URL-encoded and concatenated
2097 with the URL provided. If no URL is specified, the Google Chart
2098 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2100 7. If the `--mathjax` option is used, TeX math will be displayed
2101 between `\(...\)` (for inline math) or `\[...\]` (for display
2102 math) and put in `<span>` tags with class `math`.
2103 The [MathJax] script will be used to render it as formulas.
2105Raw HTML
2106--------
2108**Extension: `raw_html`**
2110Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2111(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2112literally). (Technically this is not an extension, since standard
2113markdown allows it, but it has been made an extension so that it can
2114be disabled if desired.)
2116The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2117DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2118formats.
2120**Extension: `markdown_in_html_blocks`**
2122Standard markdown allows you to include HTML "blocks": blocks
2123of HTML between balanced tags that are separated from the surrounding text
2124with blank lines, and start and end at the left margin. Within
2125these blocks, everything is interpreted as HTML, not markdown;
2126so (for example), `*` does not signify emphasis.
2128Pandoc behaves this way when the `markdown_strict` format is used; but
2129by default, pandoc interprets material between HTML block tags as markdown.
2130Thus, for example, Pandoc will turn
2132 <table>
2133 <tr>
2134 <td>*one*</td>
2135 <td>[a link](http://google.com)</td>
2136 </tr>
2137 </table>
2139into
2141 <table>
2142 <tr>
2143 <td><em>one</em></td>
2144 <td><a href="http://google.com">a link</a></td>
2145 </tr>
2146 </table>
2148whereas `Markdown.pl` will preserve it as is.
2150There is one exception to this rule: text between `<script>` and
2151`<style>` tags is not interpreted as markdown.
2153This departure from standard markdown should make it easier to mix
2154markdown with HTML block elements. For example, one can surround
2155a block of markdown text with `<div>` tags without preventing it
2156from being interpreted as markdown.
2158Raw TeX
2159-------
2161**Extension: `raw_tex`**
2163In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2164included in a document. Inline TeX commands will be preserved and passed
2165unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2166LaTeX to include BibTeX citations:
2168 This result was proved in \cite{jones.1967}.
2170Note that in LaTeX environments, like
2172 \begin{tabular}{|l|l|}\hline
2173 Age & Frequency \\ \hline
2174 18--25 & 15 \\
2175 26--35 & 33 \\
2176 36--45 & 22 \\ \hline
2177 \end{tabular}
2179the material between the begin and end tags will be interpreted as raw
2180LaTeX, not as markdown.
2182Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2183and ConTeXt.
2185LaTeX macros
2186------------
2188**Extension: `latex_macros`**
2190For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2191`\renewcommand` definitions and apply the resulting macros to all LaTeX
2192math. So, for example, the following will work in all output formats,
2193not just LaTeX:
2195 \newcommand{\tuple}[1]{\langle #1 \rangle}
2197 $\tuple{a, b, c}$
2199In LaTeX output, the `\newcommand` definition will simply be passed
2200unchanged to the output.
2203Links
2204-----
2206Markdown allows links to be specified in several ways.
2208### Automatic links ###
2210If you enclose a URL or email address in pointy brackets, it
2211will become a link:
2213 <http://google.com>
2214 <sam@green.eggs.ham>
2216### Inline links ###
2218An inline link consists of the link text in square brackets,
2219followed by the URL in parentheses. (Optionally, the URL can
2220be followed by a link title, in quotes.)
2222 This is an [inline link](/url), and here's [one with
2223 a title](http://fsf.org "click here for a good time!").
2225There can be no space between the bracketed part and the parenthesized part.
2226The link text can contain formatting (such as emphasis), but the title cannot.
2229### Reference links ###
2231An *explicit* reference link has two parts, the link itself and the link
2232definition, which may occur elsewhere in the document (either
2233before or after the link).
2235The link consists of link text in square brackets, followed by a label in
2236square brackets. (There can be space between the two.) The link definition
2237consists of the bracketed label, followed by a colon and a space, followed by
2238the URL, and optionally (after a space) a link title either in quotes or in
2239parentheses.
2241Here are some examples:
2243 [my label 1]: /foo/bar.html "My title, optional"
2244 [my label 2]: /foo
2245 [my label 3]: http://fsf.org (The free software foundation)
2246 [my label 4]: /bar#special 'A title in single quotes'
2248The URL may optionally be surrounded by angle brackets:
2250 [my label 5]: <http://foo.bar.baz>
2252The title may go on the next line:
2254 [my label 3]: http://fsf.org
2255 "The free software foundation"
2257Note that link labels are not case sensitive. So, this will work:
2259 Here is [my link][FOO]
2261 [Foo]: /bar/baz
2263In an *implicit* reference link, the second pair of brackets is
2264empty, or omitted entirely:
2266 See [my website][], or [my website].
2268 [my website]: http://foo.bar.baz
2270Note: In `Markdown.pl` and most other markdown implementations,
2271reference link definitions cannot occur in nested constructions
2272such as list items or block quotes. Pandoc lifts this arbitrary
2273seeming restriction. So the following is fine in pandoc, though
2274not in most other implementations:
2276 > My block [quote].
2278 > [quote]: /foo
2280### Internal links
2282To link to another section of the same document, use the automatically
2283generated identifier (see [Header identifiers in HTML, LaTeX, and
2284ConTeXt](#header-identifiers-in-html-latex-and-context), below).
2285For example:
2287 See the [Introduction](#introduction).
2291 See the [Introduction].
2293 [Introduction]: #introduction
2295Internal links are currently supported for HTML formats (including
2296HTML slide shows and EPUB), LaTeX, and ConTeXt.
2298Images
2299------
2301A link immediately preceded by a `!` will be treated as an image.
2302The link text will be used as the image's alt text:
2304 ![la lune](lalune.jpg "Voyage to the moon")
2306 ![movie reel]
2308 [movie reel]: movie.gif
2310### Pictures with captions ###
2312**Extension: `implicit_figures`**
2314An image occurring by itself in a paragraph will be rendered as
2315a figure with a caption.[^5] (In LaTeX, a figure environment will be
2316used; in HTML, the image will be placed in a `div` with class
2317`figure`, together with a caption in a `p` with class `caption`.)
2318The image's alt text will be used as the caption.
2320 ![This is the caption](/url/of/image.png)
2322[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2323 ODT. In those formats, you'll just get an image in a paragraph by
2324 itself, with no caption.
2326If you just want a regular inline image, just make sure it is not
2327the only thing in the paragraph. One way to do this is to insert a
2328nonbreaking space after the image:
2330 ![This image won't be a figure](/url/of/image.png)\
2333Footnotes
2334---------
2336**Extension: `footnotes`**
2338Pandoc's markdown allows footnotes, using the following syntax:
2340 Here is a footnote reference,[^1] and another.[^longnote]
2342 [^1]: Here is the footnote.
2344 [^longnote]: Here's one with multiple blocks.
2346 Subsequent paragraphs are indented to show that they
2347 belong to the previous footnote.
2349 { some.code }
2351 The whole paragraph can be indented, or just the first
2352 line. In this way, multi-paragraph footnotes work like
2353 multi-paragraph list items.
2355 This paragraph won't be part of the note, because it
2356 isn't indented.
2358The identifiers in footnote references may not contain spaces, tabs,
2359or newlines. These identifiers are used only to correlate the
2360footnote reference with the note itself; in the output, footnotes
2361will be numbered sequentially.
2363The footnotes themselves need not be placed at the end of the
2364document. They may appear anywhere except inside other block elements
2365(lists, block quotes, tables, etc.).
2367**Extension: `inline_notes`**
2369Inline footnotes are also allowed (though, unlike regular notes,
2370they cannot contain multiple paragraphs). The syntax is as follows:
2372 Here is an inline note.^[Inlines notes are easier to write, since
2373 you don't have to pick an identifier and move down to type the
2374 note.]
2376Inline and regular footnotes may be mixed freely.
2379Citations
2380---------
2382**Extension: `citations`**
2384Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2385citations and a bibliography in a number of styles. Basic usage is
2387 pandoc --filter pandoc-citeproc myinput.txt
2389In order to use this feature, you will need to specify a bibliography file
2390using the `bibliography` metadata field in a YAML metadata section.
2391The bibliography may have any of these formats:
2393 Format File extension
2394 ------------ --------------
2395 MODS .mods
2396 BibLaTeX .bib
2397 BibTeX .bibtex
2398 RIS .ris
2399 EndNote .enl
2400 EndNote XML .xml
2401 ISI .wos
2402 MEDLINE .medline
2403 Copac .copac
2404 JSON citeproc .json
2406Note that `.bib` can generally be used with both BibTeX and BibLaTeX
2407files, but you can use `.bibtex` to force BibTeX.
2409Alternatively you can use a `references` field in the document's YAML
2410metadata. This should include an array of YAML-encoded references,
2411for example:
2413 ---
2414 references:
2415 - id: fenner2012a
2416 title: One-click science marketing
2417 author:
2418 - family: Fenner
2419 given: Martin
2420 container-title: Nature Materials
2421 volume: 11
2422 URL: 'http://dx.doi.org/10.1038/nmat3283'
2423 DOI: 10.1038/nmat3283
2424 issue: 4
2425 publisher: Nature Publishing Group
2426 page: 261-263
2427 type: article-journal
2428 issued:
2429 year: 2012
2430 month: 3
2431 ...
2433(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce
2434these from a MODS reference collection.)
2436By default, `pandoc-citeproc` will use a Chicago author-date format for
2437citations and references. To use another style, you will need to specify
2438a [CSL] 1.0 style file in the `csl` metadata field. A primer on creating and
2439modifying CSL styles can be found at
2440<http://citationstyles.org/downloads/primer.html>. A repository of CSL styles
2441can be found at <https://github.com/citation-style-language/styles>. See also
2442<http://zotero.org/styles> for easy browsing.
2444Citations go inside square brackets and are separated by semicolons.
2445Each citation must have a key, composed of '@' + the citation
2446identifier from the database, and may optionally have a prefix,
2447a locator, and a suffix. Here are some examples:
2449 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
2451 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2453 Blah blah [@smith04; @doe99].
2455A minus sign (`-`) before the `@` will suppress mention of
2456the author in the citation. This can be useful when the
2457author is already mentioned in the text:
2459 Smith says blah [-@smith04].
2461You can also write an in-text citation, as follows:
2463 @smith04 says blah.
2465 @smith04 [p. 33] says blah.
2467If the style calls for a list of works cited, it will be placed
2468at the end of the document. Normally, you will want to end your
2469document with an appropriate header:
2471 last paragraph...
2473 # References
2475The bibliography will be inserted after this header.
2477If you want to include items in the bibliography without actually
2478citing them in the body text, you can define a dummy `nocite` metadata
2479field and put the citations there:
2481 ---
2482 nocite:
2483 | @item1, @item2
2484 ...
2486 @item3
2488In this example, the document will contain a citation for `item3`
2489only, but the bibliography will contain entries for `item1`, `item2`, and
2490`item3`.
2492Non-pandoc extensions
2493---------------------
2495The following markdown syntax extensions are not enabled by default
2496in pandoc, but may be enabled by adding `+EXTENSION` to the format
2497name, where `EXTENSION` is the name of the extension. Thus, for
2498example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2500**Extension: `lists_without_preceding_blankline`**\
2501Allow a list to occur right after a paragraph, with no intervening
2502blank space.
2504**Extension: `hard_line_breaks`**\
2505Causes all newlines within a paragraph to be interpreted as hard line
2506breaks instead of spaces.
2508**Extension: `ignore_line_breaks`**\
2509Causes newlines within a paragraph to be ignored, rather than being
2510treated as spaces or as hard line breaks. This option is intended for
2511use with East Asian languages where spaces are not used between words,
2512but text is divided into lines for readability.
2514**Extension: `tex_math_single_backslash`**\
2515Causes anything between `\(` and `\)` to be interpreted as inline
2516TeX math, and anything between `\[` and `\]` to be interpreted
2517as display TeX math. Note: a drawback of this extension is that
2518it precludes escaping `(` and `[`.
2520**Extension: `tex_math_double_backslash`**\
2521Causes anything between `\\(` and `\\)` to be interpreted as inline
2522TeX math, and anything between `\\[` and `\\]` to be interpreted
2523as display TeX math.
2525**Extension: `markdown_attribute`**\
2526By default, pandoc interprets material inside block-level tags as markdown.
2527This extension changes the behavior so that markdown is only parsed
2528inside block-level tags if the tags have the attribute `markdown=1`.
2530**Extension: `mmd_title_block`**\
2531Enables a [MultiMarkdown] style title block at the top of
2532the document, for example:
2534 Title: My title
2535 Author: John Doe
2536 Date: September 1, 2008
2537 Comment: This is a sample mmd title block, with
2538 a field spanning multiple lines.
2540See the MultiMarkdown documentation for details. If `pandoc_title_block` or
2541`yaml_metadata_block` is enabled, it will take precedence over
2542`mmd_title_block`.
2544 [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
2546**Extension: `abbreviations`**\
2547Parses PHP Markdown Extra abbreviation keys, like
2549 *[HTML]: Hyper Text Markup Language
2551Note that the pandoc document model does not support
2552abbreviations, so if this extension is enabled, abbreviation keys are
2553simply skipped (as opposed to being parsed as paragraphs).
2555**Extension: `autolink_bare_uris`**\
2556Makes all absolute URIs into links, even when not surrounded by
2557pointy braces `<...>`.
2559**Extension: `ascii_identifiers`**\
2560Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
2561Accents are stripped off of accented latin letters, and non-latin
2562letters are omitted.
2564**Extension: `link_attributes`**\
2565Parses multimarkdown style key-value attributes on link and image references.
2566Note that pandoc's internal document model provides nowhere to put
2567these, so they are presently just ignored.
2569**Extension: `mmd_header_identifiers`**\
2570Parses multimarkdown style header identifiers (in square brackets,
2571after the header but before any trailing `#`s in an ATX header).
2573Markdown variants
2574-----------------
2576In addition to pandoc's extended markdown, the following markdown
2577variants are supported:
2579`markdown_phpextra` (PHP Markdown Extra)
2580: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
2581 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
2582 `header_attributes`, `abbreviations`.
2584`markdown_github` (Github-flavored Markdown)
2585: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
2586 `fenced_code_blocks`, `fenced_code_attributes`, `auto_identifiers`,
2587 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
2588 `intraword_underscores`, `strikeout`, `hard_line_breaks`
2590`markdown_mmd` (MultiMarkdown)
2591: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
2592 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
2593 `mmd_title_block`, `footnotes`, `definition_lists`,
2594 `all_symbols_escapable`, `implicit_header_references`,
2595 `auto_identifiers`, `mmd_header_identifiers`
2597`markdown_strict` (Markdown.pl)
2598: `raw_html`
2600Extensions with formats other than markdown
2601-------------------------------------------
2603Some of the extensions discussed above can be used with formats
2604other than markdown:
2606* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
2607 and `textile` input (and is used by default).
2609* `tex_math_dollars`, `tex_math_single_backslash`, and
2610 `tex_math_double_backslash` can be used with `html` input.
2611 (This is handy for reading web pages formatted using MathJax,
2612 for example.)
2614Producing slide shows with Pandoc
2615=================================
2617You can use Pandoc to produce an HTML + javascript slide presentation
2618that can be viewed via a web browser. There are five ways to do this,
2619using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
2620You can also produce a PDF slide show using LaTeX [beamer].
2622Here's the markdown source for a simple slide show, `habits.txt`:
2624 % Habits
2625 % John Doe
2626 % March 22, 2005
2628 # In the morning
2630 ## Getting up
2632 - Turn off alarm
2633 - Get out of bed
2635 ## Breakfast
2637 - Eat eggs
2638 - Drink coffee
2640 # In the evening
2642 ## Dinner
2644 - Eat spaghetti
2645 - Drink wine
2647 ------------------
2649 ![picture of spaghetti](images/spaghetti.jpg)
2651 ## Going to sleep
2653 - Get in bed
2654 - Count sheep
2656To produce an HTML/javascript slide show, simply type
2658 pandoc -t FORMAT -s habits.txt -o habits.html
2660where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
2662For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
2663`-s/--standalone` option embeds a link to javascripts and CSS files, which are
2664assumed to be available at the relative path `s5/default` (for S5), `slideous`
2665(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
2666`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
2667`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
2668above.) For DZSlides, the (relatively short) javascript and css are included in
2669the file by default.
2671With all HTML slide formats, the `--self-contained` option can be used to
2672produce a single file that contains all of the data necessary to display the
2673slide show, including linked scripts, stylesheets, images, and videos.
2675To produce a PDF slide show using beamer, type
2677 pandoc -t beamer habits.txt -o habits.pdf
2679Note that a reveal.js slide show can also be converted to a PDF
2680by printing it to a file from the browser.
2682Structuring the slide show
2683--------------------------
2685By default, the *slide level* is the highest header level in
2686the hierarchy that is followed immediately by content, and not another
2687header, somewhere in the document. In the example above, level 1 headers
2688are always followed by level 2 headers, which are followed by content,
2689so 2 is the slide level. This default can be overridden using
2690the `--slide-level` option.
2692The document is carved up into slides according to the following
2693rules:
2695 * A horizontal rule always starts a new slide.
2697 * A header at the slide level always starts a new slide.
2699 * Headers *below* the slide level in the hierarchy create
2700 headers *within* a slide.
2702 * Headers *above* the slide level in the hierarchy create
2703 "title slides," which just contain the section title
2704 and help to break the slide show into sections.
2706 * A title page is constructed automatically from the document's title
2707 block, if present. (In the case of beamer, this can be disabled
2708 by commenting out some lines in the default template.)
2710These rules are designed to support many different styles of slide show. If
2711you don't care about structuring your slides into sections and subsections,
2712you can just use level 1 headers for all each slide. (In that case, level 1
2713will be the slide level.) But you can also structure the slide show into
2714sections, as in the example above.
2716Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
2717layout will be produced, with level 1 headers building horizontally
2718and level 2 headers building vertically. It is not recommended that
2719you use deeper nesting of section levels with reveal.js.
2721Incremental lists
2722-----------------
2724By default, these writers produces lists that display "all at once."
2725If you want your lists to display incrementally (one item at a time),
2726use the `-i` option. If you want a particular list to depart from the
2727default (that is, to display incrementally without the `-i` option and
2728all at once with the `-i` option), put it in a block quote:
2730 > - Eat spaghetti
2731 > - Drink wine
2733In this way incremental and nonincremental lists can be mixed in
2734a single document.
2736Inserting pauses
2737----------------
2739You can add "pauses" within a slide by including a paragraph containing
2740three dots, separated by spaces:
2742 # Slide with a pause
2744 content before the pause
2746 . . .
2748 content after the pause
2750Styling the slides
2751------------------
2753You can change the style of HTML slides by putting customized CSS files
2754in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
2755or `$DATADIR/slideous` (for Slideous),
2756where `$DATADIR` is the user data directory (see `--data-dir`, above).
2757The originals may be found in pandoc's system data directory (generally
2758`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2759files it does not find in the user data directory.
2761For dzslides, the CSS is included in the HTML file itself, and may
2762be modified there.
2764For reveal.js, themes can be used by setting the `theme` variable,
2765for example:
2767 -V theme=moon
2769Or you can specify a custom stylesheet using the `--css` option.
2771To style beamer slides, you can specify a beamer "theme" or "colortheme"
2772using the `-V` option:
2774 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2776Note that header attributes will turn into slide attributes
2777(on a `<div>` or `<section>`) in HTML slide formats, allowing you
2778to style individual slides. In Beamer, the only header attribute
2779that affects slides is the `allowframebreaks` class, which sets the
2780`allowframebreaks` option, causing multiple slides to be created
2781if the content overfills the frame. This is recommended especially for
2782bibliographies:
2784 # References {.allowframebreaks}
2786Speaker notes
2787-------------
2789reveal.js has good support for speaker notes. You can add notes to your
2790markdown document thus:
2792 <div class="notes">
2793 This is my note.
2795 - It can contain markdown
2796 - like this list
2798 </div>
2800To show the notes window, press `s` while viewing the presentation.
2801Notes are not yet supported for other slide formats, but the notes
2802will not appear on the slides themselves.
2804EPUB Metadata
2805=============
2807EPUB metadata may be specified using the `--epub-metadata` option, but
2808if the source document is markdown, it is better to use a YAML metadata
2809block. Here is an example:
2811 ---
2812 title:
2813 - type: main
2814 text: My Book
2815 - type: subtitle
2816 text: An investigation of metadata
2817 creator:
2818 - role: author
2819 text: John Smith
2820 - role: editor
2821 text: Sarah Jones
2822 identifier:
2823 - scheme: DOI
2824 text: doi:10.234234.234/33
2825 publisher: My Press
2826 rights: (c) 2007 John Smith, CC BY-NC
2827 ...
2829The following fields are recognized:
2831`identifier`
2832 ~ Either a string value or an object with fields `text` and
2833 `scheme`. Valid values for `scheme` are `ISBN-10`,
2834 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
2835 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
2836 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
2837`title`
2838 ~ Either a string value, or an object with fields `file-as` and
2839 `type`, or a list of such objects. Valid values for `type` are
2840 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
2841`creator`
2842 ~ Either a string value, or an object with fields `role`, `file-as`,
2843 and `text`, or a list of such objects. Valid values for `role` are
2844 [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but
2845 pandoc will attempt to translate the human-readable versions
2846 (like "author" and "editor") to the appropriate marc relators.
2847`contributor`
2848 ~ Same format as `creator`.
2849`date`
2850 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
2851 Pandoc will attempt to convert other common date formats.
2852`language`
2853 ~ A string value in [RFC5646] format. Pandoc will default to the local
2854 language if nothing is specified.
2855`subject`
2856 ~ A string value or a list of such values.
2857`description`
2858 ~ A string value.
2859`type`
2860 ~ A string value.
2861`format`
2862 ~ A string value.
2863`relation`
2864 ~ A string value.
2865`coverage`
2866 ~ A string value.
2867`rights`
2868 ~ A string value.
2869`cover-image`
2870 ~ A string value (path to cover image).
2871`stylesheet`
2872 ~ A string value (path to CSS stylesheet).
2874Literate Haskell support
2875========================
2877If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
2878format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
2879`beamer`, `html` or `html5` for output only), pandoc will treat the document as
2880literate Haskell source. This means that
2882 - In markdown input, "bird track" sections will be parsed as Haskell
2883 code rather than block quotations. Text between `\begin{code}`
2884 and `\end{code}` will also be treated as Haskell code.
2886 - In markdown output, code blocks with classes `haskell` and `literate`
2887 will be rendered using bird tracks, and block quotations will be
2888 indented one space, so they will not be treated as Haskell code.
2889 In addition, headers will be rendered setext-style (with underlines)
2890 rather than atx-style (with '#' characters). (This is because ghc
2891 treats '#' characters in column 1 as introducing line numbers.)
2893 - In restructured text input, "bird track" sections will be parsed
2894 as Haskell code.
2896 - In restructured text output, code blocks with class `haskell` will
2897 be rendered using bird tracks.
2899 - In LaTeX input, text in `code` environments will be parsed as
2900 Haskell code.
2902 - In LaTeX output, code blocks with class `haskell` will be rendered
2903 inside `code` environments.
2905 - In HTML output, code blocks with class `haskell` will be rendered
2906 with class `literatehaskell` and bird tracks.
2908Examples:
2910 pandoc -f markdown+lhs -t html
2912reads literate Haskell source formatted with markdown conventions and writes
2913ordinary HTML (without bird tracks).
2915 pandoc -f markdown+lhs -t html+lhs
2917writes HTML with the Haskell code in bird tracks, so it can be copied
2918and pasted as literate Haskell source.
2920Custom writers
2921==============
2923Pandoc can be extended with custom writers written in [lua]. (Pandoc
2924includes a lua interpreter, so lua need not be installed separately.)
2926To use a custom writer, simply specify the path to the lua script
2927in place of the output format. For example:
2929 pandoc -t data/sample.lua
2931Creating a custom writer requires writing a lua function for each
2932possible element in a pandoc document. To get a documented example
2933which you can modify according to your needs, do
2935 pandoc --print-default-data-file sample.lua
2937Authors
2938=======
2940© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the
2941[GPL], version 2 or greater. This software carries no warranty of
2942any kind. (See COPYRIGHT for full copyright and warranty notices.)
2943Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
2944Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
2945Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
2946Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
2947Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
2948Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,
2949Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,
2950Jamie F. Olson.
2952[markdown]: http://daringfireball.net/projects/markdown/
2953[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
2954[S5]: http://meyerweb.com/eric/tools/s5/
2955[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
2956[Slideous]: http://goessner.net/articles/slideous/
2957[HTML]: http://www.w3.org/TR/html40/
2958[HTML 5]: http://www.w3.org/TR/html5/
2959[XHTML]: http://www.w3.org/TR/xhtml1/
2960[LaTeX]: http://www.latex-project.org/
2961[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
2962[ConTeXt]: http://www.pragma-ade.nl/
2963[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
2964[DocBook]: http://www.docbook.org/
2965[OPML]: http://dev.opml.org/spec2.html
2966[OpenDocument]: http://opendocument.xml.org/
2967[ODT]: http://en.wikipedia.org/wiki/OpenDocument
2968[Textile]: http://redcloth.org/textile
2969[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
2970[Haddock markup]: http://www.haskell.org/haddock/doc/html/ch03s08.html
2971[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
2972[Haskell]: http://www.haskell.org/
2973[GNU Texinfo]: http://www.gnu.org/software/texinfo/
2974[Emacs Org-Mode]: http://orgmode.org
2975[AsciiDoc]: http://www.methods.co.nz/asciidoc/
2976[EPUB]: http://www.idpf.org/
2977[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
2978[DZSlides]: http://paulrouget.com/dzslides/
2979[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
2980[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
2981[PDF]: http://www.adobe.com/pdf/
2982[reveal.js]: http://lab.hakim.se/reveal-js/
2983[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
2984[lua]: http://www.lua.org
2985[marc relators]: http://www.loc.gov/marc/relators/relaterm.html
2986[RFC5646]: http://tools.ietf.org/html/rfc5646
2987[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf