git.iko.soy/typeable/pandoc
on da507dc help sign in
3179 lines 113 kB history raw
1% Pandoc User's Guide
2% John MacFarlane
3% May 16, 2014
5Synopsis
6========
8pandoc [*options*] [*input-file*]...
10Description
11===========
13Pandoc is a [Haskell] library for converting from one markup format to
14another, and a command-line tool that uses this library. It can read
15[markdown] and (subsets of) [Textile], [reStructuredText], [HTML],
16[LaTeX], [MediaWiki markup], [Haddock markup], [OPML], [Emacs
17Org-mode], [DocBook], [txt2tags], [EPUB] and [Word docx]; and it can write plain text,
18[markdown], [reStructuredText], [XHTML], [HTML 5], [LaTeX] (including
19[beamer] slide shows), [ConTeXt], [RTF], [OPML], [DocBook],
20[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],
21[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3), [FictionBook2],
22[Textile], [groff man] pages, [Emacs Org-Mode], [AsciiDoc], [InDesign ICML],
23and [Slidy], [Slideous], [DZSlides], [reveal.js] or [S5] HTML slide shows.
24It can also produce [PDF] output on systems where LaTeX is installed.
26Pandoc's enhanced version of markdown includes syntax for footnotes,
27tables, flexible ordered lists, definition lists, fenced code blocks,
28superscript, subscript, strikeout, title blocks, automatic tables of
29contents, embedded LaTeX math, citations, and markdown inside HTML block
30elements. (These enhancements, described below under
31[Pandoc's markdown](#pandocs-markdown), can be disabled using the
32`markdown_strict` input or output format.)
34In contrast to most existing tools for converting markdown to HTML, which
35use regex substitutions, Pandoc has a modular design: it consists of a
36set of readers, which parse text in a given format and produce a native
37representation of the document, and a set of writers, which convert
38this native representation into a target format. Thus, adding an input
39or output format requires only adding a reader or writer.
41Using `pandoc`
42--------------
44If no *input-file* is specified, input is read from *stdin*.
45Otherwise, the *input-files* are concatenated (with a blank
46line between each) and used as input. Output goes to *stdout* by
47default (though output to *stdout* is disabled for the `odt`, `docx`,
48`epub`, and `epub3` output formats). For output to a file, use the
49`-o` option:
51 pandoc -o output.html input.txt
53Instead of a file, an absolute URI may be given. In this case
54pandoc will fetch the content using HTTP:
56 pandoc -f html -t markdown http://www.fsf.org
58If multiple input files are given, `pandoc` will concatenate them all (with
59blank lines between them) before parsing. This feature is disabled for
60 binary input formats such as `EPUB` and `docx`.
62The format of the input and output can be specified explicitly using
63command-line options. The input format can be specified using the
64`-r/--read` or `-f/--from` options, the output format using the
65`-w/--write` or `-t/--to` options. Thus, to convert `hello.txt` from
66markdown to LaTeX, you could type:
68 pandoc -f markdown -t latex hello.txt
70To convert `hello.html` from html to markdown:
72 pandoc -f html -t markdown hello.html
74Supported output formats are listed below under the `-t/--to` option.
75Supported input formats are listed below under the `-f/--from` option. Note
76that the `rst`, `textile`, `latex`, and `html` readers are not complete;
77there are some constructs that they do not parse.
79If the input or output format is not specified explicitly, `pandoc`
80will attempt to guess it from the extensions of
81the input and output filenames. Thus, for example,
83 pandoc -o hello.tex hello.txt
85will convert `hello.txt` from markdown to LaTeX. If no output file
86is specified (so that output goes to *stdout*), or if the output file's
87extension is unknown, the output format will default to HTML.
88If no input file is specified (so that input comes from *stdin*), or
89if the input files' extensions are unknown, the input format will
90be assumed to be markdown unless explicitly specified.
92Pandoc uses the UTF-8 character encoding for both input and output.
93If your local character encoding is not UTF-8, you
94should pipe input and output through `iconv`:
96 iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
98Creating a PDF
99--------------
101Earlier versions of pandoc came with a program, `markdown2pdf`, that
102used pandoc and pdflatex to produce a PDF. This is no longer needed,
103since `pandoc` can now produce `pdf` output itself. To produce a PDF, simply
104specify an output file with a `.pdf` extension. Pandoc will create a latex
105file and use pdflatex (or another engine, see `--latex-engine`) to convert it
106to PDF:
108 pandoc test.txt -o test.pdf
110Production of a PDF requires that a LaTeX engine be installed (see
111`--latex-engine`, below), and assumes that the following LaTeX packages are
112available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the
113`--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`,
114`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),
115`fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra`
116and `xunicode` (if `xelatex` is used).
118`hsmarkdown`
119------------
121A user who wants a drop-in replacement for `Markdown.pl` may create
122a symbolic link to the `pandoc` executable called `hsmarkdown`. When
123invoked under the name `hsmarkdown`, `pandoc` will behave as if
124invoked with `-f markdown_strict --email-obfuscation=references`,
125and all command-line options will be treated as regular arguments.
126However, this approach does not work under Cygwin, due to problems with
127its simulation of symbolic links.
129[Cygwin]: http://www.cygwin.com/
130[`iconv`]: http://www.gnu.org/software/libiconv/
131[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
132[TeX Live]: http://www.tug.org/texlive/
133[MacTeX]: http://www.tug.org/mactex/
135Options
136=======
138General options
139---------------
141`-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*
142: Specify input format. *FORMAT* can be `native` (native Haskell),
143 `json` (JSON version of native AST), `markdown` (pandoc's
144 extended markdown), `markdown_strict` (original unextended markdown),
145 `markdown_phpextra` (PHP Markdown Extra extended markdown),
146 `markdown_github` (github extended markdown),
147 `textile` (Textile), `rst` (reStructuredText), `html` (HTML),
148 `docbook` (DocBook), `t2t` (txt2tags), `docx` (docx), `epub` (EPUB),
149 `opml` (OPML), `org` (Emacs Org-mode), `mediawiki` (MediaWiki markup),
150 `haddock` (Haddock markup), or `latex` (LaTeX). If `+lhs` is appended
151 to `markdown`, `rst`,
152 `latex`, or `html`, the input will be treated as literate Haskell
153 source: see [Literate Haskell support](#literate-haskell-support),
154 below. Markdown syntax extensions can be individually enabled or
155 disabled by appending `+EXTENSION` or `-EXTENSION` to the format
156 name. So, for example, `markdown_strict+footnotes+definition_lists`
157 is strict markdown with footnotes and definition lists enabled,
158 and `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown
159 without pipe tables and with hard line breaks. See [Pandoc's
160 markdown](#pandocs-markdown), below, for a list of extensions and
161 their names.
163`-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*
164: Specify output format. *FORMAT* can be `native` (native Haskell),
165 `json` (JSON version of native AST), `plain` (plain text),
166 `markdown` (pandoc's extended markdown), `markdown_strict` (original
167 unextended markdown), `markdown_phpextra` (PHP Markdown extra
168 extended markdown), `markdown_github` (github extended markdown),
169 `rst` (reStructuredText), `html` (XHTML 1), `html5` (HTML 5),
170 `latex` (LaTeX), `beamer` (LaTeX beamer slide show),
171 `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),
172 `dokuwiki` (DokuWiki markup),
173 `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),
174 `opml` (OPML), `docbook` (DocBook), `opendocument` (OpenDocument), `odt`
175 (OpenOffice text document), `docx` (Word docx), `haddock` (Haddock
176 markup), `rtf` (rich text format), `epub` (EPUB v2 book), `epub3`
177 (EPUB v3), `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc),
178 `icml` (InDesign ICML), `slidy` (Slidy HTML and javascript slide show),
179 `slideous` (Slideous HTML and javascript slide show), `dzslides`
180 (DZSlides HTML5 + javascript slide show), `revealjs` (reveal.js
181 HTML5 + javascript slide show), `s5` (S5 HTML and javascript slide show),
182 or the path of a custom lua writer (see [Custom writers](#custom-writers),
183 below). Note that `odt`, `epub`, and `epub3` output will not be directed
184 to *stdout*; an output filename must be specified using the `-o/--output`
185 option. If `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,
186 `html`, or `html5`, the output will be rendered as literate Haskell
187 source: see [Literate Haskell support](#literate-haskell-support), below.
188 Markdown syntax extensions can be individually enabled or disabled by
189 appending `+EXTENSION` or `-EXTENSION` to the format name, as described
190 above under `-f`.
192`-o` *FILE*, `--output=`*FILE*
193: Write output to *FILE* instead of *stdout*. If *FILE* is
194 `-`, output will go to *stdout*. (Exception: if the output
195 format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)
197`--data-dir=`*DIRECTORY*
198: Specify the user data directory to search for pandoc data files.
199 If this option is not specified, the default user data directory
200 will be used. This is
202 $HOME/.pandoc
204 in unix,
206 C:\Documents And Settings\USERNAME\Application Data\pandoc
208 in Windows XP, and
210 C:\Users\USERNAME\AppData\Roaming\pandoc
212 in Windows 7. (You can find the default user data directory
213 on your system by looking at the output of `pandoc --version`.)
214 A `reference.odt`, `reference.docx`, `default.csl`,
215 `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory
216 placed in this directory will override pandoc's normal defaults.
218`-v`, `--version`
219: Print version.
221`-h`, `--help`
222: Show usage message.
224Reader options
225--------------
227`-R`, `--parse-raw`
228: Parse untranslatable HTML codes and LaTeX environments as raw HTML
229 or LaTeX, instead of ignoring them. Affects only HTML and LaTeX
230 input. Raw HTML can be printed in markdown, reStructuredText, HTML,
231 Slidy, Slideous, DZSlides, reveal.js, and S5 output; raw LaTeX
232 can be printed in markdown, reStructuredText, LaTeX, and ConTeXt output.
233 The default is for the readers to omit untranslatable HTML codes and
234 LaTeX environments. (The LaTeX reader does pass through untranslatable
235 LaTeX *commands*, even if `-R` is not specified.)
237`-S`, `--smart`
238: Produce typographically correct output, converting straight quotes
239 to curly quotes, `---` to em-dashes, `--` to en-dashes, and
240 `...` to ellipses. Nonbreaking spaces are inserted after certain
241 abbreviations, such as "Mr." (Note: This option is significant only when
242 the input format is `markdown`, `markdown_strict`, or `textile`. It
243 is selected automatically when the input format is `textile` or the
244 output format is `latex` or `context`, unless `--no-tex-ligatures`
245 is used.)
247`--old-dashes`
248: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
249 a numeral is an en-dash, and `--` is an em-dash. This option is selected
250 automatically for `textile` input.
252`--base-header-level=`*NUMBER*
253: Specify the base level for headers (defaults to 1).
255`--indented-code-classes=`*CLASSES*
256: Specify classes to use for indented code blocks--for example,
257 `perl,numberLines` or `haskell`. Multiple classes may be separated
258 by spaces or commas.
260`--default-image-extension=`*EXTENSION*
261: Specify a default extension to use when image paths/URLs have no
262 extension. This allows you to use the same source for formats that
263 require different kinds of images. Currently this option only affects
264 the markdown and LaTeX readers.
266`--filter=`*EXECUTABLE*
267: Specify an executable to be used as a filter transforming the
268 Pandoc AST after the input is parsed and before the output is
269 written. The executable should read JSON from stdin and write
270 JSON to stdout. The JSON must be formatted like pandoc's own
271 JSON input and output. The name of the output format will be
272 passed to the filter as the first argument. Hence,
274 pandoc --filter ./caps.py -t latex
276 is equivalent to
278 pandoc -t json | ./caps.py latex | pandoc -f json -t latex
280 The latter form may be useful for debugging filters.
282 Filters may be written in any language. `Text.Pandoc.JSON`
283 exports `toJSONFilter` to facilitate writing filters in Haskell.
284 Those who would prefer to write filters in python can use the
285 module `pandocfilters`, installable from PyPI. See
286 <http://github.com/jgm/pandocfilters> for the module and several
287 examples. Note that the *EXECUTABLE* will be sought in the user's
288 `PATH`, and not in the working directory, if no directory is
289 provided. If you want to run a script in the working directory,
290 preface the filename with `./`.
292`-M` *KEY[=VAL]*, `--metadata=`*KEY[:VAL]*
293: Set the metadata field *KEY* to the value *VAL*. A value specified
294 on the command line overrides a value specified in the document.
295 Values will be parsed as YAML boolean or string values. If no value is
296 specified, the value will be treated as Boolean true. Like
297 `--variable`, `--metadata` causes template variables to be set.
298 But unlike `--variable`, `--metadata` affects the metadata of the
299 underlying document (which is accessible from filters and may be
300 printed in some output formats).
302`--normalize`
303: Normalize the document after reading: merge adjacent
304 `Str` or `Emph` elements, for example, and remove repeated `Space`s.
306`-p`, `--preserve-tabs`
307: Preserve tabs instead of converting them to spaces (the default).
308 Note that this will only affect tabs in literal code spans and code
309 blocks; tabs in regular text will be treated as spaces.
311`--tab-stop=`*NUMBER*
312: Specify the number of spaces per tab (default is 4).
314`--track-changes=`*accept|reject|all*
315: Specifies what to do with insertions and deletions produced by the MS
316 Word "track-changes" feature. *accept* (the default), inserts all
317 insertions, and ignores all deletions. *reject* inserts all
318 deletions and ignores insertions. *all* puts in both insertions
319 and deletions, wrapped in spans with `insertion` and `deletion`
320 classes, respectively. The author and time of change is
321 included. *all* is useful for scripting: only accepting changes
322 from a certain reviewer, say, or before a certain date. This
323 option only affects the docx reader.
325`--extract-media=`*DIR*
326: Extract images and other media contained in a docx or epub container
327 to the path *DIR*, creating it if necessary, and adjust the images
328 references in the document so they point to the extracted files.
329 This option only affects the docx and epub readers.
331General writer options
332----------------------
334`-s`, `--standalone`
335: Produce output with an appropriate header and footer (e.g. a
336 standalone HTML, LaTeX, or RTF file, not a fragment). This option
337 is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`
338 output.
340`--template=`*FILE*
341: Use *FILE* as a custom template for the generated document. Implies
342 `--standalone`. See [Templates](#templates) below for a description
343 of template syntax. If no extension is specified, an extension
344 corresponding to the writer will be added, so that `--template=special`
345 looks for `special.html` for HTML output. If the template is not
346 found, pandoc will search for it in the user data directory
347 (see `--data-dir`). If this option is not used, a default
348 template appropriate for the output format will be used (see
349 `-D/--print-default-template`).
351`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*
352: Set the template variable *KEY* to the value *VAL* when rendering the
353 document in standalone mode. This is generally only useful when the
354 `--template` option is used to specify a custom template, since
355 pandoc automatically sets the variables used in the default
356 templates. If no *VAL* is specified, the key will be given the
357 value `true`.
359`-D` *FORMAT*, `--print-default-template=`*FORMAT*
360: Print the default template for an output *FORMAT*. (See `-t`
361 for a list of possible *FORMAT*s.)
363`--print-default-data-file=`*FILE*
364: Print a default data file.
366`--no-wrap`
367: Disable text wrapping in output. By default, text is wrapped
368 appropriately for the output format.
370`--columns`=*NUMBER*
371: Specify length of lines in characters (for text wrapping).
373`--toc`, `--table-of-contents`
374: Include an automatically generated table of contents (or, in
375 the case of `latex`, `context`, and `rst`, an instruction to create
376 one) in the output document. This option has no effect on `man`,
377 `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.
379`--toc-depth=`*NUMBER*
380: Specify the number of section levels to include in the table
381 of contents. The default is 3 (which means that level 1, 2, and 3
382 headers will be listed in the contents).
384`--no-highlight`
385: Disables syntax highlighting for code blocks and inlines, even when
386 a language attribute is given.
388`--highlight-style`=*STYLE*
389: Specifies the coloring style to be used in highlighted source code.
390 Options are `pygments` (the default), `kate`, `monochrome`,
391 `espresso`, `zenburn`, `haddock`, and `tango`.
393`-H` *FILE*, `--include-in-header=`*FILE*
394: Include contents of *FILE*, verbatim, at the end of the header.
395 This can be used, for example, to include special
396 CSS or javascript in HTML documents. This option can be used
397 repeatedly to include multiple files in the header. They will be
398 included in the order specified. Implies `--standalone`.
400`-B` *FILE*, `--include-before-body=`*FILE*
401: Include contents of *FILE*, verbatim, at the beginning of the
402 document body (e.g. after the `<body>` tag in HTML, or the
403 `\begin{document}` command in LaTeX). This can be used to include
404 navigation bars or banners in HTML documents. This option can be
405 used repeatedly to include multiple files. They will be included in
406 the order specified. Implies `--standalone`.
408`-A` *FILE*, `--include-after-body=`*FILE*
409: Include contents of *FILE*, verbatim, at the end of the document
410 body (before the `</body>` tag in HTML, or the
411 `\end{document}` command in LaTeX). This option can be be used
412 repeatedly to include multiple files. They will be included in the
413 order specified. Implies `--standalone`.
415Options affecting specific writers
416----------------------------------
418`--self-contained`
419: Produce a standalone HTML file with no external dependencies, using
420 `data:` URIs to incorporate the contents of linked scripts, stylesheets,
421 images, and videos. The resulting file should be "self-contained,"
422 in the sense that it needs no external files and no net access to be
423 displayed properly by a browser. This option works only with HTML output
424 formats, including `html`, `html5`, `html+lhs`, `html5+lhs`, `s5`,
425 `slidy`, `slideous`, `dzslides`, and `revealjs`. Scripts, images, and
426 stylesheets at absolute URLs will be downloaded; those at relative URLs
427 will be sought first relative to the working directory, then relative to
428 the user data directory (see `--data-dir`), and finally relative to
429 pandoc's default data directory. `--self-contained` does not
430 work with `--mathjax`.
432`--offline`
433: Deprecated synonym for `--self-contained`.
435`-5`, `--html5`
436: Produce HTML5 instead of HTML4. This option has no effect for writers
437 other than `html`. (*Deprecated:* Use the `html5` output format instead.)
439`--html-q-tags`
440: Use `<q>` tags for quotes in HTML.
442`--ascii`
443: Use only ascii characters in output. Currently supported only
444 for HTML output (which uses numerical entities instead of
445 UTF-8 when this option is selected).
447`--reference-links`
448: Use reference-style links, rather than inline links, in writing markdown
449 or reStructuredText. By default inline links are used.
451`--atx-headers`
452: Use ATX style headers in markdown and asciidoc output. The default is
453 to use setext-style headers for levels 1-2, and then ATX headers.
455`--chapters`
456: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
457 output. When the LaTeX template uses the report, book, or
458 memoir class, this option is implied. If `beamer` is the output
459 format, top-level headers will become `\part{..}`.
461`-N`, `--number-sections`
462: Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.
463 By default, sections are not numbered. Sections with class
464 `unnumbered` will never be numbered, even if `--number-sections`
465 is specified.
467`--number-offset`=*NUMBER[,NUMBER,...]*,
468: Offset for section headings in HTML output (ignored in other
469 output formats). The first number is added to the section number for
470 top-level headers, the second for second-level headers, and so on.
471 So, for example, if you want the first top-level header in your
472 document to be numbered "6", specify `--number-offset=5`.
473 If your document starts with a level-2 header which you want to
474 be numbered "1.5", specify `--number-offset=1,4`.
475 Offsets are 0 by default. Implies `--number-sections`.
477`--no-tex-ligatures`
478: Do not convert quotation marks, apostrophes, and dashes to
479 the TeX ligatures when writing LaTeX or ConTeXt. Instead, just
480 use literal unicode characters. This is needed for using advanced
481 OpenType features with XeLaTeX and LuaLaTeX. Note: normally
482 `--smart` is selected automatically for LaTeX and ConTeXt
483 output, but it must be specified explicitly if `--no-tex-ligatures`
484 is selected. If you use literal curly quotes, dashes, and ellipses
485 in your source, then you may want to use `--no-tex-ligatures`
486 without `--smart`.
488`--listings`
489: Use listings package for LaTeX code blocks
491`-i`, `--incremental`
492: Make list items in slide shows display incrementally (one by one).
493 The default is for lists to be displayed all at once.
495`--slide-level`=*NUMBER*
496: Specifies that headers with the specified level create
497 slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headers
498 above this level in the hierarchy are used to divide the
499 slide show into sections; headers below this level create
500 subheads within a slide. The default is to set the slide level
501 based on the contents of the document; see
502 [Structuring the slide show](#structuring-the-slide-show), below.
504`--section-divs`
505: Wrap sections in `<div>` tags (or `<section>` tags in HTML5),
506 and attach identifiers to the enclosing `<div>` (or `<section>`)
507 rather than the header itself.
508 See [Section identifiers](#header-identifiers-in-html-latex-and-context), below.
510`--email-obfuscation=`*none|javascript|references*
511: Specify a method for obfuscating `mailto:` links in HTML documents.
512 *none* leaves `mailto:` links as they are. *javascript* obfuscates
513 them using javascript. *references* obfuscates them by printing their
514 letters as decimal or hexadecimal character references.
516`--id-prefix`=*STRING*
517: Specify a prefix to be added to all automatically generated identifiers
518 in HTML and DocBook output, and to footnote numbers in markdown output.
519 This is useful for preventing duplicate identifiers when generating
520 fragments to be included in other pages.
522`-T` *STRING*, `--title-prefix=`*STRING*
523: Specify *STRING* as a prefix at the beginning of the title
524 that appears in the HTML header (but not in the title as it
525 appears at the beginning of the HTML body). Implies
526 `--standalone`.
528`-c` *URL*, `--css=`*URL*
529: Link to a CSS style sheet. This option can be be used repeatedly to
530 include multiple files. They will be included in the order specified.
532`--reference-odt=`*FILE*
533: Use the specified file as a style reference in producing an ODT.
534 For best results, the reference ODT should be a modified version
535 of an ODT produced using pandoc. The contents of the reference ODT
536 are ignored, but its stylesheets are used in the new ODT. If no
537 reference ODT is specified on the command line, pandoc will look
538 for a file `reference.odt` in the user data directory (see
539 `--data-dir`). If this is not found either, sensible defaults will be
540 used.
542`--reference-docx=`*FILE*
543: Use the specified file as a style reference in producing a docx file.
544 For best results, the reference docx should be a modified version
545 of a docx file produced using pandoc. The contents of the reference docx
546 are ignored, but its stylesheets and document properties (including
547 margins, page size, header, and footer) are used in the new docx. If no
548 reference docx is specified on the command line, pandoc will look
549 for a file `reference.docx` in the user data directory (see
550 `--data-dir`). If this is not found either, sensible defaults will be
551 used. The following styles are used by pandoc: [paragraph]
552 Normal, Compact, Title, Subtitle, Authors, Date, Abstract, Heading 1,
553 Heading 2, Heading 3, Heading 4, Heading 5, Block Quote, Definition Term,
554 Definition, Body Text, Table Caption, Image Caption; [character] Default
555 Paragraph Font, Body Text Char, Verbatim Char, Footnote Ref,
556 Link.
558`--epub-stylesheet=`*FILE*
559: Use the specified CSS file to style the EPUB. If no stylesheet
560 is specified, pandoc will look for a file `epub.css` in the
561 user data directory (see `--data-dir`). If it is not
562 found there, sensible defaults will be used.
564`--epub-cover-image=`*FILE*
565: Use the specified image as the EPUB cover. It is recommended
566 that the image be less than 1000px in width and height. Note that
567 in a markdown source document you can also specify `cover-image`
568 in a YAML metadata block (see [EPUB Metadata], below).
570`--epub-metadata=`*FILE*
571: Look in the specified XML file for metadata for the EPUB.
572 The file should contain a series of Dublin Core elements,
573 as documented at <http://dublincore.org/documents/dces/>.
574 For example:
576 <dc:rights>Creative Commons</dc:rights>
577 <dc:language>es-AR</dc:language>
579 By default, pandoc will include the following metadata elements:
580 `<dc:title>` (from the document title), `<dc:creator>` (from the
581 document authors), `<dc:date>` (from the document date, which should
582 be in [ISO 8601 format]), `<dc:language>` (from the `lang`
583 variable, or, if is not set, the locale), and `<dc:identifier
584 id="BookId">` (a randomly generated UUID). Any of these may be
585 overridden by elements in the metadata file.
587 Note: if the source document is markdown, a YAML metadata block
588 in the document can be used instead. See below under
589 [EPUB Metadata].
591`--epub-embed-font=`*FILE*
592: Embed the specified font in the EPUB. This option can be repeated
593 to embed multiple fonts. To use embedded fonts, you
594 will need to add declarations like the following to your CSS (see
595 `--epub-stylesheet`):
597 @font-face {
598 font-family: DejaVuSans;
599 font-style: normal;
600 font-weight: normal;
601 src:url("DejaVuSans-Regular.ttf");
602 }
603 @font-face {
604 font-family: DejaVuSans;
605 font-style: normal;
606 font-weight: bold;
607 src:url("DejaVuSans-Bold.ttf");
608 }
609 @font-face {
610 font-family: DejaVuSans;
611 font-style: italic;
612 font-weight: normal;
613 src:url("DejaVuSans-Oblique.ttf");
614 }
615 @font-face {
616 font-family: DejaVuSans;
617 font-style: italic;
618 font-weight: bold;
619 src:url("DejaVuSans-BoldOblique.ttf");
620 }
621 body { font-family: "DejaVuSans"; }
623`--epub-chapter-level=`*NUMBER*
624: Specify the header level at which to split the EPUB into separate
625 "chapter" files. The default is to split into chapters at level 1
626 headers. This option only affects the internal composition of the
627 EPUB, not the way chapters and sections are displayed to users. Some
628 readers may be slow if the chapter files are too large, so for large
629 documents with few level 1 headers, one might want to use a chapter
630 level of 2 or 3.
632`--latex-engine=`*pdflatex|lualatex|xelatex*
633: Use the specified LaTeX engine when producing PDF output.
634 The default is `pdflatex`. If the engine is not in your PATH,
635 the full path of the engine may be specified here.
637Citation rendering
638------------------
640`--bibliography=`*FILE*
641: Set the `bibliography` field in the document's metadata to *FILE*,
642 overriding any value set in the metadata, and process citations
643 using `pandoc-citeproc`. (This is equivalent to
644 `--metadata bibliography=FILE --filter pandoc-citeproc`.)
646`--csl=`*FILE*
647: Set the `csl` field in the document's metadata to *FILE*,
648 overriding any value set in the metadata. (This is equivalent to
649 `--metadata csl=FILE`.)
651`--citation-abbreviations=`*FILE*
652: Set the `citation-abbreviations` field in the document's metadata to
653 *FILE*, overriding any value set in the metadata. (This is equivalent to
654 `--metadata citation-abbreviations=FILE`.)
656`--natbib`
657: Use natbib for citations in LaTeX output. This option is not for use
658 with the `pandoc-citeproc` filter or with PDF output. It is intended for
659 use in producing a LaTeX file that can be processed with pdflatex and
660 bibtex.
662`--biblatex`
663: Use biblatex for citations in LaTeX output. This option is not for use
664 with the `pandoc-citeproc` filter or with PDF output. It is intended for
665 use in producing a LaTeX file that can be processed with pdflatex and
666 bibtex or biber.
668Math rendering in HTML
669----------------------
671`-m` [*URL*], `--latexmathml`[=*URL*]
672: Use the [LaTeXMathML] script to display embedded TeX math in HTML output.
673 To insert a link to a local copy of the `LaTeXMathML.js` script,
674 provide a *URL*. If no *URL* is provided, the contents of the
675 script will be inserted directly into the HTML header, preserving
676 portability at the price of efficiency. If you plan to use math on
677 several pages, it is much better to link to a copy of the script,
678 so it can be cached.
680`--mathml`[=*URL*]
681: Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).
682 In standalone `html` output, a small javascript (or a link to such a
683 script if a *URL* is supplied) will be inserted that allows the MathML to
684 be viewed on some browsers.
686`--jsmath`[=*URL*]
687: Use [jsMath] to display embedded TeX math in HTML output.
688 The *URL* should point to the jsMath load script (e.g.
689 `jsMath/easy/load.js`); if provided, it will be linked to in
690 the header of standalone HTML documents. If a *URL* is not provided,
691 no link to the jsMath load script will be inserted; it is then
692 up to the author to provide such a link in the HTML template.
694`--mathjax`[=*URL*]
695: Use [MathJax] to display embedded TeX math in HTML output.
696 The *URL* should point to the `MathJax.js` load script.
697 If a *URL* is not provided, a link to the MathJax CDN will
698 be inserted.
700`--gladtex`
701: Enclose TeX math in `<eq>` tags in HTML output. These can then
702 be processed by [gladTeX] to produce links to images of the typeset
703 formulas.
705`--mimetex`[=*URL*]
706: Render TeX math using the [mimeTeX] CGI script. If *URL* is not
707 specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`.
709`--webtex`[=*URL*]
710: Render TeX formulas using an external script that converts TeX
711 formulas to images. The formula will be concatenated with the URL
712 provided. If *URL* is not specified, the Google Chart API will be used.
714Options for wrapper scripts
715---------------------------
717`--dump-args`
718: Print information about command-line arguments to *stdout*, then exit.
719 This option is intended primarily for use in wrapper scripts.
720 The first line of output contains the name of the output file specified
721 with the `-o` option, or `-` (for *stdout*) if no output file was
722 specified. The remaining lines contain the command-line arguments,
723 one per line, in the order they appear. These do not include regular
724 Pandoc options and their arguments, but do include any options appearing
725 after a `--` separator at the end of the line.
727`--ignore-args`
728: Ignore command-line arguments (for use in wrapper scripts).
729 Regular Pandoc options are not ignored. Thus, for example,
731 pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
733 is equivalent to
735 pandoc -o foo.html -s
737[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
738[jsMath]: http://www.math.union.edu/~dpvc/jsmath/
739[MathJax]: http://www.mathjax.org/
740[gladTeX]: http://ans.hsh.no/home/mgg/gladtex/
741[mimeTeX]: http://www.forkosh.com/mimetex.html
742[CSL]: http://CitationStyles.org
744Templates
745=========
747When the `-s/--standalone` option is used, pandoc uses a template to
748add header and footer material that is needed for a self-standing
749document. To see the default template that is used, just type
751 pandoc -D FORMAT
753where `FORMAT` is the name of the output format. A custom template
754can be specified using the `--template` option. You can also override
755the system default templates for a given output format `FORMAT`
756by putting a file `templates/default.FORMAT` in the user data
757directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
758customize the `default.opendocument` template. For `pdf` output,
759customize the `default.latex` template.
761Templates may contain *variables*. Variable names are sequences of
762alphanumerics, `-`, and `_`, starting with a letter. A variable name
763surrounded by `$` signs will be replaced by its value. For example,
764the string `$title$` in
766 <title>$title$</title>
768will be replaced by the document title.
770To write a literal `$` in a template, use `$$`.
772Some variables are set automatically by pandoc. These vary somewhat
773depending on the output format, but include metadata fields (such
774as `title`, `author`, and `date`) as well as the following:
776`header-includes`
777: contents specified by `-H/--include-in-header` (may have multiple
778 values)
780`toc`
781: non-null value if `--toc/--table-of-contents` was specified
783`include-before`
784: contents specified by `-B/--include-before-body` (may have
785 multiple values)
787`include-after`
788: contents specified by `-A/--include-after-body` (may have
789 multiple values)
791`body`
792: body of document
794`lang`
795: language code for HTML or LaTeX documents
797`slidy-url`
798: base URL for Slidy documents (defaults to
799 `http://www.w3.org/Talks/Tools/Slidy2`)
801`slideous-url`
802: base URL for Slideous documents (defaults to `slideous`)
804`s5-url`
805: base URL for S5 documents (defaults to `s5/default`)
807`revealjs-url`
808: base URL for reveal.js documents (defaults to `reveal.js`)
810`theme`
811: reveal.js or LaTeX beamer theme
813`transition`
814: reveal.js transition
816`fontsize`
817: font size (10pt, 11pt, 12pt) for LaTeX documents
819`documentclass`
820: document class for LaTeX documents
822`classoption`
823: option for LaTeX documentclass, e.g. `oneside`; may be repeated
824 for multiple options
826`geometry`
827: options for LaTeX `geometry` class, e.g. `margin=1in`;
828 may be repeated for multiple options
830`linestretch`
831: adjusts line spacing (requires the `setspace` package)
833`fontfamily`
834: font package to use for LaTeX documents (with pdflatex):
835 TeXLive has `bookman` (Bookman), `utopia` or `fourier` (Utopia),
836 `fouriernc` (New Century Schoolbook), `times` or `txfonts` (Times),
837 `mathpazo` or `pxfonts` or `mathpple` (Palatino),
838 `libertine` (Linux Libertine), `arev` (Arev Sans),
839 and the default `lmodern`, among others.
841`mainfont`, `sansfont`, `monofont`, `mathfont`
842: fonts for LaTeX documents (works only with xelatex
843 and lualatex)
845`colortheme`
846: colortheme for LaTeX beamer documents
848`fonttheme`
849: fonttheme for LaTeX beamer documents
851`linkcolor`
852: color for internal links in LaTeX documents (`red`, `green`,
853 `magenta`, `cyan`, `blue`, `black`)
855`urlcolor`
856: color for external links in LaTeX documents
858`citecolor`
859: color for citation links in LaTeX documents
861`links-as-notes`
862: causes links to be printed as footnotes in LaTeX documents
864`toc`
865: include table of contents in LaTeX documents
867`toc-depth`
868: level of section to include in table of contents in LaTeX documents
870`lof`
871: include list of figures in LaTeX documents
873`lot`
874: include list of tables in LaTeX documents
876`biblio-style`
877: bibliography style in LaTeX, when used with `--natbib`
879`biblio-files`
880: bibliography files to use in LaTeX, with `--natbib` or `--biblatex`
882`section`
883: section number in man pages
885`header`
886: header in man pages
888`footer`
889: footer in man pages
891Variables may be set at the command line using the `-V/--variable`
892option. Variables set in this way override metadata fields with
893the same name.
895Templates may contain conditionals. The syntax is as follows:
897 $if(variable)$
898 X
899 $else$
900 Y
901 $endif$
903This will include `X` in the template if `variable` has a non-null
904value; otherwise it will include `Y`. `X` and `Y` are placeholders for
905any valid template text, and may include interpolated variables or other
906conditionals. The `$else$` section may be omitted.
908When variables can have multiple values (for example, `author` in
909a multi-author document), you can use the `$for$` keyword:
911 $for(author)$
912 <meta name="author" content="$author$" />
913 $endfor$
915You can optionally specify a separator to be used between
916consecutive items:
918 $for(author)$$author$$sep$, $endfor$
920A dot can be used to select a field of a variable that takes
921an object as its value. So, for example:
923 $author.name$ ($author.affiliation$)
925If you use custom templates, you may need to revise them as pandoc
926changes. We recommend tracking the changes in the default templates,
927and modifying your custom templates accordingly. An easy way to do this
928is to fork the pandoc-templates repository
929(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
930pandoc release.
932Pandoc's markdown
933=================
935Pandoc understands an extended and slightly revised version of
936John Gruber's [markdown] syntax. This document explains the syntax,
937noting differences from standard markdown. Except where noted, these
938differences can be suppressed by using the `markdown_strict` format instead
939of `markdown`. An extensions can be enabled by adding `+EXTENSION`
940to the format name and disabled by adding `-EXTENSION`. For example,
941`markdown_strict+footnotes` is strict markdown with footnotes
942enabled, while `markdown-footnotes-pipe_tables` is pandoc's
943markdown without footnotes or pipe tables.
945Philosophy
946----------
948Markdown is designed to be easy to write, and, even more importantly,
949easy to read:
951> A Markdown-formatted document should be publishable as-is, as plain
952> text, without looking like it's been marked up with tags or formatting
953> instructions.
954> -- [John Gruber](http://daringfireball.net/projects/markdown/syntax#philosophy)
956This principle has guided pandoc's decisions in finding syntax for
957tables, footnotes, and other extensions.
959There is, however, one respect in which pandoc's aims are different
960from the original aims of markdown. Whereas markdown was originally
961designed with HTML generation in mind, pandoc is designed for multiple
962output formats. Thus, while pandoc allows the embedding of raw HTML,
963it discourages it, and provides other, non-HTMLish ways of representing
964important document elements like definition lists, tables, mathematics, and
965footnotes.
967Paragraphs
968----------
970A paragraph is one or more lines of text followed by one or more blank line.
971Newlines are treated as spaces, so you can reflow your paragraphs as you like.
972If you need a hard line break, put two or more spaces at the end of a line.
974#### Extension: `escaped_line_breaks` ####
976A backslash followed by a newline is also a hard line break.
977Note: in multiline and grid table cells, this is the only way
978to create a hard line break, since trailing spaces in the cells
979are ignored.
981Headers
982-------
984There are two kinds of headers, Setext and atx.
986### Setext-style headers ###
988A setext-style header is a line of text "underlined" with a row of `=` signs
989(for a level one header) or `-` signs (for a level two header):
991 A level-one header
992 ==================
994 A level-two header
995 ------------------
997The header text can contain inline formatting, such as emphasis (see
998[Inline formatting](#inline-formatting), below).
1001### Atx-style headers ###
1003An Atx-style header consists of one to six `#` signs and a line of
1004text, optionally followed by any number of `#` signs. The number of
1005`#` signs at the beginning of the line is the header level:
1007 ## A level-two header
1009 ### A level-three header ###
1011As with setext-style headers, the header text can contain formatting:
1013 # A level-one header with a [link](/url) and *emphasis*
1015#### Extension: `blank_before_header` ####
1017Standard markdown syntax does not require a blank line before a header.
1018Pandoc does require this (except, of course, at the beginning of the
1019document). The reason for the requirement is that it is all too easy for a
1020`#` to end up at the beginning of a line by accident (perhaps through line
1021wrapping). Consider, for example:
1023 I like several of their flavors of ice cream:
1024 #22, for example, and #5.
1027### Header identifiers in HTML, LaTeX, and ConTeXt ###
1029#### Extension: `header_attributes` ####
1031Headers can be assigned attributes using this syntax at the end
1032of the line containing the header text:
1034 {#identifier .class .class key=value key=value}
1036Thus, for example, the following headers will all be assigned the identifier
1037`foo`:
1039 # My header {#foo}
1041 ## My header ## {#foo}
1043 My other header {#foo}
1044 ---------------
1046(This syntax is compatible with [PHP Markdown Extra].)
1048Note that although this syntax allows assignment of classes and key/value
1049attributes, writers generally don't use all of this information. Identifiers,
1050classes, and key/value attributes are used in HTML and HTML-based formats such
1051as EPUB and slidy. Identifiers are used for labels and link anchors in the
1052LaTeX, ConTeXt, Textile, and AsciiDoc writers.
1054Headers with the class `unnumbered` will not be numbered, even if
1055`--number-sections` is specified. A single hyphen (`-`) in an attribute
1056context is equivalent to `.unnumbered`, and preferable in non-English
1057documents. So,
1059 # My header {-}
1061is just the same as
1063 # My header {.unnumbered}
1065#### Extension: `auto_identifiers` ####
1067A header without an explicitly specified identifier will be
1068automatically assigned a unique identifier based on the header text.
1069To derive the identifier from the header text,
1071 - Remove all formatting, links, etc.
1072 - Remove all footnotes.
1073 - Remove all punctuation, except underscores, hyphens, and periods.
1074 - Replace all spaces and newlines with hyphens.
1075 - Convert all alphabetic characters to lowercase.
1076 - Remove everything up to the first letter (identifiers may
1077 not begin with a number or punctuation mark).
1078 - If nothing is left after this, use the identifier `section`.
1080Thus, for example,
1082 Header Identifier
1083 ------------------------------- ----------------------------
1084 Header identifiers in HTML `header-identifiers-in-html`
1085 *Dogs*?--in *my* house? `dogs--in-my-house`
1086 [HTML], [S5], or [RTF]? `html-s5-or-rtf`
1087 3. Applications `applications`
1088 33 `section`
1090These rules should, in most cases, allow one to determine the identifier
1091from the header text. The exception is when several headers have the
1092same text; in this case, the first will get an identifier as described
1093above; the second will get the same identifier with `-1` appended; the
1094third with `-2`; and so on.
1096These identifiers are used to provide link targets in the table of
1097contents generated by the `--toc|--table-of-contents` option. They
1098also make it easy to provide links from one section of a document to
1099another. A link to this section, for example, might look like this:
1101 See the section on
1102 [header identifiers](#header-identifiers-in-html-latex-and-context).
1104Note, however, that this method of providing links to sections works
1105only in HTML, LaTeX, and ConTeXt formats.
1107If the `--section-divs` option is specified, then each section will
1108be wrapped in a `div` (or a `section`, if `--html5` was specified),
1109and the identifier will be attached to the enclosing `<div>`
1110(or `<section>`) tag rather than the header itself. This allows entire
1111sections to be manipulated using javascript or treated differently in
1112CSS.
1114#### Extension: `implicit_header_references` ####
1116Pandoc behaves as if reference links have been defined for each header.
1117So, instead of
1119 [header identifiers](#header-identifiers-in-html)
1121you can simply write
1123 [header identifiers]
1127 [header identifiers][]
1131 [the section on header identifiers][header identifiers]
1133If there are multiple headers with identical text, the corresponding
1134reference will link to the first one only, and you will need to use explicit
1135links to link to the others, as described above.
1137Unlike regular reference links, these references are case-sensitive.
1139Note: if you have defined an explicit identifier for a header,
1140then implicit references to it will not work.
1142Block quotations
1143----------------
1145Markdown uses email conventions for quoting blocks of text.
1146A block quotation is one or more paragraphs or other block elements
1147(such as lists or headers), with each line preceded by a `>` character
1148and a space. (The `>` need not start at the left margin, but it should
1149not be indented more than three spaces.)
1151 > This is a block quote. This
1152 > paragraph has two lines.
1154 > 1. This is a list inside a block quote.
1155 > 2. Second item.
1157A "lazy" form, which requires the `>` character only on the first
1158line of each block, is also allowed:
1160 > This is a block quote. This
1161 paragraph has two lines.
1163 > 1. This is a list inside a block quote.
1164 2. Second item.
1166Among the block elements that can be contained in a block quote are
1167other block quotes. That is, block quotes can be nested:
1169 > This is a block quote.
1171 > > A block quote within a block quote.
1173#### Extension: `blank_before_blockquote` ####
1175Standard markdown syntax does not require a blank line before a block
1176quote. Pandoc does require this (except, of course, at the beginning of the
1177document). The reason for the requirement is that it is all too easy for a
1178`>` to end up at the beginning of a line by accident (perhaps through line
1179wrapping). So, unless the `markdown_strict` format is used, the following does
1180not produce a nested block quote in pandoc:
1182 > This is a block quote.
1183 >> Nested.
1186Verbatim (code) blocks
1187----------------------
1189### Indented code blocks ###
1191A block of text indented four spaces (or one tab) is treated as verbatim
1192text: that is, special characters do not trigger special formatting,
1193and all spaces and line breaks are preserved. For example,
1195 if (a > 3) {
1196 moveShip(5 * gravity, DOWN);
1199The initial (four space or one tab) indentation is not considered part
1200of the verbatim text, and is removed in the output.
1202Note: blank lines in the verbatim text need not begin with four spaces.
1205### Fenced code blocks ###
1207#### Extension: `fenced_code_blocks` ####
1209In addition to standard indented code blocks, Pandoc supports
1210*fenced* code blocks. These begin with a row of three or more
1211tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or
1212backticks that must be at least as long as the starting row. Everything
1213between these lines is treated as code. No indentation is necessary:
1215 ~~~~~~~
1216 if (a > 3) {
1217 moveShip(5 * gravity, DOWN);
1219 ~~~~~~~
1221Like regular code blocks, fenced code blocks must be separated
1222from surrounding text by blank lines.
1224If the code itself contains a row of tildes or backticks, just use a longer
1225row of tildes or backticks at the start and end:
1227 ~~~~~~~~~~~~~~~~
1228 ~~~~~~~~~~
1229 code including tildes
1230 ~~~~~~~~~~
1231 ~~~~~~~~~~~~~~~~
1233#### Extension: `fenced_code_attributes` ####
1235Optionally, you may attach attributes to the code block using
1236this syntax:
1238 ~~~~ {#mycode .haskell .numberLines startFrom="100"}
1239 qsort [] = []
1240 qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
1241 qsort (filter (>= x) xs)
1242 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1244Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
1245`startFrom` is an attribute with value `100`. Some output formats can use this
1246information to do syntax highlighting. Currently, the only output formats
1247that uses this information are HTML and LaTeX. If highlighting is supported
1248for your output format and language, then the code block above will appear
1249highlighted, with numbered lines. (To see which languages are supported, do
1250`pandoc --version`.) Otherwise, the code block above will appear as follows:
1252 <pre id="mycode" class="haskell numberLines" startFrom="100">
1253 <code>
1254 ...
1255 </code>
1256 </pre>
1258A shortcut form can also be used for specifying the language of
1259the code block:
1261 ```haskell
1262 qsort [] = []
1263 ```
1265This is equivalent to:
1267 ``` {.haskell}
1268 qsort [] = []
1269 ```
1271If the `fenced_code_attributes` extension is disabled, but
1272input contains class attribute(s) for the codeblock, the first
1273class attribute will be printed after the opening fence as a bare
1274word.
1276To prevent all highlighting, use the `--no-highlight` flag.
1277To set the highlighting style, use `--highlight-style`.
1279Line blocks
1280-----------
1282#### Extension: `line_blocks` ####
1284A line block is a sequence of lines beginning with a vertical bar (`|`)
1285followed by a space. The division into lines will be preserved in
1286the output, as will any leading spaces; otherwise, the lines will
1287be formatted as markdown. This is useful for verse and addresses:
1289 | The limerick packs laughs anatomical
1290 | In space that is quite economical.
1291 | But the good ones I've seen
1292 | So seldom are clean
1293 | And the clean ones so seldom are comical
1295 | 200 Main St.
1296 | Berkeley, CA 94718
1298The lines can be hard-wrapped if needed, but the continuation
1299line must begin with a space.
1301 | The Right Honorable Most Venerable and Righteous Samuel L.
1302 Constable, Jr.
1303 | 200 Main St.
1304 | Berkeley, CA 94718
1306This syntax is borrowed from [reStructuredText].
1308Lists
1309-----
1311### Bullet lists ###
1313A bullet list is a list of bulleted list items. A bulleted list
1314item begins with a bullet (`*`, `+`, or `-`). Here is a simple
1315example:
1317 * one
1318 * two
1319 * three
1321This will produce a "compact" list. If you want a "loose" list, in which
1322each item is formatted as a paragraph, put spaces between the items:
1324 * one
1326 * two
1328 * three
1330The bullets need not be flush with the left margin; they may be
1331indented one, two, or three spaces. The bullet must be followed
1332by whitespace.
1334List items look best if subsequent lines are flush with the first
1335line (after the bullet):
1337 * here is my first
1338 list item.
1339 * and my second.
1341But markdown also allows a "lazy" format:
1343 * here is my first
1344 list item.
1345 * and my second.
1347### The four-space rule ###
1349A list item may contain multiple paragraphs and other block-level
1350content. However, subsequent paragraphs must be preceded by a blank line
1351and indented four spaces or a tab. The list will look better if the first
1352paragraph is aligned with the rest:
1354 * First paragraph.
1356 Continued.
1358 * Second paragraph. With a code block, which must be indented
1359 eight spaces:
1361 { code }
1363List items may include other lists. In this case the preceding blank
1364line is optional. The nested list must be indented four spaces or
1365one tab:
1367 * fruits
1368 + apples
1369 - macintosh
1370 - red delicious
1371 + pears
1372 + peaches
1373 * vegetables
1374 + broccoli
1375 + chard
1377As noted above, markdown allows you to write list items "lazily," instead of
1378indenting continuation lines. However, if there are multiple paragraphs or
1379other blocks in a list item, the first line of each must be indented.
1381 + A lazy, lazy, list
1382 item.
1384 + Another one; this looks
1385 bad but is legal.
1387 Second paragraph of second
1388 list item.
1390**Note:** Although the four-space rule for continuation paragraphs
1391comes from the official [markdown syntax guide], the reference implementation,
1392`Markdown.pl`, does not follow it. So pandoc will give different results than
1393`Markdown.pl` when authors have indented continuation paragraphs fewer than
1394four spaces.
1396The [markdown syntax guide] is not explicit whether the four-space
1397rule applies to *all* block-level content in a list item; it only
1398mentions paragraphs and code blocks. But it implies that the rule
1399applies to all block-level content (including nested lists), and
1400pandoc interprets it that way.
1402 [markdown syntax guide]:
1403 http://daringfireball.net/projects/markdown/syntax#list
1405### Ordered lists ###
1407Ordered lists work just like bulleted lists, except that the items
1408begin with enumerators rather than bullets.
1410In standard markdown, enumerators are decimal numbers followed
1411by a period and a space. The numbers themselves are ignored, so
1412there is no difference between this list:
1414 1. one
1415 2. two
1416 3. three
1418and this one:
1420 5. one
1421 7. two
1422 1. three
1424#### Extension: `fancy_lists` ####
1426Unlike standard markdown, Pandoc allows ordered list items to be marked
1427with uppercase and lowercase letters and roman numerals, in addition to
1428arabic numerals. List markers may be enclosed in parentheses or followed by a
1429single right-parentheses or period. They must be separated from the
1430text that follows by at least one space, and, if the list marker is a
1431capital letter with a period, by at least two spaces.[^2]
1433[^2]: The point of this rule is to ensure that normal paragraphs
1434 starting with people's initials, like
1436 B. Russell was an English philosopher.
1438 do not get treated as list items.
1440 This rule will not prevent
1442 (C) 2007 Joe Smith
1444 from being interpreted as a list item. In this case, a backslash
1445 escape can be used:
1447 (C\) 2007 Joe Smith
1449The `fancy_lists` extension also allows '`#`' to be used as an
1450ordered list marker in place of a numeral:
1452 #. one
1453 #. two
1455#### Extension: `startnum` ####
1457Pandoc also pays attention to the type of list marker used, and to the
1458starting number, and both of these are preserved where possible in the
1459output format. Thus, the following yields a list with numbers followed
1460by a single parenthesis, starting with 9, and a sublist with lowercase
1461roman numerals:
1463 9) Ninth
1464 10) Tenth
1465 11) Eleventh
1466 i. subone
1467 ii. subtwo
1468 iii. subthree
1470Pandoc will start a new list each time a different type of list
1471marker is used. So, the following will create three lists:
1473 (2) Two
1474 (5) Three
1475 1. Four
1476 * Five
1478If default list markers are desired, use `#.`:
1480 #. one
1481 #. two
1482 #. three
1485### Definition lists ###
1487#### Extension: `definition_lists` ####
1489Pandoc supports definition lists, using the syntax of
1490[PHP Markdown Extra] with some extensions.[^3]
1492 Term 1
1494 : Definition 1
1496 Term 2 with *inline markup*
1498 : Definition 2
1500 { some code, part of Definition 2 }
1502 Third paragraph of definition 2.
1504Each term must fit on one line, which may optionally be followed by
1505a blank line, and must be followed by one or more definitions.
1506A definition begins with a colon or tilde, which may be indented one
1507or two spaces.
1509A term may have multiple definitions, and each definition may consist of one or
1510more block elements (paragraph, code block, list, etc.), each indented four
1511spaces or one tab stop. The body of the definition (including the first line,
1512aside from the colon or tilde) should be indented four spaces. However,
1513as with other markdown lists, you can "lazily" omit indentation except
1514at the beginning of a paragraph or other block element:
1516 Term 1
1518 : Definition
1519 with lazy continuation.
1521 Second paragraph of the definition.
1523If you leave space before the definition (as in the example above),
1524the text of the definition will be treated as a paragraph. In some
1525output formats, this will mean greater spacing between term/definition
1526pairs. For a more compact definition list, omit the space before the
1527definition:
1529 Term 1
1530 ~ Definition 1
1532 Term 2
1533 ~ Definition 2a
1534 ~ Definition 2b
1536Note that space between items in a definition list is required.
1537(A variant that loosens this requirement, but disallows "lazy"
1538hard wrapping, can be activated with `compact_definition_lists`: see
1539[Non-pandoc extensions](#non-pandoc-extensions), below.)
1541[^3]: I have been influenced by the suggestions of [David Wheeler](http://www.justatheory.com/computers/markup/modest-markdown-proposal.html).
1543[PHP Markdown Extra]: http://www.michelf.com/projects/php-markdown/extra/
1546### Numbered example lists ###
1548#### Extension: `example_lists` ####
1550The special list marker `@` can be used for sequentially numbered
1551examples. The first list item with a `@` marker will be numbered '1',
1552the next '2', and so on, throughout the document. The numbered examples
1553need not occur in a single list; each new list using `@` will take up
1554where the last stopped. So, for example:
1556 (@) My first example will be numbered (1).
1557 (@) My second example will be numbered (2).
1559 Explanation of examples.
1561 (@) My third example will be numbered (3).
1563Numbered examples can be labeled and referred to elsewhere in the
1564document:
1566 (@good) This is a good example.
1568 As (@good) illustrates, ...
1570The label can be any string of alphanumeric characters, underscores,
1571or hyphens.
1574### Compact and loose lists ###
1576Pandoc behaves differently from `Markdown.pl` on some "edge
1577cases" involving lists. Consider this source:
1579 + First
1580 + Second:
1581 - Fee
1582 - Fie
1583 - Foe
1585 + Third
1587Pandoc transforms this into a "compact list" (with no `<p>` tags around
1588"First", "Second", or "Third"), while markdown puts `<p>` tags around
1589"Second" and "Third" (but not "First"), because of the blank space
1590around "Third". Pandoc follows a simple rule: if the text is followed by
1591a blank line, it is treated as a paragraph. Since "Second" is followed
1592by a list, and not a blank line, it isn't treated as a paragraph. The
1593fact that the list is followed by a blank line is irrelevant. (Note:
1594Pandoc works this way even when the `markdown_strict` format is specified. This
1595behavior is consistent with the official markdown syntax description,
1596even though it is different from that of `Markdown.pl`.)
1599### Ending a list ###
1601What if you want to put an indented code block after a list?
1603 - item one
1604 - item two
1606 { my code block }
1608Trouble! Here pandoc (like other markdown implementations) will treat
1609`{ my code block }` as the second paragraph of item two, and not as
1610a code block.
1612To "cut off" the list after item two, you can insert some non-indented
1613content, like an HTML comment, which won't produce visible output in
1614any format:
1616 - item one
1617 - item two
1619 <!-- end of list -->
1621 { my code block }
1623You can use the same trick if you want two consecutive lists instead
1624of one big list:
1626 1. one
1627 2. two
1628 3. three
1630 <!-- -->
1632 1. uno
1633 2. dos
1634 3. tres
1636Horizontal rules
1637----------------
1639A line containing a row of three or more `*`, `-`, or `_` characters
1640(optionally separated by spaces) produces a horizontal rule:
1642 * * * *
1644 ---------------
1647Tables
1648------
1650Four kinds of tables may be used. The first three kinds presuppose the use of
1651a fixed-width font, such as Courier. The fourth kind can be used with
1652proportionally spaced fonts, as it does not require lining up columns.
1654#### Extension: `table_captions` ####
1656A caption may optionally be provided with all 4 kinds of tables (as
1657illustrated in the examples below). A caption is a paragraph beginning
1658with the string `Table:` (or just `:`), which will be stripped off.
1659It may appear either before or after the table.
1661#### Extension: `simple_tables` ####
1663Simple tables look like this:
1665 Right Left Center Default
1666 ------- ------ ---------- -------
1667 12 12 12 12
1668 123 123 123 123
1669 1 1 1 1
1671 Table: Demonstration of simple table syntax.
1673The headers and table rows must each fit on one line. Column
1674alignments are determined by the position of the header text relative
1675to the dashed line below it:[^4]
1677 - If the dashed line is flush with the header text on the right side
1678 but extends beyond it on the left, the column is right-aligned.
1679 - If the dashed line is flush with the header text on the left side
1680 but extends beyond it on the right, the column is left-aligned.
1681 - If the dashed line extends beyond the header text on both sides,
1682 the column is centered.
1683 - If the dashed line is flush with the header text on both sides,
1684 the default alignment is used (in most cases, this will be left).
1686[^4]: This scheme is due to Michel Fortin, who proposed it on the
1687 [Markdown discussion list](http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html).
1689The table must end with a blank line, or a line of dashes followed by
1690a blank line.
1692The column headers may be omitted, provided a dashed line is used
1693to end the table. For example:
1695 ------- ------ ---------- -------
1696 12 12 12 12
1697 123 123 123 123
1698 1 1 1 1
1699 ------- ------ ---------- -------
1701When headers are omitted, column alignments are determined on the basis
1702of the first line of the table body. So, in the tables above, the columns
1703would be right, left, center, and right aligned, respectively.
1705#### Extension: `multiline_tables` ####
1707Multiline tables allow headers and table rows to span multiple lines
1708of text (but cells that span multiple columns or rows of the table are
1709not supported). Here is an example:
1711 -------------------------------------------------------------
1712 Centered Default Right Left
1713 Header Aligned Aligned Aligned
1714 ----------- ------- --------------- -------------------------
1715 First row 12.0 Example of a row that
1716 spans multiple lines.
1718 Second row 5.0 Here's another one. Note
1719 the blank line between
1720 rows.
1721 -------------------------------------------------------------
1723 Table: Here's the caption. It, too, may span
1724 multiple lines.
1726These work like simple tables, but with the following differences:
1728 - They must begin with a row of dashes, before the header text
1729 (unless the headers are omitted).
1730 - They must end with a row of dashes, then a blank line.
1731 - The rows must be separated by blank lines.
1733In multiline tables, the table parser pays attention to the widths of
1734the columns, and the writers try to reproduce these relative widths in
1735the output. So, if you find that one of the columns is too narrow in the
1736output, try widening it in the markdown source.
1738Headers may be omitted in multiline tables as well as simple tables:
1740 ----------- ------- --------------- -------------------------
1741 First row 12.0 Example of a row that
1742 spans multiple lines.
1744 Second row 5.0 Here's another one. Note
1745 the blank line between
1746 rows.
1747 ----------- ------- --------------- -------------------------
1749 : Here's a multiline table without headers.
1751It is possible for a multiline table to have just one row, but the row
1752should be followed by a blank line (and then the row of dashes that ends
1753the table), or the table may be interpreted as a simple table.
1755#### Extension: `grid_tables` ####
1757Grid tables look like this:
1759 : Sample grid table.
1761 +---------------+---------------+--------------------+
1762 | Fruit | Price | Advantages |
1763 +===============+===============+====================+
1764 | Bananas | $1.34 | - built-in wrapper |
1765 | | | - bright color |
1766 +---------------+---------------+--------------------+
1767 | Oranges | $2.10 | - cures scurvy |
1768 | | | - tasty |
1769 +---------------+---------------+--------------------+
1771The row of `=`s separates the header from the table body, and can be
1772omitted for a headerless table. The cells of grid tables may contain
1773arbitrary block elements (multiple paragraphs, code blocks, lists,
1774etc.). Alignments are not supported, nor are cells that span multiple
1775columns or rows. Grid tables can be created easily using [Emacs table mode].
1777 [Emacs table mode]: http://table.sourceforge.net/
1779#### Extension: `pipe_tables` ####
1781Pipe tables look like this:
1783 | Right | Left | Default | Center |
1784 |------:|:-----|---------|:------:|
1785 | 12 | 12 | 12 | 12 |
1786 | 123 | 123 | 123 | 123 |
1787 | 1 | 1 | 1 | 1 |
1789 : Demonstration of pipe table syntax.
1791The syntax is [the same as in PHP markdown extra]. The beginning and
1792ending pipe characters are optional, but pipes are required between all
1793columns. The colons indicate column alignment as shown. The header
1794can be omitted, but the horizontal line must still be included, as
1795it defines column alignments.
1797Since the pipes indicate column boundaries, columns need not be vertically
1798aligned, as they are in the above example. So, this is a perfectly
1799legal (though ugly) pipe table:
1801 fruit| price
1802 -----|-----:
1803 apple|2.05
1804 pear|1.37
1805 orange|3.09
1807The cells of pipe tables cannot contain block elements like paragraphs
1808and lists, and cannot span multiple lines. Note also that in LaTeX/PDF
1809output, the cells produced by pipe tables will not wrap, since there
1810is no information available about relative widths. If you want content
1811to wrap within cells, use multiline or grid tables.
1813 [the same as in PHP markdown extra]:
1814 http://michelf.ca/projects/php-markdown/extra/#table
1816Note: Pandoc also recognizes pipe tables of the following
1817form, as can produced by Emacs' orgtbl-mode:
1819 | One | Two |
1820 |-----+-------|
1821 | my | table |
1822 | is | nice |
1824The difference is that `+` is used instead of `|`. Other orgtbl features
1825are not supported. In particular, to get non-default column alignment,
1826you'll need to add colons as above.
1828Metadata blocks
1829---------------
1831#### Extension: `pandoc_title_block` ####
1833If the file begins with a title block
1835 % title
1836 % author(s) (separated by semicolons)
1837 % date
1839it will be parsed as bibliographic information, not regular text. (It
1840will be used, for example, in the title of standalone LaTeX or HTML
1841output.) The block may contain just a title, a title and an author,
1842or all three elements. If you want to include an author but no
1843title, or a title and a date but no author, you need a blank line:
1846 % Author
1848 % My title
1850 % June 15, 2006
1852The title may occupy multiple lines, but continuation lines must
1853begin with leading space, thus:
1855 % My title
1856 on multiple lines
1858If a document has multiple authors, the authors may be put on
1859separate lines with leading space, or separated by semicolons, or
1860both. So, all of the following are equivalent:
1862 % Author One
1863 Author Two
1865 % Author One; Author Two
1867 % Author One;
1868 Author Two
1870The date must fit on one line.
1872All three metadata fields may contain standard inline formatting
1873(italics, links, footnotes, etc.).
1875Title blocks will always be parsed, but they will affect the output only
1876when the `--standalone` (`-s`) option is chosen. In HTML output, titles
1877will appear twice: once in the document head -- this is the title that
1878will appear at the top of the window in a browser -- and once at the
1879beginning of the document body. The title in the document head can have
1880an optional prefix attached (`--title-prefix` or `-T` option). The title
1881in the body appears as an H1 element with class "title", so it can be
1882suppressed or reformatted with CSS. If a title prefix is specified with
1883`-T` and no title block appears in the document, the title prefix will
1884be used by itself as the HTML title.
1886The man page writer extracts a title, man page section number, and
1887other header and footer information from the title line. The title
1888is assumed to be the first word on the title line, which may optionally
1889end with a (single-digit) section number in parentheses. (There should
1890be no space between the title and the parentheses.) Anything after
1891this is assumed to be additional footer and header text. A single pipe
1892character (`|`) should be used to separate the footer text from the header
1893text. Thus,
1895 % PANDOC(1)
1897will yield a man page with the title `PANDOC` and section 1.
1899 % PANDOC(1) Pandoc User Manuals
1901will also have "Pandoc User Manuals" in the footer.
1903 % PANDOC(1) Pandoc User Manuals | Version 4.0
1905will also have "Version 4.0" in the header.
1907#### Extension: `yaml_metadata_block` ####
1909A YAML metadata block is a valid YAML object, delimited by a line of three
1910hyphens (`---`) at the top and a line of three hyphens (`---`) or three dots
1911(`...`) at the bottom. A YAML metadata block may occur anywhere in the
1912document, but if it is not at the beginning, it must be preceded by a blank
1913line. (Note that, because of the way pandoc concatenates input files when
1914several are provided, you may also keep the metadata in a separate YAML file
1915and pass it to pandoc as an argument, along with your markdown files:
1917 pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
1919Just be sure that the YAML file begins with `---` and ends with `---` or
1920`...`.)
1922Metadata will be taken from the fields of the YAML object and added to any
1923existing document metadata. Metadata can contain lists and objects (nested
1924arbitrarily), but all string scalars will be interpreted as markdown. Fields
1925with names ending in an underscore will be ignored by pandoc. (They may be
1926given a role by external processors.)
1928A document may contain multiple metadata blocks. The metadata fields will
1929be combined through a *left-biased union*: if two metadata blocks attempt
1930to set the same field, the value from the first block will be taken.
1932Note that YAML escaping rules must be followed. Thus, for example,
1933if a title contains a colon, it must be quoted. The pipe character
1934(`|`) can be used to begin an indented block that will be interpreted
1935literally, without need for escaping. This form is necessary
1936when the field contains blank lines:
1938 ---
1939 title: 'This is the title: it contains a colon'
1940 author:
1941 - name: Author One
1942 affiliation: University of Somewhere
1943 - name: Author Two
1944 affiliation: University of Nowhere
1945 tags: [nothing, nothingness]
1946 abstract: |
1947 This is the abstract.
1949 It consists of two paragraphs.
1950 ...
1952Template variables will be set automatically from the metadata. Thus, for
1953example, in writing HTML, the variable `abstract` will be set to the HTML
1954equivalent of the markdown in the `abstract` field:
1956 <p>This is the abstract.</p>
1957 <p>It consists of two paragraphs.</p>
1959Note: The `author` variable in the default templates expects a simple list or
1960string. To use the structured authors in the example, you would need a
1961custom template. For example:
1963 $for(author)$
1964 $if(author.name)$
1965 $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
1966 $else$
1967 $author$
1968 $endif$
1969 $endfor$
1972Backslash escapes
1973-----------------
1975#### Extension: `all_symbols_escapable` ####
1977Except inside a code block or inline code, any punctuation or space
1978character preceded by a backslash will be treated literally, even if it
1979would normally indicate formatting. Thus, for example, if one writes
1981 *\*hello\**
1983one will get
1985 <em>*hello*</em>
1987instead of
1989 <strong>hello</strong>
1991This rule is easier to remember than standard markdown's rule,
1992which allows only the following characters to be backslash-escaped:
1994 \`*_{}[]()>#+-.!
1996(However, if the `markdown_strict` format is used, the standard markdown rule
1997will be used.)
1999A backslash-escaped space is parsed as a nonbreaking space. It will
2000appear in TeX output as `~` and in HTML and XML as `\&#160;` or
2001`\&nbsp;`.
2003A backslash-escaped newline (i.e. a backslash occurring at the end of
2004a line) is parsed as a hard line break. It will appear in TeX output as
2005`\\` and in HTML as `<br />`. This is a nice alternative to
2006markdown's "invisible" way of indicating hard line breaks using
2007two trailing spaces on a line.
2009Backslash escapes do not work in verbatim contexts.
2011Smart punctuation
2012-----------------
2014#### Extension ####
2016If the `--smart` option is specified, pandoc will produce typographically
2017correct output, converting straight quotes to curly quotes, `---` to
2018em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
2019are inserted after certain abbreviations, such as "Mr."
2021Note: if your LaTeX template uses the `csquotes` package, pandoc will
2022detect automatically this and use `\enquote{...}` for quoted text.
2024Inline formatting
2025-----------------
2027### Emphasis ###
2029To *emphasize* some text, surround it with `*`s or `_`, like this:
2031 This text is _emphasized with underscores_, and this
2032 is *emphasized with asterisks*.
2034Double `*` or `_` produces **strong emphasis**:
2036 This is **strong emphasis** and __with underscores__.
2038A `*` or `_` character surrounded by spaces, or backslash-escaped,
2039will not trigger emphasis:
2041 This is * not emphasized *, and \*neither is this\*.
2043#### Extension: `intraword_underscores` ####
2045Because `_` is sometimes used inside words and identifiers,
2046pandoc does not interpret a `_` surrounded by alphanumeric
2047characters as an emphasis marker. If you want to emphasize
2048just part of a word, use `*`:
2050 feas*ible*, not feas*able*.
2053### Strikeout ###
2055#### Extension: `strikeout` ####
2057To strikeout a section of text with a horizontal line, begin and end it
2058with `~~`. Thus, for example,
2060 This ~~is deleted text.~~
2063### Superscripts and subscripts ###
2065#### Extension: `superscript`, `subscript` ####
2067Superscripts may be written by surrounding the superscripted text by `^`
2068characters; subscripts may be written by surrounding the subscripted
2069text by `~` characters. Thus, for example,
2071 H~2~O is a liquid. 2^10^ is 1024.
2073If the superscripted or subscripted text contains spaces, these spaces
2074must be escaped with backslashes. (This is to prevent accidental
2075superscripting and subscripting through the ordinary use of `~` and `^`.)
2076Thus, if you want the letter P with 'a cat' in subscripts, use
2077`P~a\ cat~`, not `P~a cat~`.
2080### Verbatim ###
2082To make a short span of text verbatim, put it inside backticks:
2084 What is the difference between `>>=` and `>>`?
2086If the verbatim text includes a backtick, use double backticks:
2088 Here is a literal backtick `` ` ``.
2090(The spaces after the opening backticks and before the closing
2091backticks will be ignored.)
2093The general rule is that a verbatim span starts with a string
2094of consecutive backticks (optionally followed by a space)
2095and ends with a string of the same number of backticks (optionally
2096preceded by a space).
2098Note that backslash-escapes (and other markdown constructs) do not
2099work in verbatim contexts:
2101 This is a backslash followed by an asterisk: `\*`.
2103#### Extension: `inline_code_attributes` ####
2105Attributes can be attached to verbatim text, just as with
2106[fenced code blocks](#fenced-code-blocks):
2108 `<$>`{.haskell}
2110### Small caps ###
2112To write small caps, you can use an HTML span tag:
2114 <span style="font-variant:small-caps;">Small caps</span>
2116(The semicolon is optional and there may be space after the
2117colon.) This will work in all output formats that support small caps.
2119Math
2120----
2122#### Extension: `tex_math_dollars` ####
2124Anything between two `$` characters will be treated as TeX math. The
2125opening `$` must have a character immediately to its right, while the
2126closing `$` must have a character immediately to its left. Thus,
2127`$20,000 and $30,000` won't parse as math. If for some reason
2128you need to enclose text in literal `$` characters, backslash-escape
2129them and they won't be treated as math delimiters.
2131TeX math will be printed in all output formats. How it is rendered
2132depends on the output format:
2134Markdown, LaTeX, Org-Mode, ConTeXt
2135 ~ It will appear verbatim between `$` characters.
2137reStructuredText
2138 ~ It will be rendered using an interpreted text role `:math:`, as described
2139 [here](http://www.american.edu/econ/itex2mml/mathhack.rst).
2141AsciiDoc
2142 ~ It will be rendered as `latexmath:[...]`.
2144Texinfo
2145 ~ It will be rendered inside a `@math` command.
2147groff man
2148 ~ It will be rendered verbatim without `$`'s.
2150MediaWiki, DokuWiki
2151 ~ It will be rendered inside `<math>` tags.
2153Textile
2154 ~ It will be rendered inside `<span class="math">` tags.
2156RTF, OpenDocument, ODT
2157 ~ It will be rendered, if possible, using unicode characters,
2158 and will otherwise appear verbatim.
2160Docbook
2161 ~ If the `--mathml` flag is used, it will be rendered using mathml
2162 in an `inlineequation` or `informalequation` tag. Otherwise it
2163 will be rendered, if possible, using unicode characters.
2165Docx
2166 ~ It will be rendered using OMML math markup.
2168FictionBook2
2169 ~ If the `--webtex` option is used, formulas are rendered as images
2170 using Google Charts or other compatible web service, downloaded
2171 and embedded in the e-book. Otherwise, they will appear verbatim.
2173HTML, Slidy, DZSlides, S5, EPUB
2174 ~ The way math is rendered in HTML will depend on the
2175 command-line options selected:
2177 1. The default is to render TeX math as far as possible using unicode
2178 characters, as with RTF, DocBook, and OpenDocument output. Formulas
2179 are put inside a `span` with `class="math"`, so that they may be
2180 styled differently from the surrounding text if needed.
2182 2. If the `--latexmathml` option is used, TeX math will be displayed
2183 between `$` or `$$` characters and put in `<span>` tags with class `LaTeX`.
2184 The [LaTeXMathML] script will be used to render it as formulas.
2185 (This trick does not work in all browsers, but it works in Firefox.
2186 In browsers that do not support LaTeXMathML, TeX math will appear
2187 verbatim between `$` characters.)
2189 3. If the `--jsmath` option is used, TeX math will be put inside
2190 `<span>` tags (for inline math) or `<div>` tags (for display math)
2191 with class `math`. The [jsMath] script will be used to render
2192 it.
2194 4. If the `--mimetex` option is used, the [mimeTeX] CGI script will
2195 be called to generate images for each TeX formula. This should
2196 work in all browsers. The `--mimetex` option takes an optional URL
2197 as argument. If no URL is specified, it will be assumed that the
2198 mimeTeX CGI script is at `/cgi-bin/mimetex.cgi`.
2200 5. If the `--gladtex` option is used, TeX formulas will be enclosed
2201 in `<eq>` tags in the HTML output. The resulting `htex` file may then
2202 be processed by [gladTeX], which will produce image files for each
2203 formula and an `html` file with links to these images. So, the
2204 procedure is:
2206 pandoc -s --gladtex myfile.txt -o myfile.htex
2207 gladtex -d myfile-images myfile.htex
2208 # produces myfile.html and images in myfile-images
2210 6. If the `--webtex` option is used, TeX formulas will be converted
2211 to `<img>` tags that link to an external script that converts
2212 formulas to images. The formula will be URL-encoded and concatenated
2213 with the URL provided. If no URL is specified, the Google Chart
2214 API will be used (`http://chart.apis.google.com/chart?cht=tx&chl=`).
2216 7. If the `--mathjax` option is used, TeX math will be displayed
2217 between `\(...\)` (for inline math) or `\[...\]` (for display
2218 math) and put in `<span>` tags with class `math`.
2219 The [MathJax] script will be used to render it as formulas.
2221Raw HTML
2222--------
2224#### Extension: `raw_html` ####
2226Markdown allows you to insert raw HTML (or DocBook) anywhere in a document
2227(except verbatim contexts, where `<`, `>`, and `&` are interpreted
2228literally). (Technically this is not an extension, since standard
2229markdown allows it, but it has been made an extension so that it can
2230be disabled if desired.)
2232The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
2233DZSlides, EPUB, Markdown, and Textile output, and suppressed in other
2234formats.
2236#### Extension: `markdown_in_html_blocks` ####
2238Standard markdown allows you to include HTML "blocks": blocks
2239of HTML between balanced tags that are separated from the surrounding text
2240with blank lines, and start and end at the left margin. Within
2241these blocks, everything is interpreted as HTML, not markdown;
2242so (for example), `*` does not signify emphasis.
2244Pandoc behaves this way when the `markdown_strict` format is used; but
2245by default, pandoc interprets material between HTML block tags as markdown.
2246Thus, for example, Pandoc will turn
2248 <table>
2249 <tr>
2250 <td>*one*</td>
2251 <td>[a link](http://google.com)</td>
2252 </tr>
2253 </table>
2255into
2257 <table>
2258 <tr>
2259 <td><em>one</em></td>
2260 <td><a href="http://google.com">a link</a></td>
2261 </tr>
2262 </table>
2264whereas `Markdown.pl` will preserve it as is.
2266There is one exception to this rule: text between `<script>` and
2267`<style>` tags is not interpreted as markdown.
2269This departure from standard markdown should make it easier to mix
2270markdown with HTML block elements. For example, one can surround
2271a block of markdown text with `<div>` tags without preventing it
2272from being interpreted as markdown.
2274#### Extension: `native_divs` ####
2276Use native pandoc `Div` blocks for content inside `<div>` tags.
2277For the most part this should give the same output as
2278`markdown_in_html_blocks`, but it makes it easier to write pandoc
2279filters to manipulate groups of blocks.
2281#### Extension: `native_spans` ####
2283Use native pandoc `Span` blocks for content inside `<span>` tags.
2284For the most part this should give the same output as `raw_html`,
2285but it makes it easier to write pandoc filters to manipulate groups
2286of inlines.
2288Raw TeX
2289-------
2291#### Extension: `raw_tex` ####
2293In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
2294included in a document. Inline TeX commands will be preserved and passed
2295unchanged to the LaTeX and ConTeXt writers. Thus, for example, you can use
2296LaTeX to include BibTeX citations:
2298 This result was proved in \cite{jones.1967}.
2300Note that in LaTeX environments, like
2302 \begin{tabular}{|l|l|}\hline
2303 Age & Frequency \\ \hline
2304 18--25 & 15 \\
2305 26--35 & 33 \\
2306 36--45 & 22 \\ \hline
2307 \end{tabular}
2309the material between the begin and end tags will be interpreted as raw
2310LaTeX, not as markdown.
2312Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
2313and ConTeXt.
2315LaTeX macros
2316------------
2318#### Extension: `latex_macros` ####
2320For output formats other than LaTeX, pandoc will parse LaTeX `\newcommand` and
2321`\renewcommand` definitions and apply the resulting macros to all LaTeX
2322math. So, for example, the following will work in all output formats,
2323not just LaTeX:
2325 \newcommand{\tuple}[1]{\langle #1 \rangle}
2327 $\tuple{a, b, c}$
2329In LaTeX output, the `\newcommand` definition will simply be passed
2330unchanged to the output.
2333Links
2334-----
2336Markdown allows links to be specified in several ways.
2338### Automatic links ###
2340If you enclose a URL or email address in pointy brackets, it
2341will become a link:
2343 <http://google.com>
2344 <sam@green.eggs.ham>
2346### Inline links ###
2348An inline link consists of the link text in square brackets,
2349followed by the URL in parentheses. (Optionally, the URL can
2350be followed by a link title, in quotes.)
2352 This is an [inline link](/url), and here's [one with
2353 a title](http://fsf.org "click here for a good time!").
2355There can be no space between the bracketed part and the parenthesized part.
2356The link text can contain formatting (such as emphasis), but the title cannot.
2359### Reference links ###
2361An *explicit* reference link has two parts, the link itself and the link
2362definition, which may occur elsewhere in the document (either
2363before or after the link).
2365The link consists of link text in square brackets, followed by a label in
2366square brackets. (There can be space between the two.) The link definition
2367consists of the bracketed label, followed by a colon and a space, followed by
2368the URL, and optionally (after a space) a link title either in quotes or in
2369parentheses.
2371Here are some examples:
2373 [my label 1]: /foo/bar.html "My title, optional"
2374 [my label 2]: /foo
2375 [my label 3]: http://fsf.org (The free software foundation)
2376 [my label 4]: /bar#special 'A title in single quotes'
2378The URL may optionally be surrounded by angle brackets:
2380 [my label 5]: <http://foo.bar.baz>
2382The title may go on the next line:
2384 [my label 3]: http://fsf.org
2385 "The free software foundation"
2387Note that link labels are not case sensitive. So, this will work:
2389 Here is [my link][FOO]
2391 [Foo]: /bar/baz
2393In an *implicit* reference link, the second pair of brackets is
2394empty, or omitted entirely:
2396 See [my website][], or [my website].
2398 [my website]: http://foo.bar.baz
2400Note: In `Markdown.pl` and most other markdown implementations,
2401reference link definitions cannot occur in nested constructions
2402such as list items or block quotes. Pandoc lifts this arbitrary
2403seeming restriction. So the following is fine in pandoc, though
2404not in most other implementations:
2406 > My block [quote].
2408 > [quote]: /foo
2410### Internal links ###
2412To link to another section of the same document, use the automatically
2413generated identifier (see [Header identifiers in HTML, LaTeX, and
2414ConTeXt](#header-identifiers-in-html-latex-and-context), below).
2415For example:
2417 See the [Introduction](#introduction).
2421 See the [Introduction].
2423 [Introduction]: #introduction
2425Internal links are currently supported for HTML formats (including
2426HTML slide shows and EPUB), LaTeX, and ConTeXt.
2428Images
2429------
2431A link immediately preceded by a `!` will be treated as an image.
2432The link text will be used as the image's alt text:
2434 ![la lune](lalune.jpg "Voyage to the moon")
2436 ![movie reel]
2438 [movie reel]: movie.gif
2440#### Extension: `implicit_figures` ####
2442An image occurring by itself in a paragraph will be rendered as
2443a figure with a caption.[^5] (In LaTeX, a figure environment will be
2444used; in HTML, the image will be placed in a `div` with class
2445`figure`, together with a caption in a `p` with class `caption`.)
2446The image's alt text will be used as the caption.
2448 ![This is the caption](/url/of/image.png)
2450[^5]: This feature is not yet implemented for RTF, OpenDocument, or
2451 ODT. In those formats, you'll just get an image in a paragraph by
2452 itself, with no caption.
2454If you just want a regular inline image, just make sure it is not
2455the only thing in the paragraph. One way to do this is to insert a
2456nonbreaking space after the image:
2458 ![This image won't be a figure](/url/of/image.png)\
2461Footnotes
2462---------
2464#### Extension: `footnotes` ####
2466Pandoc's markdown allows footnotes, using the following syntax:
2468 Here is a footnote reference,[^1] and another.[^longnote]
2470 [^1]: Here is the footnote.
2472 [^longnote]: Here's one with multiple blocks.
2474 Subsequent paragraphs are indented to show that they
2475 belong to the previous footnote.
2477 { some.code }
2479 The whole paragraph can be indented, or just the first
2480 line. In this way, multi-paragraph footnotes work like
2481 multi-paragraph list items.
2483 This paragraph won't be part of the note, because it
2484 isn't indented.
2486The identifiers in footnote references may not contain spaces, tabs,
2487or newlines. These identifiers are used only to correlate the
2488footnote reference with the note itself; in the output, footnotes
2489will be numbered sequentially.
2491The footnotes themselves need not be placed at the end of the
2492document. They may appear anywhere except inside other block elements
2493(lists, block quotes, tables, etc.).
2495#### Extension: `inline_notes` ####
2497Inline footnotes are also allowed (though, unlike regular notes,
2498they cannot contain multiple paragraphs). The syntax is as follows:
2500 Here is an inline note.^[Inlines notes are easier to write, since
2501 you don't have to pick an identifier and move down to type the
2502 note.]
2504Inline and regular footnotes may be mixed freely.
2507Citations
2508---------
2510#### Extension: `citations` ####
2512Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
2513citations and a bibliography in a number of styles. Basic usage is
2515 pandoc --filter pandoc-citeproc myinput.txt
2517In order to use this feature, you will need to specify a bibliography file
2518using the `bibliography` metadata field in a YAML metadata section.
2519The bibliography may have any of these formats:
2521 Format File extension
2522 ------------ --------------
2523 MODS .mods
2524 BibLaTeX .bib
2525 BibTeX .bibtex
2526 RIS .ris
2527 EndNote .enl
2528 EndNote XML .xml
2529 ISI .wos
2530 MEDLINE .medline
2531 Copac .copac
2532 JSON citeproc .json
2534Note that `.bib` can generally be used with both BibTeX and BibLaTeX
2535files, but you can use `.bibtex` to force BibTeX.
2537Alternatively you can use a `references` field in the document's YAML
2538metadata. This should include an array of YAML-encoded references,
2539for example:
2541 ---
2542 references:
2543 - id: fenner2012a
2544 title: One-click science marketing
2545 author:
2546 - family: Fenner
2547 given: Martin
2548 container-title: Nature Materials
2549 volume: 11
2550 URL: 'http://dx.doi.org/10.1038/nmat3283'
2551 DOI: 10.1038/nmat3283
2552 issue: 4
2553 publisher: Nature Publishing Group
2554 page: 261-263
2555 type: article-journal
2556 issued:
2557 year: 2012
2558 month: 3
2559 ...
2561(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce
2562these from a MODS reference collection.)
2564By default, `pandoc-citeproc` will use a Chicago author-date format for
2565citations and references. To use another style, you will need to specify
2566a [CSL] 1.0 style file in the `csl` metadata field. A primer on creating and
2567modifying CSL styles can be found at
2568<http://citationstyles.org/downloads/primer.html>. A repository of CSL styles
2569can be found at <https://github.com/citation-style-language/styles>. See also
2570<http://zotero.org/styles> for easy browsing.
2572Citations go inside square brackets and are separated by semicolons.
2573Each citation must have a key, composed of '@' + the citation
2574identifier from the database, and may optionally have a prefix,
2575a locator, and a suffix. The citation key must begin with a letter
2576or `_`, and may contain alphanumerics, `_`, and internal punctuation
2577characters (`:.#$%&-+?<>~/`). Here are some examples:
2579 Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
2581 Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
2583 Blah blah [@smith04; @doe99].
2585A minus sign (`-`) before the `@` will suppress mention of
2586the author in the citation. This can be useful when the
2587author is already mentioned in the text:
2589 Smith says blah [-@smith04].
2591You can also write an in-text citation, as follows:
2593 @smith04 says blah.
2595 @smith04 [p. 33] says blah.
2597If the style calls for a list of works cited, it will be placed
2598at the end of the document. Normally, you will want to end your
2599document with an appropriate header:
2601 last paragraph...
2603 # References
2605The bibliography will be inserted after this header. Note that
2606the `unnumbered` class will be added to this header, so that the
2607section will not be numbered.
2609If you want to include items in the bibliography without actually
2610citing them in the body text, you can define a dummy `nocite` metadata
2611field and put the citations there:
2613 ---
2614 nocite: |
2615 @item1, @item2
2616 ...
2618 @item3
2620In this example, the document will contain a citation for `item3`
2621only, but the bibliography will contain entries for `item1`, `item2`, and
2622`item3`.
2624Non-pandoc extensions
2625---------------------
2627The following markdown syntax extensions are not enabled by default
2628in pandoc, but may be enabled by adding `+EXTENSION` to the format
2629name, where `EXTENSION` is the name of the extension. Thus, for
2630example, `markdown+hard_line_breaks` is markdown with hard line breaks.
2632#### Extension: `lists_without_preceding_blankline` ####
2634Allow a list to occur right after a paragraph, with no intervening
2635blank space.
2637#### Extension: `hard_line_breaks` ####
2639Causes all newlines within a paragraph to be interpreted as hard line
2640breaks instead of spaces.
2642#### Extension: `ignore_line_breaks` ####
2644Causes newlines within a paragraph to be ignored, rather than being
2645treated as spaces or as hard line breaks. This option is intended for
2646use with East Asian languages where spaces are not used between words,
2647but text is divided into lines for readability.
2649#### Extension: `tex_math_single_backslash` ####
2651Causes anything between `\(` and `\)` to be interpreted as inline
2652TeX math, and anything between `\[` and `\]` to be interpreted
2653as display TeX math. Note: a drawback of this extension is that
2654it precludes escaping `(` and `[`.
2656#### Extension: `tex_math_double_backslash` ####
2658Causes anything between `\\(` and `\\)` to be interpreted as inline
2659TeX math, and anything between `\\[` and `\\]` to be interpreted
2660as display TeX math.
2662#### Extension: `markdown_attribute` ####
2664By default, pandoc interprets material inside block-level tags as markdown.
2665This extension changes the behavior so that markdown is only parsed
2666inside block-level tags if the tags have the attribute `markdown=1`.
2668#### Extension: `mmd_title_block` ####
2670Enables a [MultiMarkdown] style title block at the top of
2671the document, for example:
2673 Title: My title
2674 Author: John Doe
2675 Date: September 1, 2008
2676 Comment: This is a sample mmd title block, with
2677 a field spanning multiple lines.
2679See the MultiMarkdown documentation for details. If `pandoc_title_block` or
2680`yaml_metadata_block` is enabled, it will take precedence over
2681`mmd_title_block`.
2683 [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/
2685#### Extension: `abbreviations` ####
2687Parses PHP Markdown Extra abbreviation keys, like
2689 *[HTML]: Hyper Text Markup Language
2691Note that the pandoc document model does not support
2692abbreviations, so if this extension is enabled, abbreviation keys are
2693simply skipped (as opposed to being parsed as paragraphs).
2695#### Extension: `autolink_bare_uris` ####
2697Makes all absolute URIs into links, even when not surrounded by
2698pointy braces `<...>`.
2700#### Extension: `ascii_identifiers` ####
2702Causes the identifiers produced by `auto_identifiers` to be pure ASCII.
2703Accents are stripped off of accented latin letters, and non-latin
2704letters are omitted.
2706#### Extension: `link_attributes` ####
2708Parses multimarkdown style key-value attributes on link and image references.
2709Note that pandoc's internal document model provides nowhere to put
2710these, so they are presently just ignored.
2712#### Extension: `mmd_header_identifiers` ####
2714Parses multimarkdown style header identifiers (in square brackets,
2715after the header but before any trailing `#`s in an ATX header).
2717#### Extension: `compact_definition_lists` ####
2719Activates the definition list syntax of pandoc 1.12.x and earlier.
2720This syntax differs from the one described [above](#definition-lists)
2721in several respects:
2723 - No blank line is required between consecutive items of the
2724 definition list.
2725 - To get a "tight" or "compact" list, omit space between consecutive
2726 items; the space between a term and its definition does not affect
2727 anything.
2728 - Lazy wrapping of paragraphs is not allowed: the entire definition must
2729 be indented four spaces.[^6]
2731[^6]: To see why laziness is incompatible with relaxing the requirement
2732 of a blank line between items, consider the following example:
2734 bar
2735 : definition
2736 foo
2737 : definition
2739 Is this a single list item with two definitions of "bar," the first of
2740 which is lazily wrapped, or two list items? To remove the ambiguity
2741 we must either disallow lazy wrapping or require a blank line between
2742 list items.
2744Markdown variants
2745-----------------
2747In addition to pandoc's extended markdown, the following markdown
2748variants are supported:
2750`markdown_phpextra` (PHP Markdown Extra)
2751: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
2752 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
2753 `header_attributes`, `abbreviations`.
2755`markdown_github` (Github-flavored Markdown)
2756: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
2757 `fenced_code_blocks`, `auto_identifiers`,
2758 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
2759 `intraword_underscores`, `strikeout`, `hard_line_breaks`
2761`markdown_mmd` (MultiMarkdown)
2762: `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,
2763 `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,
2764 `mmd_title_block`, `footnotes`, `definition_lists`,
2765 `all_symbols_escapable`, `implicit_header_references`,
2766 `auto_identifiers`, `mmd_header_identifiers`
2768`markdown_strict` (Markdown.pl)
2769: `raw_html`
2771Extensions with formats other than markdown
2772-------------------------------------------
2774Some of the extensions discussed above can be used with formats
2775other than markdown:
2777* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`,
2778 and `textile` input (and is used by default).
2780* `tex_math_dollars`, `tex_math_single_backslash`, and
2781 `tex_math_double_backslash` can be used with `html` input.
2782 (This is handy for reading web pages formatted using MathJax,
2783 for example.)
2785Producing slide shows with Pandoc
2786=================================
2788You can use Pandoc to produce an HTML + javascript slide presentation
2789that can be viewed via a web browser. There are five ways to do this,
2790using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
2791You can also produce a PDF slide show using LaTeX [beamer].
2793Here's the markdown source for a simple slide show, `habits.txt`:
2795 % Habits
2796 % John Doe
2797 % March 22, 2005
2799 # In the morning
2801 ## Getting up
2803 - Turn off alarm
2804 - Get out of bed
2806 ## Breakfast
2808 - Eat eggs
2809 - Drink coffee
2811 # In the evening
2813 ## Dinner
2815 - Eat spaghetti
2816 - Drink wine
2818 ------------------
2820 ![picture of spaghetti](images/spaghetti.jpg)
2822 ## Going to sleep
2824 - Get in bed
2825 - Count sheep
2827To produce an HTML/javascript slide show, simply type
2829 pandoc -t FORMAT -s habits.txt -o habits.html
2831where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
2833For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
2834`-s/--standalone` option embeds a link to javascripts and CSS files, which are
2835assumed to be available at the relative path `s5/default` (for S5), `slideous`
2836(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
2837`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
2838`slideous-url`, `revealjs-url`, or `s5-url` variables; see `--variable`,
2839above.) For DZSlides, the (relatively short) javascript and css are included in
2840the file by default.
2842With all HTML slide formats, the `--self-contained` option can be used to
2843produce a single file that contains all of the data necessary to display the
2844slide show, including linked scripts, stylesheets, images, and videos.
2846To produce a PDF slide show using beamer, type
2848 pandoc -t beamer habits.txt -o habits.pdf
2850Note that a reveal.js slide show can also be converted to a PDF
2851by printing it to a file from the browser.
2853Structuring the slide show
2854--------------------------
2856By default, the *slide level* is the highest header level in
2857the hierarchy that is followed immediately by content, and not another
2858header, somewhere in the document. In the example above, level 1 headers
2859are always followed by level 2 headers, which are followed by content,
2860so 2 is the slide level. This default can be overridden using
2861the `--slide-level` option.
2863The document is carved up into slides according to the following
2864rules:
2866 * A horizontal rule always starts a new slide.
2868 * A header at the slide level always starts a new slide.
2870 * Headers *below* the slide level in the hierarchy create
2871 headers *within* a slide.
2873 * Headers *above* the slide level in the hierarchy create
2874 "title slides," which just contain the section title
2875 and help to break the slide show into sections.
2877 * A title page is constructed automatically from the document's title
2878 block, if present. (In the case of beamer, this can be disabled
2879 by commenting out some lines in the default template.)
2881These rules are designed to support many different styles of slide show. If
2882you don't care about structuring your slides into sections and subsections,
2883you can just use level 1 headers for all each slide. (In that case, level 1
2884will be the slide level.) But you can also structure the slide show into
2885sections, as in the example above.
2887Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
2888layout will be produced, with level 1 headers building horizontally
2889and level 2 headers building vertically. It is not recommended that
2890you use deeper nesting of section levels with reveal.js.
2892Incremental lists
2893-----------------
2895By default, these writers produces lists that display "all at once."
2896If you want your lists to display incrementally (one item at a time),
2897use the `-i` option. If you want a particular list to depart from the
2898default (that is, to display incrementally without the `-i` option and
2899all at once with the `-i` option), put it in a block quote:
2901 > - Eat spaghetti
2902 > - Drink wine
2904In this way incremental and nonincremental lists can be mixed in
2905a single document.
2907Inserting pauses
2908----------------
2910You can add "pauses" within a slide by including a paragraph containing
2911three dots, separated by spaces:
2913 # Slide with a pause
2915 content before the pause
2917 . . .
2919 content after the pause
2921Styling the slides
2922------------------
2924You can change the style of HTML slides by putting customized CSS files
2925in `$DATADIR/s5/default` (for S5), `$DATADIR/slidy` (for Slidy),
2926or `$DATADIR/slideous` (for Slideous),
2927where `$DATADIR` is the user data directory (see `--data-dir`, above).
2928The originals may be found in pandoc's system data directory (generally
2929`$CABALDIR/pandoc-VERSION/s5/default`). Pandoc will look there for any
2930files it does not find in the user data directory.
2932For dzslides, the CSS is included in the HTML file itself, and may
2933be modified there.
2935For reveal.js, themes can be used by setting the `theme` variable,
2936for example:
2938 -V theme=moon
2940Or you can specify a custom stylesheet using the `--css` option.
2942To style beamer slides, you can specify a beamer "theme" or "colortheme"
2943using the `-V` option:
2945 pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
2947Note that header attributes will turn into slide attributes
2948(on a `<div>` or `<section>`) in HTML slide formats, allowing you
2949to style individual slides. In Beamer, the only header attribute
2950that affects slides is the `allowframebreaks` class, which sets the
2951`allowframebreaks` option, causing multiple slides to be created
2952if the content overfills the frame. This is recommended especially for
2953bibliographies:
2955 # References {.allowframebreaks}
2957Speaker notes
2958-------------
2960reveal.js has good support for speaker notes. You can add notes to your
2961markdown document thus:
2963 <div class="notes">
2964 This is my note.
2966 - It can contain markdown
2967 - like this list
2969 </div>
2971To show the notes window, press `s` while viewing the presentation.
2972Notes are not yet supported for other slide formats, but the notes
2973will not appear on the slides themselves.
2975EPUB Metadata
2976=============
2978EPUB metadata may be specified using the `--epub-metadata` option, but
2979if the source document is markdown, it is better to use a YAML metadata
2980block. Here is an example:
2982 ---
2983 title:
2984 - type: main
2985 text: My Book
2986 - type: subtitle
2987 text: An investigation of metadata
2988 creator:
2989 - role: author
2990 text: John Smith
2991 - role: editor
2992 text: Sarah Jones
2993 identifier:
2994 - scheme: DOI
2995 text: doi:10.234234.234/33
2996 publisher: My Press
2997 rights: (c) 2007 John Smith, CC BY-NC
2998 ...
3000The following fields are recognized:
3002`identifier`
3003 ~ Either a string value or an object with fields `text` and
3004 `scheme`. Valid values for `scheme` are `ISBN-10`,
3005 `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`,
3006 `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`,
3007 `ISMN-13`, `ISBN-A`, `JP`, `OLCC`.
3009`title`
3010 ~ Either a string value, or an object with fields `file-as` and
3011 `type`, or a list of such objects. Valid values for `type` are
3012 `main`, `subtitle`, `short`, `collection`, `edition`, `extended`.
3014`creator`
3015 ~ Either a string value, or an object with fields `role`, `file-as`,
3016 and `text`, or a list of such objects. Valid values for `role` are
3017 [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but
3018 pandoc will attempt to translate the human-readable versions
3019 (like "author" and "editor") to the appropriate marc relators.
3021`contributor`
3022 ~ Same format as `creator`.
3024`date`
3025 ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.)
3026 Pandoc will attempt to convert other common date formats.
3028`language`
3029 ~ A string value in [RFC5646] format. Pandoc will default to the local
3030 language if nothing is specified.
3032`subject`
3033 ~ A string value or a list of such values.
3035`description`
3036 ~ A string value.
3038`type`
3039 ~ A string value.
3041`format`
3042 ~ A string value.
3044`relation`
3045 ~ A string value.
3047`coverage`
3048 ~ A string value.
3050`rights`
3051 ~ A string value.
3053`cover-image`
3054 ~ A string value (path to cover image).
3056`stylesheet`
3057 ~ A string value (path to CSS stylesheet).
3059`page-progression-direction`
3060 ~ Either `ltr` or `rtl`. Specifies the synonymous spine [attribute][EPUBspine].
3062Literate Haskell support
3063========================
3065If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output
3066format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output;
3067`beamer`, `html` or `html5` for output only), pandoc will treat the document as
3068literate Haskell source. This means that
3070 - In markdown input, "bird track" sections will be parsed as Haskell
3071 code rather than block quotations. Text between `\begin{code}`
3072 and `\end{code}` will also be treated as Haskell code.
3074 - In markdown output, code blocks with classes `haskell` and `literate`
3075 will be rendered using bird tracks, and block quotations will be
3076 indented one space, so they will not be treated as Haskell code.
3077 In addition, headers will be rendered setext-style (with underlines)
3078 rather than atx-style (with '#' characters). (This is because ghc
3079 treats '#' characters in column 1 as introducing line numbers.)
3081 - In restructured text input, "bird track" sections will be parsed
3082 as Haskell code.
3084 - In restructured text output, code blocks with class `haskell` will
3085 be rendered using bird tracks.
3087 - In LaTeX input, text in `code` environments will be parsed as
3088 Haskell code.
3090 - In LaTeX output, code blocks with class `haskell` will be rendered
3091 inside `code` environments.
3093 - In HTML output, code blocks with class `haskell` will be rendered
3094 with class `literatehaskell` and bird tracks.
3096Examples:
3098 pandoc -f markdown+lhs -t html
3100reads literate Haskell source formatted with markdown conventions and writes
3101ordinary HTML (without bird tracks).
3103 pandoc -f markdown+lhs -t html+lhs
3105writes HTML with the Haskell code in bird tracks, so it can be copied
3106and pasted as literate Haskell source.
3108Custom writers
3109==============
3111Pandoc can be extended with custom writers written in [lua]. (Pandoc
3112includes a lua interpreter, so lua need not be installed separately.)
3114To use a custom writer, simply specify the path to the lua script
3115in place of the output format. For example:
3117 pandoc -t data/sample.lua
3119Creating a custom writer requires writing a lua function for each
3120possible element in a pandoc document. To get a documented example
3121which you can modify according to your needs, do
3123 pandoc --print-default-data-file sample.lua
3125Authors
3126=======
3128© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the
3129[GPL], version 2 or greater. This software carries no warranty of
3130any kind. (See COPYRIGHT for full copyright and warranty notices.)
3131Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,
3132Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,
3133Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,
3134Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
3135Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine
3136Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,
3137Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,
3138Jamie F. Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse
3139Rosenthal.
3141[markdown]: http://daringfireball.net/projects/markdown/
3142[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
3143[S5]: http://meyerweb.com/eric/tools/s5/
3144[Slidy]: http://www.w3.org/Talks/Tools/Slidy/
3145[Slideous]: http://goessner.net/articles/slideous/
3146[HTML]: http://www.w3.org/TR/html40/
3147[HTML 5]: http://www.w3.org/TR/html5/
3148[XHTML]: http://www.w3.org/TR/xhtml1/
3149[LaTeX]: http://www.latex-project.org/
3150[beamer]: http://www.tex.ac.uk/CTAN/macros/latex/contrib/beamer
3151[ConTeXt]: http://www.pragma-ade.nl/
3152[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
3153[DocBook]: http://www.docbook.org/
3154[OPML]: http://dev.opml.org/spec2.html
3155[OpenDocument]: http://opendocument.xml.org/
3156[ODT]: http://en.wikipedia.org/wiki/OpenDocument
3157[Textile]: http://redcloth.org/textile
3158[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting
3159[DokuWiki markup]: https://www.dokuwiki.org/dokuwiki
3160[Haddock markup]: http://www.haskell.org/haddock/doc/html/ch03s08.html
3161[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
3162[Haskell]: http://www.haskell.org/
3163[GNU Texinfo]: http://www.gnu.org/software/texinfo/
3164[Emacs Org-Mode]: http://orgmode.org
3165[AsciiDoc]: http://www.methods.co.nz/asciidoc/
3166[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
3167[DZSlides]: http://paulrouget.com/dzslides/
3168[ISO 8601 format]: http://www.w3.org/TR/NOTE-datetime
3169[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
3170[PDF]: http://www.adobe.com/pdf/
3171[reveal.js]: http://lab.hakim.se/reveal-js/
3172[FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
3173[lua]: http://www.lua.org
3174[marc relators]: http://www.loc.gov/marc/relators/relaterm.html
3175[RFC5646]: http://tools.ietf.org/html/rfc5646
3176[InDesign ICML]: https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
3177[txt2tags]: http://txt2tags.org/
3178[EPUB]: http://idpf.org/epub
3179[EPUBspine]: http://www.idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem