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], [AsciiDoc], and [Slidy], [DZSlides], or [S5] HTML
22Pandoc's enhanced version of markdown includes syntax for footnotes,
23tables, flexible ordered lists, definition lists, delimited code blocks,
24superscript, subscript, strikeout, title blocks, automatic tables of
25contents, embedded LaTeX math, citations, and markdown inside HTML block
26elements. (These enhancements, described below under
27[Pandoc's markdown](#pandocs-markdown), can be disabled using the `--strict`
30In contrast to most existing tools for converting markdown to HTML, which
31use regex substitutions, Pandoc has a modular design: it consists of a
32set of readers, which parse text in a given format and produce a native
33representation of the document, and a set of writers, which convert
34this native representation into a target format. Thus, adding an input
35or output format requires only adding a reader or writer.
40If no *input-file* is specified, input is read from *stdin*.
41Otherwise, the *input-files* are concatenated (with a blank
42line between each) and used as input. Output goes to *stdout* by
43default (though output to *stdout* is disabled for the `odt` and
44`epub` output formats). For output to a file, use the `-o` option:
46 pandoc -o output.html input.txt
48Instead of a file, an absolute URI may be given. In this case
49pandoc will fetch the content using HTTP:
51 pandoc -f html -t markdown http://www.fsf.org
53If multiple input files are given, `pandoc` will concatenate them all (with
54blank lines between them) before parsing.
56The format of the input and output can be specified explicitly using
57command-line options. The input format can be specified using the
58`-r/--read` or `-f/--from` options, the output format using the
59`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
60markdown to LaTeX, you could type:
62 pandoc -f markdown -t latex hello.txt
64To convert `hello.html` from html to markdown:
66 pandoc -f html -t markdown hello.html
68Supported output formats are listed below under the `-t/--to` option.
69Supported input formats are listed below under the `-f/--from` option. Note
70that the `rst`, `textile`, `latex`, and `html` readers are not complete;
71there are some constructs that they do not parse.
73If the input or output format is not specified explicitly, `pandoc`
74will attempt to guess it from the extensions of
75the input and output filenames. Thus, for example,
77 pandoc -o hello.tex hello.txt
79will convert `hello.txt` from markdown to LaTeX. If no output file
80is specified (so that output goes to *stdout*), or if the output file's
81extension is unknown, the output format will default to HTML.
82If no input file is specified (so that input comes from *stdin*), or
83if the input files' extensions are unknown, the input format will
84be assumed to be markdown unless explicitly specified.
86Pandoc uses the UTF-8 character encoding for both input and output.
87If your local character encoding is not UTF-8, you
88should pipe input and output through `iconv`:
90 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
98The standard Pandoc installation includes `markdown2pdf`, a wrapper
99around `pandoc` and `pdflatex` that produces PDFs directly from markdown
100sources. The default behavior of `markdown2pdf` is to create a file with
101the same base name as the first argument and the extension `pdf`; thus,
104 markdown2pdf sample.txt endnotes.txt
106will produce `sample.pdf`. 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), `asciidoc` (AsciiDoc), `slidy` (Slidy HTML and
160 javascript slide show), `dzslides` (HTML5 + javascript slide show),
161 `s5` (S5 HTML and javascript slide show), or `rtf` (rich text
162 format). Note that `odt` and `epub` output will not be directed to
163 *stdout*; an output filename must be specified using the `-o/--output`
164 option. If `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`,
165 the output will be rendered as literate Haskell source:
166 see [Literate Haskell support](#literate-haskell-support),
170: Produce output with an appropriate header and footer (e.g. a
171 standalone HTML, LaTeX, or RTF file, not a fragment).
173`-o` *FILE*, `--output=`*FILE*
174: Write output to *FILE* instead of *stdout*. If *FILE* is
175 `-`, output will go to *stdout*. (Exception: if the output
176 format is `odt` or `epub`, output to stdout is disabled.)
178`-p`, `--preserve-tabs`
179: Preserve tabs instead of converting them to spaces (the default).
182: Specify the number of spaces per tab (default is 4).
185: Use strict markdown syntax, with no pandoc extensions or variants.
186 When the input format is HTML, this means that constructs that have no
187 equivalents in standard markdown (e.g. definition lists or strikeout
188 text) will be parsed as raw HTML.
191: Normalize the document after reading: merge adjacent
192 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
195: Use reference-style links, rather than inline links, in writing markdown
196 or reStructuredText. By default inline links are used.
199: Parse untranslatable HTML codes and LaTeX environments as raw HTML
200 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
201 input. Raw HTML can be printed in markdown, reStructuredText, HTML, Slidy,
202 DZSlides, and S5 output; raw LaTeX can be printed in markdown,
203 reStructuredText, LaTeX, and ConTeXt output. The default is for the
204 readers to omit untranslatable HTML codes and LaTeX environments.
205 (The LaTeX reader does pass through untranslatable LaTeX *commands*,
206 even if `-R` is not specified.)
209: Produce typographically correct output, converting straight quotes
210 to curly quotes, `---` and `--` to dashes, and `...` to ellipses.
211 Nonbreaking spaces are inserted after certain abbreviations, such
212 as "Mr." (Note: This option is significant only when the input format is
213 `markdown` or `textile`. It is selected automatically when the input
214 format is `textile` or the output format is `latex` or `context`.)
217: Produce HTML5 instead of HTML4. This option has no effect for writers
220`-m` [*URL*], `--latexmathml`[=*URL*]
221: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
222 To insert a link to a local copy of the `LaTeXMathML.js` script,
223 provide a *URL*. If no *URL* is provided, the contents of the
224 script will be inserted directly into the HTML header, preserving
225 portability at the price of efficiency. If you plan to use math on
226 several pages, it is much better to link to a copy of the script,
230: Convert TeX math to MathML. In standalone mode, a small javascript
231 (or a link to such a script if a *URL* is supplied) will be inserted that
232 allows the MathML to be viewed on some browsers.
235: Use [jsMath] to display embedded TeX math in HTML output.
236 The *URL* should point to the jsMath load script (e.g.
237 `jsMath/easy/load.js`); if provided, it will be linked to in
238 the header of standalone HTML documents. If a *URL* is not provided,
239 no link to the jsMath load script will be inserted; it is then
240 up to the author to provide such a link in the HTML template.
243: Use [MathJax] to display embedded TeX math in HTML output.
244 The *URL* should point to the `MathJax.js` load script.
245 If a *URL* is not provided, a link to the MathJax CDN will
249: Enclose TeX math in `<eq>` tags in HTML output. These can then
250 be processed by [gladTeX] to produce links to images of the typeset
254: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
255 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
258: Render TeX formulas using an external script that converts TeX
259 formulas to images. The formula will be concatenated with the URL
260 provided. If *URL* is not specified, the Google Chart API will be used.
263: Make list items in Slidy, DZSlides or S5 display incrementally (one by one).
264 The default is for lists to be displayed all at once.
267: Produce a standalone HTML file with no external dependencies, using
268 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
269 images, and videos. The resulting file should be "self-contained,"
270 in the sense that it needs no external files and no net access to be
271 displayed properly by a browser. This option works only with HTML output
272 formats, including `html`, `html+lhs`, `s5`, `slidy`, and `dzslides`.
273 Scripts, images, and stylesheets at absolute URLs will be downloaded;
274 those at relative URLs will be sought first relative to the working
275 directory, then relative to the user data directory (see `--data-dir`),
276 and finally relative to pandoc's default data directory.
279: Deprecated synonym for `--self-contained`.
282: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
283 output. When the LaTeX template uses the report, book, or
284 memoir class, this option is implied.
286`-N`, `--number-sections`
287: Number section headings in LaTeX, ConTeXt, or HTML output.
288 By default, sections are not numbered.
291: Use listings package for LaTeX code blocks
294: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
295 and attach identifiers to the enclosing `<div>` (or `<section>`)
296 rather than the header itself.
297 See [Section identifiers](#header-identifiers-in-html), below.
300: Disable text wrapping in output. By default, text is wrapped
301 appropriately for the output format.
304: Specify length of lines in characters (for text wrapping).
306`--email-obfuscation=`*none|javascript|references*
307: Specify a method for obfuscating `mailto:` links in HTML documents.
308 *none* leaves `mailto:` links as they are. *javascript* obfuscates
309 them using javascript. *references* obfuscates them by printing their
310 letters as decimal or hexadecimal character references.
311 If `--strict` is specified, *references* is used regardless of the
312 presence of this option.
314`--id-prefix`=*STRING*
315: Specify a prefix to be added to all automatically generated identifiers
316 in HTML output. This is useful for preventing duplicate identifiers
317 when generating fragments to be included in other pages.
319`--indented-code-classes=`*CLASSES*
320: Specify classes to use for indented code blocks--for example,
321 `perl,numberLines` or `haskell`. Multiple classes may be separated
324`--toc`, `--table-of-contents`
325: Include an automatically generated table of contents (or, in
326 the case of `latex`, `context`, and `rst`, an instruction to create
327 one) in the output document. This option has no effect on `man`,
328 `docbook`, `slidy`, or `s5` output.
330`--base-header-level=`*NUMBER*
331: Specify the base level for headers (defaults to 1).
334: Use *FILE* as a custom template for the generated document. Implies
335 `--standalone`. See [Templates](#templates) below for a description
336 of template syntax. If no extension is specified, an extension
337 corresponding to the writer will be added, so that `--template=special`
338 looks for `special.html` for HTML output. If the template is not
339 found, pandoc will search for it in the user data directory
340 (see `--data-dir`). If this option is not used, a default
341 template appropriate for the output format will be used (see
342 `-D/--print-default-template`).
344`-V` *KEY=VAL*, `--variable=`*KEY:VAL*
345: Set the template variable *KEY* to the value *VAL* when rendering the
346 document in standalone mode. This is generally only useful when the
347 `--template` option is used to specify a custom template, since
348 pandoc automatically sets the variables used in the default
351`-c` *URL*, `--css=`*URL*
352: Link to a CSS style sheet.
354`-H` *FILE*, `--include-in-header=`*FILE*
355: Include contents of *FILE*, verbatim, at the end of the header.
356 This can be used, for example, to include special
357 CSS or javascript in HTML documents. This option can be used
358 repeatedly to include multiple files in the header. They will be
359 included in the order specified. Implies `--standalone`.
361`-B` *FILE*, `--include-before-body=`*FILE*
362: Include contents of *FILE*, verbatim, at the beginning of the
363 document body (e.g. after the `<body>` tag in HTML, or the
364 `\begin{document}` command in LaTeX). This can be used to include
365 navigation bars or banners in HTML documents. This option can be
366 used repeatedly to include multiple files. They will be included in
367 the order specified. Implies `--standalone`.
369`-A` *FILE*, `--include-after-body=`*FILE*
370: Include contents of *FILE*, verbatim, at the end of the document
371 body (before the `</body>` tag in HTML, or the
372 `\end{document}` command in LaTeX). This option can be be used
373 repeatedly to include multiple files. They will be included in the
374 order specified. Implies `--standalone`.
376`--reference-odt=`*FILE*
377: Use the specified file as a style reference in producing an ODT.
378 For best results, the reference ODT should be a modified version
379 of an ODT produced using pandoc. The contents of the reference ODT
380 are ignored, but its stylesheets are used in the new ODT. If no
381 reference ODT is specified on the command line, pandoc will look
382 for a file `reference.odt` in the user data directory (see
383 `--data-dir`). If this is not found either, sensible defaults will be
386`--epub-stylesheet=`*FILE*
387: Use the specified CSS file to style the EPUB. If no stylesheet
388 is specified, pandoc will look for a file `epub.css` in the
389 user data directory (see `--data-dir`, below). If it is not
390 found there, sensible defaults will be used.
392`--epub-cover-image=`*FILE*
393: Use the specified image as the EPUB cover. It is recommended
394 that the image be less than 1000px in width and height.
396`--epub-metadata=`*FILE*
397: Look in the specified XML file for metadata for the EPUB.
398 The file should contain a series of Dublin Core elements,
399 as documented at <http://dublincore.org/documents/dces/>.
402 <dc:rights>Creative Commons</dc:rights>
403 <dc:language>es-AR</dc:language>
405 By default, pandoc will include the following metadata elements:
406 `<dc:title>` (from the document title), `<dc:creator>` (from the
407 document authors), `<dc:language>` (from the locale), and
408 `<dc:identifier id="BookId">` (a randomly generated UUID). Any of
409 these may be overridden by elements in the metadata file.
411`-D` *FORMAT*, `--print-default-template=`*FORMAT*
412: Print the default template for an output *FORMAT*. (See `-t`
413 for a list of possible *FORMAT*s.)
415`-T` *STRING*, `--title-prefix=`*STRING*
416: Specify *STRING* as a prefix at the beginning of the title
417 that appears in the HTML header (but not in the title as it
418 appears at the beginning of the HTML body). Implies
421`--bibliography=`*FILE*
422: Specify bibliography database to be used in resolving
423 citations. The database type will be determined from the
424 extension of *FILE*, which may be `.mods` (MODS format),
425 `.bib` (BibTeX/BibLaTeX format),
426 `.ris` (RIS format), `.enl` (EndNote format),
427 `.xml` (EndNote XML format), `.wos` (ISI format),
428 `.medline` (MEDLINE format), `.copac` (Copac format),
429 or `.json` (citeproc JSON). If you want to use multiple
430 bibliographies, just use this option repeatedly.
433: Specify [CSL] style to be used in formatting citations and
434 the bibliography. If *FILE* is not found, pandoc will look
441 C:\Documents And Settings\USERNAME\Application Data\csl
443 in Windows. If the `--csl` option is not specified, pandoc
444 will use a default style: either `default.csl` in the
445 user data directory (see `--data-dir`), or, if that is
446 not present, the Chicago author-date style.
448`--citation-abbreviations=`*FILE*
449: Specify a file containing abbreviations for journal titles and
450 other bibliographic fields (indicated by setting `form="short"`
451 in the CSL node for the field). The format is described at
452 <http://citationstylist.org/2011/10/19/abbreviations-for-zotero-test-release/>.
453 Here is a short example:
457 "Lloyd's Law Reports": "Lloyd's Rep",
458 "Estates Gazette": "EG",
459 "Scots Law Times": "SLT"
465: Use natbib for citations in LaTeX output.
468: Use biblatex for citations in LaTeX output.
470`--data-dir=`*DIRECTORY*
471: Specify the user data directory to search for pandoc data files.
472 If this option is not specified, the default user data directory
479 C:\Documents And Settings\USERNAME\Application Data\pandoc
481 in Windows. A `reference.odt`, `epub.css`, `templates` directory,
482 or `s5` directory placed in this directory will override pandoc's
486: Print information about command-line arguments to *stdout*, then exit.
487 This option is intended primarily for use in wrapper scripts.
488 The first line of output contains the name of the output file specified
489 with the `-o` option, or `-` (for *stdout*) if no output file was
490 specified. The remaining lines contain the command-line arguments,
491 one per line, in the order they appear. These do not include regular
492 Pandoc options and their arguments, but do include any options appearing
493 after a `--` separator at the end of the line.
496: Ignore command-line arguments (for use in wrapper scripts).
497 Regular Pandoc options are not ignored. Thus, for example,
499 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
503 pandoc -o foo.html -s
511[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
512[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
513[MathJax]: http://www.mathjax.org/
514[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
515[mimeTeX]: http://www.forkosh.com/mimetex.html
516[CSL]: http://CitationStyles.org
521When the `-s/--standalone` option is used, pandoc uses a template to
522add header and footer material that is needed for a self-standing
523document. To see the default template that is used, just type
527where `FORMAT` is the name of the output format. A custom template
528can be specified using the `--template` option. You can also override
529the system default templates for a given output format `FORMAT`
530by putting a file `templates/default.FORMAT` in the user data
531directory (see `--data-dir`, above).
533Templates may contain *variables*. Variable names are sequences of
534alphanumerics, `-`, and `_`, starting with a letter. A variable name
535surrounded by `$` signs will be replaced by its value. For example,
536the string `$title$` in
538 <title>$title$</title>
540will be replaced by the document title.
542To write a literal `$` in a template, use `$$`.
544Some variables are set automatically by pandoc. These vary somewhat
545depending on the output format, but include:
548: contents specified by `-H/--include-in-header` (may have multiple
551: non-null value if `--toc/--table-of-contents` was specified
553: contents specified by `-B/--include-before-body` (may have
556: contents specified by `-A/--include-after-body` (may have
561: title of document, as specified in title block
563: author of document, as specified in title block (may have
566: date of document, as specified in title block
568: language code for HTML or LaTeX documents
570: base URL for Slidy documents (defaults to
571 `http://www.w3.org/Talks/Tools/Slidy2`)
573: base URL for S5 documents (defaults to `ui/default`)
575Variables may be set at the command line using the `-V/--variable`
576option. This allows users to include custom variables in their
579Templates may contain conditionals. The syntax is as follows:
587This will include `X` in the template if `variable` has a non-null
588value; otherwise it will include `Y`. `X` and `Y` are placeholders for
589any valid template text, and may include interpolated variables or other
590conditionals. The `$else$` section may be omitted.
592When variables can have multiple values (for example, `author` in
593a multi-author document), you can use the `$for$` keyword:
596 <meta name="author" content="$author$" />
599You can optionally specify a separator to be used between
602 $for(author)$$author$$sep$, $endfor$
604If you use custom templates, you may need to revise them as pandoc
605changes. We recommend tracking the changes in the default templates,
606and modifying your custom templates accordingly. An easy way to do this
607is to fork the pandoc-templates repository
608(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
614Pandoc understands an extended and slightly revised version of
615John Gruber's [markdown] syntax. This document explains the syntax,
616noting differences from standard markdown. Except where noted, these
617differences can be suppressed by specifying the `--strict` command-line
623Markdown is designed to be easy to write, and, even more importantly,
626> A Markdown-formatted document should be publishable as-is, as plain
627> text, without looking like it's been marked up with tags or formatting
629> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
631This principle has guided pandoc's decisions in finding syntax for
632tables, footnotes, and other extensions.
634There is, however, one respect in which pandoc's aims are different
635from the original aims of markdown. Whereas markdown was originally
636designed with HTML generation in mind, pandoc is designed for multiple
637output formats. Thus, while pandoc allows the embedding of raw HTML,
638it discourages it, and provides other, non-HTMLish ways of representing
639important document elements like definition lists, tables, mathematics, and
645A paragraph is one or more lines of text followed by one or more blank line.
646Newlines are treated as spaces, so you can reflow your paragraphs as you like.
647If you need a hard line break, put two or more spaces at the end of a line,
648or type a backslash followed by a newline.
653There are two kinds of headers, Setext and atx.
655### Setext-style headers ###
657A setext-style header is a line of text "underlined" with a row of `=` signs
658(for a level one header) of `-` signs (for a level two header):
666The header text can contain inline formatting, such as emphasis (see
667[Inline formatting](#inline-formatting), below).
670### Atx-style headers ###
672An Atx-style header consists of one to six `#` signs and a line of
673text, optionally followed by any number of `#` signs. The number of
674`#` signs at the beginning of the line is the header level:
676 ## A level-two header
678 ### A level-three header ###
680As with setext-style headers, the header text can contain formatting:
682 # A level-one header with a [link](/url) and *emphasis*
684Standard markdown syntax does not require a blank line before a header.
685Pandoc does require this (except, of course, at the beginning of the
686document). The reason for the requirement is that it is all too easy for a
687`#` to end up at the beginning of a line by accident (perhaps through line
688wrapping). Consider, for example:
690 I like several of their flavors of ice cream:
691 #22, for example, and #5.
694### Header identifiers in HTML ###
698Each header element in pandoc's HTML output is given a unique
699identifier. This identifier is based on the text of the header. To
700derive the identifier from the header text,
702 - Remove all formatting, links, etc.
703 - Remove all punctuation, except underscores, hyphens, and periods.
704 - Replace all spaces and newlines with hyphens.
705 - Convert all alphabetic characters to lowercase.
706 - Remove everything up to the first letter (identifiers may
707 not begin with a number or punctuation mark).
708 - If nothing is left after this, use the identifier `section`.
713 ------------------------------- ----------------------------
714 Header identifiers in HTML `header-identifiers-in-html`
715 *Dogs*?--in *my* house? `dogs--in-my-house`
716 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
717 3. Applications `applications`
720These rules should, in most cases, allow one to determine the identifier
721from the header text. The exception is when several headers have the
722same text; in this case, the first will get an identifier as described
723above; the second will get the same identifier with `-1` appended; the
724third with `-2`; and so on.
726These identifiers are used to provide link targets in the table of
727contents generated by the `--toc|--table-of-contents` option. They
728also make it easy to provide links from one section of a document to
729another. A link to this section, for example, might look like this:
732 [header identifiers](#header-identifiers-in-html).
734Note, however, that this method of providing links to sections works
737If the `--section-divs` option is specified, then each section will
738be wrapped in a `div` (or a `section`, if `--html5` was specified),
739and the identifier will be attached to the enclosing `<div>`
740(or `<section>`) tag rather than the header itself. This allows entire
741sections to be manipulated using javascript or treated differently in
748Markdown uses email conventions for quoting blocks of text.
749A block quotation is one or more paragraphs or other block elements
750(such as lists or headers), with each line preceded by a `>` character
751and a space. (The `>` need not start at the left margin, but it should
752not be indented more than three spaces.)
754 > This is a block quote. This
755 > paragraph has two lines.
757 > 1. This is a list inside a block quote.
760A "lazy" form, which requires the `>` character only on the first
761line of each block, is also allowed:
763 > This is a block quote. This
764 paragraph has two lines.
766 > 1. This is a list inside a block quote.
769Among the block elements that can be contained in a block quote are
770other block quotes. That is, block quotes can be nested:
772 > This is a block quote.
774 > > A block quote within a block quote.
776Standard markdown syntax does not require a blank line before a block
777quote. Pandoc does require this (except, of course, at the beginning of the
778document). The reason for the requirement is that it is all too easy for a
779`>` to end up at the beginning of a line by accident (perhaps through line
780wrapping). So, unless `--strict` is used, the following does not produce
781a nested block quote in pandoc:
783 > This is a block quote.
787Verbatim (code) blocks
788----------------------
790### Indented code blocks ###
792A block of text indented four spaces (or one tab) is treated as verbatim
793text: that is, special characters do not trigger special formatting,
794and all spaces and line breaks are preserved. For example,
797 moveShip(5 * gravity, DOWN);
800The initial (four space or one tab) indentation is not considered part
801of the verbatim text, and is removed in the output.
803Note: blank lines in the verbatim text need not begin with four spaces.
806### Delimited code blocks ###
810In addition to standard indented code blocks, Pandoc supports
811*delimited* code blocks. These begin with a row of three or more
812tildes (`~`) and end with a row of tildes that must be at least
813as long as the starting row. Everything between the tilde-lines
814is treated as code. No indentation is necessary:
818 moveShip(5 * gravity, DOWN);
822Like regular code blocks, delimited code blocks must be separated
823from surrounding text by blank lines.
825If the code itself contains a row of tildes, just use a longer
826row of tildes at the start and end:
830 code including tildes
834Optionally, you may specify the language of the code block using
837 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines}
839 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
840 qsort (filter (>= x) xs)
841 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
843Some output formats can use this information to do syntax highlighting.
844Currently, the only output format that uses this information is HTML.
845If highlighting is supported for your output format and language, then the
846code block above will appear highlighted, with numbered lines. (To see
847which languages are supported, do `pandoc --version`.) Otherwise, the
848code block above will appear as follows:
850 <pre class="haskell">
862A bullet list is a list of bulleted list items. A bulleted list
863item begins with a bullet (`*`, `+`, or `-`). Here is a simple
870This will produce a "compact" list. If you want a "loose" list, in which
871each item is formatted as a paragraph, put spaces between the items:
879The bullets need not be flush with the left margin; they may be
880indented one, two, or three spaces. The bullet must be followed
883List items look best if subsequent lines are flush with the first
884line (after the bullet):
890But markdown also allows a "lazy" format:
896### The four-space rule ###
898A list item may contain multiple paragraphs and other block-level
899content. However, subsequent paragraphs must be preceded by a blank line
900and indented four spaces or a tab. The list will look better if the first
901paragraph is aligned with the rest:
907 * Second paragraph. With a code block, which must be indented
912List items may include other lists. In this case the preceding blank
913line is optional. The nested list must be indented four spaces or
926As noted above, markdown allows you to write list items "lazily," instead of
927indenting continuation lines. However, if there are multiple paragraphs or
928other blocks in a list item, the first line of each must be indented.
933 + Another one; this looks
936 Second paragraph of second
939**Note:** Although the four-space rule for continuation paragraphs
940comes from the official [markdown syntax guide], the reference implementation,
941`Markdown.pl`, does not follow it. So pandoc will give different results than
942`Markdown.pl` when authors have indented continuation paragraphs fewer than
945The [markdown syntax guide] is not explicit whether the four-space
946rule applies to *all* block-level content in a list item; it only
947mentions paragraphs and code blocks. But it implies that the rule
948applies to all block-level content (including nested lists), and
949pandoc interprets it that way.
951 [markdown syntax guide]:
952 http://daringfireball.net/projects/markdown/syntax#list
956Ordered lists work just like bulleted lists, except that the items
957begin with enumerators rather than bullets.
959In standard markdown, enumerators are decimal numbers followed
960by a period and a space. The numbers themselves are ignored, so
961there is no difference between this list:
975Unlike standard markdown, Pandoc allows ordered list items to be marked
976with uppercase and lowercase letters and roman numerals, in addition to
977arabic numerals. List markers may be enclosed in parentheses or followed by a
978single right-parentheses or period. They must be separated from the
979text that follows by at least one space, and, if the list marker is a
980capital letter with a period, by at least two spaces.[^2]
982[^2]: The point of this rule is to ensure that normal paragraphs
983 starting with people's initials, like
985 B. Russell was an English philosopher.
987 do not get treated as list items.
989 This rule will not prevent
993 from being interpreted as a list item. In this case, a backslash
998Pandoc also pays attention to the type of list marker used, and to the
999starting number, and both of these are preserved where possible in the
1000output format. Thus, the following yields a list with numbers followed
1001by a single parenthesis, starting with 9, and a sublist with lowercase
1011Note that Pandoc pays attention only to the *starting* marker in a list.
1012So, the following yields a list numbered sequentially starting from 2:
1019If default list markers are desired, use `#.`:
1026### Definition lists ###
1030Pandoc supports definition lists, using a syntax inspired by
1031[PHP Markdown Extra] and [reStructuredText]:[^3]
1037 Term 2 with *inline markup*
1041 { some code, part of Definition 2 }
1043 Third paragraph of definition 2.
1045Each term must fit on one line, which may optionally be followed by
1046a blank line, and must be followed by one or more definitions.
1047A definition begins with a colon or tilde, which may be indented one
1048or two spaces. The body of the definition (including the first line,
1049aside from the colon or tilde) should be indented four spaces. A term may have
1050multiple definitions, and each definition may consist of one or more block
1051elements (paragraph, code block, list, etc.), each indented four spaces or one
1054If you leave space after the definition (as in the example above),
1055the blocks of the definitions will be considered paragraphs. In some
1056output formats, this will mean greater spacing between term/definition
1057pairs. For a compact definition list, do not leave space between the
1058definition and the next term:
1066[^3]: I have also been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1068[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1071### Numbered example lists ###
1075The special list marker `@` can be used for sequentially numbered
1076examples. The first list item with a `@` marker will be numbered '1',
1077the next '2', and so on, throughout the document. The numbered examples
1078need not occur in a single list; each new list using `@` will take up
1079where the last stopped. So, for example:
1081 (@) My first example will be numbered (1).
1082 (@) My second example will be numbered (2).
1084 Explanation of examples.
1086 (@) My third example will be numbered (3).
1088Numbered examples can be labeled and referred to elsewhere in the
1091 (@good) This is a good example.
1093 As (@good) illustrates, ...
1095The label can be any string of alphanumeric characters, underscores,
1099### Compact and loose lists ###
1101Pandoc behaves differently from `Markdown.pl` on some "edge
1102cases" involving lists. Consider this source:
1112Pandoc transforms this into a "compact list" (with no `<p>` tags around
1113"First", "Second", or "Third"), while markdown puts `<p>` tags around
1114"Second" and "Third" (but not "First"), because of the blank space
1115around "Third". Pandoc follows a simple rule: if the text is followed by
1116a blank line, it is treated as a paragraph. Since "Second" is followed
1117by a list, and not a blank line, it isn't treated as a paragraph. The
1118fact that the list is followed by a blank line is irrelevant. (Note:
1119Pandoc works this way even when the `--strict` option is specified. This
1120behavior is consistent with the official markdown syntax description,
1121even though it is different from that of `Markdown.pl`.)
1124### Ending a list ###
1126What if you want to put an indented code block after a list?
1133Trouble! Here pandoc (like other markdown implementations) will treat
1134`{ my code block }` as the second paragraph of item two, and not as
1137To "cut off" the list after item two, you can insert some non-indented
1138content, like an HTML comment, which won't produce visible output in
1144 <!-- end of list -->
1148You can use the same trick if you want two consecutive lists instead
1165A line containing a row of three or more `*`, `-`, or `_` characters
1166(optionally separated by spaces) produces a horizontal rule:
1178Three kinds of tables may be used. All three kinds presuppose the use of
1179a fixed-width font, such as Courier.
1181**Simple tables** look like this:
1183 Right Left Center Default
1184 ------- ------ ---------- -------
1189 Table: Demonstration of simple table syntax.
1191The headers and table rows must each fit on one line. Column
1192alignments are determined by the position of the header text relative
1193to the dashed line below it:[^4]
1195 - If the dashed line is flush with the header text on the right side
1196 but extends beyond it on the left, the column is right-aligned.
1197 - If the dashed line is flush with the header text on the left side
1198 but extends beyond it on the right, the column is left-aligned.
1199 - If the dashed line extends beyond the header text on both sides,
1200 the column is centered.
1201 - If the dashed line is flush with the header text on both sides,
1202 the default alignment is used (in most cases, this will be left).
1204[^4]: This scheme is due to Michel Fortin, who proposed it on the
1205 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1207The table must end with a blank line, or a line of dashes followed by
1208a blank line. A caption may optionally be provided (as illustrated in
1209the example above). A caption is a paragraph beginning with the string
1210`Table:` (or just `:`), which will be stripped off. It may appear either
1211before or after the table.
1213The column headers may be omitted, provided a dashed line is used
1214to end the table. For example:
1216 ------- ------ ---------- -------
1220 ------- ------ ---------- -------
1222When headers are omitted, column alignments are determined on the basis
1223of the first line of the table body. So, in the tables above, the columns
1224would be right, left, center, and right aligned, respectively.
1226**Multiline tables** allow headers and table rows to span multiple lines
1227of text (but cells that span multiple columns or rows of the table are
1228not supported). Here is an example:
1230 -------------------------------------------------------------
1231 Centered Default Right Left
1232 Header Aligned Aligned Aligned
1233 ----------- ------- --------------- -------------------------
1234 First row 12.0 Example of a row that
1235 spans multiple lines.
1237 Second row 5.0 Here's another one. Note
1238 the blank line between
1240 -------------------------------------------------------------
1242 Table: Here's the caption. It, too, may span
1245These work like simple tables, but with the following differences:
1247 - They must begin with a row of dashes, before the header text
1248 (unless the headers are omitted).
1249 - They must end with a row of dashes, then a blank line.
1250 - The rows must be separated by blank lines.
1252In multiline tables, the table parser pays attention to the widths of
1253the columns, and the writers try to reproduce these relative widths in
1254the output. So, if you find that one of the columns is too narrow in the
1255output, try widening it in the markdown source.
1257Headers may be omitted in multiline tables as well as simple tables:
1259 ----------- ------- --------------- -------------------------
1260 First row 12.0 Example of a row that
1261 spans multiple lines.
1263 Second row 5.0 Here's another one. Note
1264 the blank line between
1266 -------------------------------------------------------------
1268 : Here's a multiline table without headers.
1270It is possible for a multiline table to have just one row, but the row
1271should be followed by a blank line (and then the row of dashes that ends
1272the table), or the table may be interpreted as a simple table.
1274**Grid tables** look like this:
1276 : Sample grid table.
1278 +---------------+---------------+--------------------+
1279 | Fruit | Price | Advantages |
1280 +===============+===============+====================+
1281 | Bananas | $1.34 | - built-in wrapper |
1282 | | | - bright color |
1283 +---------------+---------------+--------------------+
1284 | Oranges | $2.10 | - cures scurvy |
1286 +---------------+---------------+--------------------+
1288The row of `=`s separates the header from the table body, and can be
1289omitted for a headerless table. The cells of grid tables may contain
1290arbitrary block elements (multiple paragraphs, code blocks, lists,
1291etc.). Alignments are not supported, nor are cells that span multiple
1292columns or rows. Grid tables can be created easily using [Emacs table mode].
1294 [Emacs table mode]: http://table.sourceforge.net/
1302If the file begins with a title block
1305 % author(s) (separated by semicolons)
1308it will be parsed as bibliographic information, not regular text. (It
1309will be used, for example, in the title of standalone LaTeX or HTML
1310output.) The block may contain just a title, a title and an author,
1311or all three elements. If you want to include an author but no
1312title, or a title and a date but no author, you need a blank line:
1321The title may occupy multiple lines, but continuation lines must
1322begin with leading space, thus:
1327If a document has multiple authors, the authors may be put on
1328separate lines with leading space, or separated by semicolons, or
1329both. So, all of the following are equivalent:
1334 % Author One; Author Two
1339The date must fit on one line.
1341All three metadata fields may contain standard inline formatting
1342(italics, links, footnotes, etc.).
1344Title blocks will always be parsed, but they will affect the output only
1345when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1346will appear twice: once in the document head -- this is the title that
1347will appear at the top of the window in a browser -- and once at the
1348beginning of the document body. The title in the document head can have
1349an optional prefix attached (`--title-prefix` or `-T` option). The title
1350in the body appears as an H1 element with class "title", so it can be
1351suppressed or reformatted with CSS. If a title prefix is specified with
1352`-T` and no title block appears in the document, the title prefix will
1353be used by itself as the HTML title.
1355The man page writer extracts a title, man page section number, and
1356other header and footer information from the title line. The title
1357is assumed to be the first word on the title line, which may optionally
1358end with a (single-digit) section number in parentheses. (There should
1359be no space between the title and the parentheses.) Anything after
1360this is assumed to be additional footer and header text. A single pipe
1361character (`|`) should be used to separate the footer text from the header
1366will yield a man page with the title `PANDOC` and section 1.
1368 % PANDOC(1) Pandoc User Manuals
1370will also have "Pandoc User Manuals" in the footer.
1372 % PANDOC(1) Pandoc User Manuals | Version 4.0
1374will also have "Version 4.0" in the header.
1380Except inside a code block or inline code, any punctuation or space
1381character preceded by a backslash will be treated literally, even if it
1382would normally indicate formatting. Thus, for example, if one writes
1392 <strong>hello</strong>
1394This rule is easier to remember than standard markdown's rule,
1395which allows only the following characters to be backslash-escaped:
1399(However, if the `--strict` option is supplied, the standard
1400markdown rule will be used.)
1402A backslash-escaped space is parsed as a nonbreaking space. It will
1403appear in TeX output as `~` and in HTML and XML as `\ ` or
1406A backslash-escaped newline (i.e. a backslash occurring at the end of
1407a line) is parsed as a hard line break. It will appear in TeX output as
1408`\\` and in HTML as `<br />`. This is a nice alternative to
1409markdown's "invisible" way of indicating hard line breaks using
1410two trailing spaces on a line.
1412Backslash escapes do not work in verbatim contexts.
1417If the `--smart` option is specified, pandoc will produce typographically
1418correct output, converting straight quotes to curly quotes, `---` and `--`
1419to Em-dashes, and `...` to ellipses. Nonbreaking spaces are inserted after
1420certain abbreviations, such as "Mr."
1422Note: if your LaTeX template uses the `csquotes` package, pandoc will
1423detect automatically this and use `\enquote{...}` for quoted text.
1430To *emphasize* some text, surround it with `*`s or `_`, like this:
1432 This text is _emphasized with underscores_, and this
1433 is *emphasized with asterisks*.
1435Double `*` or `_` produces **strong emphasis**:
1437 This is **strong emphasis** and __with underscores__.
1439A `*` or `_` character surrounded by spaces, or backslash-escaped,
1440will not trigger emphasis:
1442 This is * not emphasized *, and \*neither is this\*.
1444Because `_` is sometimes used inside words and identifiers,
1445pandoc does not interpret a `_` surrounded by alphanumeric
1446characters as an emphasis marker. If you want to emphasize
1447just part of a word, use `*`:
1449 feas*ible*, not feas*able*.
1456To strikeout a section of text with a horizontal line, begin and end it
1457with `~~`. Thus, for example,
1459 This ~~is deleted text.~~
1462### Superscripts and subscripts ###
1466Superscripts may be written by surrounding the superscripted text by `^`
1467characters; subscripts may be written by surrounding the subscripted
1468text by `~` characters. Thus, for example,
1470 H~2~O is a liquid. 2^10^ is 1024.
1472If the superscripted or subscripted text contains spaces, these spaces
1473must be escaped with backslashes. (This is to prevent accidental
1474superscripting and subscripting through the ordinary use of `~` and `^`.)
1475Thus, if you want the letter P with 'a cat' in subscripts, use
1476`P~a\ cat~`, not `P~a cat~`.
1481To make a short span of text verbatim, put it inside backticks:
1483 What is the difference between `>>=` and `>>`?
1485If the verbatim text includes a backtick, use double backticks:
1487 Here is a literal backtick `` ` ``.
1489(The spaces after the opening backticks and before the closing
1490backticks will be ignored.)
1492The general rule is that a verbatim span starts with a string
1493of consecutive backticks (optionally followed by a space)
1494and ends with a string of the same number of backticks (optionally
1495preceded by a space).
1497Note that backslash-escapes (and other markdown constructs) do not
1498work in verbatim contexts:
1500 This is a backslash followed by an asterisk: `\*`.
1508Anything between two `$` characters will be treated as TeX math. The
1509opening `$` must have a character immediately to its right, while the
1510closing `$` must have a character immediately to its left. Thus,
1511`$20,000 and $30,000` won't parse as math. If for some reason
1512you need to enclose text in literal `$` characters, backslash-escape
1513them and they won't be treated as math delimiters.
1515TeX math will be printed in all output formats. How it is rendered
1516depends on the output format:
1518Markdown, reStructuredText, LaTeX, Org-Mode, ConTeXt
1519 ~ It will appear verbatim between `$` characters.
1522 ~ It will be rendered using an interpreted text role `:math:`, as described
1523 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
1526 ~ It will be rendered as `latexmath:[...]`.
1529 ~ It will be rendered inside a `@math` command.
1532 ~ It will be rendered verbatim without `$`'s.
1535 ~ It will be rendered inside `<math>` tags.
1538 ~ It will be rendered inside `<span class="math">` tags.
1540RTF, DocBook, OpenDocument, ODT
1541 ~ It will be rendered, if possible, using unicode characters,
1542 and will otherwise appear verbatim.
1544HTML, Slidy, DZSlides, S5, EPUB
1545 ~ The way math is rendered in HTML will depend on the
1546 command-line options selected:
1548 1. The default is to render TeX math as far as possible using unicode
1549 characters, as with RTF, DocBook, and OpenDocument output. Formulas
1550 are put inside a `span` with `class="math"`, so that they may be
1551 styled differently from the surrounding text if needed.
1553 2. If the `--latexmathml` option is used, TeX math will be displayed
1554 between $ or $$ characters and put in `<span>` tags with class `LaTeX`.
1555 The [LaTeXMathML] script will be used to render it as formulas.
1556 (This trick does not work in all browsers, but it works in Firefox.
1557 In browsers that do not support LaTeXMathML, TeX math will appear
1558 verbatim between $ characters.)
1560 3. If the `--jsmath` option is used, TeX math will be put inside
1561 `<span>` tags (for inline math) or `<div>` tags (for display math)
1562 with class `math`. The [jsMath] script will be used to render
1565 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
1566 be called to generate images for each TeX formula. This should
1567 work in all browsers. The `--mimetex` option takes an optional URL
1568 as argument. If no URL is specified, it will be assumed that the
1569 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
1571 5. If the `--gladtex` option is used, TeX formulas will be enclosed
1572 in `<eq>` tags in the HTML output. The resulting `htex` file may then
1573 be processed by [gladTeX], which will produce image files for each
1574 formula and an `html` file with links to these images. So, the
1577 pandoc -s --gladtex myfile.txt -o myfile.htex
1578 gladtex -d myfile-images myfile.htex
1579 # produces myfile.html and images in myfile-images
1581 6. If the `--webtex` option is used, TeX formulas will be converted
1582 to `<img>` tags that link to an external script that converts
1583 formulas to images. The formula will be URL-encoded and concatenated
1584 with the URL provided. If no URL is specified, the Google Chart
1585 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
1591Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
1592(except verbatim contexts, where `<`, `>`, and `&` are interpreted
1595The raw HTML is passed through unchanged in HTML, S5, Slidy, DZSlides, EPUB,
1596Markdown, and Textile output, and suppressed in other formats.
1600Standard markdown allows you to include HTML "blocks": blocks
1601of HTML between balanced tags that are separated from the surrounding text
1602with blank lines, and start and end at the left margin. Within
1603these blocks, everything is interpreted as HTML, not markdown;
1604so (for example), `*` does not signify emphasis.
1606Pandoc behaves this way when `--strict` is specified; but by default,
1607pandoc interprets material between HTML block tags as markdown.
1608Thus, for example, Pandoc will turn
1613 <td>[a link](http://google.com)</td>
1621 <td><em>one</em></td>
1622 <td><a href="http://google.com">a link</a></td>
1626whereas `Markdown.pl` will preserve it as is.
1628There is one exception to this rule: text between `<script>` and
1629`<style>` tags is not interpreted as markdown.
1631This departure from standard markdown should make it easier to mix
1632markdown with HTML block elements. For example, one can surround
1633a block of markdown text with `<div>` tags without preventing it
1634from being interpreted as markdown.
1641In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
1642included in a document. Inline TeX commands will be preserved and passed
1643unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
1644LaTeX to include BibTeX citations:
1646 This result was proved in \cite{jones.1967}.
1648Note that in LaTeX environments, like
1650 \begin{tabular}{|l|l|}\hline
1651 Age & Frequency \\ \hline
1654 36--45 & 22 \\ \hline
1657the material between the begin and end tags will be interpreted as raw
1658LaTeX, not as markdown.
1660Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
1665For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
1666`\renewcommand` definitions and apply the resulting macros to all LaTeX
1667math. So, for example, the following will work in all output formats,
1670 \newcommand{\tuple}[1]{\langle #1 \rangle}
1674In LaTeX output, the `\newcommand` definition will simply be passed
1675unchanged to the output.
1681Markdown allows links to be specified in several ways.
1683### Automatic links ###
1685If you enclose a URL or email address in pointy brackets, it
1689 <sam@green.eggs.ham>
1694An inline link consists of the link text in square brackets,
1695followed by the URL in parentheses. (Optionally, the URL can
1696be followed by a link title, in quotes.)
1698 This is an [inline link](/url), and here's [one with
1699 a title](http://fsf.org "click here for a good time!").
1701There can be no space between the bracketed part and the parenthesized part.
1702The link text can contain formatting (such as emphasis), but the title cannot.
1705### Reference links ###
1707An *explicit* reference link has two parts, the link itself and the link
1708definition, which may occur elsewhere in the document (either
1709before or after the link).
1711The link consists of link text in square brackets, followed by a label in
1712square brackets. (There can be space between the two.) The link definition
1713must begin at the left margin or indented no more than three spaces. It
1714consists of the bracketed label, followed by a colon and a space, followed by
1715the URL, and optionally (after a space) a link title either in quotes or in
1718Here are some examples:
1720 [my label 1]: /foo/bar.html "My title, optional"
1722 [my label 3]: http://fsf.org (The free software foundation)
1723 [my label 4]: /bar#special 'A title in single quotes'
1725The URL may optionally be surrounded by angle brackets:
1727 [my label 5]: <http://foo.bar.baz>
1729The title may go on the next line:
1731 [my label 3]: http://fsf.org
1732 "The free software foundation"
1734Note that link labels are not case sensitive. So, this will work:
1736 Here is [my link][FOO]
1740In an *implicit* reference link, the second pair of brackets is
1741empty, or omitted entirely:
1743 See [my website][], or [my website].
1745 [my website]: http://foo.bar.baz
1751A link immediately preceded by a `!` will be treated as an image.
1752The link text will be used as the image's alt text:
1754 
1758 [movie reel]: movie.gif
1760### Pictures with captions ###
1764An image occurring by itself in a paragraph will be rendered as
1765a figure with a caption.[^5] (In LaTeX, a figure environment will be
1766used; in HTML, the image will be placed in a `div` with class
1767`figure`, together with a caption in a `p` with class `caption`.)
1768The image's alt text will be used as the caption.
1770 
1772[^5]: This feature is not yet implemented for RTF, OpenDocument, or
1773 ODT. In those formats, you'll just get an image in a paragraph by
1774 itself, with no caption.
1776If you just want a regular inline image, just make sure it is not
1777the only thing in the paragraph. One way to do this is to insert a
1778nonbreaking space after the image:
1780 \
1788Pandoc's markdown allows footnotes, using the following syntax:
1790 Here is a footnote reference,[^1] and another.[^longnote]
1792 [^1]: Here is the footnote.
1794 [^longnote]: Here's one with multiple blocks.
1796 Subsequent paragraphs are indented to show that they
1797 belong to the previous footnote.
1801 The whole paragraph can be indented, or just the first
1802 line. In this way, multi-paragraph footnotes work like
1803 multi-paragraph list items.
1805 This paragraph won't be part of the note, because it
1808The identifiers in footnote references may not contain spaces, tabs,
1809or newlines. These identifiers are used only to correlate the
1810footnote reference with the note itself; in the output, footnotes
1811will be numbered sequentially.
1813The footnotes themselves need not be placed at the end of the
1814document. They may appear anywhere except inside other block elements
1815(lists, block quotes, tables, etc.).
1817Inline footnotes are also allowed (though, unlike regular notes,
1818they cannot contain multiple paragraphs). The syntax is as follows:
1820 Here is an inline note.^[Inlines notes are easier to write, since
1821 you don't have to pick an identifier and move down to type the
1824Inline and regular footnotes may be mixed freely.
1832Pandoc can automatically generate citations and a bibliography in a number of
1833styles (using Andrea Rossato's `hs-citeproc`). In order to use this feature,
1834you will need a bibliographic database in one of the following formats:
1836 Format File extension
1837 ------------ --------------
1839 BibTeX/BibLaTeX .bib
1848You will need to specify the bibliography file using the `--bibliography`
1849command-line option (which may be repeated if you have several
1852By default, pandoc will use a Chicago author-date format for citations
1853and references. To use another style, you will need to use the
1854`--csl` option to specify a [CSL] 1.0 style file. A primer on
1855creating and modifying CSL styles can be found at
1856<http://citationstyles.org/downloads/primer.html>.
1857A repository of CSL styles can be found at
1858<https://github.com/citation-style-language/styles>.
1859See also <http://zotero.org/styles> for easy browsing.
1861Citations go inside square brackets and are separated by semicolons.
1862Each citation must have a key, composed of '@' + the citation
1863identifier from the database, and may optionally have a prefix,
1864a locator, and a suffix. Here are some examples:
1866 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
1868 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
1870 Blah blah [@smith04; @doe99].
1872A minus sign (`-`) before the `@` will suppress mention of
1873the author in the citation. This can be useful when the
1874author is already mentioned in the text:
1876 Smith says blah [-@smith04].
1878You can also write an in-text citation, as follows:
1882 @smith04 [p. 33] says blah.
1884If the style calls for a list of works cited, it will be placed
1885at the end of the document. Normally, you will want to end your
1886document with an appropriate header:
1892The bibliography will be inserted after this header.
1895Producing HTML slide shows with Pandoc
1896======================================
1898You can use Pandoc to produce an HTML + javascript slide presentation
1899that can be viewed via a web browser. There are three ways to do this,
1900using [S5], [DZSlides], or [Slidy].
1902Here's the markdown source for a simple slide show, `eating.txt`:
1918 --------------------------
1920 
1922To produce the slide show, simply type
1924 pandoc -w s5 -s eating.txt > eating.html
1928 pandoc -w slidy -s eating.txt > eating.html
1932 pandoc -w dzslides -s eating.txt > eating.html
1936A title page is constructed automatically from the document's title
1937block. Each level-one header and horizontal rule begins a new slide.
1939For Slidy and S5, the file produced by pandoc with the `-s/--standalone`
1940option embeds a link to javascripts and CSS files, which are assumed to
1941be available at the relative path `s5/default` (for S5) or at the Slidy
1942website at `w3.org` (for Slidy). (These paths can be changed by setting
1943the `slidy-url` or `s5-url` variables; see `--variable`, above.) For DZSlides,
1944the (relatively short) javascript and css are included in the file by default.
1946You can change the style of the slides by putting customized CSS files
1947in `$DATADIR/s5/default` (for S5) or `$DATADIR/slidy` (for Slidy),
1948where `$DATADIR` is the user data directory (see `--data-dir`, above).
1949The originals may be found in pandoc's system data directory (generally
1950`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
1951files it does not find in the user data directory.
1953The `--self-contained` option can be used to produce a single file that
1954contains all of the data necessary to display the slide show, including
1955linked scripts, stylesheets, images, and videos.
1960By default, these writers produces lists that display "all at once."
1961If you want your lists to display incrementally (one item at a time),
1962use the `-i` option. If you want a particular list to depart from the
1963default (that is, to display incrementally without the `-i` option and
1964all at once with the `-i` option), put it in a block quote:
1969In this way incremental and nonincremental lists can be mixed in
1972Literate Haskell support
1973========================
1975If you append `+lhs` to an appropriate input or output format (`markdown`,
1976`rst`, or `latex` for input or output; `html` for output only), pandoc
1977will treat the document as literate Haskell source. This means that
1979 - In markdown input, "bird track" sections will be parsed as Haskell
1980 code rather than block quotations. Text between `\begin{code}`
1981 and `\end{code}` will also be treated as Haskell code.
1983 - In markdown output, code blocks with class `haskell` will be
1984 rendered using bird tracks, and block quotations will be
1985 indented one space, so they will not be treated as Haskell code.
1986 In addition, headers will be rendered setext-style (with underlines)
1987 rather than atx-style (with '#' characters). (This is because ghc
1988 treats '#' characters in column 1 as introducing line numbers.)
1990 - In restructured text input, "bird track" sections will be parsed
1993 - In restructured text output, code blocks with class `haskell` will
1994 be rendered using bird tracks.
1996 - In LaTeX input, text in `code` environments will be parsed as
1999 - In LaTeX output, code blocks with class `haskell` will be rendered
2000 inside `code` environments.
2002 - In HTML output, code blocks with class `haskell` will be rendered
2003 with class `literatehaskell` and bird tracks.
2007 pandoc -f markdown+lhs -t html
2009reads literate Haskell source formatted with markdown conventions and writes
2010ordinary HTML (without bird tracks).
2012 pandoc -f markdown+lhs -t html+lhs
2014writes HTML with the Haskell code in bird tracks, so it can be copied
2015and pasted as literate Haskell source.
2020© 2006-2011 John MacFarlane (jgm at berkeley dot edu). Released under the
2021[GPL], version 2 or greater. This software carries no warranty of
2022any kind. (See COPYRIGHT for full copyright and warranty notices.)
2023Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
2024Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
2025Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
2026Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
2027Christopher Sawicki, Kelsey Hightower.
2029[markdown]: http://daringfireball.net/projects/markdown/
2030[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
2031[S5]: http://meyerweb.com/eric/tools/s5/
2032[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
2033[HTML]: http://www.w3.org/TR/html40/
2034[LaTeX]: http://www.latex-project.org/
2035[ConTeXt]: http://www.pragma-ade.nl/
2036[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
2037[DocBook XML]: http://www.docbook.org/
2038[OpenDocument XML]: http://opendocument.xml.org/
2039[ODT]: http://en.wikipedia.org/wiki/OpenDocument
2040[Textile]: http://redcloth.org/textile
2041[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
2042[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
2043[Haskell]: http://www.haskell.org/
2044[GNU Texinfo]: http://www.gnu.org/software/texinfo/
2045[Emacs Org-Mode]: http://orgmode.org
2046[AsciiDoc]: http://www.methods.co.nz/asciidoc/
2047[EPUB]: http://www.idpf.org/
2048[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
2049[DZSlides]: http://paulrouget.com/dzslides/
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