8pandoc [*options*] [*input-file*]...
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],
16and [LaTeX]; and it can write plain text, [markdown], [reStructuredText],
17[XHTML], [HTML 5], [LaTeX] (including [beamer] slide shows),
18[ConTeXt], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [Word docx], [GNU
19Texinfo], [MediaWiki markup], [EPUB], [Textile], [groff man] pages, [Emacs
20Org-Mode], [AsciiDoc], and [Slidy], [DZSlides], or [S5] HTML slide shows. It
21can also produce [PDF] output on systems where LaTeX is installed.
23Pandoc's enhanced version of markdown includes syntax for footnotes,
24tables, flexible ordered lists, definition lists, delimited code blocks,
25superscript, subscript, strikeout, title blocks, automatic tables of
26contents, embedded LaTeX math, citations, and markdown inside HTML block
27elements. (These enhancements, described below under
28[Pandoc's markdown](#pandocs-markdown), can be disabled using the `--strict`
31In contrast to most existing tools for converting markdown to HTML, which
32use regex substitutions, Pandoc has a modular design: it consists of a
33set of readers, which parse text in a given format and produce a native
34representation of the document, and a set of writers, which convert
35this native representation into a target format. Thus, adding an input
36or output format requires only adding a reader or writer.
41If no *input-file* is specified, input is read from *stdin*.
42Otherwise, the *input-files* are concatenated (with a blank
43line between each) and used as input. Output goes to *stdout* by
44default (though output to *stdout* is disabled for the `odt`, `docx`,
45and `epub` output formats). For output to a file, use the
48 pandoc -o output.html input.txt
50Instead of a file, an absolute URI may be given. In this case
51pandoc will fetch the content using HTTP:
53 pandoc -f html -t markdown http://www.fsf.org
55If multiple input files are given, `pandoc` will concatenate them all (with
56blank lines between them) before parsing.
58The format of the input and output can be specified explicitly using
59command-line options. The input format can be specified using the
60`-r/--read` or `-f/--from` options, the output format using the
61`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
62markdown to LaTeX, you could type:
64 pandoc -f markdown -t latex hello.txt
66To convert `hello.html` from html to markdown:
68 pandoc -f html -t markdown hello.html
70Supported output formats are listed below under the `-t/--to` option.
71Supported input formats are listed below under the `-f/--from` option. Note
72that the `rst`, `textile`, `latex`, and `html` readers are not complete;
73there are some constructs that they do not parse.
75If the input or output format is not specified explicitly, `pandoc`
76will attempt to guess it from the extensions of
77the input and output filenames. Thus, for example,
79 pandoc -o hello.tex hello.txt
81will convert `hello.txt` from markdown to LaTeX. If no output file
82is specified (so that output goes to *stdout*), or if the output file's
83extension is unknown, the output format will default to HTML.
84If no input file is specified (so that input comes from *stdin*), or
85if the input files' extensions are unknown, the input format will
86be assumed to be markdown unless explicitly specified.
88Pandoc uses the UTF-8 character encoding for both input and output.
89If your local character encoding is not UTF-8, you
90should pipe input and output through `iconv`:
92 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
97Earlier versions of pandoc came with a program, `markdown2pdf`, that
98used pandoc and pdflatex to produce a PDF. This is no longer needed,
99since `pandoc` can now produce `pdf` output itself. To produce a PDF, simply
100specify an output file with a `.pdf` extension. Pandoc will create a latex
101file and use pdflatex (or another engine, see `--latex-engine`) to convert it
104 pandoc test.txt -o test.pdf
106Production of a PDF requires that a LaTeX engine be installed (see
107`--latex-engine`, below), and assumes that the following LaTeX packages are
108available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the
109`--listings` option is used), `fancyvrb`, `enumerate`, `ctable`, `url`,
110`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),
111`fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra`
112and `xunicode` (if `xelatex` is used).
117A user who wants a drop-in replacement for `Markdown.pl` may create
118a symbolic link to the `pandoc` executable called `hsmarkdown`. When
119invoked under the name `hsmarkdown`, `pandoc` will behave as if the
120`--strict` flag had been selected, and no command-line options will be
121recognized. However, this approach does not work under Cygwin, due to
122problems with its simulation of symbolic links.
124[Cygwin]: http://www.cygwin.com/
125[`iconv`]: http://www.gnu.org/software/libiconv/
126[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
127[TeX Live]: http://www.tug.org/texlive/
128[MacTeX]: http://www.tug.org/mactex/
136`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
137: Specify input format. *FORMAT* can be `native` (native Haskell),
138 `json` (JSON version of native AST), `markdown` (markdown),
139 `textile` (Textile), `rst` (reStructuredText), `html` (HTML),
140 or `latex` (LaTeX). If `+lhs` is appended to `markdown`, `rst`,
141 or `latex`, the input will be treated as literate Haskell source:
142 see [Literate Haskell support](#literate-haskell-support),
145`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
146: Specify output format. *FORMAT* can be `native` (native Haskell),
147 `json` (JSON version of native AST), `plain` (plain text),
148 `markdown` (markdown), `rst` (reStructuredText), `html` (XHTML 1),
149 `html5` (HTML 5), `latex` (LaTeX), `beamer` (LaTeX beamer slide show),
150 `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),
151 `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),
152 `docbook` (DocBook XML), `opendocument` (OpenDocument XML), `odt`
153 (OpenOffice text document), `docx` (Word docx), `epub` (EPUB book),
154 `asciidoc` (AsciiDoc), `slidy` (Slidy HTML and javascript slide show),
155 `dzslides` (HTML5 + javascript slide show), `s5` (S5 HTML and javascript
156 slide show), or `rtf` (rich text format). Note that `odt` and `epub`
157 output will not be directed to *stdout*; an output filename must
158 be specified using the `-o/--output` option. If `+lhs` is appended
159 to `markdown`, `rst`, `latex`, `html`, or `html5`, the output will
160 be rendered as literate Haskell source: see [Literate Haskell
161 support](#literate-haskell-support), below.
163`-o` *FILE*, `--output=`*FILE*
164: Write output to *FILE* instead of *stdout*. If *FILE* is
165 `-`, output will go to *stdout*. (Exception: if the output
166 format is `odt`, `docx`, or `epub`, output to stdout is disabled.)
168`--data-dir=`*DIRECTORY*
169: Specify the user data directory to search for pandoc data files.
170 If this option is not specified, the default user data directory
177 C:\Documents And Settings\USERNAME\Application Data\pandoc
179 in Windows. A `reference.odt`, `reference.docx`, `default.csl`,
180 `epub.css`, `templates`, `slidy`, or `s5` directory placed in this
181 directory will override pandoc's normal defaults.
193: Use strict markdown syntax, with no pandoc extensions or variants.
194 When the input format is HTML, this means that constructs that have no
195 equivalents in standard markdown (e.g. definition lists or strikeout
196 text) will be parsed as raw HTML.
199: Parse untranslatable HTML codes and LaTeX environments as raw HTML
200 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
201 input. Raw HTML can be printed in markdown, reStructuredText, HTML, Slidy,
202 DZSlides, and S5 output; raw LaTeX can be printed in markdown,
203 reStructuredText, LaTeX, and ConTeXt output. The default is for the
204 readers to omit untranslatable HTML codes and LaTeX environments.
205 (The LaTeX reader does pass through untranslatable LaTeX *commands*,
206 even if `-R` is not specified.)
209: Produce typographically correct output, converting straight quotes
210 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
211 `...` to ellipses. Nonbreaking spaces are inserted after certain
212 abbreviations, such as "Mr." (Note: This option is significant only when
213 the input format is `markdown` or `textile`. It is selected automatically
214 when the input format is `textile` or the output format is `latex` or
218: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
219 a numeral is an en-dash, and `--` is an em-dash. This option is selected
220 automatically for `textile` input.
222`--base-header-level=`*NUMBER*
223: Specify the base level for headers (defaults to 1).
225`--indented-code-classes=`*CLASSES*
226: Specify classes to use for indented code blocks--for example,
227 `perl,numberLines` or `haskell`. Multiple classes may be separated
231: Normalize the document after reading: merge adjacent
232 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
234`-p`, `--preserve-tabs`
235: Preserve tabs instead of converting them to spaces (the default).
238: Specify the number of spaces per tab (default is 4).
240General writer options
241----------------------
244: Produce output with an appropriate header and footer (e.g. a
245 standalone HTML, LaTeX, or RTF file, not a fragment). This option
246 is set automatically for `pdf`, `epub`, `docx`, and `odt` output.
249: Use *FILE* as a custom template for the generated document. Implies
250 `--standalone`. See [Templates](#templates) below for a description
251 of template syntax. If no extension is specified, an extension
252 corresponding to the writer will be added, so that `--template=special`
253 looks for `special.html` for HTML output. If the template is not
254 found, pandoc will search for it in the user data directory
255 (see `--data-dir`). If this option is not used, a default
256 template appropriate for the output format will be used (see
257 `-D/--print-default-template`).
259`-V` *KEY=VAL*, `--variable=`*KEY:VAL*
260: Set the template variable *KEY* to the value *VAL* when rendering the
261 document in standalone mode. This is generally only useful when the
262 `--template` option is used to specify a custom template, since
263 pandoc automatically sets the variables used in the default
266`-D` *FORMAT*, `--print-default-template=`*FORMAT*
267: Print the default template for an output *FORMAT*. (See `-t`
268 for a list of possible *FORMAT*s.)
271: Disable text wrapping in output. By default, text is wrapped
272 appropriately for the output format.
275: Specify length of lines in characters (for text wrapping).
277`--toc`, `--table-of-contents`
278: Include an automatically generated table of contents (or, in
279 the case of `latex`, `context`, and `rst`, an instruction to create
280 one) in the output document. This option has no effect on `man`,
281 `docbook`, `slidy`, or `s5` output.
284: Disables syntax highlighting for code blocks and inlines, even when
285 a language attribute is given.
287`--highlight-style`=*STYLE*
288: Specifies the coloring style to be used in highlighted source code.
289 Options are `pygments` (the default), `kate`, `monochrome`,
290 `espresso`, `haddock`, and `tango`.
292`-H` *FILE*, `--include-in-header=`*FILE*
293: Include contents of *FILE*, verbatim, at the end of the header.
294 This can be used, for example, to include special
295 CSS or javascript in HTML documents. This option can be used
296 repeatedly to include multiple files in the header. They will be
297 included in the order specified. Implies `--standalone`.
299`-B` *FILE*, `--include-before-body=`*FILE*
300: Include contents of *FILE*, verbatim, at the beginning of the
301 document body (e.g. after the `<body>` tag in HTML, or the
302 `\begin{document}` command in LaTeX). This can be used to include
303 navigation bars or banners in HTML documents. This option can be
304 used repeatedly to include multiple files. They will be included in
305 the order specified. Implies `--standalone`.
307`-A` *FILE*, `--include-after-body=`*FILE*
308: Include contents of *FILE*, verbatim, at the end of the document
309 body (before the `</body>` tag in HTML, or the
310 `\end{document}` command in LaTeX). This option can be be used
311 repeatedly to include multiple files. They will be included in the
312 order specified. Implies `--standalone`.
314Options affecting specific writers
315----------------------------------
318: Produce a standalone HTML file with no external dependencies, using
319 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
320 images, and videos. The resulting file should be "self-contained,"
321 in the sense that it needs no external files and no net access to be
322 displayed properly by a browser. This option works only with HTML output
323 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
324 `slidy`, and `dzslides`. Scripts, images, and stylesheets at absolute URLs
325 will be downloaded; those at relative URLs will be sought first relative
326 to the working directory, then relative to the user data directory (see
327 `--data-dir`), and finally relative to pandoc's default data directory.
330: Deprecated synonym for `--self-contained`.
333: Produce HTML5 instead of HTML4. This option has no effect for writers
334 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
337: Use only ascii characters in output. Currently supported only
338 for HTML output (which uses numerical entities instead of
339 UTF-8 when this option is selected).
342: Use reference-style links, rather than inline links, in writing markdown
343 or reStructuredText. By default inline links are used.
346: Use ATX style headers in markdown output. The default is to use
347 setext-style headers for levels 1-2, and then ATX headers.
350: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
351 output. When the LaTeX template uses the report, book, or
352 memoir class, this option is implied. If `--beamer` is used,
353 top-level headers will become `\part{..}`.
355`-N`, `--number-sections`
356: Number section headings in LaTeX, ConTeXt, or HTML output.
357 By default, sections are not numbered.
360: Use listings package for LaTeX code blocks
363: Make list items in slide shows display incrementally (one by one).
364 The default is for lists to be displayed all at once.
366`--slide-level`=*NUMBER*
367: Specifies that headers with the specified level create
368 slides (for `beamer`, `s5`, `slidy`, `dzslides`). Headers
369 above this level in the hierarchy are used to divide the
370 slide show into sections; headers below this level create
371 subheads within a slide. The default is to set the slide level
372 based on the contents of the document; see
373 [Structuring the slide show](#structuring-the-slide-show), below.
376: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
377 and attach identifiers to the enclosing `<div>` (or `<section>`)
378 rather than the header itself.
379 See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.
381`--email-obfuscation=`*none|javascript|references*
382: Specify a method for obfuscating `mailto:` links in HTML documents.
383 *none* leaves `mailto:` links as they are. *javascript* obfuscates
384 them using javascript. *references* obfuscates them by printing their
385 letters as decimal or hexadecimal character references.
386 If `--strict` is specified, *references* is used regardless of the
387 presence of this option.
389`--id-prefix`=*STRING*
390: Specify a prefix to be added to all automatically generated identifiers
391 in HTML output. This is useful for preventing duplicate identifiers
392 when generating fragments to be included in other pages.
394`-T` *STRING*, `--title-prefix=`*STRING*
395: Specify *STRING* as a prefix at the beginning of the title
396 that appears in the HTML header (but not in the title as it
397 appears at the beginning of the HTML body). Implies
400`-c` *URL*, `--css=`*URL*
401: Link to a CSS style sheet.
403`--reference-odt=`*FILE*
404: Use the specified file as a style reference in producing an ODT.
405 For best results, the reference ODT should be a modified version
406 of an ODT produced using pandoc. The contents of the reference ODT
407 are ignored, but its stylesheets are used in the new ODT. If no
408 reference ODT is specified on the command line, pandoc will look
409 for a file `reference.odt` in the user data directory (see
410 `--data-dir`). If this is not found either, sensible defaults will be
413`--reference-docx=`*FILE*
414: Use the specified file as a style reference in producing a docx file.
415 For best results, the reference docx should be a modified version
416 of a docx file produced using pandoc. The contents of the reference docx
417 are ignored, but its stylesheets are used in the new docx. If no
418 reference docx is specified on the command line, pandoc will look
419 for a file `reference.docx` in the user data directory (see
420 `--data-dir`). If this is not found either, sensible defaults will be
423`--epub-stylesheet=`*FILE*
424: Use the specified CSS file to style the EPUB. If no stylesheet
425 is specified, pandoc will look for a file `epub.css` in the
426 user data directory (see `--data-dir`). If it is not
427 found there, sensible defaults will be used.
429`--epub-cover-image=`*FILE*
430: Use the specified image as the EPUB cover. It is recommended
431 that the image be less than 1000px in width and height.
433`--epub-metadata=`*FILE*
434: Look in the specified XML file for metadata for the EPUB.
435 The file should contain a series of Dublin Core elements,
436 as documented at <http://dublincore.org/documents/dces/>.
439 <dc:rights>Creative Commons</dc:rights>
440 <dc:language>es-AR</dc:language>
442 By default, pandoc will include the following metadata elements:
443 `<dc:title>` (from the document title), `<dc:creator>` (from the
444 document authors), `<dc:date>` (from the document date, which should
445 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
446 variable, or, if is not set, the locale), and `<dc:identifier
447 id="BookId">` (a randomly generated UUID). Any of these may be
448 overridden by elements in the metadata file.
450`--epub-embed-font=`*FILE*
451: Embed the specified font in the EPUB. This option can be repeated
452 to embed multiple fonts. To use embedded fonts, you
453 will need to add declarations like the following to your CSS (see
454 ``--epub-stylesheet`):
457 font-family: DejaVuSans;
460 src:url("DejaVuSans-Regular.ttf");
463 font-family: DejaVuSans;
466 src:url("DejaVuSans-Bold.ttf");
469 font-family: DejaVuSans;
472 src:url("DejaVuSans-Oblique.ttf");
475 font-family: DejaVuSans;
478 src:url("DejaVuSans-BoldOblique.ttf");
480 body { font-family: "DejaVuSans"; }
482`--latex-engine=`*pdflatex|lualatex|xelatex*
483: Use the specified LaTeX engine when producing PDF output.
484 The default is `pdflatex`. If the engine is not in your PATH,
485 the full path of the engine may be specified here.
490`--bibliography=`*FILE*
491: Specify bibliography database to be used in resolving
492 citations. The database type will be determined from the
493 extension of *FILE*, which may be `.mods` (MODS format),
494 `.bib` (BibTeX/BibLaTeX format),
495 `.ris` (RIS format), `.enl` (EndNote format),
496 `.xml` (EndNote XML format), `.wos` (ISI format),
497 `.medline` (MEDLINE format), `.copac` (Copac format),
498 or `.json` (citeproc JSON). If you want to use multiple
499 bibliographies, just use this option repeatedly.
502: Specify [CSL] style to be used in formatting citations and
503 the bibliography. If *FILE* is not found, pandoc will look
510 C:\Documents And Settings\USERNAME\Application Data\csl
512 in Windows. If the `--csl` option is not specified, pandoc
513 will use a default style: either `default.csl` in the
514 user data directory (see `--data-dir`), or, if that is
515 not present, the Chicago author-date style.
517`--citation-abbreviations=`*FILE*
518: Specify a file containing abbreviations for journal titles and
519 other bibliographic fields (indicated by setting `form="short"`
520 in the CSL node for the field). The format is described at
521 <http://citationstylist.org/2011/10/19/abbreviations-for-zotero-test-release/>.
522 Here is a short example:
526 "Lloyd's Law Reports": "Lloyd's Rep",
527 "Estates Gazette": "EG",
528 "Scots Law Times": "SLT"
534: Use natbib for citations in LaTeX output.
537: Use biblatex for citations in LaTeX output.
539Math rendering in HTML
540----------------------
542`-m` [*URL*], `--latexmathml`[=*URL*]
543: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
544 To insert a link to a local copy of the `LaTeXMathML.js` script,
545 provide a *URL*. If no *URL* is provided, the contents of the
546 script will be inserted directly into the HTML header, preserving
547 portability at the price of efficiency. If you plan to use math on
548 several pages, it is much better to link to a copy of the script,
552: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
553 In standalone `html` output, a small javascript (or a link to such a
554 script if a *URL* is supplied) will be inserted that allows the MathML to
555 be viewed on some browsers.
558: Use [jsMath] to display embedded TeX math in HTML output.
559 The *URL* should point to the jsMath load script (e.g.
560 `jsMath/easy/load.js`); if provided, it will be linked to in
561 the header of standalone HTML documents. If a *URL* is not provided,
562 no link to the jsMath load script will be inserted; it is then
563 up to the author to provide such a link in the HTML template.
566: Use [MathJax] to display embedded TeX math in HTML output.
567 The *URL* should point to the `MathJax.js` load script.
568 If a *URL* is not provided, a link to the MathJax CDN will
572: Enclose TeX math in `<eq>` tags in HTML output. These can then
573 be processed by [gladTeX] to produce links to images of the typeset
577: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
578 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
581: Render TeX formulas using an external script that converts TeX
582 formulas to images. The formula will be concatenated with the URL
583 provided. If *URL* is not specified, the Google Chart API will be used.
585Options for wrapper scripts
586---------------------------
589: Print information about command-line arguments to *stdout*, then exit.
590 This option is intended primarily for use in wrapper scripts.
591 The first line of output contains the name of the output file specified
592 with the `-o` option, or `-` (for *stdout*) if no output file was
593 specified. The remaining lines contain the command-line arguments,
594 one per line, in the order they appear. These do not include regular
595 Pandoc options and their arguments, but do include any options appearing
596 after a `--` separator at the end of the line.
599: Ignore command-line arguments (for use in wrapper scripts).
600 Regular Pandoc options are not ignored. Thus, for example,
602 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
606 pandoc -o foo.html -s
608[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
609[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
610[MathJax]: http://www.mathjax.org/
611[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
612[mimeTeX]: http://www.forkosh.com/mimetex.html
613[CSL]: http://CitationStyles.org
618When the `-s/--standalone` option is used, pandoc uses a template to
619add header and footer material that is needed for a self-standing
620document. To see the default template that is used, just type
624where `FORMAT` is the name of the output format. A custom template
625can be specified using the `--template` option. You can also override
626the system default templates for a given output format `FORMAT`
627by putting a file `templates/default.FORMAT` in the user data
628directory (see `--data-dir`, above).
630Templates may contain *variables*. Variable names are sequences of
631alphanumerics, `-`, and `_`, starting with a letter. A variable name
632surrounded by `$` signs will be replaced by its value. For example,
633the string `$title$` in
635 <title>$title$</title>
637will be replaced by the document title.
639To write a literal `$` in a template, use `$$`.
641Some variables are set automatically by pandoc. These vary somewhat
642depending on the output format, but include:
645: contents specified by `-H/--include-in-header` (may have multiple
648: non-null value if `--toc/--table-of-contents` was specified
650: contents specified by `-B/--include-before-body` (may have
653: contents specified by `-A/--include-after-body` (may have
658: title of document, as specified in title block
660: author of document, as specified in title block (may have
663: date of document, as specified in title block
665: language code for HTML or LaTeX documents
667: base URL for Slidy documents (defaults to
668 `http://www.w3.org/Talks/Tools/Slidy2`)
670: base URL for S5 documents (defaults to `ui/default`)
672: font size (10pt, 11pt, 12pt) for LaTeX documents
674: document class for LaTeX documents
676: theme for LaTeX beamer documents
678: colortheme for LaTeX beamer documents
680Variables may be set at the command line using the `-V/--variable`
681option. This allows users to include custom variables in their
684Templates may contain conditionals. The syntax is as follows:
692This will include `X` in the template if `variable` has a non-null
693value; otherwise it will include `Y`. `X` and `Y` are placeholders for
694any valid template text, and may include interpolated variables or other
695conditionals. The `$else$` section may be omitted.
697When variables can have multiple values (for example, `author` in
698a multi-author document), you can use the `$for$` keyword:
701 <meta name="author" content="$author$" />
704You can optionally specify a separator to be used between
707 $for(author)$$author$$sep$, $endfor$
709If you use custom templates, you may need to revise them as pandoc
710changes. We recommend tracking the changes in the default templates,
711and modifying your custom templates accordingly. An easy way to do this
712is to fork the pandoc-templates repository
713(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
719Pandoc understands an extended and slightly revised version of
720John Gruber's [markdown] syntax. This document explains the syntax,
721noting differences from standard markdown. Except where noted, these
722differences can be suppressed by specifying the `--strict` command-line
728Markdown is designed to be easy to write, and, even more importantly,
731> A Markdown-formatted document should be publishable as-is, as plain
732> text, without looking like it's been marked up with tags or formatting
734> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
736This principle has guided pandoc's decisions in finding syntax for
737tables, footnotes, and other extensions.
739There is, however, one respect in which pandoc's aims are different
740from the original aims of markdown. Whereas markdown was originally
741designed with HTML generation in mind, pandoc is designed for multiple
742output formats. Thus, while pandoc allows the embedding of raw HTML,
743it discourages it, and provides other, non-HTMLish ways of representing
744important document elements like definition lists, tables, mathematics, and
750A paragraph is one or more lines of text followed by one or more blank line.
751Newlines are treated as spaces, so you can reflow your paragraphs as you like.
752If you need a hard line break, put two or more spaces at the end of a line,
753or type a backslash followed by a newline.
758There are two kinds of headers, Setext and atx.
760### Setext-style headers ###
762A setext-style header is a line of text "underlined" with a row of `=` signs
763(for a level one header) of `-` signs (for a level two header):
771The header text can contain inline formatting, such as emphasis (see
772[Inline formatting](#inline-formatting), below).
775### Atx-style headers ###
777An Atx-style header consists of one to six `#` signs and a line of
778text, optionally followed by any number of `#` signs. The number of
779`#` signs at the beginning of the line is the header level:
781 ## A level-two header
783 ### A level-three header ###
785As with setext-style headers, the header text can contain formatting:
787 # A level-one header with a [link](/url) and *emphasis*
789Standard markdown syntax does not require a blank line before a header.
790Pandoc does require this (except, of course, at the beginning of the
791document). The reason for the requirement is that it is all too easy for a
792`#` to end up at the beginning of a line by accident (perhaps through line
793wrapping). Consider, for example:
795 I like several of their flavors of ice cream:
796 #22, for example, and #5.
799### Header identifiers in HTML, LaTeX, and ConTeXt ###
803Each header element in pandoc's HTML and ConTeXt output is given a
804unique identifier. This identifier is based on the text of the header.
805To derive the identifier from the header text,
807 - Remove all formatting, links, etc.
808 - Remove all punctuation, except underscores, hyphens, and periods.
809 - Replace all spaces and newlines with hyphens.
810 - Convert all alphabetic characters to lowercase.
811 - Remove everything up to the first letter (identifiers may
812 not begin with a number or punctuation mark).
813 - If nothing is left after this, use the identifier `section`.
818 ------------------------------- ----------------------------
819 Header identifiers in HTML `header-identifiers-in-html`
820 *Dogs*?--in *my* house? `dogs--in-my-house`
821 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
822 3. Applications `applications`
825These rules should, in most cases, allow one to determine the identifier
826from the header text. The exception is when several headers have the
827same text; in this case, the first will get an identifier as described
828above; the second will get the same identifier with `-1` appended; the
829third with `-2`; and so on.
831These identifiers are used to provide link targets in the table of
832contents generated by the `--toc|--table-of-contents` option. They
833also make it easy to provide links from one section of a document to
834another. A link to this section, for example, might look like this:
837 [header identifiers][#header-identifiers-in-html].
839Note, however, that this method of providing links to sections works
840only in HTML, LaTeX, and ConTeXt formats.
842If the `--section-divs` option is specified, then each section will
843be wrapped in a `div` (or a `section`, if `--html5` was specified),
844and the identifier will be attached to the enclosing `<div>`
845(or `<section>`) tag rather than the header itself. This allows entire
846sections to be manipulated using javascript or treated differently in
853Markdown uses email conventions for quoting blocks of text.
854A block quotation is one or more paragraphs or other block elements
855(such as lists or headers), with each line preceded by a `>` character
856and a space. (The `>` need not start at the left margin, but it should
857not be indented more than three spaces.)
859 > This is a block quote. This
860 > paragraph has two lines.
862 > 1. This is a list inside a block quote.
865A "lazy" form, which requires the `>` character only on the first
866line of each block, is also allowed:
868 > This is a block quote. This
869 paragraph has two lines.
871 > 1. This is a list inside a block quote.
874Among the block elements that can be contained in a block quote are
875other block quotes. That is, block quotes can be nested:
877 > This is a block quote.
879 > > A block quote within a block quote.
881Standard markdown syntax does not require a blank line before a block
882quote. Pandoc does require this (except, of course, at the beginning of the
883document). The reason for the requirement is that it is all too easy for a
884`>` to end up at the beginning of a line by accident (perhaps through line
885wrapping). So, unless `--strict` is used, the following does not produce
886a nested block quote in pandoc:
888 > This is a block quote.
892Verbatim (code) blocks
893----------------------
895### Indented code blocks ###
897A block of text indented four spaces (or one tab) is treated as verbatim
898text: that is, special characters do not trigger special formatting,
899and all spaces and line breaks are preserved. For example,
902 moveShip(5 * gravity, DOWN);
905The initial (four space or one tab) indentation is not considered part
906of the verbatim text, and is removed in the output.
908Note: blank lines in the verbatim text need not begin with four spaces.
911### Delimited code blocks ###
915In addition to standard indented code blocks, Pandoc supports
916*delimited* code blocks. These begin with a row of three or more
917tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
918backticks that must be at least as long as the starting row. Everything
919between these lines is treated as code. No indentation is necessary:
923 moveShip(5 * gravity, DOWN);
927Like regular code blocks, delimited code blocks must be separated
928from surrounding text by blank lines.
930If the code itself contains a row of tildes or backticks, just use a longer
931row of tildes or backticks at the start and end:
935 code including tildes
939Optionally, you may attach attributes to the code block using
942 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
944 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
945 qsort (filter (>= x) xs)
946 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
948Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
949`startFrom` is an attribute with value `100`. Some output formats can use this
950information to do syntax highlighting. Currently, the only output formats
951that uses this information are HTML and LaTeX. If highlighting is supported
952for your output format and language, then the code block above will appear
953highlighted, with numbered lines. (To see which languages are supported, do
954`pandoc --version`.) Otherwise, the code block above will appear as follows:
956 <pre id="mycode" class="haskell numberLines" startFrom="100">
962A shortcut form can also be used for specifying the language of
969This is equivalent to:
975To prevent all highlighting, use the `--no-highlight` flag.
976To set the highlighting style, use `--highlight-style`.
983A bullet list is a list of bulleted list items. A bulleted list
984item begins with a bullet (`*`, `+`, or `-`). Here is a simple
991This will produce a "compact" list. If you want a "loose" list, in which
992each item is formatted as a paragraph, put spaces between the items:
1000The bullets need not be flush with the left margin; they may be
1001indented one, two, or three spaces. The bullet must be followed
1004List items look best if subsequent lines are flush with the first
1005line (after the bullet):
1011But markdown also allows a "lazy" format:
1017### The four-space rule ###
1019A list item may contain multiple paragraphs and other block-level
1020content. However, subsequent paragraphs must be preceded by a blank line
1021and indented four spaces or a tab. The list will look better if the first
1022paragraph is aligned with the rest:
1028 * Second paragraph. With a code block, which must be indented
1033List items may include other lists. In this case the preceding blank
1034line is optional. The nested list must be indented four spaces or
1047As noted above, markdown allows you to write list items "lazily," instead of
1048indenting continuation lines. However, if there are multiple paragraphs or
1049other blocks in a list item, the first line of each must be indented.
1051 + A lazy, lazy, list
1054 + Another one; this looks
1057 Second paragraph of second
1060**Note:** Although the four-space rule for continuation paragraphs
1061comes from the official [markdown syntax guide], the reference implementation,
1062`Markdown.pl`, does not follow it. So pandoc will give different results than
1063`Markdown.pl` when authors have indented continuation paragraphs fewer than
1066The [markdown syntax guide] is not explicit whether the four-space
1067rule applies to *all* block-level content in a list item; it only
1068mentions paragraphs and code blocks. But it implies that the rule
1069applies to all block-level content (including nested lists), and
1070pandoc interprets it that way.
1072 [markdown syntax guide]:
1073 http://daringfireball.net/projects/markdown/syntax#list
1075### Ordered lists ###
1077Ordered lists work just like bulleted lists, except that the items
1078begin with enumerators rather than bullets.
1080In standard markdown, enumerators are decimal numbers followed
1081by a period and a space. The numbers themselves are ignored, so
1082there is no difference between this list:
1096Unlike standard markdown, Pandoc allows ordered list items to be marked
1097with uppercase and lowercase letters and roman numerals, in addition to
1098arabic numerals. List markers may be enclosed in parentheses or followed by a
1099single right-parentheses or period. They must be separated from the
1100text that follows by at least one space, and, if the list marker is a
1101capital letter with a period, by at least two spaces.[^2]
1103[^2]: The point of this rule is to ensure that normal paragraphs
1104 starting with people's initials, like
1106 B. Russell was an English philosopher.
1108 do not get treated as list items.
1110 This rule will not prevent
1114 from being interpreted as a list item. In this case, a backslash
1119Pandoc also pays attention to the type of list marker used, and to the
1120starting number, and both of these are preserved where possible in the
1121output format. Thus, the following yields a list with numbers followed
1122by a single parenthesis, starting with 9, and a sublist with lowercase
1132Note that Pandoc pays attention only to the *starting* marker in a list.
1133So, the following yields a list numbered sequentially starting from 2:
1140If default list markers are desired, use `#.`:
1147### Definition lists ###
1151Pandoc supports definition lists, using a syntax inspired by
1152[PHP Markdown Extra] and [reStructuredText]:[^3]
1158 Term 2 with *inline markup*
1162 { some code, part of Definition 2 }
1164 Third paragraph of definition 2.
1166Each term must fit on one line, which may optionally be followed by
1167a blank line, and must be followed by one or more definitions.
1168A definition begins with a colon or tilde, which may be indented one
1169or two spaces. The body of the definition (including the first line,
1170aside from the colon or tilde) should be indented four spaces. A term may have
1171multiple definitions, and each definition may consist of one or more block
1172elements (paragraph, code block, list, etc.), each indented four spaces or one
1175If you leave space after the definition (as in the example above),
1176the blocks of the definitions will be considered paragraphs. In some
1177output formats, this will mean greater spacing between term/definition
1178pairs. For a compact definition list, do not leave space between the
1179definition and the next term:
1187[^3]: I have also been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1189[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1192### Numbered example lists ###
1196The special list marker `@` can be used for sequentially numbered
1197examples. The first list item with a `@` marker will be numbered '1',
1198the next '2', and so on, throughout the document. The numbered examples
1199need not occur in a single list; each new list using `@` will take up
1200where the last stopped. So, for example:
1202 (@) My first example will be numbered (1).
1203 (@) My second example will be numbered (2).
1205 Explanation of examples.
1207 (@) My third example will be numbered (3).
1209Numbered examples can be labeled and referred to elsewhere in the
1212 (@good) This is a good example.
1214 As (@good) illustrates, ...
1216The label can be any string of alphanumeric characters, underscores,
1220### Compact and loose lists ###
1222Pandoc behaves differently from `Markdown.pl` on some "edge
1223cases" involving lists. Consider this source:
1233Pandoc transforms this into a "compact list" (with no `<p>` tags around
1234"First", "Second", or "Third"), while markdown puts `<p>` tags around
1235"Second" and "Third" (but not "First"), because of the blank space
1236around "Third". Pandoc follows a simple rule: if the text is followed by
1237a blank line, it is treated as a paragraph. Since "Second" is followed
1238by a list, and not a blank line, it isn't treated as a paragraph. The
1239fact that the list is followed by a blank line is irrelevant. (Note:
1240Pandoc works this way even when the `--strict` option is specified. This
1241behavior is consistent with the official markdown syntax description,
1242even though it is different from that of `Markdown.pl`.)
1245### Ending a list ###
1247What if you want to put an indented code block after a list?
1254Trouble! Here pandoc (like other markdown implementations) will treat
1255`{ my code block }` as the second paragraph of item two, and not as
1258To "cut off" the list after item two, you can insert some non-indented
1259content, like an HTML comment, which won't produce visible output in
1265 <!-- end of list -->
1269You can use the same trick if you want two consecutive lists instead
1285A line containing a row of three or more `*`, `-`, or `_` characters
1286(optionally separated by spaces) produces a horizontal rule:
1298Three kinds of tables may be used. All three kinds presuppose the use of
1299a fixed-width font, such as Courier.
1301**Simple tables** look like this:
1303 Right Left Center Default
1304 ------- ------ ---------- -------
1309 Table: Demonstration of simple table syntax.
1311The headers and table rows must each fit on one line. Column
1312alignments are determined by the position of the header text relative
1313to the dashed line below it:[^4]
1315 - If the dashed line is flush with the header text on the right side
1316 but extends beyond it on the left, the column is right-aligned.
1317 - If the dashed line is flush with the header text on the left side
1318 but extends beyond it on the right, the column is left-aligned.
1319 - If the dashed line extends beyond the header text on both sides,
1320 the column is centered.
1321 - If the dashed line is flush with the header text on both sides,
1322 the default alignment is used (in most cases, this will be left).
1324[^4]: This scheme is due to Michel Fortin, who proposed it on the
1325 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1327The table must end with a blank line, or a line of dashes followed by
1328a blank line. A caption may optionally be provided (as illustrated in
1329the example above). A caption is a paragraph beginning with the string
1330`Table:` (or just `:`), which will be stripped off. It may appear either
1331before or after the table.
1333The column headers may be omitted, provided a dashed line is used
1334to end the table. For example:
1336 ------- ------ ---------- -------
1340 ------- ------ ---------- -------
1342When headers are omitted, column alignments are determined on the basis
1343of the first line of the table body. So, in the tables above, the columns
1344would be right, left, center, and right aligned, respectively.
1346**Multiline tables** allow headers and table rows to span multiple lines
1347of text (but cells that span multiple columns or rows of the table are
1348not supported). Here is an example:
1350 -------------------------------------------------------------
1351 Centered Default Right Left
1352 Header Aligned Aligned Aligned
1353 ----------- ------- --------------- -------------------------
1354 First row 12.0 Example of a row that
1355 spans multiple lines.
1357 Second row 5.0 Here's another one. Note
1358 the blank line between
1360 -------------------------------------------------------------
1362 Table: Here's the caption. It, too, may span
1365These work like simple tables, but with the following differences:
1367 - They must begin with a row of dashes, before the header text
1368 (unless the headers are omitted).
1369 - They must end with a row of dashes, then a blank line.
1370 - The rows must be separated by blank lines.
1372In multiline tables, the table parser pays attention to the widths of
1373the columns, and the writers try to reproduce these relative widths in
1374the output. So, if you find that one of the columns is too narrow in the
1375output, try widening it in the markdown source.
1377Headers may be omitted in multiline tables as well as simple tables:
1379 ----------- ------- --------------- -------------------------
1380 First row 12.0 Example of a row that
1381 spans multiple lines.
1383 Second row 5.0 Here's another one. Note
1384 the blank line between
1386 -------------------------------------------------------------
1388 : Here's a multiline table without headers.
1390It is possible for a multiline table to have just one row, but the row
1391should be followed by a blank line (and then the row of dashes that ends
1392the table), or the table may be interpreted as a simple table.
1394**Grid tables** look like this:
1396 : Sample grid table.
1398 +---------------+---------------+--------------------+
1399 | Fruit | Price | Advantages |
1400 +===============+===============+====================+
1401 | Bananas | $1.34 | - built-in wrapper |
1402 | | | - bright color |
1403 +---------------+---------------+--------------------+
1404 | Oranges | $2.10 | - cures scurvy |
1406 +---------------+---------------+--------------------+
1408The row of `=`s separates the header from the table body, and can be
1409omitted for a headerless table. The cells of grid tables may contain
1410arbitrary block elements (multiple paragraphs, code blocks, lists,
1411etc.). Alignments are not supported, nor are cells that span multiple
1412columns or rows. Grid tables can be created easily using [Emacs table mode].
1414 [Emacs table mode]: http://table.sourceforge.net/
1422If the file begins with a title block
1425 % author(s) (separated by semicolons)
1428it will be parsed as bibliographic information, not regular text. (It
1429will be used, for example, in the title of standalone LaTeX or HTML
1430output.) The block may contain just a title, a title and an author,
1431or all three elements. If you want to include an author but no
1432title, or a title and a date but no author, you need a blank line:
1441The title may occupy multiple lines, but continuation lines must
1442begin with leading space, thus:
1447If a document has multiple authors, the authors may be put on
1448separate lines with leading space, or separated by semicolons, or
1449both. So, all of the following are equivalent:
1454 % Author One; Author Two
1459The date must fit on one line.
1461All three metadata fields may contain standard inline formatting
1462(italics, links, footnotes, etc.).
1464Title blocks will always be parsed, but they will affect the output only
1465when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1466will appear twice: once in the document head -- this is the title that
1467will appear at the top of the window in a browser -- and once at the
1468beginning of the document body. The title in the document head can have
1469an optional prefix attached (`--title-prefix` or `-T` option). The title
1470in the body appears as an H1 element with class "title", so it can be
1471suppressed or reformatted with CSS. If a title prefix is specified with
1472`-T` and no title block appears in the document, the title prefix will
1473be used by itself as the HTML title.
1475The man page writer extracts a title, man page section number, and
1476other header and footer information from the title line. The title
1477is assumed to be the first word on the title line, which may optionally
1478end with a (single-digit) section number in parentheses. (There should
1479be no space between the title and the parentheses.) Anything after
1480this is assumed to be additional footer and header text. A single pipe
1481character (`|`) should be used to separate the footer text from the header
1486will yield a man page with the title `PANDOC` and section 1.
1488 % PANDOC(1) Pandoc User Manuals
1490will also have "Pandoc User Manuals" in the footer.
1492 % PANDOC(1) Pandoc User Manuals | Version 4.0
1494will also have "Version 4.0" in the header.
1500Except inside a code block or inline code, any punctuation or space
1501character preceded by a backslash will be treated literally, even if it
1502would normally indicate formatting. Thus, for example, if one writes
1512 <strong>hello</strong>
1514This rule is easier to remember than standard markdown's rule,
1515which allows only the following characters to be backslash-escaped:
1519(However, if the `--strict` option is supplied, the standard
1520markdown rule will be used.)
1522A backslash-escaped space is parsed as a nonbreaking space. It will
1523appear in TeX output as `~` and in HTML and XML as `\ ` or
1526A backslash-escaped newline (i.e. a backslash occurring at the end of
1527a line) is parsed as a hard line break. It will appear in TeX output as
1528`\\` and in HTML as `<br />`. This is a nice alternative to
1529markdown's "invisible" way of indicating hard line breaks using
1530two trailing spaces on a line.
1532Backslash escapes do not work in verbatim contexts.
1537If the `--smart` option is specified, pandoc will produce typographically
1538correct output, converting straight quotes to curly quotes, `---` and `--`
1539to Em-dashes, and `...` to ellipses. Nonbreaking spaces are inserted after
1540certain abbreviations, such as "Mr."
1542Note: if your LaTeX template uses the `csquotes` package, pandoc will
1543detect automatically this and use `\enquote{...}` for quoted text.
1550To *emphasize* some text, surround it with `*`s or `_`, like this:
1552 This text is _emphasized with underscores_, and this
1553 is *emphasized with asterisks*.
1555Double `*` or `_` produces **strong emphasis**:
1557 This is **strong emphasis** and __with underscores__.
1559A `*` or `_` character surrounded by spaces, or backslash-escaped,
1560will not trigger emphasis:
1562 This is * not emphasized *, and \*neither is this\*.
1564Because `_` is sometimes used inside words and identifiers,
1565pandoc does not interpret a `_` surrounded by alphanumeric
1566characters as an emphasis marker. If you want to emphasize
1567just part of a word, use `*`:
1569 feas*ible*, not feas*able*.
1576To strikeout a section of text with a horizontal line, begin and end it
1577with `~~`. Thus, for example,
1579 This ~~is deleted text.~~
1582### Superscripts and subscripts ###
1586Superscripts may be written by surrounding the superscripted text by `^`
1587characters; subscripts may be written by surrounding the subscripted
1588text by `~` characters. Thus, for example,
1590 H~2~O is a liquid. 2^10^ is 1024.
1592If the superscripted or subscripted text contains spaces, these spaces
1593must be escaped with backslashes. (This is to prevent accidental
1594superscripting and subscripting through the ordinary use of `~` and `^`.)
1595Thus, if you want the letter P with 'a cat' in subscripts, use
1596`P~a\ cat~`, not `P~a cat~`.
1601To make a short span of text verbatim, put it inside backticks:
1603 What is the difference between `>>=` and `>>`?
1605If the verbatim text includes a backtick, use double backticks:
1607 Here is a literal backtick `` ` ``.
1609(The spaces after the opening backticks and before the closing
1610backticks will be ignored.)
1612The general rule is that a verbatim span starts with a string
1613of consecutive backticks (optionally followed by a space)
1614and ends with a string of the same number of backticks (optionally
1615preceded by a space).
1617Note that backslash-escapes (and other markdown constructs) do not
1618work in verbatim contexts:
1620 This is a backslash followed by an asterisk: `\*`.
1628Anything between two `$` characters will be treated as TeX math. The
1629opening `$` must have a character immediately to its right, while the
1630closing `$` must have a character immediately to its left. Thus,
1631`$20,000 and $30,000` won't parse as math. If for some reason
1632you need to enclose text in literal `$` characters, backslash-escape
1633them and they won't be treated as math delimiters.
1635TeX math will be printed in all output formats. How it is rendered
1636depends on the output format:
1638Markdown, reStructuredText, LaTeX, Org-Mode, ConTeXt
1639 ~ It will appear verbatim between `$` characters.
1642 ~ It will be rendered using an interpreted text role `:math:`, as described
1643 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
1646 ~ It will be rendered as `latexmath:[...]`.
1649 ~ It will be rendered inside a `@math` command.
1652 ~ It will be rendered verbatim without `$`'s.
1655 ~ It will be rendered inside `<math>` tags.
1658 ~ It will be rendered inside `<span class="math">` tags.
1660RTF, OpenDocument, ODT
1661 ~ It will be rendered, if possible, using unicode characters,
1662 and will otherwise appear verbatim.
1665 ~ If the `--mathml` flag is used, it will be rendered using mathml
1666 in an `inlineequation` or `informalequation` tag. Otherwise it
1667 will be rendered, if possible, using unicode characters.
1670 ~ It will be rendered using OMML math markup.
1672HTML, Slidy, DZSlides, S5, EPUB
1673 ~ The way math is rendered in HTML will depend on the
1674 command-line options selected:
1676 1. The default is to render TeX math as far as possible using unicode
1677 characters, as with RTF, DocBook, and OpenDocument output. Formulas
1678 are put inside a `span` with `class="math"`, so that they may be
1679 styled differently from the surrounding text if needed.
1681 2. If the `--latexmathml` option is used, TeX math will be displayed
1682 between $ or $$ characters and put in `<span>` tags with class `LaTeX`.
1683 The [LaTeXMathML] script will be used to render it as formulas.
1684 (This trick does not work in all browsers, but it works in Firefox.
1685 In browsers that do not support LaTeXMathML, TeX math will appear
1686 verbatim between $ characters.)
1688 3. If the `--jsmath` option is used, TeX math will be put inside
1689 `<span>` tags (for inline math) or `<div>` tags (for display math)
1690 with class `math`. The [jsMath] script will be used to render
1693 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
1694 be called to generate images for each TeX formula. This should
1695 work in all browsers. The `--mimetex` option takes an optional URL
1696 as argument. If no URL is specified, it will be assumed that the
1697 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
1699 5. If the `--gladtex` option is used, TeX formulas will be enclosed
1700 in `<eq>` tags in the HTML output. The resulting `htex` file may then
1701 be processed by [gladTeX], which will produce image files for each
1702 formula and an `html` file with links to these images. So, the
1705 pandoc -s --gladtex myfile.txt -o myfile.htex
1706 gladtex -d myfile-images myfile.htex
1707 # produces myfile.html and images in myfile-images
1709 6. If the `--webtex` option is used, TeX formulas will be converted
1710 to `<img>` tags that link to an external script that converts
1711 formulas to images. The formula will be URL-encoded and concatenated
1712 with the URL provided. If no URL is specified, the Google Chart
1713 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
1719Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
1720(except verbatim contexts, where `<`, `>`, and `&` are interpreted
1723The raw HTML is passed through unchanged in HTML, S5, Slidy, DZSlides, EPUB,
1724Markdown, and Textile output, and suppressed in other formats.
1728Standard markdown allows you to include HTML "blocks": blocks
1729of HTML between balanced tags that are separated from the surrounding text
1730with blank lines, and start and end at the left margin. Within
1731these blocks, everything is interpreted as HTML, not markdown;
1732so (for example), `*` does not signify emphasis.
1734Pandoc behaves this way when `--strict` is specified; but by default,
1735pandoc interprets material between HTML block tags as markdown.
1736Thus, for example, Pandoc will turn
1741 <td>[a link](http://google.com)</td>
1749 <td><em>one</em></td>
1750 <td><a href="http://google.com">a link</a></td>
1754whereas `Markdown.pl` will preserve it as is.
1756There is one exception to this rule: text between `<script>` and
1757`<style>` tags is not interpreted as markdown.
1759This departure from standard markdown should make it easier to mix
1760markdown with HTML block elements. For example, one can surround
1761a block of markdown text with `<div>` tags without preventing it
1762from being interpreted as markdown.
1769In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
1770included in a document. Inline TeX commands will be preserved and passed
1771unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
1772LaTeX to include BibTeX citations:
1774 This result was proved in \cite{jones.1967}.
1776Note that in LaTeX environments, like
1778 \begin{tabular}{|l|l|}\hline
1779 Age & Frequency \\ \hline
1782 36--45 & 22 \\ \hline
1785the material between the begin and end tags will be interpreted as raw
1786LaTeX, not as markdown.
1788Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
1793For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
1794`\renewcommand` definitions and apply the resulting macros to all LaTeX
1795math. So, for example, the following will work in all output formats,
1798 \newcommand{\tuple}[1]{\langle #1 \rangle}
1802In LaTeX output, the `\newcommand` definition will simply be passed
1803unchanged to the output.
1809Markdown allows links to be specified in several ways.
1811### Automatic links ###
1813If you enclose a URL or email address in pointy brackets, it
1817 <sam@green.eggs.ham>
1822An inline link consists of the link text in square brackets,
1823followed by the URL in parentheses. (Optionally, the URL can
1824be followed by a link title, in quotes.)
1826 This is an [inline link](/url), and here's [one with
1827 a title](http://fsf.org "click here for a good time!").
1829There can be no space between the bracketed part and the parenthesized part.
1830The link text can contain formatting (such as emphasis), but the title cannot.
1833### Reference links ###
1835An *explicit* reference link has two parts, the link itself and the link
1836definition, which may occur elsewhere in the document (either
1837before or after the link).
1839The link consists of link text in square brackets, followed by a label in
1840square brackets. (There can be space between the two.) The link definition
1841must begin at the left margin or indented no more than three spaces. It
1842consists of the bracketed label, followed by a colon and a space, followed by
1843the URL, and optionally (after a space) a link title either in quotes or in
1846Here are some examples:
1848 [my label 1]: /foo/bar.html "My title, optional"
1850 [my label 3]: http://fsf.org (The free software foundation)
1851 [my label 4]: /bar#special 'A title in single quotes'
1853The URL may optionally be surrounded by angle brackets:
1855 [my label 5]: <http://foo.bar.baz>
1857The title may go on the next line:
1859 [my label 3]: http://fsf.org
1860 "The free software foundation"
1862Note that link labels are not case sensitive. So, this will work:
1864 Here is [my link][FOO]
1868In an *implicit* reference link, the second pair of brackets is
1869empty, or omitted entirely:
1871 See [my website][], or [my website].
1873 [my website]: http://foo.bar.baz
1879A link immediately preceded by a `!` will be treated as an image.
1880The link text will be used as the image's alt text:
1882 
1886 [movie reel]: movie.gif
1888### Pictures with captions ###
1892An image occurring by itself in a paragraph will be rendered as
1893a figure with a caption.[^5] (In LaTeX, a figure environment will be
1894used; in HTML, the image will be placed in a `div` with class
1895`figure`, together with a caption in a `p` with class `caption`.)
1896The image's alt text will be used as the caption.
1898 
1900[^5]: This feature is not yet implemented for RTF, OpenDocument, or
1901 ODT. In those formats, you'll just get an image in a paragraph by
1902 itself, with no caption.
1904If you just want a regular inline image, just make sure it is not
1905the only thing in the paragraph. One way to do this is to insert a
1906nonbreaking space after the image:
1908 \
1916Pandoc's markdown allows footnotes, using the following syntax:
1918 Here is a footnote reference,[^1] and another.[^longnote]
1920 [^1]: Here is the footnote.
1922 [^longnote]: Here's one with multiple blocks.
1924 Subsequent paragraphs are indented to show that they
1925 belong to the previous footnote.
1929 The whole paragraph can be indented, or just the first
1930 line. In this way, multi-paragraph footnotes work like
1931 multi-paragraph list items.
1933 This paragraph won't be part of the note, because it
1936The identifiers in footnote references may not contain spaces, tabs,
1937or newlines. These identifiers are used only to correlate the
1938footnote reference with the note itself; in the output, footnotes
1939will be numbered sequentially.
1941The footnotes themselves need not be placed at the end of the
1942document. They may appear anywhere except inside other block elements
1943(lists, block quotes, tables, etc.).
1945Inline footnotes are also allowed (though, unlike regular notes,
1946they cannot contain multiple paragraphs). The syntax is as follows:
1948 Here is an inline note.^[Inlines notes are easier to write, since
1949 you don't have to pick an identifier and move down to type the
1952Inline and regular footnotes may be mixed freely.
1960Pandoc can automatically generate citations and a bibliography in a number of
1961styles (using Andrea Rossato's `hs-citeproc`). In order to use this feature,
1962you will need a bibliographic database in one of the following formats:
1964 Format File extension
1965 ------------ --------------
1967 BibTeX/BibLaTeX .bib
1976You will need to specify the bibliography file using the `--bibliography`
1977command-line option (which may be repeated if you have several
1980By default, pandoc will use a Chicago author-date format for citations
1981and references. To use another style, you will need to use the
1982`--csl` option to specify a [CSL] 1.0 style file. A primer on
1983creating and modifying CSL styles can be found at
1984<http://citationstyles.org/downloads/primer.html>.
1985A repository of CSL styles can be found at
1986<https://github.com/citation-style-language/styles>.
1987See also <http://zotero.org/styles> for easy browsing.
1989Citations go inside square brackets and are separated by semicolons.
1990Each citation must have a key, composed of '@' + the citation
1991identifier from the database, and may optionally have a prefix,
1992a locator, and a suffix. Here are some examples:
1994 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
1996 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
1998 Blah blah [@smith04; @doe99].
2000A minus sign (`-`) before the `@` will suppress mention of
2001the author in the citation. This can be useful when the
2002author is already mentioned in the text:
2004 Smith says blah [-@smith04].
2006You can also write an in-text citation, as follows:
2010 @smith04 [p. 33] says blah.
2012If the style calls for a list of works cited, it will be placed
2013at the end of the document. Normally, you will want to end your
2014document with an appropriate header:
2020The bibliography will be inserted after this header.
2023Producing slide shows with Pandoc
2024=================================
2026You can use Pandoc to produce an HTML + javascript slide presentation
2027that can be viewed via a web browser. There are three ways to do this,
2028using [S5], [DZSlides], or [Slidy]. You can also produce a PDF slide
2029show using LaTeX [beamer].
2031Here's the markdown source for a simple slide show, `habits.txt`:
2058 
2065To produce the slide show, simply type
2067 pandoc -t s5 -s habits.txt -o habits.html
2071 pandoc -t slidy -s habits.txt -o habits.html
2075 pandoc -t dzslides -s habits.txt -o habits.html
2079 pandoc -t beamer habits.txt -o habits.pdf
2083With all HTML slide formats, the `--self-contained` option can be used to
2084produce a single file that contains all of the data necessary to display the
2085slide show, including linked scripts, stylesheets, images, and videos.
2087Structuring the slide show
2088--------------------------
2090By default, the *slide level* is the highest header level in
2091the hierarchy that is followed immediately by content, and not another
2092header, somewhere in the document. In the example above, level 1 headers
2093are always followed by level 2 headers, which are followed by content,
2094so 2 is the slide level. This default can be overridden using
2095the `--slide-level` option.
2097The document is carved up into slides according to the following
2100 * A horizontal rule always starts a new slide.
2102 * A header at the slide level always starts a new slide.
2104 * Headers *below* the slide level in the hierarchy create
2105 headers *within* a slide.
2107 * Headers *above* the slide level in the hierarchy create
2108 "title slides," which just contain the section title
2109 and help to break the slide show into sections.
2111 * A title page is constructed automatically from the document's title
2112 block, if present. (In the case of beamer, this can be disabled
2113 by commenting out some lines in the default template.)
2115These rules are designed to support many different styles of slide show. If
2116you don't care about structuring your slides into sections and subsections,
2117you can just use level 1 headers for all each slide. (In that case, level 1
2118will be the slide level.) But you can also structure the slide show into
2119sections, as in the example above.
2121For Slidy and S5, the file produced by pandoc with the `-s/--standalone`
2122option embeds a link to javascripts and CSS files, which are assumed to
2123be available at the relative path `s5/default` (for S5) or at the Slidy
2124website at `w3.org` (for Slidy). (These paths can be changed by setting
2125the `slidy-url` or `s5-url` variables; see `--variable`, above.) For DZSlides,
2126the (relatively short) javascript and css are included in the file by default.
2131By default, these writers produces lists that display "all at once."
2132If you want your lists to display incrementally (one item at a time),
2133use the `-i` option. If you want a particular list to depart from the
2134default (that is, to display incrementally without the `-i` option and
2135all at once with the `-i` option), put it in a block quote:
2140In this way incremental and nonincremental lists can be mixed in
2146You can change the style of HTML slides by putting customized CSS files
2147in `$DATADIR/s5/default` (for S5) or `$DATADIR/slidy` (for Slidy),
2148where `$DATADIR` is the user data directory (see `--data-dir`, above).
2149The originals may be found in pandoc's system data directory (generally
2150`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2151files it does not find in the user data directory.
2153For dzslides, the CSS is included in the HTML file itself, and may
2156To style beamer slides, you can specify a beamer "theme" or "colortheme"
2157using the `-V` option:
2159 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2161Literate Haskell support
2162========================
2164If you append `+lhs` to an appropriate input or output format (`markdown`,
2165`rst`, or `latex` for input or output; `html` or `html5` for output only),
2166pandoc will treat the document as literate Haskell source. This means that
2168 - In markdown input, "bird track" sections will be parsed as Haskell
2169 code rather than block quotations. Text between `\begin{code}`
2170 and `\end{code}` will also be treated as Haskell code.
2172 - In markdown output, code blocks with classes `haskell` and `literate`
2173 will be rendered using bird tracks, and block quotations will be
2174 indented one space, so they will not be treated as Haskell code.
2175 In addition, headers will be rendered setext-style (with underlines)
2176 rather than atx-style (with '#' characters). (This is because ghc
2177 treats '#' characters in column 1 as introducing line numbers.)
2179 - In restructured text input, "bird track" sections will be parsed
2182 - In restructured text output, code blocks with class `haskell` will
2183 be rendered using bird tracks.
2185 - In LaTeX input, text in `code` environments will be parsed as
2188 - In LaTeX output, code blocks with class `haskell` will be rendered
2189 inside `code` environments.
2191 - In HTML output, code blocks with class `haskell` will be rendered
2192 with class `literatehaskell` and bird tracks.
2196 pandoc -f markdown+lhs -t html
2198reads literate Haskell source formatted with markdown conventions and writes
2199ordinary HTML (without bird tracks).
2201 pandoc -f markdown+lhs -t html+lhs
2203writes HTML with the Haskell code in bird tracks, so it can be copied
2204and pasted as literate Haskell source.
2209© 2006-2011 John MacFarlane (jgm at berkeley dot edu). Released under the
2210[GPL], version 2 or greater. This software carries no warranty of
2211any kind. (See COPYRIGHT for full copyright and warranty notices.)
2212Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
2213Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
2214Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
2215Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
2216Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
2217Latter, Ralf Stephan, Eric Seidel, B. Scott Michel.
2219[markdown]: http://daringfireball.net/projects/markdown/
2220[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
2221[S5]: http://meyerweb.com/eric/tools/s5/
2222[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
2223[HTML]: http://www.w3.org/TR/html40/
2224[HTML 5]: http://www.w3.org/TR/html5/
2225[XHTML]: http://www.w3.org/TR/xhtml1/
2226[LaTeX]: http://www.latex-project.org/
2227[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
2228[ConTeXt]: http://www.pragma-ade.nl/
2229[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
2230[DocBook XML]: http://www.docbook.org/
2231[OpenDocument XML]: http://opendocument.xml.org/
2232[ODT]: http://en.wikipedia.org/wiki/OpenDocument
2233[Textile]: http://redcloth.org/textile
2234[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
2235[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
2236[Haskell]: http://www.haskell.org/
2237[GNU Texinfo]: http://www.gnu.org/software/texinfo/
2238[Emacs Org-Mode]: http://orgmode.org
2239[AsciiDoc]: http://www.methods.co.nz/asciidoc/
2240[EPUB]: http://www.idpf.org/
2241[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
2242[DZSlides]: http://paulrouget.com/dzslides/
2243[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
2244[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
2245[PDF]: http://www.adobe.com/pdf/
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list