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],
16[LaTeX], and [DocBook XML]; and it can write plain text, [markdown],
17[reStructuredText], [XHTML], [HTML 5], [LaTeX] (including [beamer]
18slide shows), [ConTeXt], [RTF], [DocBook XML], [OpenDocument XML],
19[ODT], [Word docx], [GNU Texinfo], [MediaWiki markup], [EPUB],
20[Textile], [groff man] pages, [Emacs Org-Mode], [AsciiDoc], and [Slidy],
21[DZSlides], or [S5] HTML slide shows. It can also produce [PDF] output
22on systems where LaTeX is installed.
24Pandoc's enhanced version of markdown includes syntax for footnotes,
25tables, flexible ordered lists, definition lists, delimited code blocks,
26superscript, subscript, strikeout, title blocks, automatic tables of
27contents, embedded LaTeX math, citations, and markdown inside HTML block
28elements. (These enhancements, described below under
29[Pandoc's markdown](#pandocs-markdown), can be disabled using the `--strict`
32In contrast to most existing tools for converting markdown to HTML, which
33use regex substitutions, Pandoc has a modular design: it consists of a
34set of readers, which parse text in a given format and produce a native
35representation of the document, and a set of writers, which convert
36this native representation into a target format. Thus, adding an input
37or output format requires only adding a reader or writer.
42If no *input-file* is specified, input is read from *stdin*.
43Otherwise, the *input-files* are concatenated (with a blank
44line between each) and used as input. Output goes to *stdout* by
45default (though output to *stdout* is disabled for the `odt`, `docx`,
46and `epub` output formats). For output to a file, use the
49 pandoc -o output.html input.txt
51Instead of a file, an absolute URI may be given. In this case
52pandoc will fetch the content using HTTP:
54 pandoc -f html -t markdown http://www.fsf.org
56If multiple input files are given, `pandoc` will concatenate them all (with
57blank lines between them) before parsing.
59The format of the input and output can be specified explicitly using
60command-line options. The input format can be specified using the
61`-r/--read` or `-f/--from` options, the output format using the
62`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
63markdown to LaTeX, you could type:
65 pandoc -f markdown -t latex hello.txt
67To convert `hello.html` from html to markdown:
69 pandoc -f html -t markdown hello.html
71Supported output formats are listed below under the `-t/--to` option.
72Supported input formats are listed below under the `-f/--from` option. Note
73that the `rst`, `textile`, `latex`, and `html` readers are not complete;
74there are some constructs that they do not parse.
76If the input or output format is not specified explicitly, `pandoc`
77will attempt to guess it from the extensions of
78the input and output filenames. Thus, for example,
80 pandoc -o hello.tex hello.txt
82will convert `hello.txt` from markdown to LaTeX. If no output file
83is specified (so that output goes to *stdout*), or if the output file's
84extension is unknown, the output format will default to HTML.
85If no input file is specified (so that input comes from *stdin*), or
86if the input files' extensions are unknown, the input format will
87be assumed to be markdown unless explicitly specified.
89Pandoc uses the UTF-8 character encoding for both input and output.
90If your local character encoding is not UTF-8, you
91should pipe input and output through `iconv`:
93 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
98Earlier versions of pandoc came with a program, `markdown2pdf`, that
99used pandoc and pdflatex to produce a PDF. This is no longer needed,
100since `pandoc` can now produce `pdf` output itself. To produce a PDF, simply
101specify an output file with a `.pdf` extension. Pandoc will create a latex
102file and use pdflatex (or another engine, see `--latex-engine`) to convert it
105 pandoc test.txt -o test.pdf
107Production of a PDF requires that a LaTeX engine be installed (see
108`--latex-engine`, below), and assumes that the following LaTeX packages are
109available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the
110`--listings` option is used), `fancyvrb`, `enumerate`, `ctable`, `url`,
111`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),
112`fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra`
113and `xunicode` (if `xelatex` is used).
118A user who wants a drop-in replacement for `Markdown.pl` may create
119a symbolic link to the `pandoc` executable called `hsmarkdown`. When
120invoked under the name `hsmarkdown`, `pandoc` will behave as if the
121`--strict` flag had been selected, and no command-line options will be
122recognized. However, this approach does not work under Cygwin, due to
123problems with its simulation of symbolic links.
125[Cygwin]: http://www.cygwin.com/
126[`iconv`]: http://www.gnu.org/software/libiconv/
127[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
128[TeX Live]: http://www.tug.org/texlive/
129[MacTeX]: http://www.tug.org/mactex/
137`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
138: Specify input format. *FORMAT* can be `native` (native Haskell),
139 `json` (JSON version of native AST), `markdown` (markdown),
140 `textile` (Textile), `rst` (reStructuredText), `html` (HTML),
141 `docbook` (DocBook XML), or `latex` (LaTeX). If `+lhs` is
142 appended to `markdown`, `rst`, `latex`, the input will be
143 treated as literate Haskell source: see [Literate Haskell
144 support](#literate-haskell-support), below.
146`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
147: Specify output format. *FORMAT* can be `native` (native Haskell),
148 `json` (JSON version of native AST), `plain` (plain text),
149 `markdown` (markdown), `rst` (reStructuredText), `html` (XHTML 1),
150 `html5` (HTML 5), `latex` (LaTeX), `beamer` (LaTeX beamer slide show),
151 `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),
152 `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),
153 `docbook` (DocBook XML), `opendocument` (OpenDocument XML), `odt`
154 (OpenOffice text document), `docx` (Word docx), `epub` (EPUB book),
155 `asciidoc` (AsciiDoc), `slidy` (Slidy HTML and javascript slide show),
156 `dzslides` (HTML5 + javascript slide show), `s5` (S5 HTML and javascript
157 slide show), or `rtf` (rich text format). Note that `odt` and `epub`
158 output will not be directed to *stdout*; an output filename must
159 be specified using the `-o/--output` option. If `+lhs` is appended
160 to `markdown`, `rst`, `latex`, `beamer`, `html`, or `html5`, the output
161 will be rendered as literate Haskell source: see [Literate Haskell
162 support](#literate-haskell-support), below.
164`-o` *FILE*, `--output=`*FILE*
165: Write output to *FILE* instead of *stdout*. If *FILE* is
166 `-`, output will go to *stdout*. (Exception: if the output
167 format is `odt`, `docx`, or `epub`, output to stdout is disabled.)
169`--data-dir=`*DIRECTORY*
170: Specify the user data directory to search for pandoc data files.
171 If this option is not specified, the default user data directory
178 C:\Documents And Settings\USERNAME\Application Data\pandoc
180 in Windows. A `reference.odt`, `reference.docx`, `default.csl`,
181 `epub.css`, `templates`, `slidy`, or `s5` directory placed in this
182 directory will override pandoc's normal defaults.
194: Use strict markdown syntax, with no pandoc extensions or variants.
195 When the input format is HTML, this means that constructs that have no
196 equivalents in standard markdown (e.g. definition lists or strikeout
197 text) will be parsed as raw HTML.
200: Parse untranslatable HTML codes and LaTeX environments as raw HTML
201 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
202 input. Raw HTML can be printed in markdown, reStructuredText, HTML, Slidy,
203 DZSlides, and S5 output; raw LaTeX can be printed in markdown,
204 reStructuredText, LaTeX, and ConTeXt output. The default is for the
205 readers to omit untranslatable HTML codes and LaTeX environments.
206 (The LaTeX reader does pass through untranslatable LaTeX *commands*,
207 even if `-R` is not specified.)
210: Produce typographically correct output, converting straight quotes
211 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
212 `...` to ellipses. Nonbreaking spaces are inserted after certain
213 abbreviations, such as "Mr." (Note: This option is significant only when
214 the input format is `markdown` or `textile`. It is selected automatically
215 when the input format is `textile` or the output format is `latex` or
219: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
220 a numeral is an en-dash, and `--` is an em-dash. This option is selected
221 automatically for `textile` input.
223`--base-header-level=`*NUMBER*
224: Specify the base level for headers (defaults to 1).
226`--indented-code-classes=`*CLASSES*
227: Specify classes to use for indented code blocks--for example,
228 `perl,numberLines` or `haskell`. Multiple classes may be separated
232: Normalize the document after reading: merge adjacent
233 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
235`-p`, `--preserve-tabs`
236: Preserve tabs instead of converting them to spaces (the default).
239: Specify the number of spaces per tab (default is 4).
241General writer options
242----------------------
245: Produce output with an appropriate header and footer (e.g. a
246 standalone HTML, LaTeX, or RTF file, not a fragment). This option
247 is set automatically for `pdf`, `epub`, `docx`, and `odt` output.
250: Use *FILE* as a custom template for the generated document. Implies
251 `--standalone`. See [Templates](#templates) below for a description
252 of template syntax. If no extension is specified, an extension
253 corresponding to the writer will be added, so that `--template=special`
254 looks for `special.html` for HTML output. If the template is not
255 found, pandoc will search for it in the user data directory
256 (see `--data-dir`). If this option is not used, a default
257 template appropriate for the output format will be used (see
258 `-D/--print-default-template`).
260`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*
261: Set the template variable *KEY* to the value *VAL* when rendering the
262 document in standalone mode. This is generally only useful when the
263 `--template` option is used to specify a custom template, since
264 pandoc automatically sets the variables used in the default
265 templates. If no *VAL* is specified, the key will be given the
268`-D` *FORMAT*, `--print-default-template=`*FORMAT*
269: Print the default template for an output *FORMAT*. (See `-t`
270 for a list of possible *FORMAT*s.)
273: Disable text wrapping in output. By default, text is wrapped
274 appropriately for the output format.
277: Specify length of lines in characters (for text wrapping).
279`--toc`, `--table-of-contents`
280: Include an automatically generated table of contents (or, in
281 the case of `latex`, `context`, and `rst`, an instruction to create
282 one) in the output document. This option has no effect on `man`,
283 `docbook`, `slidy`, or `s5` output.
286: Disables syntax highlighting for code blocks and inlines, even when
287 a language attribute is given.
289`--highlight-style`=*STYLE*
290: Specifies the coloring style to be used in highlighted source code.
291 Options are `pygments` (the default), `kate`, `monochrome`,
292 `espresso`, `haddock`, and `tango`.
294`-H` *FILE*, `--include-in-header=`*FILE*
295: Include contents of *FILE*, verbatim, at the end of the header.
296 This can be used, for example, to include special
297 CSS or javascript in HTML documents. This option can be used
298 repeatedly to include multiple files in the header. They will be
299 included in the order specified. Implies `--standalone`.
301`-B` *FILE*, `--include-before-body=`*FILE*
302: Include contents of *FILE*, verbatim, at the beginning of the
303 document body (e.g. after the `<body>` tag in HTML, or the
304 `\begin{document}` command in LaTeX). This can be used to include
305 navigation bars or banners in HTML documents. This option can be
306 used repeatedly to include multiple files. They will be included in
307 the order specified. Implies `--standalone`.
309`-A` *FILE*, `--include-after-body=`*FILE*
310: Include contents of *FILE*, verbatim, at the end of the document
311 body (before the `</body>` tag in HTML, or the
312 `\end{document}` command in LaTeX). This option can be be used
313 repeatedly to include multiple files. They will be included in the
314 order specified. Implies `--standalone`.
316Options affecting specific writers
317----------------------------------
320: Produce a standalone HTML file with no external dependencies, using
321 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
322 images, and videos. The resulting file should be "self-contained,"
323 in the sense that it needs no external files and no net access to be
324 displayed properly by a browser. This option works only with HTML output
325 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
326 `slidy`, and `dzslides`. Scripts, images, and stylesheets at absolute URLs
327 will be downloaded; those at relative URLs will be sought first relative
328 to the working directory, then relative to the user data directory (see
329 `--data-dir`), and finally relative to pandoc's default data directory.
332: Deprecated synonym for `--self-contained`.
335: Produce HTML5 instead of HTML4. This option has no effect for writers
336 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
339: Use only ascii characters in output. Currently supported only
340 for HTML output (which uses numerical entities instead of
341 UTF-8 when this option is selected).
344: Use reference-style links, rather than inline links, in writing markdown
345 or reStructuredText. By default inline links are used.
348: Use ATX style headers in markdown output. The default is to use
349 setext-style headers for levels 1-2, and then ATX headers.
352: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
353 output. When the LaTeX template uses the report, book, or
354 memoir class, this option is implied. If `--beamer` is used,
355 top-level headers will become `\part{..}`.
357`-N`, `--number-sections`
358: Number section headings in LaTeX, ConTeXt, or HTML output.
359 By default, sections are not numbered.
362: Use listings package for LaTeX code blocks
365: Make list items in slide shows display incrementally (one by one).
366 The default is for lists to be displayed all at once.
368`--slide-level`=*NUMBER*
369: Specifies that headers with the specified level create
370 slides (for `beamer`, `s5`, `slidy`, `dzslides`). Headers
371 above this level in the hierarchy are used to divide the
372 slide show into sections; headers below this level create
373 subheads within a slide. The default is to set the slide level
374 based on the contents of the document; see
375 [Structuring the slide show](#structuring-the-slide-show), below.
378: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
379 and attach identifiers to the enclosing `<div>` (or `<section>`)
380 rather than the header itself.
381 See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.
383`--email-obfuscation=`*none|javascript|references*
384: Specify a method for obfuscating `mailto:` links in HTML documents.
385 *none* leaves `mailto:` links as they are. *javascript* obfuscates
386 them using javascript. *references* obfuscates them by printing their
387 letters as decimal or hexadecimal character references.
388 If `--strict` is specified, *references* is used regardless of the
389 presence of this option.
391`--id-prefix`=*STRING*
392: Specify a prefix to be added to all automatically generated identifiers
393 in HTML output. This is useful for preventing duplicate identifiers
394 when generating fragments to be included in other pages.
396`-T` *STRING*, `--title-prefix=`*STRING*
397: Specify *STRING* as a prefix at the beginning of the title
398 that appears in the HTML header (but not in the title as it
399 appears at the beginning of the HTML body). Implies
402`-c` *URL*, `--css=`*URL*
403: Link to a CSS style sheet.
405`--reference-odt=`*FILE*
406: Use the specified file as a style reference in producing an ODT.
407 For best results, the reference ODT should be a modified version
408 of an ODT produced using pandoc. The contents of the reference ODT
409 are ignored, but its stylesheets are used in the new ODT. If no
410 reference ODT is specified on the command line, pandoc will look
411 for a file `reference.odt` in the user data directory (see
412 `--data-dir`). If this is not found either, sensible defaults will be
415`--reference-docx=`*FILE*
416: Use the specified file as a style reference in producing a docx file.
417 For best results, the reference docx should be a modified version
418 of a docx file produced using pandoc. The contents of the reference docx
419 are ignored, but its stylesheets are used in the new docx. If no
420 reference docx is specified on the command line, pandoc will look
421 for a file `reference.docx` in the user data directory (see
422 `--data-dir`). If this is not found either, sensible defaults will be
425`--epub-stylesheet=`*FILE*
426: Use the specified CSS file to style the EPUB. If no stylesheet
427 is specified, pandoc will look for a file `epub.css` in the
428 user data directory (see `--data-dir`). If it is not
429 found there, sensible defaults will be used.
431`--epub-cover-image=`*FILE*
432: Use the specified image as the EPUB cover. It is recommended
433 that the image be less than 1000px in width and height.
435`--epub-metadata=`*FILE*
436: Look in the specified XML file for metadata for the EPUB.
437 The file should contain a series of Dublin Core elements,
438 as documented at <http://dublincore.org/documents/dces/>.
441 <dc:rights>Creative Commons</dc:rights>
442 <dc:language>es-AR</dc:language>
444 By default, pandoc will include the following metadata elements:
445 `<dc:title>` (from the document title), `<dc:creator>` (from the
446 document authors), `<dc:date>` (from the document date, which should
447 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
448 variable, or, if is not set, the locale), and `<dc:identifier
449 id="BookId">` (a randomly generated UUID). Any of these may be
450 overridden by elements in the metadata file.
452`--epub-embed-font=`*FILE*
453: Embed the specified font in the EPUB. This option can be repeated
454 to embed multiple fonts. To use embedded fonts, you
455 will need to add declarations like the following to your CSS (see
456 `--epub-stylesheet`):
459 font-family: DejaVuSans;
462 src:url("DejaVuSans-Regular.ttf");
465 font-family: DejaVuSans;
468 src:url("DejaVuSans-Bold.ttf");
471 font-family: DejaVuSans;
474 src:url("DejaVuSans-Oblique.ttf");
477 font-family: DejaVuSans;
480 src:url("DejaVuSans-BoldOblique.ttf");
482 body { font-family: "DejaVuSans"; }
484`--latex-engine=`*pdflatex|lualatex|xelatex*
485: Use the specified LaTeX engine when producing PDF output.
486 The default is `pdflatex`. If the engine is not in your PATH,
487 the full path of the engine may be specified here.
492`--bibliography=`*FILE*
493: Specify bibliography database to be used in resolving
494 citations. The database type will be determined from the
495 extension of *FILE*, which may be `.mods` (MODS format),
496 `.bib` (BibTeX/BibLaTeX format),
497 `.ris` (RIS format), `.enl` (EndNote format),
498 `.xml` (EndNote XML format), `.wos` (ISI format),
499 `.medline` (MEDLINE format), `.copac` (Copac format),
500 or `.json` (citeproc JSON). If you want to use multiple
501 bibliographies, just use this option repeatedly.
504: Specify [CSL] style to be used in formatting citations and
505 the bibliography. If *FILE* is not found, pandoc will look
512 C:\Documents And Settings\USERNAME\Application Data\csl
514 in Windows. If the `--csl` option is not specified, pandoc
515 will use a default style: either `default.csl` in the
516 user data directory (see `--data-dir`), or, if that is
517 not present, the Chicago author-date style.
519`--citation-abbreviations=`*FILE*
520: Specify a file containing abbreviations for journal titles and
521 other bibliographic fields (indicated by setting `form="short"`
522 in the CSL node for the field). The format is described at
523 <http://citationstylist.org/2011/10/19/abbreviations-for-zotero-test-release/>.
524 Here is a short example:
528 "Lloyd's Law Reports": "Lloyd's Rep",
529 "Estates Gazette": "EG",
530 "Scots Law Times": "SLT"
536: Use natbib for citations in LaTeX output.
539: Use biblatex for citations in LaTeX output.
541Math rendering in HTML
542----------------------
544`-m` [*URL*], `--latexmathml`[=*URL*]
545: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
546 To insert a link to a local copy of the `LaTeXMathML.js` script,
547 provide a *URL*. If no *URL* is provided, the contents of the
548 script will be inserted directly into the HTML header, preserving
549 portability at the price of efficiency. If you plan to use math on
550 several pages, it is much better to link to a copy of the script,
554: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
555 In standalone `html` output, a small javascript (or a link to such a
556 script if a *URL* is supplied) will be inserted that allows the MathML to
557 be viewed on some browsers.
560: Use [jsMath] to display embedded TeX math in HTML output.
561 The *URL* should point to the jsMath load script (e.g.
562 `jsMath/easy/load.js`); if provided, it will be linked to in
563 the header of standalone HTML documents. If a *URL* is not provided,
564 no link to the jsMath load script will be inserted; it is then
565 up to the author to provide such a link in the HTML template.
568: Use [MathJax] to display embedded TeX math in HTML output.
569 The *URL* should point to the `MathJax.js` load script.
570 If a *URL* is not provided, a link to the MathJax CDN will
574: Enclose TeX math in `<eq>` tags in HTML output. These can then
575 be processed by [gladTeX] to produce links to images of the typeset
579: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
580 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
583: Render TeX formulas using an external script that converts TeX
584 formulas to images. The formula will be concatenated with the URL
585 provided. If *URL* is not specified, the Google Chart API will be used.
587Options for wrapper scripts
588---------------------------
591: Print information about command-line arguments to *stdout*, then exit.
592 This option is intended primarily for use in wrapper scripts.
593 The first line of output contains the name of the output file specified
594 with the `-o` option, or `-` (for *stdout*) if no output file was
595 specified. The remaining lines contain the command-line arguments,
596 one per line, in the order they appear. These do not include regular
597 Pandoc options and their arguments, but do include any options appearing
598 after a `--` separator at the end of the line.
601: Ignore command-line arguments (for use in wrapper scripts).
602 Regular Pandoc options are not ignored. Thus, for example,
604 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
608 pandoc -o foo.html -s
610[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
611[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
612[MathJax]: http://www.mathjax.org/
613[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
614[mimeTeX]: http://www.forkosh.com/mimetex.html
615[CSL]: http://CitationStyles.org
620When the `-s/--standalone` option is used, pandoc uses a template to
621add header and footer material that is needed for a self-standing
622document. To see the default template that is used, just type
626where `FORMAT` is the name of the output format. A custom template
627can be specified using the `--template` option. You can also override
628the system default templates for a given output format `FORMAT`
629by putting a file `templates/default.FORMAT` in the user data
630directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
631customize the `default.opendocument` template. For `pdf` output,
632customize the `default.latex` template. For `epub` output, customize
633the `epub-page.html`, `epub-coverimage.html`, and `epub-titlepage.html`
636Templates may contain *variables*. Variable names are sequences of
637alphanumerics, `-`, and `_`, starting with a letter. A variable name
638surrounded by `$` signs will be replaced by its value. For example,
639the string `$title$` in
641 <title>$title$</title>
643will be replaced by the document title.
645To write a literal `$` in a template, use `$$`.
647Some variables are set automatically by pandoc. These vary somewhat
648depending on the output format, but include:
651: contents specified by `-H/--include-in-header` (may have multiple
654: non-null value if `--toc/--table-of-contents` was specified
656: contents specified by `-B/--include-before-body` (may have
659: contents specified by `-A/--include-after-body` (may have
664: title of document, as specified in title block
666: author of document, as specified in title block (may have
669: date of document, as specified in title block
671: language code for HTML or LaTeX documents
673: base URL for Slidy documents (defaults to
674 `http://www.w3.org/Talks/Tools/Slidy2`)
676: base URL for S5 documents (defaults to `ui/default`)
678: font size (10pt, 11pt, 12pt) for LaTeX documents
680: document class for LaTeX documents
682: options for LaTeX `geometry` class, e.g. `margin=1in`;
683 may be repeated for multiple options
684`mainfont`, `sansfont`, `monofont`, `mathfont`
685: fonts for LaTeX documents (works only with xelatex
688: theme for LaTeX beamer documents
690: colortheme for LaTeX beamer documents
692Variables may be set at the command line using the `-V/--variable`
693option. This allows users to include custom variables in their
696Templates may contain conditionals. The syntax is as follows:
704This will include `X` in the template if `variable` has a non-null
705value; otherwise it will include `Y`. `X` and `Y` are placeholders for
706any valid template text, and may include interpolated variables or other
707conditionals. The `$else$` section may be omitted.
709When variables can have multiple values (for example, `author` in
710a multi-author document), you can use the `$for$` keyword:
713 <meta name="author" content="$author$" />
716You can optionally specify a separator to be used between
719 $for(author)$$author$$sep$, $endfor$
721If you use custom templates, you may need to revise them as pandoc
722changes. We recommend tracking the changes in the default templates,
723and modifying your custom templates accordingly. An easy way to do this
724is to fork the pandoc-templates repository
725(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
731Pandoc understands an extended and slightly revised version of
732John Gruber's [markdown] syntax. This document explains the syntax,
733noting differences from standard markdown. Except where noted, these
734differences can be suppressed by specifying the `--strict` command-line
740Markdown is designed to be easy to write, and, even more importantly,
743> A Markdown-formatted document should be publishable as-is, as plain
744> text, without looking like it's been marked up with tags or formatting
746> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
748This principle has guided pandoc's decisions in finding syntax for
749tables, footnotes, and other extensions.
751There is, however, one respect in which pandoc's aims are different
752from the original aims of markdown. Whereas markdown was originally
753designed with HTML generation in mind, pandoc is designed for multiple
754output formats. Thus, while pandoc allows the embedding of raw HTML,
755it discourages it, and provides other, non-HTMLish ways of representing
756important document elements like definition lists, tables, mathematics, and
762A paragraph is one or more lines of text followed by one or more blank line.
763Newlines are treated as spaces, so you can reflow your paragraphs as you like.
764If you need a hard line break, put two or more spaces at the end of a line,
765or type a backslash followed by a newline.
770There are two kinds of headers, Setext and atx.
772### Setext-style headers ###
774A setext-style header is a line of text "underlined" with a row of `=` signs
775(for a level one header) of `-` signs (for a level two header):
783The header text can contain inline formatting, such as emphasis (see
784[Inline formatting](#inline-formatting), below).
787### Atx-style headers ###
789An Atx-style header consists of one to six `#` signs and a line of
790text, optionally followed by any number of `#` signs. The number of
791`#` signs at the beginning of the line is the header level:
793 ## A level-two header
795 ### A level-three header ###
797As with setext-style headers, the header text can contain formatting:
799 # A level-one header with a [link](/url) and *emphasis*
801Standard markdown syntax does not require a blank line before a header.
802Pandoc does require this (except, of course, at the beginning of the
803document). The reason for the requirement is that it is all too easy for a
804`#` to end up at the beginning of a line by accident (perhaps through line
805wrapping). Consider, for example:
807 I like several of their flavors of ice cream:
808 #22, for example, and #5.
811### Header identifiers in HTML, LaTeX, and ConTeXt ###
815Each header element in pandoc's HTML and ConTeXt output is given a
816unique identifier. This identifier is based on the text of the header.
817To derive the identifier from the header text,
819 - Remove all formatting, links, etc.
820 - Remove all punctuation, except underscores, hyphens, and periods.
821 - Replace all spaces and newlines with hyphens.
822 - Convert all alphabetic characters to lowercase.
823 - Remove everything up to the first letter (identifiers may
824 not begin with a number or punctuation mark).
825 - If nothing is left after this, use the identifier `section`.
830 ------------------------------- ----------------------------
831 Header identifiers in HTML `header-identifiers-in-html`
832 *Dogs*?--in *my* house? `dogs--in-my-house`
833 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
834 3. Applications `applications`
837These rules should, in most cases, allow one to determine the identifier
838from the header text. The exception is when several headers have the
839same text; in this case, the first will get an identifier as described
840above; the second will get the same identifier with `-1` appended; the
841third with `-2`; and so on.
843These identifiers are used to provide link targets in the table of
844contents generated by the `--toc|--table-of-contents` option. They
845also make it easy to provide links from one section of a document to
846another. A link to this section, for example, might look like this:
849 [header identifiers](#header-identifiers-in-html).
851Note, however, that this method of providing links to sections works
852only in HTML, LaTeX, and ConTeXt formats.
854If the `--section-divs` option is specified, then each section will
855be wrapped in a `div` (or a `section`, if `--html5` was specified),
856and the identifier will be attached to the enclosing `<div>`
857(or `<section>`) tag rather than the header itself. This allows entire
858sections to be manipulated using javascript or treated differently in
865Markdown uses email conventions for quoting blocks of text.
866A block quotation is one or more paragraphs or other block elements
867(such as lists or headers), with each line preceded by a `>` character
868and a space. (The `>` need not start at the left margin, but it should
869not be indented more than three spaces.)
871 > This is a block quote. This
872 > paragraph has two lines.
874 > 1. This is a list inside a block quote.
877A "lazy" form, which requires the `>` character only on the first
878line of each block, is also allowed:
880 > This is a block quote. This
881 paragraph has two lines.
883 > 1. This is a list inside a block quote.
886Among the block elements that can be contained in a block quote are
887other block quotes. That is, block quotes can be nested:
889 > This is a block quote.
891 > > A block quote within a block quote.
893Standard markdown syntax does not require a blank line before a block
894quote. Pandoc does require this (except, of course, at the beginning of the
895document). The reason for the requirement is that it is all too easy for a
896`>` to end up at the beginning of a line by accident (perhaps through line
897wrapping). So, unless `--strict` is used, the following does not produce
898a nested block quote in pandoc:
900 > This is a block quote.
904Verbatim (code) blocks
905----------------------
907### Indented code blocks ###
909A block of text indented four spaces (or one tab) is treated as verbatim
910text: that is, special characters do not trigger special formatting,
911and all spaces and line breaks are preserved. For example,
914 moveShip(5 * gravity, DOWN);
917The initial (four space or one tab) indentation is not considered part
918of the verbatim text, and is removed in the output.
920Note: blank lines in the verbatim text need not begin with four spaces.
923### Delimited code blocks ###
927In addition to standard indented code blocks, Pandoc supports
928*delimited* code blocks. These begin with a row of three or more
929tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
930backticks that must be at least as long as the starting row. Everything
931between these lines is treated as code. No indentation is necessary:
935 moveShip(5 * gravity, DOWN);
939Like regular code blocks, delimited code blocks must be separated
940from surrounding text by blank lines.
942If the code itself contains a row of tildes or backticks, just use a longer
943row of tildes or backticks at the start and end:
947 code including tildes
951Optionally, you may attach attributes to the code block using
954 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
956 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
957 qsort (filter (>= x) xs)
958 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
960Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
961`startFrom` is an attribute with value `100`. Some output formats can use this
962information to do syntax highlighting. Currently, the only output formats
963that uses this information are HTML and LaTeX. If highlighting is supported
964for your output format and language, then the code block above will appear
965highlighted, with numbered lines. (To see which languages are supported, do
966`pandoc --version`.) Otherwise, the code block above will appear as follows:
968 <pre id="mycode" class="haskell numberLines" startFrom="100">
974A shortcut form can also be used for specifying the language of
981This is equivalent to:
987To prevent all highlighting, use the `--no-highlight` flag.
988To set the highlighting style, use `--highlight-style`.
995A bullet list is a list of bulleted list items. A bulleted list
996item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1003This will produce a "compact" list. If you want a "loose" list, in which
1004each item is formatted as a paragraph, put spaces between the items:
1012The bullets need not be flush with the left margin; they may be
1013indented one, two, or three spaces. The bullet must be followed
1016List items look best if subsequent lines are flush with the first
1017line (after the bullet):
1023But markdown also allows a "lazy" format:
1029### The four-space rule ###
1031A list item may contain multiple paragraphs and other block-level
1032content. However, subsequent paragraphs must be preceded by a blank line
1033and indented four spaces or a tab. The list will look better if the first
1034paragraph is aligned with the rest:
1040 * Second paragraph. With a code block, which must be indented
1045List items may include other lists. In this case the preceding blank
1046line is optional. The nested list must be indented four spaces or
1059As noted above, markdown allows you to write list items "lazily," instead of
1060indenting continuation lines. However, if there are multiple paragraphs or
1061other blocks in a list item, the first line of each must be indented.
1063 + A lazy, lazy, list
1066 + Another one; this looks
1069 Second paragraph of second
1072**Note:** Although the four-space rule for continuation paragraphs
1073comes from the official [markdown syntax guide], the reference implementation,
1074`Markdown.pl`, does not follow it. So pandoc will give different results than
1075`Markdown.pl` when authors have indented continuation paragraphs fewer than
1078The [markdown syntax guide] is not explicit whether the four-space
1079rule applies to *all* block-level content in a list item; it only
1080mentions paragraphs and code blocks. But it implies that the rule
1081applies to all block-level content (including nested lists), and
1082pandoc interprets it that way.
1084 [markdown syntax guide]:
1085 http://daringfireball.net/projects/markdown/syntax#list
1087### Ordered lists ###
1089Ordered lists work just like bulleted lists, except that the items
1090begin with enumerators rather than bullets.
1092In standard markdown, enumerators are decimal numbers followed
1093by a period and a space. The numbers themselves are ignored, so
1094there is no difference between this list:
1108Unlike standard markdown, Pandoc allows ordered list items to be marked
1109with uppercase and lowercase letters and roman numerals, in addition to
1110arabic numerals. List markers may be enclosed in parentheses or followed by a
1111single right-parentheses or period. They must be separated from the
1112text that follows by at least one space, and, if the list marker is a
1113capital letter with a period, by at least two spaces.[^2]
1115[^2]: The point of this rule is to ensure that normal paragraphs
1116 starting with people's initials, like
1118 B. Russell was an English philosopher.
1120 do not get treated as list items.
1122 This rule will not prevent
1126 from being interpreted as a list item. In this case, a backslash
1131Pandoc also pays attention to the type of list marker used, and to the
1132starting number, and both of these are preserved where possible in the
1133output format. Thus, the following yields a list with numbers followed
1134by a single parenthesis, starting with 9, and a sublist with lowercase
1144Note that Pandoc pays attention only to the *starting* marker in a list.
1145So, the following yields a list numbered sequentially starting from 2:
1152If default list markers are desired, use `#.`:
1159### Definition lists ###
1163Pandoc supports definition lists, using a syntax inspired by
1164[PHP Markdown Extra] and [reStructuredText]:[^3]
1170 Term 2 with *inline markup*
1174 { some code, part of Definition 2 }
1176 Third paragraph of definition 2.
1178Each term must fit on one line, which may optionally be followed by
1179a blank line, and must be followed by one or more definitions.
1180A definition begins with a colon or tilde, which may be indented one
1181or two spaces. The body of the definition (including the first line,
1182aside from the colon or tilde) should be indented four spaces. A term may have
1183multiple definitions, and each definition may consist of one or more block
1184elements (paragraph, code block, list, etc.), each indented four spaces or one
1187If you leave space after the definition (as in the example above),
1188the blocks of the definitions will be considered paragraphs. In some
1189output formats, this will mean greater spacing between term/definition
1190pairs. For a compact definition list, do not leave space between the
1191definition and the next term:
1199[^3]: I have also been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1201[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1204### Numbered example lists ###
1208The special list marker `@` can be used for sequentially numbered
1209examples. The first list item with a `@` marker will be numbered '1',
1210the next '2', and so on, throughout the document. The numbered examples
1211need not occur in a single list; each new list using `@` will take up
1212where the last stopped. So, for example:
1214 (@) My first example will be numbered (1).
1215 (@) My second example will be numbered (2).
1217 Explanation of examples.
1219 (@) My third example will be numbered (3).
1221Numbered examples can be labeled and referred to elsewhere in the
1224 (@good) This is a good example.
1226 As (@good) illustrates, ...
1228The label can be any string of alphanumeric characters, underscores,
1232### Compact and loose lists ###
1234Pandoc behaves differently from `Markdown.pl` on some "edge
1235cases" involving lists. Consider this source:
1245Pandoc transforms this into a "compact list" (with no `<p>` tags around
1246"First", "Second", or "Third"), while markdown puts `<p>` tags around
1247"Second" and "Third" (but not "First"), because of the blank space
1248around "Third". Pandoc follows a simple rule: if the text is followed by
1249a blank line, it is treated as a paragraph. Since "Second" is followed
1250by a list, and not a blank line, it isn't treated as a paragraph. The
1251fact that the list is followed by a blank line is irrelevant. (Note:
1252Pandoc works this way even when the `--strict` option is specified. This
1253behavior is consistent with the official markdown syntax description,
1254even though it is different from that of `Markdown.pl`.)
1257### Ending a list ###
1259What if you want to put an indented code block after a list?
1266Trouble! Here pandoc (like other markdown implementations) will treat
1267`{ my code block }` as the second paragraph of item two, and not as
1270To "cut off" the list after item two, you can insert some non-indented
1271content, like an HTML comment, which won't produce visible output in
1277 <!-- end of list -->
1281You can use the same trick if you want two consecutive lists instead
1297A line containing a row of three or more `*`, `-`, or `_` characters
1298(optionally separated by spaces) produces a horizontal rule:
1310Three kinds of tables may be used. All three kinds presuppose the use of
1311a fixed-width font, such as Courier.
1313**Simple tables** look like this:
1315 Right Left Center Default
1316 ------- ------ ---------- -------
1321 Table: Demonstration of simple table syntax.
1323The headers and table rows must each fit on one line. Column
1324alignments are determined by the position of the header text relative
1325to the dashed line below it:[^4]
1327 - If the dashed line is flush with the header text on the right side
1328 but extends beyond it on the left, the column is right-aligned.
1329 - If the dashed line is flush with the header text on the left side
1330 but extends beyond it on the right, the column is left-aligned.
1331 - If the dashed line extends beyond the header text on both sides,
1332 the column is centered.
1333 - If the dashed line is flush with the header text on both sides,
1334 the default alignment is used (in most cases, this will be left).
1336[^4]: This scheme is due to Michel Fortin, who proposed it on the
1337 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1339The table must end with a blank line, or a line of dashes followed by
1340a blank line. A caption may optionally be provided (as illustrated in
1341the example above). A caption is a paragraph beginning with the string
1342`Table:` (or just `:`), which will be stripped off. It may appear either
1343before or after the table.
1345The column headers may be omitted, provided a dashed line is used
1346to end the table. For example:
1348 ------- ------ ---------- -------
1352 ------- ------ ---------- -------
1354When headers are omitted, column alignments are determined on the basis
1355of the first line of the table body. So, in the tables above, the columns
1356would be right, left, center, and right aligned, respectively.
1358**Multiline tables** allow headers and table rows to span multiple lines
1359of text (but cells that span multiple columns or rows of the table are
1360not supported). Here is an example:
1362 -------------------------------------------------------------
1363 Centered Default Right Left
1364 Header Aligned Aligned Aligned
1365 ----------- ------- --------------- -------------------------
1366 First row 12.0 Example of a row that
1367 spans multiple lines.
1369 Second row 5.0 Here's another one. Note
1370 the blank line between
1372 -------------------------------------------------------------
1374 Table: Here's the caption. It, too, may span
1377These work like simple tables, but with the following differences:
1379 - They must begin with a row of dashes, before the header text
1380 (unless the headers are omitted).
1381 - They must end with a row of dashes, then a blank line.
1382 - The rows must be separated by blank lines.
1384In multiline tables, the table parser pays attention to the widths of
1385the columns, and the writers try to reproduce these relative widths in
1386the output. So, if you find that one of the columns is too narrow in the
1387output, try widening it in the markdown source.
1389Headers may be omitted in multiline tables as well as simple tables:
1391 ----------- ------- --------------- -------------------------
1392 First row 12.0 Example of a row that
1393 spans multiple lines.
1395 Second row 5.0 Here's another one. Note
1396 the blank line between
1398 -------------------------------------------------------------
1400 : Here's a multiline table without headers.
1402It is possible for a multiline table to have just one row, but the row
1403should be followed by a blank line (and then the row of dashes that ends
1404the table), or the table may be interpreted as a simple table.
1406**Grid tables** look like this:
1408 : Sample grid table.
1410 +---------------+---------------+--------------------+
1411 | Fruit | Price | Advantages |
1412 +===============+===============+====================+
1413 | Bananas | $1.34 | - built-in wrapper |
1414 | | | - bright color |
1415 +---------------+---------------+--------------------+
1416 | Oranges | $2.10 | - cures scurvy |
1418 +---------------+---------------+--------------------+
1420The row of `=`s separates the header from the table body, and can be
1421omitted for a headerless table. The cells of grid tables may contain
1422arbitrary block elements (multiple paragraphs, code blocks, lists,
1423etc.). Alignments are not supported, nor are cells that span multiple
1424columns or rows. Grid tables can be created easily using [Emacs table mode].
1426 [Emacs table mode]: http://table.sourceforge.net/
1434If the file begins with a title block
1437 % author(s) (separated by semicolons)
1440it will be parsed as bibliographic information, not regular text. (It
1441will be used, for example, in the title of standalone LaTeX or HTML
1442output.) The block may contain just a title, a title and an author,
1443or all three elements. If you want to include an author but no
1444title, or a title and a date but no author, you need a blank line:
1453The title may occupy multiple lines, but continuation lines must
1454begin with leading space, thus:
1459If a document has multiple authors, the authors may be put on
1460separate lines with leading space, or separated by semicolons, or
1461both. So, all of the following are equivalent:
1466 % Author One; Author Two
1471The date must fit on one line.
1473All three metadata fields may contain standard inline formatting
1474(italics, links, footnotes, etc.).
1476Title blocks will always be parsed, but they will affect the output only
1477when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1478will appear twice: once in the document head -- this is the title that
1479will appear at the top of the window in a browser -- and once at the
1480beginning of the document body. The title in the document head can have
1481an optional prefix attached (`--title-prefix` or `-T` option). The title
1482in the body appears as an H1 element with class "title", so it can be
1483suppressed or reformatted with CSS. If a title prefix is specified with
1484`-T` and no title block appears in the document, the title prefix will
1485be used by itself as the HTML title.
1487The man page writer extracts a title, man page section number, and
1488other header and footer information from the title line. The title
1489is assumed to be the first word on the title line, which may optionally
1490end with a (single-digit) section number in parentheses. (There should
1491be no space between the title and the parentheses.) Anything after
1492this is assumed to be additional footer and header text. A single pipe
1493character (`|`) should be used to separate the footer text from the header
1498will yield a man page with the title `PANDOC` and section 1.
1500 % PANDOC(1) Pandoc User Manuals
1502will also have "Pandoc User Manuals" in the footer.
1504 % PANDOC(1) Pandoc User Manuals | Version 4.0
1506will also have "Version 4.0" in the header.
1512Except inside a code block or inline code, any punctuation or space
1513character preceded by a backslash will be treated literally, even if it
1514would normally indicate formatting. Thus, for example, if one writes
1524 <strong>hello</strong>
1526This rule is easier to remember than standard markdown's rule,
1527which allows only the following characters to be backslash-escaped:
1531(However, if the `--strict` option is supplied, the standard
1532markdown rule will be used.)
1534A backslash-escaped space is parsed as a nonbreaking space. It will
1535appear in TeX output as `~` and in HTML and XML as `\ ` or
1538A backslash-escaped newline (i.e. a backslash occurring at the end of
1539a line) is parsed as a hard line break. It will appear in TeX output as
1540`\\` and in HTML as `<br />`. This is a nice alternative to
1541markdown's "invisible" way of indicating hard line breaks using
1542two trailing spaces on a line.
1544Backslash escapes do not work in verbatim contexts.
1551If the `--smart` option is specified, pandoc will produce typographically
1552correct output, converting straight quotes to curly quotes, `---` to
1553em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
1554are inserted after certain abbreviations, such as "Mr."
1556Note: if your LaTeX template uses the `csquotes` package, pandoc will
1557detect automatically this and use `\enquote{...}` for quoted text.
1564To *emphasize* some text, surround it with `*`s or `_`, like this:
1566 This text is _emphasized with underscores_, and this
1567 is *emphasized with asterisks*.
1569Double `*` or `_` produces **strong emphasis**:
1571 This is **strong emphasis** and __with underscores__.
1573A `*` or `_` character surrounded by spaces, or backslash-escaped,
1574will not trigger emphasis:
1576 This is * not emphasized *, and \*neither is this\*.
1578Because `_` is sometimes used inside words and identifiers,
1579pandoc does not interpret a `_` surrounded by alphanumeric
1580characters as an emphasis marker. If you want to emphasize
1581just part of a word, use `*`:
1583 feas*ible*, not feas*able*.
1590To strikeout a section of text with a horizontal line, begin and end it
1591with `~~`. Thus, for example,
1593 This ~~is deleted text.~~
1596### Superscripts and subscripts ###
1600Superscripts may be written by surrounding the superscripted text by `^`
1601characters; subscripts may be written by surrounding the subscripted
1602text by `~` characters. Thus, for example,
1604 H~2~O is a liquid. 2^10^ is 1024.
1606If the superscripted or subscripted text contains spaces, these spaces
1607must be escaped with backslashes. (This is to prevent accidental
1608superscripting and subscripting through the ordinary use of `~` and `^`.)
1609Thus, if you want the letter P with 'a cat' in subscripts, use
1610`P~a\ cat~`, not `P~a cat~`.
1615To make a short span of text verbatim, put it inside backticks:
1617 What is the difference between `>>=` and `>>`?
1619If the verbatim text includes a backtick, use double backticks:
1621 Here is a literal backtick `` ` ``.
1623(The spaces after the opening backticks and before the closing
1624backticks will be ignored.)
1626The general rule is that a verbatim span starts with a string
1627of consecutive backticks (optionally followed by a space)
1628and ends with a string of the same number of backticks (optionally
1629preceded by a space).
1631Note that backslash-escapes (and other markdown constructs) do not
1632work in verbatim contexts:
1634 This is a backslash followed by an asterisk: `\*`.
1642Anything between two `$` characters will be treated as TeX math. The
1643opening `$` must have a character immediately to its right, while the
1644closing `$` must have a character immediately to its left. Thus,
1645`$20,000 and $30,000` won't parse as math. If for some reason
1646you need to enclose text in literal `$` characters, backslash-escape
1647them and they won't be treated as math delimiters.
1649TeX math will be printed in all output formats. How it is rendered
1650depends on the output format:
1652Markdown, LaTeX, Org-Mode, ConTeXt
1653 ~ It will appear verbatim between `$` characters.
1656 ~ It will be rendered using an interpreted text role `:math:`, as described
1657 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
1660 ~ It will be rendered as `latexmath:[...]`.
1663 ~ It will be rendered inside a `@math` command.
1666 ~ It will be rendered verbatim without `$`'s.
1669 ~ It will be rendered inside `<math>` tags.
1672 ~ It will be rendered inside `<span class="math">` tags.
1674RTF, OpenDocument, ODT
1675 ~ It will be rendered, if possible, using unicode characters,
1676 and will otherwise appear verbatim.
1679 ~ If the `--mathml` flag is used, it will be rendered using mathml
1680 in an `inlineequation` or `informalequation` tag. Otherwise it
1681 will be rendered, if possible, using unicode characters.
1684 ~ It will be rendered using OMML math markup.
1686HTML, Slidy, DZSlides, S5, EPUB
1687 ~ The way math is rendered in HTML will depend on the
1688 command-line options selected:
1690 1. The default is to render TeX math as far as possible using unicode
1691 characters, as with RTF, DocBook, and OpenDocument output. Formulas
1692 are put inside a `span` with `class="math"`, so that they may be
1693 styled differently from the surrounding text if needed.
1695 2. If the `--latexmathml` option is used, TeX math will be displayed
1696 between $ or $$ characters and put in `<span>` tags with class `LaTeX`.
1697 The [LaTeXMathML] script will be used to render it as formulas.
1698 (This trick does not work in all browsers, but it works in Firefox.
1699 In browsers that do not support LaTeXMathML, TeX math will appear
1700 verbatim between $ characters.)
1702 3. If the `--jsmath` option is used, TeX math will be put inside
1703 `<span>` tags (for inline math) or `<div>` tags (for display math)
1704 with class `math`. The [jsMath] script will be used to render
1707 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
1708 be called to generate images for each TeX formula. This should
1709 work in all browsers. The `--mimetex` option takes an optional URL
1710 as argument. If no URL is specified, it will be assumed that the
1711 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
1713 5. If the `--gladtex` option is used, TeX formulas will be enclosed
1714 in `<eq>` tags in the HTML output. The resulting `htex` file may then
1715 be processed by [gladTeX], which will produce image files for each
1716 formula and an `html` file with links to these images. So, the
1719 pandoc -s --gladtex myfile.txt -o myfile.htex
1720 gladtex -d myfile-images myfile.htex
1721 # produces myfile.html and images in myfile-images
1723 6. If the `--webtex` option is used, TeX formulas will be converted
1724 to `<img>` tags that link to an external script that converts
1725 formulas to images. The formula will be URL-encoded and concatenated
1726 with the URL provided. If no URL is specified, the Google Chart
1727 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
1733Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
1734(except verbatim contexts, where `<`, `>`, and `&` are interpreted
1737The raw HTML is passed through unchanged in HTML, S5, Slidy, DZSlides, EPUB,
1738Markdown, and Textile output, and suppressed in other formats.
1742Standard markdown allows you to include HTML "blocks": blocks
1743of HTML between balanced tags that are separated from the surrounding text
1744with blank lines, and start and end at the left margin. Within
1745these blocks, everything is interpreted as HTML, not markdown;
1746so (for example), `*` does not signify emphasis.
1748Pandoc behaves this way when `--strict` is specified; but by default,
1749pandoc interprets material between HTML block tags as markdown.
1750Thus, for example, Pandoc will turn
1755 <td>[a link](http://google.com)</td>
1763 <td><em>one</em></td>
1764 <td><a href="http://google.com">a link</a></td>
1768whereas `Markdown.pl` will preserve it as is.
1770There is one exception to this rule: text between `<script>` and
1771`<style>` tags is not interpreted as markdown.
1773This departure from standard markdown should make it easier to mix
1774markdown with HTML block elements. For example, one can surround
1775a block of markdown text with `<div>` tags without preventing it
1776from being interpreted as markdown.
1783In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
1784included in a document. Inline TeX commands will be preserved and passed
1785unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
1786LaTeX to include BibTeX citations:
1788 This result was proved in \cite{jones.1967}.
1790Note that in LaTeX environments, like
1792 \begin{tabular}{|l|l|}\hline
1793 Age & Frequency \\ \hline
1796 36--45 & 22 \\ \hline
1799the material between the begin and end tags will be interpreted as raw
1800LaTeX, not as markdown.
1802Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
1807For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
1808`\renewcommand` definitions and apply the resulting macros to all LaTeX
1809math. So, for example, the following will work in all output formats,
1812 \newcommand{\tuple}[1]{\langle #1 \rangle}
1816In LaTeX output, the `\newcommand` definition will simply be passed
1817unchanged to the output.
1823Markdown allows links to be specified in several ways.
1825### Automatic links ###
1827If you enclose a URL or email address in pointy brackets, it
1831 <sam@green.eggs.ham>
1836An inline link consists of the link text in square brackets,
1837followed by the URL in parentheses. (Optionally, the URL can
1838be followed by a link title, in quotes.)
1840 This is an [inline link](/url), and here's [one with
1841 a title](http://fsf.org "click here for a good time!").
1843There can be no space between the bracketed part and the parenthesized part.
1844The link text can contain formatting (such as emphasis), but the title cannot.
1847### Reference links ###
1849An *explicit* reference link has two parts, the link itself and the link
1850definition, which may occur elsewhere in the document (either
1851before or after the link).
1853The link consists of link text in square brackets, followed by a label in
1854square brackets. (There can be space between the two.) The link definition
1855must begin at the left margin or indented no more than three spaces. It
1856consists of the bracketed label, followed by a colon and a space, followed by
1857the URL, and optionally (after a space) a link title either in quotes or in
1860Here are some examples:
1862 [my label 1]: /foo/bar.html "My title, optional"
1864 [my label 3]: http://fsf.org (The free software foundation)
1865 [my label 4]: /bar#special 'A title in single quotes'
1867The URL may optionally be surrounded by angle brackets:
1869 [my label 5]: <http://foo.bar.baz>
1871The title may go on the next line:
1873 [my label 3]: http://fsf.org
1874 "The free software foundation"
1876Note that link labels are not case sensitive. So, this will work:
1878 Here is [my link][FOO]
1882In an *implicit* reference link, the second pair of brackets is
1883empty, or omitted entirely:
1885 See [my website][], or [my website].
1887 [my website]: http://foo.bar.baz
1891To link to another section of the same document, use the automatically
1892generated identifier (see [Header identifiers in HTML, LaTeX, and
1893ConTeXt](#header-identifiers-in-html-latex-and-context), below).
1896 See the [Introduction](#introduction).
1900 See the [Introduction].
1902 [Introduction]: #introduction
1904Internal links are currently supported for HTML formats (including
1905HTML slide shows and EPUB), LaTeX, and ConTeXt.
1910A link immediately preceded by a `!` will be treated as an image.
1911The link text will be used as the image's alt text:
1913 
1917 [movie reel]: movie.gif
1919### Pictures with captions ###
1923An image occurring by itself in a paragraph will be rendered as
1924a figure with a caption.[^5] (In LaTeX, a figure environment will be
1925used; in HTML, the image will be placed in a `div` with class
1926`figure`, together with a caption in a `p` with class `caption`.)
1927The image's alt text will be used as the caption.
1929 
1931[^5]: This feature is not yet implemented for RTF, OpenDocument, or
1932 ODT. In those formats, you'll just get an image in a paragraph by
1933 itself, with no caption.
1935If you just want a regular inline image, just make sure it is not
1936the only thing in the paragraph. One way to do this is to insert a
1937nonbreaking space after the image:
1939 \
1947Pandoc's markdown allows footnotes, using the following syntax:
1949 Here is a footnote reference,[^1] and another.[^longnote]
1951 [^1]: Here is the footnote.
1953 [^longnote]: Here's one with multiple blocks.
1955 Subsequent paragraphs are indented to show that they
1956 belong to the previous footnote.
1960 The whole paragraph can be indented, or just the first
1961 line. In this way, multi-paragraph footnotes work like
1962 multi-paragraph list items.
1964 This paragraph won't be part of the note, because it
1967The identifiers in footnote references may not contain spaces, tabs,
1968or newlines. These identifiers are used only to correlate the
1969footnote reference with the note itself; in the output, footnotes
1970will be numbered sequentially.
1972The footnotes themselves need not be placed at the end of the
1973document. They may appear anywhere except inside other block elements
1974(lists, block quotes, tables, etc.).
1976Inline footnotes are also allowed (though, unlike regular notes,
1977they cannot contain multiple paragraphs). The syntax is as follows:
1979 Here is an inline note.^[Inlines notes are easier to write, since
1980 you don't have to pick an identifier and move down to type the
1983Inline and regular footnotes may be mixed freely.
1991Pandoc can automatically generate citations and a bibliography in a number of
1992styles (using Andrea Rossato's `hs-citeproc`). In order to use this feature,
1993you will need a bibliographic database in one of the following formats:
1995 Format File extension
1996 ------------ --------------
1998 BibTeX/BibLaTeX .bib
2007You will need to specify the bibliography file using the `--bibliography`
2008command-line option (which may be repeated if you have several
2011By default, pandoc will use a Chicago author-date format for citations
2012and references. To use another style, you will need to use the
2013`--csl` option to specify a [CSL] 1.0 style file. A primer on
2014creating and modifying CSL styles can be found at
2015<http://citationstyles.org/downloads/primer.html>.
2016A repository of CSL styles can be found at
2017<https://github.com/citation-style-language/styles>.
2018See also <http://zotero.org/styles> for easy browsing.
2020Citations go inside square brackets and are separated by semicolons.
2021Each citation must have a key, composed of '@' + the citation
2022identifier from the database, and may optionally have a prefix,
2023a locator, and a suffix. Here are some examples:
2025 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
2027 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2029 Blah blah [@smith04; @doe99].
2031A minus sign (`-`) before the `@` will suppress mention of
2032the author in the citation. This can be useful when the
2033author is already mentioned in the text:
2035 Smith says blah [-@smith04].
2037You can also write an in-text citation, as follows:
2041 @smith04 [p. 33] says blah.
2043If the style calls for a list of works cited, it will be placed
2044at the end of the document. Normally, you will want to end your
2045document with an appropriate header:
2051The bibliography will be inserted after this header.
2054Producing slide shows with Pandoc
2055=================================
2057You can use Pandoc to produce an HTML + javascript slide presentation
2058that can be viewed via a web browser. There are three ways to do this,
2059using [S5], [DZSlides], or [Slidy]. You can also produce a PDF slide
2060show using LaTeX [beamer].
2062Here's the markdown source for a simple slide show, `habits.txt`:
2089 
2096To produce the slide show, simply type
2098 pandoc -t s5 -s habits.txt -o habits.html
2102 pandoc -t slidy -s habits.txt -o habits.html
2106 pandoc -t dzslides -s habits.txt -o habits.html
2110 pandoc -t beamer habits.txt -o habits.pdf
2114With all HTML slide formats, the `--self-contained` option can be used to
2115produce a single file that contains all of the data necessary to display the
2116slide show, including linked scripts, stylesheets, images, and videos.
2118Structuring the slide show
2119--------------------------
2121By default, the *slide level* is the highest header level in
2122the hierarchy that is followed immediately by content, and not another
2123header, somewhere in the document. In the example above, level 1 headers
2124are always followed by level 2 headers, which are followed by content,
2125so 2 is the slide level. This default can be overridden using
2126the `--slide-level` option.
2128The document is carved up into slides according to the following
2131 * A horizontal rule always starts a new slide.
2133 * A header at the slide level always starts a new slide.
2135 * Headers *below* the slide level in the hierarchy create
2136 headers *within* a slide.
2138 * Headers *above* the slide level in the hierarchy create
2139 "title slides," which just contain the section title
2140 and help to break the slide show into sections.
2142 * A title page is constructed automatically from the document's title
2143 block, if present. (In the case of beamer, this can be disabled
2144 by commenting out some lines in the default template.)
2146These rules are designed to support many different styles of slide show. If
2147you don't care about structuring your slides into sections and subsections,
2148you can just use level 1 headers for all each slide. (In that case, level 1
2149will be the slide level.) But you can also structure the slide show into
2150sections, as in the example above.
2152For Slidy and S5, the file produced by pandoc with the `-s/--standalone`
2153option embeds a link to javascripts and CSS files, which are assumed to
2154be available at the relative path `s5/default` (for S5) or at the Slidy
2155website at `w3.org` (for Slidy). (These paths can be changed by setting
2156the `slidy-url` or `s5-url` variables; see `--variable`, above.) For DZSlides,
2157the (relatively short) javascript and css are included in the file by default.
2162By default, these writers produces lists that display "all at once."
2163If you want your lists to display incrementally (one item at a time),
2164use the `-i` option. If you want a particular list to depart from the
2165default (that is, to display incrementally without the `-i` option and
2166all at once with the `-i` option), put it in a block quote:
2171In this way incremental and nonincremental lists can be mixed in
2177You can change the style of HTML slides by putting customized CSS files
2178in `$DATADIR/s5/default` (for S5) or `$DATADIR/slidy` (for Slidy),
2179where `$DATADIR` is the user data directory (see `--data-dir`, above).
2180The originals may be found in pandoc's system data directory (generally
2181`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2182files it does not find in the user data directory.
2184For dzslides, the CSS is included in the HTML file itself, and may
2187To style beamer slides, you can specify a beamer "theme" or "colortheme"
2188using the `-V` option:
2190 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2192Literate Haskell support
2193========================
2195If you append `+lhs` to an appropriate input or output format (`markdown`,
2196`rst`, or `latex` for input or output; `beamer`, `html` or `html5` for
2197output only), pandoc will treat the document as literate Haskell source.
2200 - In markdown input, "bird track" sections will be parsed as Haskell
2201 code rather than block quotations. Text between `\begin{code}`
2202 and `\end{code}` will also be treated as Haskell code.
2204 - In markdown output, code blocks with classes `haskell` and `literate`
2205 will be rendered using bird tracks, and block quotations will be
2206 indented one space, so they will not be treated as Haskell code.
2207 In addition, headers will be rendered setext-style (with underlines)
2208 rather than atx-style (with '#' characters). (This is because ghc
2209 treats '#' characters in column 1 as introducing line numbers.)
2211 - In restructured text input, "bird track" sections will be parsed
2214 - In restructured text output, code blocks with class `haskell` will
2215 be rendered using bird tracks.
2217 - In LaTeX input, text in `code` environments will be parsed as
2220 - In LaTeX output, code blocks with class `haskell` will be rendered
2221 inside `code` environments.
2223 - In HTML output, code blocks with class `haskell` will be rendered
2224 with class `literatehaskell` and bird tracks.
2228 pandoc -f markdown+lhs -t html
2230reads literate Haskell source formatted with markdown conventions and writes
2231ordinary HTML (without bird tracks).
2233 pandoc -f markdown+lhs -t html+lhs
2235writes HTML with the Haskell code in bird tracks, so it can be copied
2236and pasted as literate Haskell source.
2241© 2006-2011 John MacFarlane (jgm at berkeley dot edu). Released under the
2242[GPL], version 2 or greater. This software carries no warranty of
2243any kind. (See COPYRIGHT for full copyright and warranty notices.)
2244Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
2245Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
2246Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
2247Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
2248Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
2249Latter, Ralf Stephan, Eric Seidel, B. Scott Michel.
2251[markdown]: http://daringfireball.net/projects/markdown/
2252[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
2253[S5]: http://meyerweb.com/eric/tools/s5/
2254[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
2255[HTML]: http://www.w3.org/TR/html40/
2256[HTML 5]: http://www.w3.org/TR/html5/
2257[XHTML]: http://www.w3.org/TR/xhtml1/
2258[LaTeX]: http://www.latex-project.org/
2259[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
2260[ConTeXt]: http://www.pragma-ade.nl/
2261[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
2262[DocBook XML]: http://www.docbook.org/
2263[OpenDocument XML]: http://opendocument.xml.org/
2264[ODT]: http://en.wikipedia.org/wiki/OpenDocument
2265[Textile]: http://redcloth.org/textile
2266[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
2267[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
2268[Haskell]: http://www.haskell.org/
2269[GNU Texinfo]: http://www.gnu.org/software/texinfo/
2270[Emacs Org-Mode]: http://orgmode.org
2271[AsciiDoc]: http://www.methods.co.nz/asciidoc/
2272[EPUB]: http://www.idpf.org/
2273[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
2274[DZSlides]: http://paulrouget.com/dzslides/
2275[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
2276[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
2277[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