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[HTML], [LaTeX], [ConTeXt], [RTF], [DocBook XML], [OpenDocument XML], [ODT],
18[GNU Texinfo], [MediaWiki markup], [EPUB], [Textile], [groff man] pages,
19[Emacs Org-Mode], and [Slidy] or [S5] HTML slide shows.
21Pandoc's enhanced version of markdown includes syntax for footnotes,
22tables, flexible ordered lists, definition lists, delimited code blocks,
23superscript, subscript, strikeout, title blocks, automatic tables of
24contents, embedded LaTeX math, citations, and markdown inside HTML block
25elements. (These enhancements, described below under
26[Pandoc's markdown](#pandocs-markdown), can be disabled using the `--strict`
29In contrast to most existing tools for converting markdown to HTML, which
30use regex substitutions, Pandoc has a modular design: it consists of a
31set of readers, which parse text in a given format and produce a native
32representation of the document, and a set of writers, which convert
33this native representation into a target format. Thus, adding an input
34or output format requires only adding a reader or writer.
39If no *input-file* is specified, input is read from *stdin*.
40Otherwise, the *input-files* are concatenated (with a blank
41line between each) and used as input. Output goes to *stdout* by
42default (though output to *stdout* is disabled for the `odt` and
43`epub` output formats). For output to a file, use the `-o` option:
45 pandoc -o output.html input.txt
47Instead of a file, an absolute URI may be given. In this case
48pandoc will fetch the content using HTTP:
50 pandoc -f html -t markdown http://www.fsf.org
52If multiple input files are given, `pandoc` will concatenate them all (with
53blank lines between them) before parsing.
55The format of the input and output can be specified explicitly using
56command-line options. The input format can be specified using the
57`-r/--read` or `-f/--from` options, the output format using the
58`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
59markdown to LaTeX, you could type:
61 pandoc -f markdown -t latex hello.txt
63To convert `hello.html` from html to markdown:
65 pandoc -f html -t markdown hello.html
67Supported output formats are listed below under the `-t/--to` option.
68Supported input formats are listed below under the `-f/--from` option. Note
69that the `rst`, `textile`, `latex`, and `html` readers are not complete;
70there are some constructs that they do not parse.
72If the input or output format is not specified explicitly, `pandoc`
73will attempt to guess it from the extensions of
74the input and output filenames. Thus, for example,
76 pandoc -o hello.tex hello.txt
78will convert `hello.txt` from markdown to LaTeX. If no output file
79is specified (so that output goes to *stdout*), or if the output file's
80extension is unknown, the output format will default to HTML.
81If no input file is specified (so that input comes from *stdin*), or
82if the input files' extensions are unknown, the input format will
83be assumed to be markdown unless explicitly specified.
85Pandoc uses the UTF-8 character encoding for both input and output.
86If your local character encoding is not UTF-8, you
87should pipe input and output through `iconv`:
89 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
97The standard Pandoc installation includes `markdown2pdf`, a wrapper
98around `pandoc` and `pdflatex` that produces PDFs directly from markdown
99sources. The default behavior of `markdown2pdf` is to create a file with
100the same base name as the first argument and the extension `pdf`; thus,
103 markdown2pdf sample.txt endnotes.txt
105will produce `sample.pdf`. (If `sample.pdf` exists already,
106it will be backed up before being overwritten.) An output file
107name can be specified explicitly using the `-o` option:
109 markdown2pdf -o book.pdf chap1 chap2
111If no input file is specified, input will be taken from *stdin*.
112All of `pandoc`'s options will work with `markdown2pdf` as well.
114`markdown2pdf` assumes that `pdflatex` is in the path. It also
115assumes that the following LaTeX packages are available:
116`unicode`, `fancyhdr` (if you have verbatim text in footnotes),
117`graphicx` (if you use images), `array` (if you use tables),
118and `ulem` (if you use strikeout text). If they are not already
119included in your LaTeX distribution, you can get them from
120[CTAN]. A full [TeX Live] or [MacTeX] distribution will have all of
126A user who wants a drop-in replacement for `Markdown.pl` may create
127a symbolic link to the `pandoc` executable called `hsmarkdown`. When
128invoked under the name `hsmarkdown`, `pandoc` will behave as if the
129`--strict` flag had been selected, and no command-line options will be
130recognized. However, this approach does not work under Cygwin, due to
131problems with its simulation of symbolic links.
133[Cygwin]: http://www.cygwin.com/
134[`iconv`]: http://www.gnu.org/software/libiconv/
135[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
136[TeX Live]: http://www.tug.org/texlive/
137[MacTeX]: http://www.tug.org/mactex/
142`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
143: Specify input format. *FORMAT* can be `native` (native Haskell),
144 `json` (JSON version of native AST), `markdown` (markdown),
145 `textile` (Textile), `rst` (reStructuredText), `html` (HTML),
146 or `latex` (LaTeX). If `+lhs` is appended to `markdown`, `rst`,
147 or `latex`, the input will be treated as literate Haskell source:
148 see [Literate Haskell support](#literate-haskell-support),
151`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
152: Specify output format. *FORMAT* can be `native` (native Haskell),
153 `json` (JSON version of native AST), `plain` (plain text),
154 `markdown` (markdown), `rst` (reStructuredText),
155 `html` (HTML), `latex` (LaTeX), `context` (ConTeXt), `man` (groff man),
156 `mediawiki` (MediaWiki markup), `textile` (Textile), `org` (Emacs
157 Org-Mode), `texinfo` (GNU Texinfo), `docbook` (DocBook XML),
158 `opendocument` (OpenDocument XML), `odt` (OpenOffice text document),
159 `epub` (EPUB book), `slidy` (Slidy HTML and javascript slide show),
160 `s5` (S5 HTML and javascript slide show), or `rtf` (rich text
161 format). Note that `odt` and `epub` output will not be directed to
162 *stdout*; an output filename must be specified using the `-o/--output`
163 option. If `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`,
164 the output will be rendered as literate Haskell source:
165 see [Literate Haskell support](#literate-haskell-support),
169: Produce output with an appropriate header and footer (e.g. a
170 standalone HTML, LaTeX, or RTF file, not a fragment).
172`-o` *FILE*, `--output=`*FILE*
173: Write output to *FILE* instead of *stdout*. If *FILE* is
174 `-`, output will go to *stdout*. (Exception: if the output
175 format is `odt` or `epub`, output to stdout is disabled.)
177`-p`, `--preserve-tabs`
178: Preserve tabs instead of converting them to spaces (the default).
181: Specify the number of spaces per tab (default is 4).
184: Use strict markdown syntax, with no pandoc extensions or variants.
185 When the input format is HTML, this means that constructs that have no
186 equivalents in standard markdown (e.g. definition lists or strikeout
187 text) will be parsed as raw HTML.
190: Normalize the document after reading: merge adjacent
191 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
194: Use reference-style links, rather than inline links, in writing markdown
195 or reStructuredText. By default inline links are used.
198: Parse untranslatable HTML codes and LaTeX environments as raw HTML
199 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
200 input. Raw HTML can be printed in markdown, reStructuredText, HTML, Slidy,
201 and S5 output; raw LaTeX can be printed in markdown, reStructuredText,
202 LaTeX, and ConTeXt output. The default is for the readers to omit
203 untranslatable HTML codes and LaTeX environments. (The LaTeX reader
204 does pass through untranslatable LaTeX *commands*, even if `-R` is not
208: Produce typographically correct output, converting straight quotes
209 to curly quotes, `---` and `--` to dashes, ande `...` to ellipses.
210 Nonbreaking spaces are inserted after certain abbreviations, such
211 as "Mr." (Note: This option is significant only when the input format is
212 `markdown` or `textile`. It is selected automatically when the input
213 format is `textile` or the output format is `latex` or `context`.)
216: Produce HTML5 instead of HTML4. This option has no effect for writers
219`-m` [*URL*], `--latexmathml`[=*URL*]
220: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
221 To insert a link to a local copy of the `LaTeXMathML.js` script,
222 provide a *URL*. If no *URL* is provided, the contents of the
223 script will be inserted directly into the HTML header, preserving
224 portability at the price of efficiency. If you plan to use math on
225 several pages, it is much better to link to a copy of the script,
229: Convert TeX math to MathML. In standalone mode, a small javascript
230 (or a link to such a script if a *URL* is supplied) will be inserted that
231 allows the MathML to be viewed on some browsers.
234: Use [jsMath] to display embedded TeX math in HTML output.
235 The *URL* should point to the jsMath load script (e.g.
236 `jsMath/easy/load.js`); if provided, it will be linked to in
237 the header of standalone HTML documents. If a *URL* is not provided,
238 no link to the jsMath load script will be inserted; it is then
239 up to the author to provide such a link in the HTML template.
242: Use [MathJax] to display embedded TeX math in HTML output.
243 The *URL* should point to the `MathJax.js` load script.
246: Enclose TeX math in `<eq>` tags in HTML output. These can then
247 be processed by [gladTeX] to produce links to images of the typeset
251: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
252 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
255: Render TeX formulas using an external script that converts TeX
256 formulas to images. The formula will be concatenated with the URL
257 provided. If *URL* is not specified, the Google Chart API will be used.
260: Make list items in Slidy or S5 display incrementally (one by one).
261 The default is for lists to be displayed all at once.
264: Include all the CSS and javascript needed for a Slidy or S5 slide
265 show in the output, so that the slide show will work even when no
266 internet connection is available.
269: Create LaTeX outut suitable for processing by XeTeX.
272: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
275`-N`, `--number-sections`
276: Number section headings in LaTeX, ConTeXt, or HTML output.
277 By default, sections are not numbered.
280: Use listings package for LaTeX code blocks
283: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
284 and attach identifiers to the enclosing `<div>` (or `<section>`)
285 rather than the header itself.
286 See [Section identifiers](#header-identifiers-in-html), below.
289: Disable text wrapping in output. By default, text is wrapped
290 appropriately for the output format.
293: Specify length of lines in characters (for text wrapping).
296: Use only ascii characters in output. Currently supported only
297 for HTML output (which uses numerical entities instead of
298 UTF-8 when this option is selected).
300`--email-obfuscation=`*none|javascript|references*
301: Specify a method for obfuscating `mailto:` links in HTML documents.
302 *none* leaves `mailto:` links as they are. *javascript* obfuscates
303 them using javascript. *references* obfuscates them by printing their
304 letters as decimal or hexadecimal character references.
305 If `--strict` is specified, *references* is used regardless of the
306 presence of this option.
308`--id-prefix`=*STRING*
309: Specify a prefix to be added to all automatically generated identifiers
310 in HTML output. This is useful for preventing duplicate identifiers
311 when generating fragments to be included in other pages.
313`--indented-code-classes=`*CLASSES*
314: Specify classes to use for indented code blocks--for example,
315 `perl,numberLines` or `haskell`. Multiple classes may be separated
318`--toc`, `--table-of-contents`
319: Include an automatically generated table of contents (or, in
320 the case of `latex`, `context`, and `rst`, an instruction to create
321 one) in the output document. This option has no effect on `man`,
322 `docbook`, `slidy`, or `s5` output.
324`--base-header-level=`*NUMBER*
325: Specify the base level for headers (defaults to 1).
328: Use *FILE* as a custom template for the generated document. Implies
329 `--standalone`. See [Templates](#templates) below for a description
330 of template syntax. If this option is not used, a default
331 template appropriate for the output format will be used. See also
332 `-D/--print-default-template`.
334`-V` *KEY=VAL*, `--variable=`*KEY:VAL*
335: Set the template variable *KEY* to the value *VAL* when rendering the
336 document in standalone mode. This is only useful when the
337 `--template` option is used to specify a custom template, since
338 pandoc automatically sets the variables used in the default
341`-c` *URL*, `--css=`*URL*
342: Link to a CSS style sheet.
344`-H` *FILE*, `--include-in-header=`*FILE*
345: Include contents of *FILE*, verbatim, at the end of the header.
346 This can be used, for example, to include special
347 CSS or javascript in HTML documents. This option can be used
348 repeatedly to include multiple files in the header. They will be
349 included in the order specified. Implies `--standalone`.
351`-B` *FILE*, `--include-before-body=`*FILE*
352: Include contents of *FILE*, verbatim, at the beginning of the
353 document body (e.g. after the `<body>` tag in HTML, or the
354 `\begin{document}` command in LaTeX). This can be used to include
355 navigation bars or banners in HTML documents. This option can be
356 used repeatedly to include multiple files. They will be included in
357 the order specified. Implies `--standalone`.
359`-A` *FILE*, `--include-after-body=`*FILE*
360: Include contents of *FILE*, verbatim, at the end of the document
361 body (before the `</body>` tag in HTML, or the
362 `\end{document}` command in LaTeX). This option can be be used
363 repeatedly to include multiple files. They will be included in the
364 order specified. Implies `--standalone`.
366`--reference-odt=`*FILE*
367: Use the specified file as a style reference in producing an ODT.
368 For best results, the reference ODT should be a modified version
369 of an ODT produced using pandoc. The contents of the reference ODT
370 are ignored, but its stylesheets are used in the new ODT. If no
371 reference ODT is specified on the command line, pandoc will look
372 for a file `reference.odt` in the user data directory (see
373 `--data-dir`). If this is not found either, sensible defaults will be
376`--epub-stylesheet=`*FILE*
377: Use the specified CSS file to style the EPUB. If no stylesheet
378 is specified, pandoc will look for a file `epub.css` in the
379 user data directory (see `--data-dir`, below). If it is not
380 found there, sensible defaults will be used.
382`--epub-metadata=`*FILE*
383: Look in the specified XML file for metadata for the EPUB.
384 The file should contain a series of Dublin Core elements,
385 as documented at <http://dublincore.org/documents/dces/>.
388 <dc:rights>Creative Commons</dc:rights>
389 <dc:language>es-AR</dc:language>
391 By default, pandoc will include the following metadata elements:
392 `<dc:title>` (from the document title), `<dc:creator>` (from the
393 document authors), `<dc:language>` (from the locale), and
394 `<dc:identifier id="BookId">` (a randomly generated UUID). Any of
395 these may be overridden by elements in the metadata file.
397`-D` *FORMAT*, `--print-default-template=`*FORMAT*
398: Print the default template for an output *FORMAT*. (See `-t`
399 for a list of possible *FORMAT*s.)
401`-T` *STRING*, `--title-prefix=`*STRING*
402: Specify *STRING* as a prefix at the beginning of the title
403 that appears in the HTML header (but not in the title as it
404 appears at the beginning of the HTML body). Implies
407`--bibliography=`*FILE*
408: Specify bibliography database to be used in resolving
409 citations. The database type will be determined from the
410 extension of *FILE*, which may be `.mods` (MODS format),
411 `.bib` (BibTeX format), `.bbx` (BibLaTeX format),
412 `.ris` (RIS format), `.enl` (EndNote format),
413 `.xml` (EndNote XML format), `.wos` (ISI format),
414 `.medline` (MEDLINE format), `.copac` (Copac format),
415 or `.json` (citeproc JSON). If you want to use multiple
416 bibliographies, just use this option repeatedly.
419: Specify [CSL] style to be used in formatting citations and
420 the bibliography. If *FILE* is not found, pandoc will look
427 C:\Documents And Settings\USERNAME\Application Data\csl
429 in Windows. If the `--csl` option is not specified, pandoc
430 will use a default style: either `default.csl` in the
431 user data directory (see `--data-dir`), or, if that is
432 not present, the Chicago author-date style.
434`--data-dir=`*DIRECTORY*
435: Specify the user data directory to search for pandoc data files.
436 If this option is not specified, the default user data directory
443 C:\Documents And Settings\USERNAME\Application Data\pandoc
445 in Windows. A `reference.odt`, `epub.css`, `templates` directory,
446 or `s5` directory placed in this directory will override pandoc's
450: Print information about command-line arguments to *stdout*, then exit.
451 This option is intended primarily for use in wrapper scripts.
452 The first line of output contains the name of the output file specified
453 with the `-o` option, or `-` (for *stdout*) if no output file was
454 specified. The remaining lines contain the command-line arguments,
455 one per line, in the order they appear. These do not include regular
456 Pandoc options and their arguments, but do include any options appearing
457 after a `--` separator at the end of the line.
460: Ignore command-line arguments (for use in wrapper scripts).
461 Regular Pandoc options are not ignored. Thus, for example,
463 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
467 pandoc -o foo.html -s
475[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
476[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
477[MathJax]: http://www.mathjax.org/
478[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
479[mimeTeX]: http://www.forkosh.com/mimetex.html
480[CSL]: http://CitationStyles.org
485When the `-s/--standalone` option is used, pandoc uses a template to
486add header and footer material that is needed for a self-standing
487document. To see the default template that is used, just type
491where `FORMAT` is the name of the output format. A custom template
492can be specified using the `--template` option. You can also override
493the system default templates for a given output format `FORMAT`
494by putting a file `templates/FORMAT.template` in the user data
495directory (see `--data-dir`, above).
497Templates may contain *variables*. Variable names are sequences of
498alphanumerics, `-`, and `_`, starting with a letter. A variable name
499surrounded by `$` signs will be replaced by its value. For example,
500the string `$title$` in
502 <title>$title$</title>
504will be replaced by the document title.
506To write a literal `$` in a template, use `$$`.
508Some variables are set automatically by pandoc. These vary somewhat
509depending on the output format, but include:
512: contents specified by `-H/--include-in-header` (may have multiple
515: non-null value if `--toc/--table-of-contents` was specified
517: contents specified by `-B/--include-before-body` (may have
520: contents specified by `-A/--include-after-body` (may have
525: title of document, as specified in title block
527: author of document, as specified in title block (may have
530: date of document, as specified in title block
532: language code for HTML documents
534Variables may be set at the command line using the `-V/--variable`
535option. This allows users to include custom variables in their
538Templates may contain conditionals. The syntax is as follows:
546This will include `X` in the template if `variable` has a non-null
547value; otherwise it will include `Y`. `X` and `Y` are placeholders for
548any valid template text, and may include interpolated variables or other
549conditionals. The `$else$` section may be omitted.
551When variables can have multiple values (for example, `author` in
552a multi-author document), you can use the `$for$` keyword:
555 <meta name="author" content="$author$" />
558You can optionally specify a separator to be used between
561 $for(author)$$author$$sep$, $endfor$
566Pandoc understands an extended and slightly revised version of
567John Gruber's [markdown] syntax. This document explains the syntax,
568noting differences from standard markdown. Except where noted, these
569differences can be suppressed by specifying the `--strict` command-line
575Markdown is designed to be easy to write, and, even more importantly,
578> A Markdown-formatted document should be publishable as-is, as plain
579> text, without looking like it's been marked up with tags or formatting
581> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
583This principle has guided pandoc's decisions in finding syntax for
584tables, footnotes, and other extensions.
586There is, however, one respect in which pandoc's aims are different
587from the original aims of markdown. Whereas markdown was originally
588designed with HTML generation in mind, pandoc is designed for multiple
589output formats. Thus, while pandoc allows the embedding of raw HTML,
590it discourages it, and provides other, non-HTMLish ways of representing
591important document elements like definition lists, tables, mathematics, and
597A paragraph is one or more lines of text followed by one or more blank line.
598Newlines are treated as spaces, so you can reflow your paragraphs as you like.
599If you need a hard line break, put two or more spaces at the end of a line,
600or or type a backslash followed by a newline.
605There are two kinds of headers, Setext and atx.
607### Setext-style headers ###
609A setext-style header is a line of text "underlined" with a row of `=` signs
610(for a level one header) of `-` signs (for a level two header):
618The header text can contain inline formatting, such as emphasis (see
619[Inline formatting](#inline-formatting), below).
622### Atx-style headers ###
624An Atx-style header consists of one to six `#` signs and a line of
625text, optionally followed by any number of `#` signs. The number of
626`#` signs at the beginning of the line is the header level:
628 ## A level-two header
630 ### A level-three header ###
632As with setext-style headers, the header text can contain formatting:
634 # A level-one header with a [link](/url) and *emphasis*
636Standard markdown syntax does not require a blank line before a header.
637Pandoc does require this (except, of course, at the beginning of the
638document). The reason for the requirement is that it is all too easy for a
639`#` to end up at the beginning of a line by accident (perhaps through line
640wrapping). Consider, for example:
642 I like several of their flavors of ice cream:
643 #22, for example, and #5.
646### Header identifiers in HTML ###
650Each header element in pandoc's HTML output is given a unique
651identifier. This identifier is based on the text of the header. To
652derive the identifier from the header text,
654 - Remove all formatting, links, etc.
655 - Remove all punctuation, except underscores, hyphens, and periods.
656 - Replace all spaces and newlines with hyphens.
657 - Convert all alphabetic characters to lowercase.
658 - Remove everything up to the first letter (identifiers may
659 not begin with a number or punctuation mark).
660 - If nothing is left after this, use the identifier `section`.
665 ------------------------------- ----------------------------
666 Header identifiers in HTML `header-identifiers-in-html`
667 *Dogs*?--in *my* house? `dogs--in-my-house`
668 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
669 3. Applications `applications`
672These rules should, in most cases, allow one to determine the identifier
673from the header text. The exception is when several headers have the
674same text; in this case, the first will get an identifier as described
675above; the second will get the same identifier with `-1` appended; the
676third with `-2`; and so on.
678These identifiers are used to provide link targets in the table of
679contents generated by the `--toc|--table-of-contents` option. They
680also make it easy to provide links from one section of a document to
681another. A link to this section, for example, might look like this:
684 [header identifiers](#header-identifiers-in-html).
686Note, however, that this method of providing links to sections works
689If the `--section-divs` option is specified, then each section will
690be wrapped in a `div` (or a `section`, if `--html5` was specified),
691and the identifier will be attached to the enclosing `<div>`
692(or `<section>`) tag rather than the header itself. This allows entire
693sections to be manipulated using javascript or treated differently in
700Markdown uses email conventions for quoting blocks of text.
701A block quotation is one or more paragraphs or other block elements
702(such as lists or headers), with each line preceded by a `>` character
703and a space. (The `>` need not start at the left margin, but it should
704not be indented more than three spaces.)
706 > This is a block quote. This
707 > paragraph has two lines.
709 > 1. This is a list inside a block quote.
712A "lazy" form, which requires the `>` character only on the first
713line of each block, is also allowed:
715 > This is a block quote. This
716 paragraph has two lines.
718 > 1. This is a list inside a block quote.
721Among the block elements that can be contained in a block quote are
722other block quotes. That is, block quotes can be nested:
724 > This is a block quote.
726 > > A block quote within a block quote.
728Standard markdown syntax does not require a blank line before a block
729quote. Pandoc does require this (except, of course, at the beginning of the
730document). The reason for the requirement is that it is all too easy for a
731`>` to end up at the beginning of a line by accident (perhaps through line
732wrapping). So, unless `--strict` is used, the following does not produce
733a nested block quote in pandoc:
735 > This is a block quote.
739Verbatim (code) blocks
740----------------------
742### Indented code blocks ###
744A block of text indented four spaces (or one tab) is treated as verbatim
745text: that is, special characters do not trigger special formatting,
746and all spaces and line breaks are preserved. For example,
749 moveShip(5 * gravity, DOWN);
752The initial (four space or one tab) indentation is not considered part
753of the verbatim text, and is removed in the output.
755Note: blank lines in the verbatim text need not begin with four spaces.
758### Delimited code blocks ###
762In addition to standard indented code blocks, Pandoc supports
763*delimited* code blocks. These begin with a row of three or more
764tildes (`~`) and end with a row of tildes that must be at least
765as long as the starting row. Everything between the tilde-lines
766is treated as code. No indentation is necessary:
770 moveShip(5 * gravity, DOWN);
774Like regular code blocks, delimited code blocks must be separated
775from surrounding text by blank lines.
777If the code itself contains a row of tildes, just use a longer
778row of tildes at the start and end:
782 code including tildes
786Optionally, you may specify the language of the code block using
789 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines}
791 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
792 qsort (filter (>= x) xs)
793 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
795Some output formats can use this information to do syntax highlighting.
796Currently, the only output format that uses this information is HTML.
798If pandoc has been compiled with syntax highlighting support, then the
799code block above will appear highlighted, with numbered lines. (To see
800which languages are supported, do `pandoc --version`.)
802If pandoc has not been compiled with syntax highlighting support, the
803code block above will appear as follows:
805 <pre class="haskell">
817A bullet list is a list of bulleted list items. A bulleted list
818item begins with a bullet (`*`, `+`, or `-`). Here is a simple
825This will produce a "compact" list. If you want a "loose" list, in which
826each item is formatted as a paragraph, put spaces between the items:
834The bullets need not be flush with the left margin; they may be
835indented one, two, or three spaces. The bullet must be followed
838List items look best if subsequent lines are flush with the first
839line (after the bullet):
845But markdown also allows a "lazy" format:
851### The four-space rule ###
853A list item may contain multiple paragraphs and other block-level
854content. However, subsequent paragraphs must be preceded by a blank line
855and indented four spaces or a tab. The list will look better if the first
856paragraph is aligned with the rest:
862 * Second paragraph. With a code block, which must be indented
867List items may include other lists. In this case the preceding blank
868line is optional. The nested list must be indented four spaces or
881As noted above, markdown allows you to write list items "lazily," instead of
882indenting continuation lines. However, if there are multiple paragraphs or
883other blocks in a list item, the first line of each must be indented.
888 + Another one; this looks
891 Second paragraph of second
894**Note:** Although the four-space rule for continuation paragraphs
895comes from the official [markdown syntax guide], the reference implementation,
896`Markdown.pl`, does not follow it. So pandoc will give different results than
897`Markdown.pl` when authors have indented continuation paragraphs fewer than
900The [markdown syntax guide] is not explicit whether the four-space
901rule applies to *all* block-level content in a list item; it only
902mentions paragraphs and code blocks. But it implies that the rule
903applies to all block-level content (including nested lists), and
904pandoc interprets it that way.
906 [markdown syntax guide]:
907 http://daringfireball.net/projects/markdown/syntax#list
911Ordered lists work just like bulleted lists, except that the items
912begin with enumerators rather than bullets.
914In standard markdown, enumerators are decimal numbers followed
915by a period and a space. The numbers themselves are ignored, so
916there is no difference between this list:
930Unlike standard markdown, Pandoc allows ordered list items to be marked
931with uppercase and lowercase letters and roman numerals, in addition to
932arabic numerals. List markers may be enclosed in parentheses or followed by a
933single right-parentheses or period. They must be separated from the
934text that follows by at least one space, and, if the list marker is a
935capital letter with a period, by at least two spaces.[^2]
937[^2]: The point of this rule is to ensure that normal paragraphs
938 starting with people's initials, like
940 B. Russell was an English philosopher.
942 do not get treated as list items.
944 This rule will not prevent
948 from being interpreted as a list item. In this case, a backslash
953Pandoc also pays attention to the type of list marker used, and to the
954starting number, and both of these are preserved where possible in the
955output format. Thus, the following yields a list with numbers followed
956by a single parenthesis, starting with 9, and a sublist with lowercase
966Note that Pandoc pays attention only to the *starting* marker in a list.
967So, the following yields a list numbered sequentially starting from 2:
974If default list markers are desired, use `#.`:
981### Definition lists ###
985Pandoc supports definition lists, using a syntax inspired by
986[PHP Markdown Extra] and [reStructuredText]:[^3]
992 Term 2 with *inline markup*
996 { some code, part of Definition 2 }
998 Third paragraph of definition 2.
1000Each term must fit on one line, which may optionally be followed by
1001a blank line, and must be followed by one or more definitions.
1002A definition begins with a colon or tilde, which may be indented one
1003or two spaces. A term may have multiple definitions, and each definition
1004may consist of one or more block elements (paragraph, code block, list,
1005etc.), each indented four spaces or one tab stop.
1007If you leave space after the definition (as in the example above),
1008the blocks of the definitions will be considered paragraphs. In some
1009output formats, this will mean greater spacing between term/definition
1010pairs. For a compact definition list, do not leave space between the
1011definition and the next term:
1019[^3]: I have also been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1021[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1024### Numbered example lists ###
1028The special list marker `@` can be used for sequentially numbered
1029examples. The first list item with a `@` marker will be numbered '1',
1030the next '2', and so on, throughout the document. The numbered examples
1031need not occur in a single list; each new list using `@` will take up
1032where the last stopped. So, for example:
1034 (@) My first example will be numbered (1).
1035 (@) My second example will be numbered (2).
1037 Explanation of examples.
1039 (@) My third example will be numbered (3).
1041Numbered examples can be labeled and referred to elsewhere in the
1044 (@good) This is a good example.
1046 As (@good) illustrates, ...
1048The label can be any string of alphanumeric characters, underscores,
1052### Compact and loose lists ###
1054Pandoc behaves differently from `Markdown.pl` on some "edge
1055cases" involving lists. Consider this source:
1065Pandoc transforms this into a "compact list" (with no `<p>` tags around
1066"First", "Second", or "Third"), while markdown puts `<p>` tags around
1067"Second" and "Third" (but not "First"), because of the blank space
1068around "Third". Pandoc follows a simple rule: if the text is followed by
1069a blank line, it is treated as a paragraph. Since "Second" is followed
1070by a list, and not a blank line, it isn't treated as a paragraph. The
1071fact that the list is followed by a blank line is irrelevant. (Note:
1072Pandoc works this way even when the `--strict` option is specified. This
1073behavior is consistent with the official markdown syntax description,
1074even though it is different from that of `Markdown.pl`.)
1077### Ending a list ###
1079What if you want to put an indented code block after a list?
1086Trouble! Here pandoc (like other markdown implementations) will treat
1087`{ my code block }` as the second paragraph of item two, and not as
1090To "cut off" the list after item two, you can insert some non-indented
1091content, like an HTML comment, which won't produce visible output in
1097 <!-- end of list -->
1101You can use the same trick if you want two consecutive lists instead
1118A line containing a row of three or more `*`, `-`, or `_` characters
1119(optionally separated by spaces) produces a horizontal rule:
1131Three kinds of tables may be used. All three kinds presuppose the use of
1132a fixed-width font, such as Courier.
1134**Simple tables** look like this:
1136 Right Left Center Default
1137 ------- ------ ---------- -------
1142 Table: Demonstration of simple table syntax.
1144The headers and table rows must each fit on one line. Column
1145alignments are determined by the position of the header text relative
1146to the dashed line below it:[^4]
1148 - If the dashed line is flush with the header text on the right side
1149 but extends beyond it on the left, the column is right-aligned.
1150 - If the dashed line is flush with the header text on the left side
1151 but extends beyond it on the right, the column is left-aligned.
1152 - If the dashed line extends beyond the header text on both sides,
1153 the column is centered.
1154 - If the dashed line is flush with the header text on both sides,
1155 the default alignment is used (in most cases, this will be left).
1157[^4]: This scheme is due to Michel Fortin, who proposed it on the
1158 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1160The table must end with a blank line, or a line of dashes followed by
1161a blank line. A caption may optionally be provided (as illustrated in
1162the example above). A caption is a paragraph beginning with the string
1163`Table:` (or just `:`), which will be stripped off. It may appear either
1164before or after the table.
1166The column headers may be omitted, provided a dashed line is used
1167to end the table. For example:
1169 ------- ------ ---------- -------
1173 ------- ------ ---------- -------
1175When headers are omitted, column alignments are determined on the basis
1176of the first line of the table body. So, in the tables above, the columns
1177would be right, left, center, and right aligned, respectively.
1179**Multiline tables** allow headers and table rows to span multiple lines
1180of text (but cells that span multiple columns or rows of the table are
1181not supported). Here is an example:
1183 -------------------------------------------------------------
1184 Centered Default Right Left
1185 Header Aligned Aligned Aligned
1186 ----------- ------- --------------- -------------------------
1187 First row 12.0 Example of a row that
1188 spans multiple lines.
1190 Second row 5.0 Here's another one. Note
1191 the blank line between
1193 -------------------------------------------------------------
1195 Table: Here's the caption. It, too, may span
1198These work like simple tables, but with the following differences:
1200 - They must begin with a row of dashes, before the header text
1201 (unless the headers are omitted).
1202 - They must end with a row of dashes, then a blank line.
1203 - The rows must be separated by blank lines.
1205In multiline tables, the table parser pays attention to the widths of
1206the columns, and the writers try to reproduce these relative widths in
1207the output. So, if you find that one of the columns is too narrow in the
1208output, try widening it in the markdown source.
1210Headers may be omitted in multiline tables as well as simple tables:
1212 ----------- ------- --------------- -------------------------
1213 First row 12.0 Example of a row that
1214 spans multiple lines.
1216 Second row 5.0 Here's another one. Note
1217 the blank line between
1219 -------------------------------------------------------------
1221 : Here's a multiline table without headers.
1223It is possible for a multiline table to have just one row, but the row
1224should be followed by a blank line (and then the row of dashes that ends
1225the table), or the table may be interpreted as a simple table.
1227**Grid tables** look like this:
1229 : Sample grid table.
1231 +---------------+---------------+--------------------+
1232 | Fruit | Price | Advantages |
1233 +===============+===============+====================+
1234 | Bananas | $1.34 | - built-in wrapper |
1235 | | | - bright color |
1236 +---------------+---------------+--------------------+
1237 | Oranges | $2.10 | - cures scurvy |
1239 +---------------+---------------+--------------------+
1241The row of `=`s separates the header from the table body, and can be
1242omitted for a headerless table. The cells of grid tables may contain
1243arbitrary block elements (multiple paragraphs, code blocks, lists,
1244etc.). Alignments are not supported, nor are cells that span multiple
1245columns or rows. Grid tables can be created easily using [Emacs table mode].
1247 [Emacs table mode]: http://table.sourceforge.net/
1255If the file begins with a title block
1258 % author(s) (separated by semicolons)
1261it will be parsed as bibliographic information, not regular text. (It
1262will be used, for example, in the title of standalone LaTeX or HTML
1263output.) The block may contain just a title, a title and an author,
1264or all three elements. If you want to include an author but no
1265title, or a title and a date but no author, you need a blank line:
1274The title may occupy multiple lines, but continuation lines must
1275begin with leading space, thus:
1280If a document has multiple authors, the authors may be put on
1281separate lines with leading space, or separated by semicolons, or
1282both. So, all of the following are equivalent:
1287 % Author One; Author Two
1292The date must fit on one line.
1294All three metadata fields may contain standard inline formatting
1295(italics, links, footnotes, etc.).
1297Title blocks will always be parsed, but they will affect the output only
1298when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1299will appear twice: once in the document head -- this is the title that
1300will appear at the top of the window in a browser -- and once at the
1301beginning of the document body. The title in the document head can have
1302an optional prefix attached (`--title-prefix` or `-T` option). The title
1303in the body appears as an H1 element with class "title", so it can be
1304suppressed or reformatted with CSS. If a title prefix is specified with
1305`-T` and no title block appears in the document, the title prefix will
1306be used by itself as the HTML title.
1308The man page writer extracts a title, man page section number, and
1309other header and footer information from the title line. The title
1310is assumed to be the first word on the title line, which may optionally
1311end with a (single-digit) section number in parentheses. (There should
1312be no space between the title and the parentheses.) Anything after
1313this is assumed to be additional footer and header text. A single pipe
1314character (`|`) should be used to separate the footer text from the header
1319will yield a man page with the title `PANDOC` and section 1.
1321 % PANDOC(1) Pandoc User Manuals
1323will also have "Pandoc User Manuals" in the footer.
1325 % PANDOC(1) Pandoc User Manuals | Version 4.0
1327will also have "Version 4.0" in the header.
1333Except inside a code block or inline code, any punctuation or space
1334character preceded by a backslash will be treated literally, even if it
1335would normally indicate formatting. Thus, for example, if one writes
1345 <strong>hello</strong>
1347This rule is easier to remember than standard markdown's rule,
1348which allows only the following characters to be backslash-escaped:
1352(However, if the `--strict` option is supplied, the standard
1353markdown rule will be used.)
1355A backslash-escaped space is parsed as a nonbreaking space. It will
1356appear in TeX output as `~` and in HTML and XML as `\ ` or
1359A backslash-escaped newline (i.e. a backslash occurring at the end of
1360a line) is parsed as a hard line break. It will appear in TeX output as
1361`\\` and in HTML as `<br />`. This is a nice alternative to
1362markdown's "invisible" way of indicating hard line breaks using
1363two trailing spaces on a line.
1365Backslash escapes do not work in verbatim contexts.
1370If the `--smart` option is specified, pandoc will produce typographically
1371correct output, converting straight quotes to curly quotes, `---` and `--`
1372to Em-dashes, and `...` to ellipses. Nonbreaking spaces are inserted after
1373certain abbreviations, such as "Mr."
1380To *emphasize* some text, surround it with `*`s or `_`, like this:
1382 This text is _emphasized with underscores_, and this
1383 is *emphasized with asterisks*.
1385Double `*` or `_` produces **strong emphasis**:
1387 This is **strong emphasis** and __with underscores__.
1389A `*` or `_` character surrounded by spaces, or backslash-escaped,
1390will not trigger emphasis:
1392 This is * not emphasized *, and \*neither is this\*.
1394Because `_` is sometimes used inside words and identifiers,
1395pandoc does not interpret a `_` surrounded by alphanumeric
1396characters as an emphasis marker. If you want to emphasize
1397just part of a word, use `*`:
1399 feas*ible*, not feas*able*.
1406To strikeout a section of text with a horizontal line, begin and end it
1407with `~~`. Thus, for example,
1409 This ~~is deleted text.~~
1412### Superscripts and subscripts ###
1416Superscripts may be written by surrounding the superscripted text by `^`
1417characters; subscripts may be written by surrounding the subscripted
1418text by `~` characters. Thus, for example,
1420 H~2~O is a liquid. 2^10^ is 1024.
1422If the superscripted or subscripted text contains spaces, these spaces
1423must be escaped with backslashes. (This is to prevent accidental
1424superscripting and subscripting through the ordinary use of `~` and `^`.)
1425Thus, if you want the letter P with 'a cat' in subscripts, use
1426`P~a\ cat~`, not `P~a cat~`.
1431To make a short span of text verbatim, put it inside backticks:
1433 What is the difference between `>>=` and `>>`?
1435If the verbatim text includes a backtick, use double backticks:
1437 Here is a literal backtick `` ` ``.
1439(The spaces after the opening backticks and before the closing
1440backticks will be ignored.)
1442The general rule is that a verbatim span starts with a string
1443of consecutive backticks (optionally followed by a space)
1444and ends with a string of the same number of backticks (optionally
1445preceded by a space).
1447Note that backslash-escapes (and other markdown constructs) do not
1448work in verbatim contexts:
1450 This is a backslash followed by an asterisk: `\*`.
1458Anything between two `$` characters will be treated as TeX math. The
1459opening `$` must have a character immediately to its right, while the
1460closing `$` must have a character immediately to its left. Thus,
1461`$20,000 and $30,000` won't parse as math. If for some reason
1462you need to enclose text in literal `$` characters, backslash-escape
1463them and they won't be treated as math delimiters.
1465TeX math will be printed in all output formats. How it is rendered
1466depends on the output format:
1468Markdown, reStructuredText, LaTeX, Org-Mode, ConTeXt
1469 ~ It will appear verbatim between `$` characters.
1472 ~ It will be rendered using an interpreted text role `:math:`, as described
1473 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
1476 ~ It will be rendered inside a `@math` command.
1479 ~ It will be rendered verbatim without `$`'s.
1482 ~ It will be rendered inside `<math>` tags.
1485 ~ It will be rendered inside `<span class="math">` tags.
1487RTF, Docbook, OpenDocument, ODT
1488 ~ It will be rendered, if possible, using unicode characters,
1489 and will otherwise appear verbatim.
1491HTML, Slidy, S5, EPUB
1492 ~ The way math is rendered in HTML will depend on the
1493 command-line options selected:
1495 1. The default is to render TeX math as far as possible using unicode
1496 characters, as with RTF, Docbook, and OpenDocument output. Formulas
1497 are put inside a `span` with `class="math"`, so that they may be
1498 styled differently from the surrounding text if needed.
1500 2. If the `--latexmathml` option is used, TeX math will be displayed
1501 between $ or $$ characters and put in `<span>` tags with class `LaTeX`.
1502 The [LaTeXMathML] script will be used to render it as formulas.
1503 (This trick does not work in all browsers, but it works in Firefox.
1504 In browsers that do not support LaTeXMathML, TeX math will appear
1505 verbatim between $ characters.)
1507 3. If the `--jsmath` option is used, TeX math will be put inside
1508 `<span>` tags (for inline math) or `<div>` tags (for display math)
1509 with class `math`. The [jsMath] script will be used to render
1512 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
1513 be called to generate images for each TeX formula. This should
1514 work in all browsers. The `--mimetex` option takes an optional URL
1515 as argument. If no URL is specified, it will be assumed that the
1516 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
1518 5. If the `--gladtex` option is used, TeX formulas will be enclosed
1519 in `<eq>` tags in the HTML output. The resulting `htex` file may then
1520 be processed by [gladTeX], which will produce image files for each
1521 formula and an `html` file with links to these images. So, the
1524 pandoc -s --gladtex myfile.txt -o myfile.htex
1525 gladtex -d myfile-images myfile.htex
1526 # produces myfile.html and images in myfile-images
1528 6. If the `--webtex` option is used, TeX formulas will be converted
1529 to `<img>` tags that link to an external script that converts
1530 formulas to images. The formula will be URL-encoded and concatenated
1531 with the URL provided. If no URL is specified, the Google Chart
1532 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
1538Markdown allows you to insert raw HTML anywhere in a document
1539(except verbatim contexts, where `<`, `>`, and `&` are interpreted
1542The raw HTML is passed through unchanged in HTML, S5, Slidy, EPUB,
1543Markdown, and Textile output, and suppressed in other formats.
1547Standard markdown allows you to include HTML "blocks": blocks
1548of HTML between balanced tags that are separated from the surrounding text
1549with blank lines, and start and end at the left margin. Within
1550these blocks, everything is interpreted as HTML, not markdown;
1551so (for example), `*` does not signify emphasis.
1553Pandoc behaves this way when `--strict` is specified; but by default,
1554pandoc interprets material between HTML block tags as markdown.
1555Thus, for example, Pandoc will turn
1560 <td>[a link](http://google.com)</td>
1568 <td><em>one</em></td>
1569 <td><a href="http://google.com">a link</a></td>
1573whereas `Markdown.pl` will preserve it as is.
1575There is one exception to this rule: text between `<script>` and
1576`<style>` tags is not interpreted as markdown.
1578This departure from standard markdown should make it easier to mix
1579markdown with HTML block elements. For example, one can surround
1580a block of markdown text with `<div>` tags without preventing it
1581from being interpreted as markdown.
1589In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
1590included in a document. Inline TeX commands will be preserved and passed
1591unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
1592LaTeX to include BibTeX citations:
1594 This result was proved in \cite{jones.1967}.
1596Note that in LaTeX environments, like
1598 \begin{tabular}{|l|l|}\hline
1599 Age & Frequency \\ \hline
1602 36--45 & 22 \\ \hline
1605the material between the begin and end tags will be interpreted as raw
1606LaTeX, not as markdown.
1608Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
1613For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
1614`\renewcommand` definitions and apply the resulting macros to all LaTeX
1615math. So, for example, the following will work in all output formats,
1618 \newcommand{\tuple}[1]{\langle #1 \rangle}
1622In LaTeX output, the `\newcommand` definition will simply be passed
1623unchanged to the output.
1629Markdown allows links to be specified in several ways.
1631### Automatic links ###
1633If you enclose a URL or email address in pointy brackets, it
1637 <sam@green.eggs.ham>
1642An inline link consists of the link text in square brackets,
1643followed by the URL in parentheses. (Optionally, the URL can
1644be followed by a link title, in quotes.)
1646 This is an [inline link](/url), and here's [one with
1647 a title](http://fsf.org "click here for a good time!").
1649There can be no space between the bracketed part and the parenthesized part.
1650The link text can contain formatting (such as emphasis), but the title cannot.
1653### Reference links ###
1655An *explicit* reference link has two parts, the link itself and the link
1656definition, which may occur elsewhere in the document (either
1657before or after the link).
1659The link consists of link text in square brackets, followed by a label in
1660square brackets. (There can be space between the two.) The link definition
1661must begin at the left margin or indented no more than three spaces. It
1662consists of the bracketed label, followed by a colon and a space, followed by
1663the URL, and optionally (after a space) a link title either in quotes or in
1666Here are some examples:
1668 [my label 1]: /foo/bar.html "My title, optional"
1670 [my label 3]: http://fsf.org (The free software foundation)
1671 [my label 4]: /bar#special 'A title in single quotes'
1673The URL may optionally be surrounded by angle brackets:
1675 [my label 5]: <http://foo.bar.baz>
1677The title may go on the next line:
1679 [my label 3]: http://fsf.org
1680 "The free software foundation"
1682Note that link labels are not case sensitive. So, this will work:
1684 Here is [my link][FOO]
1688In an *implicit* reference link, the second pair of brackets is
1689empty, or omitted entirely:
1691 See [my website][], or [my website].
1693 [my website]: http://foo.bar.baz
1699A link immediately preceded by a `!` will be treated as an image.
1700The link text will be used as the image's alt text:
1702 
1706 [movie reel]: movie.gif
1708### Pictures with captions ###
1712An image occurring by itself in a paragraph will be rendered as
1713a figure with a caption.[^5] (In LaTeX, a figure environment will be
1714used; in HTML, the image will be placed in a `div` with class
1715`figure`, together with a caption in a `p` with class `caption`.)
1716The image's alt text will be used as the caption.
1718 
1720[^5]: This feature is not yet implemented for RTF, OpenDocument, or
1721 ODT. In those formats, you'll just get an image in a paragraph by
1722 itself, with no caption.
1724If you just want a regular inline image, just make sure it is not
1725the only thing in the paragraph. One way to do this is to insert a
1726nonbreaking space after the image:
1728 \
1736Pandoc's markdown allows footnotes, using the following syntax:
1738 Here is a footnote reference,[^1] and another.[^longnote]
1740 [^1]: Here is the footnote.
1742 [^longnote]: Here's one with multiple blocks.
1744 Subsequent paragraphs are indented to show that they
1745 belong to the previous footnote.
1749 The whole paragraph can be indented, or just the first
1750 line. In this way, multi-paragraph footnotes work like
1751 multi-paragraph list items.
1753 This paragraph won't be part of the note, because it
1756The identifiers in footnote references may not contain spaces, tabs,
1757or newlines. These identifiers are used only to correlate the
1758footnote reference with the note itself; in the output, footnotes
1759will be numbered sequentially.
1761The footnotes themselves need not be placed at the end of the
1762document. They may appear anywhere except inside other block elements
1763(lists, block quotes, tables, etc.).
1765Inline footnotes are also allowed (though, unlike regular notes,
1766they cannot contain multiple paragraphs). The syntax is as follows:
1768 Here is an inline note.^[Inlines notes are easier to write, since
1769 you don't have to pick an identifier and move down to type the
1772Inline and regular footnotes may be mixed freely.
1780Pandoc can automatically generate citations and a bibliography in a number of
1781styles (using Andrea Rossato's `hs-citeproc`). In order to use this feature,
1782you will need a bibliographic database in one of the following formats:
1784 Format File extension
1785 ------------ --------------
1797You will need to specify the bibliography file using the `--bibliography`
1798command-line option (which may be repeated if you have several
1801By default, pandoc will use a Chicago author-date format for citations
1802and references. To use another style, you will need to use the
1803`--csl` option to specify a [CSL] 1.0 style file. A primer on
1804creating and modifying CSL styles can be found at
1805<http://citationstyles.org/downloads/primer.html>.
1806A repository of CSL styles can be found at
1807<https://github.com/citation-style-language/styles>.
1809Citations go inside square brackets and are separated by semicolons.
1810Each citation must have a key, composed of '@' + the citation
1811identifier from the database, and may optionally have a prefix,
1812a locator, and a suffix. Here are some examples:
1814 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
1816 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
1818 Blah blah [@smith04; @doe99].
1820A minus sign (`-`) before the `@` will suppress mention of
1821the author in the citation. This can be useful when the
1822author is already mentioned in the text:
1824 Smith says blah [-@smith04].
1826You can also write an in-text citation, as follows:
1830 @smith04 [p. 33] says blah.
1832If the style calls for a list of works cited, it will be placed
1833at the end of the document. Normally, you will want to end your
1834document with an appropriate header:
1840The bibliography will be inserted after this header.
1843Producing HTML slide shows with Pandoc
1844======================================
1846You can use Pandoc to produce an HTML + javascript slide presentation
1847that can be viewed via a web browser. There are two ways to do this,
1848using [S5] or [Slidy].
1850Here's the markdown source for a simple slide show, `eating.txt`:
1866 --------------------------
1868 
1870To produce the slide show, simply type
1872 pandoc -w s5 -s eating.txt > eating.html
1876 pandoc -w slidy -s eating.txt > eating.html
1880A title page is constructed automatically from the document's title
1881block. Each level-one header and horizontal rule begins a new slide.
1883The file produced by pandoc with the `-s/--standalone` option embeds a
1884link to javascripts and CSS files, which are assumed to be available at
1885the relative path `ui/default` (for S5) or at the Slidy website at
1886`w3.org` (for Slidy). If the `--offline` option is specified, the
1887scripts and CSS will be included directly in the generated file, so that
1888it may be used offline.
1890You can change the style of the slides by putting customized CSS files
1891in `$DATADIR/s5/default` (for S5) or `$DATADIR/slidy` (for Slidy),
1892where `$DATADIR` is the user data directory (see `--data-dir`, above).
1893The originals may be found in pandoc's system data directory (generally
1894`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
1895files it does not find in the user data directory.
1900By default, these writers produces lists that display "all at once."
1901If you want your lists to display incrementally (one item at a time),
1902use the `-i` option. If you want a particular list to depart from the
1903default (that is, to display incrementally without the `-i` option and
1904all at once with the `-i` option), put it in a block quote:
1909In this way incremental and nonincremental lists can be mixed in
1912Literate Haskell support
1913========================
1915If you append `+lhs` to an appropriate input or output format (`markdown`,
1916`rst`, or `latex` for input or output; `html` for output only), pandoc
1917will treat the document as literate Haskell source. This means that
1919 - In markdown input, "bird track" sections will be parsed as Haskell
1920 code rather than block quotations. Text between `\begin{code}`
1921 and `\end{code}` will also be treated as Haskell code.
1923 - In markdown output, code blocks with class `haskell` will be
1924 rendered using bird tracks, and block quotations will be
1925 indented one space, so they will not be treated as Haskell code.
1926 In addition, headers will be rendered setext-style (with underlines)
1927 rather than atx-style (with '#' characters). (This is because ghc
1928 treats '#' characters in column 1 as introducing line numbers.)
1930 - In restructured text input, "bird track" sections will be parsed
1933 - In restructured text output, code blocks with class `haskell` will
1934 be rendered using bird tracks.
1936 - In LaTeX input, text in `code` environments will be parsed as
1939 - In LaTeX output, code blocks with class `haskell` will be rendered
1940 inside `code` environments.
1942 - In HTML output, code blocks with class `haskell` will be rendered
1943 with class `literatehaskell` and bird tracks.
1947 pandoc -f markdown+lhs -t html
1949reads literate Haskell source formatted with markdown conventions and writes
1950ordinary HTML (without bird tracks).
1952 pandoc -f markdown+lhs -t html+lhs
1954writes HTML with the Haskell code in bird tracks, so it can be copied
1955and pasted as literate Haskell source.
1960© 2006-2011 John MacFarlane (jgm at berkeley dot edu). Released under the
1961[GPL], version 2 or greater. This software carries no warranty of
1962any kind. (See COPYRIGHT for full copyright and warranty notices.)
1963Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
1964Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
1965Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
1966Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner.
1968[markdown]: http://daringfireball.net/projects/markdown/
1969[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
1970[S5]: http://meyerweb.com/eric/tools/s5/
1971[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
1972[HTML]: http://www.w3.org/TR/html40/
1973[LaTeX]: http://www.latex-project.org/
1974[ConTeXt]: http://www.pragma-ade.nl/
1975[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
1976[DocBook XML]: http://www.docbook.org/
1977[OpenDocument XML]: http://opendocument.xml.org/
1978[ODT]: http://en.wikipedia.org/wiki/OpenDocument
1979[Textile]: http://redcloth.org/textile
1980[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
1981[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
1982[Haskell]: http://www.haskell.org/
1983[GNU Texinfo]: http://www.gnu.org/software/texinfo/
1984[Emacs Org-Mode]: http://org-mode.org
1985[EPUB]: http://www.idpf.org/
1986[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
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