@@ -1,7 +1,7 @@
2title: Pandoc User's Guide
2title: Pandoc User's Guide
3author: John MacFarlane
3author: John MacFarlane
4−date: November 7, 2020
4+date: June 20, 2021
@@ -136,7 +136,7 @@ to output the generated LaTeX. You can then test it with `pdflatex test.tex`.
136When using LaTeX, the following packages need to be available
136When using LaTeX, the following packages need to be available
137(they are included with all recent versions of [TeX Live]):
137(they are included with all recent versions of [TeX Live]):
138[`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],
138[`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],
139−[`ifxetex`], [`ifluatex`], [`listings`] (if the
139+[`iftex`], [`listings`] (if the
140`--listings` option is used), [`fancyvrb`], [`longtable`],
140`--listings` option is used), [`fancyvrb`], [`longtable`],
141[`booktabs`], [`graphicx`] (if the document
141[`booktabs`], [`graphicx`] (if the document
142contains images), [`hyperref`], [`xcolor`],
142contains images), [`hyperref`], [`xcolor`],
@@ -180,8 +180,7 @@ footnotes in tables).
180[`graphicx`]: https://ctan.org/pkg/graphicx
180[`graphicx`]: https://ctan.org/pkg/graphicx
181[`grffile`]: https://ctan.org/pkg/grffile
181[`grffile`]: https://ctan.org/pkg/grffile
182[`hyperref`]: https://ctan.org/pkg/hyperref
182[`hyperref`]: https://ctan.org/pkg/hyperref
183−[`ifluatex`]: https://ctan.org/pkg/ifluatex
184−[`ifxetex`]: https://ctan.org/pkg/ifxetex
183+[`iftex`]: https://ctan.org/pkg/iftex
185[`listings`]: https://ctan.org/pkg/listings
184[`listings`]: https://ctan.org/pkg/listings
186[`lm`]: https://ctan.org/pkg/lm
185[`lm`]: https://ctan.org/pkg/lm
187[`longtable`]: https://ctan.org/pkg/longtable
186[`longtable`]: https://ctan.org/pkg/longtable
@@ -281,6 +280,8 @@ header when requesting a document from a URL:
281 ::: {#output-formats}
280 ::: {#output-formats}
282 - `asciidoc` ([AsciiDoc]) or `asciidoctor` ([AsciiDoctor])
281 - `asciidoc` ([AsciiDoc]) or `asciidoctor` ([AsciiDoctor])
283 - `beamer` ([LaTeX beamer][`beamer`] slide show)
282 - `beamer` ([LaTeX beamer][`beamer`] slide show)
283+ - `bibtex` ([BibTeX] bibliography)
284+ - `biblatex` ([BibLaTeX] bibliography)
284 - `commonmark` ([CommonMark] Markdown)
285 - `commonmark` ([CommonMark] Markdown)
285 - `commonmark_x` ([CommonMark] Markdown with extensions)
286 - `commonmark_x` ([CommonMark] Markdown with extensions)
286 - `context` ([ConTeXt])
287 - `context` ([ConTeXt])
@@ -360,15 +361,15 @@ header when requesting a document from a URL:
360 will be used. On \*nix and macOS systems this will be the `pandoc`
361 will be used. On \*nix and macOS systems this will be the `pandoc`
361 subdirectory of the XDG data directory (by default,
362 subdirectory of the XDG data directory (by default,
362 `$HOME/.local/share`, overridable by setting the `XDG_DATA_HOME`
363 `$HOME/.local/share`, overridable by setting the `XDG_DATA_HOME`
363− environment variable). If that directory does not exist,
364+ environment variable). If that directory does not exist and
364− `$HOME/.pandoc` will be used (for backwards compatibility).
365+ `$HOME/.pandoc` exists, it will be used (for backwards compatibility).
365− In Windows the default user data directory is
366+ On Windows the default user data directory is
366 `C:\Users\USERNAME\AppData\Roaming\pandoc`.
367 `C:\Users\USERNAME\AppData\Roaming\pandoc`.
367 You can find the default user data directory on your system by
368 You can find the default user data directory on your system by
368 looking at the output of `pandoc --version`.
369 looking at the output of `pandoc --version`.
370+ Data files placed in this directory (for example, `reference.odt`,
369− A `reference.odt`, `reference.docx`, `epub.css`, `templates`,
371+ `reference.docx`, `epub.css`, `templates`) will override
370− `slidy`, `slideous`, or `s5` directory
371− placed in this directory will override pandoc's normal defaults.
372+ pandoc's normal defaults.
373`-d` *FILE*, `--defaults=`*FILE*
374`-d` *FILE*, `--defaults=`*FILE*
@@ -485,7 +486,7 @@ header when requesting a document from a URL:
485[Emacs Org mode]: https://orgmode.org
486[Emacs Org mode]: https://orgmode.org
486[AsciiDoc]: https://www.methods.co.nz/asciidoc/
487[AsciiDoc]: https://www.methods.co.nz/asciidoc/
487[AsciiDoctor]: https://asciidoctor.org/
488[AsciiDoctor]: https://asciidoctor.org/
488−[DZSlides]: http://paulrouget.com/dzslides/
489+[DZSlides]: https://paulrouget.com/dzslides/
489[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML
490[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML
490[PDF]: https://www.adobe.com/pdf/
491[PDF]: https://www.adobe.com/pdf/
491[reveal.js]: https://revealjs.com/
492[reveal.js]: https://revealjs.com/
@@ -588,8 +589,8 @@ header when requesting a document from a URL:
589 3. `$PATH` (executable only)
590 3. `$PATH` (executable only)
591− Filters and Lua-filters are applied in the order specified
592+ Filters, Lua-filters, and citeproc processing are applied in
592− on the command line.
593+ the order specified on the command line.
594`-L` *SCRIPT*, `--lua-filter=`*SCRIPT*
595`-L` *SCRIPT*, `--lua-filter=`*SCRIPT*
@@ -603,26 +604,17 @@ header when requesting a document from a URL:
603 The `pandoc` Lua module provides helper functions for element
604 The `pandoc` Lua module provides helper functions for element
604 creation. It is always loaded into the script's Lua environment.
605 creation. It is always loaded into the script's Lua environment.
606− The following is an example Lua script for macro-expansion:
607+ See the [Lua filters documentation] for further details.
608− function expand_hello_world(inline)
609− if inline.c == '{{helloworld}}' then
610− return pandoc.Emph{ pandoc.Str "Hello, World" }
616− return {{Str = expand_hello_world}}
618 In order of preference, pandoc will look for Lua filters in
609 In order of preference, pandoc will look for Lua filters in
620− 1. a specified full or relative path (executable or
611+ 1. a specified full or relative path
623− 2. `$DATADIR/filters` (executable or non-executable)
624− where `$DATADIR` is the user data directory (see
613+ 2. `$DATADIR/filters` where `$DATADIR` is the user data
625− `--data-dir`, above).
614+ directory (see `--data-dir`, above).
616+ Filters, Lua filters, and citeproc processing are applied in
617+ the order specified on the command line.
627`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]
619`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]
@@ -683,12 +675,12 @@ header when requesting a document from a URL:
683: Extract images and other media contained in or linked from
675: Extract images and other media contained in or linked from
684 the source document to the path *DIR*, creating it if
676 the source document to the path *DIR*, creating it if
685 necessary, and adjust the images references in the document
677 necessary, and adjust the images references in the document
686− so they point to the extracted files. If the source format is
678+ so they point to the extracted files. Media are downloaded,
687− a binary container (docx, epub, or odt), the media is
679+ read from the file system, or extracted from a binary
688− extracted from the container and the original
680+ container (e.g. docx), as needed. The original file paths
689− filenames are used. Otherwise the media is read from the
681+ are used if they are relative paths not containing `..`.
690− file system or downloaded, and new filenames are constructed
682+ Otherwise filenames are constructed from the SHA1 hash of
691− based on SHA1 hashes of the contents.
683+ the contents.
693`--abbreviations=`*FILE*
685`--abbreviations=`*FILE*
@@ -699,14 +691,15 @@ header when requesting a document from a URL:
699 system default, use
691 system default, use
700 `pandoc --print-default-data-file=abbreviations`. The only
692 `pandoc --print-default-data-file=abbreviations`. The only
701 use pandoc makes of this list is in the Markdown reader.
693 use pandoc makes of this list is in the Markdown reader.
702− Strings ending in a period that are found in this list will
694+ Strings found in this list will be followed by a nonbreaking
703− be followed by a nonbreaking space, so that the period will
704− not produce sentence-ending space in formats like LaTeX.
695+ space, and the period will not produce sentence-ending space
696+ in formats like LaTeX. The strings may not contain spaces.
706[`pandocfilters`]: https://github.com/jgm/pandocfilters
698[`pandocfilters`]: https://github.com/jgm/pandocfilters
707[PHP]: https://github.com/vinai/pandocfilters-php
699[PHP]: https://github.com/vinai/pandocfilters-php
708[perl]: https://metacpan.org/pod/Pandoc::Filter
700[perl]: https://metacpan.org/pod/Pandoc::Filter
709[JavaScript/node.js]: https://github.com/mvhenderson/pandoc-filter-node
701[JavaScript/node.js]: https://github.com/mvhenderson/pandoc-filter-node
702+[Lua filters documentation]: https://pandoc.org/lua-filters.html
711## General writer options {.options}
704## General writer options {.options}
@@ -898,11 +891,11 @@ header when requesting a document from a URL:
898 will not be searched. For example:
891 will not be searched. For example:
899 `--resource-path=.:test` will search the working directory
892 `--resource-path=.:test` will search the working directory
900 and the `test` subdirectory, in that order.
893 and the `test` subdirectory, in that order.
901−
894+ This option can be used repeatedly. Search path components
902− `--resource-path` only has an effect if (a) the output
895+ that come later on the command line will be searched before
903− format embeds images (for example, `docx`, `pdf`, or `html`
896+ those that come earlier, so
904− with `--self-contained`) or (b) it is used together with
897+ `--resource-path foo:bar --resource-path baz:bim` is
905− `--extract-media`.
898+ equivalent to `--resource-path baz:bim:foo:bar`.
907`--request-header=`*NAME*`:`*VAL*
900`--request-header=`*NAME*`:`*VAL*
@@ -914,7 +907,7 @@ header when requesting a document from a URL:
915`--no-check-certificate`
908`--no-check-certificate`
917−: Disable the certificate verification to allow access to
910+: Disable the certificate verification to allow access to
918 unsecure HTTP resources (for example when the certificate
911 unsecure HTTP resources (for example when the certificate
919 is no longer valid or self signed).
912 is no longer valid or self signed).
@@ -963,37 +956,45 @@ header when requesting a document from a URL:
963 placement of link references is affected by the
956 placement of link references is affected by the
964 `--reference-location` option.
957 `--reference-location` option.
966−`--reference-location = block`|`section`|`document`
959+`--reference-location=block`|`section`|`document`
968: Specify whether footnotes (and references, if `reference-links` is
961: Specify whether footnotes (and references, if `reference-links` is
969 set) are placed at the end of the current (top-level) block, the
962 set) are placed at the end of the current (top-level) block, the
970 current section, or the document. The default is
963 current section, or the document. The default is
971 `document`. Currently only affects the markdown writer.
964 `document`. Currently only affects the markdown writer.
966+`--markdown-headings=setext`|`atx`
968+: Specify whether to use ATX-style (`#`-prefixed) or
969+ Setext-style (underlined) headings for level 1 and 2
970+ headings in Markdown output. (The default is `atx`.)
971+ ATX-style headings are always used for levels 3+.
972+ This option also affects Markdown cells in `ipynb` output.
973`--atx-headers`
974`--atx-headers`
975−: Use ATX-style headings in Markdown output. The default is
976+: *Deprecated synonym for `--markdown-headings=atx`.*
976− to use setext-style headings for levels 1 to 2, and then ATX headings.
977− (Note: for `gfm` output, ATX headings are always used.)
978− This option also affects markdown cells in `ipynb` output.
980−`--top-level-division=[default|section|chapter|part]`
978+`--top-level-division=default`|`section`|`chapter`|`part`
982−: Treat top-level headings as the given division type in LaTeX, ConTeXt,
980+: Treat top-level headings as the given division type in
983− DocBook, and TEI output. The hierarchy order is part, chapter, then section;
981+ LaTeX, ConTeXt, DocBook, and TEI output. The hierarchy
982+ order is part, chapter, then section; all headings are
984− all headings are shifted such that the top-level heading becomes the specified
983+ shifted such that the top-level heading becomes the
985− type. The default behavior is to determine the best division type via
984+ specified type. The default behavior is to determine the
986− heuristics: unless other conditions apply, `section` is chosen. When the
985+ best division type via heuristics: unless other conditions
986+ apply, `section` is chosen. When the `documentclass`
987− `documentclass` variable is set to `report`, `book`, or `memoir` (unless the
987+ variable is set to `report`, `book`, or `memoir` (unless the
988− `article` option is specified), `chapter` is implied as the setting for this
988+ `article` option is specified), `chapter` is implied as the
989− option. If `beamer` is the output format, specifying either `chapter` or
989+ setting for this option. If `beamer` is the output format,
990+ specifying either `chapter` or `part` will cause top-level
990− `part` will cause top-level headings to become `\part{..}`, while
991+ headings to become `\part{..}`, while second-level headings
991− second-level headings remain as their default type.
992+ remain as their default type.
993`-N`, `--number-sections`
994`-N`, `--number-sections`
995−: Number section headings in LaTeX, ConTeXt, HTML, Docx, or EPUB output.
996+: Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB
996− By default, sections are not numbered. Sections with class
997+ output. By default, sections are not numbered. Sections with class
997 `unnumbered` will never be numbered, even if `--number-sections`
998 `unnumbered` will never be numbered, even if `--number-sections`
998 is specified.
999 is specified.
@@ -1326,7 +1327,10 @@ header when requesting a document from a URL:
1326: Set the `bibliography` field in the document's metadata to *FILE*,
1327: Set the `bibliography` field in the document's metadata to *FILE*,
1327 overriding any value set in the metadata. If you supply
1328 overriding any value set in the metadata. If you supply
1328 this argument multiple times, each *FILE* will be added to
1329 this argument multiple times, each *FILE* will be added to
1329− bibliography.
1330+ bibliography. If *FILE* is a URL, it will be fetched
1331+ via HTTP. If *FILE* is not found relative to the
1332+ working directory, it will be sought in the resource path
1333+ (see `--resource-path`).
1331`--csl=`*FILE*
1335`--csl=`*FILE*
@@ -1335,8 +1339,8 @@ header when requesting a document from a URL:
1335 `--metadata csl=FILE`.) If *FILE* is a URL, it will be
1339 `--metadata csl=FILE`.) If *FILE* is a URL, it will be
1336 fetched via HTTP. If *FILE* is not found relative to the
1340 fetched via HTTP. If *FILE* is not found relative to the
1337 working directory, it will be sought in the resource path
1341 working directory, it will be sought in the resource path
1338− and finally in the `csl` subdirectory of the
1342+ (see `--resource-path`) and finally in the `csl`
1339− pandoc user data directory.
1343+ subdirectory of the pandoc user data directory.
1341`--citation-abbreviations=`*FILE*
1345`--citation-abbreviations=`*FILE*
@@ -1345,28 +1349,31 @@ header when requesting a document from a URL:
1345 `--metadata citation-abbreviations=FILE`.)
1349 `--metadata citation-abbreviations=FILE`.)
1346 If *FILE* is a URL, it will be fetched via HTTP. If *FILE* is not
1350 If *FILE* is a URL, it will be fetched via HTTP. If *FILE* is not
1347 found relative to the working directory, it will be sought
1351 found relative to the working directory, it will be sought
1348− in the resource path and finally in the `csl` subdirectory
1352+ in the resource path (see `--resource-path`) and finally in
1349− of the pandoc user data directory.
1353+ the `csl` subdirectory of the pandoc user data directory.
1351`--natbib`
1355`--natbib`
1353−: Use [`natbib`] for citations in LaTeX output. This option is not for use
1357+: Use [`natbib`] for citations in LaTeX output. This option
1354− with the `--citeproc` option or with PDF output. It is intended for
1358+ is not for use with the `--citeproc` option or with PDF
1359+ output. It is intended for use in producing a LaTeX file
1355− use in producing a LaTeX file that can be processed with [`bibtex`].
1360+ that can be processed with [`bibtex`].
1357`--biblatex`
1362`--biblatex`
1359−: Use [`biblatex`] for citations in LaTeX output. This option is not for use
1364+: Use [`biblatex`] for citations in LaTeX output. This option
1360− with the `--citeproc` option or with PDF output. It is intended for
1365+ is not for use with the `--citeproc` option or with PDF
1366+ output. It is intended for use in producing a LaTeX file
1361− use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
1367+ that can be processed with [`bibtex`] or [`biber`].
1363## Math rendering in HTML {.options}
1369## Math rendering in HTML {.options}
1365−The default is to render TeX math as far as possible using Unicode characters.
1371+The default is to render TeX math as far as possible using
1372+Unicode characters. Formulas are put inside a `span` with
1366−Formulas are put inside a `span` with `class="math"`, so that they may be styled
1373+`class="math"`, so that they may be styled differently from the
1367−differently from the surrounding text if needed. However, this gives acceptable
1374+surrounding text if needed. However, this gives acceptable
1368−results only for basic math, usually you will want to use `--mathjax` or another
1375+results only for basic math, usually you will want to use
1369−of the following options.
1376+`--mathjax` or another of the following options.
1371`--mathjax`[`=`*URL*]
1378`--mathjax`[`=`*URL*]
@@ -1380,10 +1387,11 @@ of the following options.
1381`--mathml`
1388`--mathml`
1383−: Convert TeX math to [MathML] (in `epub3`, `docbook4`, `docbook5`, `jats`,
1390+: Convert TeX math to [MathML] (in `epub3`, `docbook4`,
1391+ `docbook5`, `jats`, `html4` and `html5`). This is the
1384− `html4` and `html5`). This is the default in `odt` output. Note that
1392+ default in `odt` output. Note that currently only Firefox
1385− currently only Firefox and Safari (and select e-book readers) natively
1393+ and Safari (and select e-book readers) natively support
1386− support MathML.
1394+ MathML.
1388`--webtex`[`=`*URL*]
1396`--webtex`[`=`*URL*]
@@ -1407,13 +1415,12 @@ of the following options.
1407`--gladtex`
1415`--gladtex`
1409: Enclose TeX math in `<eq>` tags in HTML output. The resulting HTML
1417: Enclose TeX math in `<eq>` tags in HTML output. The resulting HTML
1410− can then be processed by [GladTeX] to produce images of the typeset
1418+ can then be processed by [GladTeX] to produce SVG images of the typeset
1411− formulas and an HTML file with links to these images.
1419+ formulas and an HTML file with these images embedded.
1412− So, the procedure is:
1414 pandoc -s --gladtex input.md -o myfile.htex
1421 pandoc -s --gladtex input.md -o myfile.htex
1415− gladtex -d myfile-images myfile.htex
1422+ gladtex -d image_dir myfile.htex
1416− # produces myfile.html and images in myfile-images
1423+ # produces myfile.html and images in image_dir
1418[MathML]: https://www.w3.org/Math/
1425[MathML]: https://www.w3.org/Math/
1419[MathJax]: https://www.mathjax.org
1426[MathJax]: https://www.mathjax.org
@@ -1461,6 +1468,7 @@ Nonzero exit codes have the following meanings:
1461 24 PandocCiteprocError
1468 24 PandocCiteprocError
1462 31 PandocEpubSubdirectoryError
1469 31 PandocEpubSubdirectoryError
1463 43 PandocPDFError
1470 43 PandocPDFError
1464 47 PandocPDFProgramNotFoundError
1472 47 PandocPDFProgramNotFoundError
1465 61 PandocHttpError
1473 61 PandocHttpError
1466 62 PandocShouldNeverHappenError
1474 62 PandocShouldNeverHappenError
@@ -1473,6 +1481,7 @@ Nonzero exit codes have the following meanings:
1473 91 PandocMacroLoop
1481 91 PandocMacroLoop
1474 92 PandocUTF8DecodingError
1482 92 PandocUTF8DecodingError
1475 93 PandocIpynbDecodingError
1483 93 PandocIpynbDecodingError
1484+ 94 PandocUnsupportedCharsetError
1476 97 PandocCouldNotFindDataFileError
1485 97 PandocCouldNotFindDataFileError
1477 99 PandocResourceNotFound
1486 99 PandocResourceNotFound
1478----- ------------------------------------
1487----- ------------------------------------
@@ -1497,6 +1506,16 @@ input-files:
1497- content.md
1506- content.md
1498# or you may use input-file: with a single value
1507# or you may use input-file: with a single value
1509+# Include options from the specified defaults files.
1510+# The files will be searched for first in the working directory
1511+# and then in the defaults subdirectory of the user data directory.
1512+# The files are included in the same order in which they appear in
1513+# the list. Options specified in this defaults file always have
1514+# priority over the included ones.
1500template: letter
1519template: letter
1501standalone: true
1520standalone: true
1502self-contained: false
1521self-contained: false
@@ -1554,8 +1573,11 @@ data-dir:
1554verbosity: INFO
1573verbosity: INFO
1555log-file: log.json
1574log-file: log.json
1557−# citeproc, natbib, or biblatex
1576+# citeproc, natbib, or biblatex. This only affects LaTeX
1577+# output. If you want to use citeproc to format citations,
1578+# you should also set 'citeproc: true' (see above).
1558cite-method: citeproc
1579cite-method: citeproc
1559# part, chapter, section, or default:
1581# part, chapter, section, or default:
1560top-level-division: chapter
1582top-level-division: chapter
1561abbreviations:
1583abbreviations:
@@ -1624,7 +1646,7 @@ epub-cover-image: cover.jpg
1624reference-links: true
1646reference-links: true
1625# block, section, or document
1647# block, section, or document
1626reference-location: block
1648reference-location: block
1627−atx-headers: false
1649+markdown-headings: setext
1629# accept, reject, or all
1651# accept, reject, or all
1630track-changes: accept
1652track-changes: accept
@@ -1654,6 +1676,34 @@ one line:
1654verbosity: INFO
1676verbosity: INFO
1679+In fields that expect a file path (or list of file paths), the
1680+following syntax may be used to interpolate environment variables:
1683+csl: ${HOME}/mycsldir/special.csl
1686+`${USERDATA}` may also be used; this will always resolve to the
1687+user data directory that is current when the defaults file is
1688+parsed, regardless of the setting of the environment
1689+variable `USERDATA`.
1691+`${.}` will resolve to the directory containing the default
1692+file itself. This allows you to refer to resources contained
1696+epub-cover-image: ${.}/cover.jpg
1697+epub-metadata: ${.}/meta.xml
1699+- . # the working directory from which pandoc is run
1700+- ${.}/images # the images subdirectory of the directory
1701+ # containing this defaults file
1704+This environment variable interpolation syntax *only* works in
1705+fields that expect file paths.
1657Default files can be placed in the `defaults` subdirectory of
1707Default files can be placed in the `defaults` subdirectory of
1658the user data directory and used from any directory. For
1708the user data directory and used from any directory. For
1659example, one could create a file specifying defaults for writing
1709example, one could create a file specifying defaults for writing
@@ -1881,7 +1931,8 @@ ${ styles.html() }
1883(If a partial is not found in the directory of the
1933(If a partial is not found in the directory of the
1934+template and the template path is given as a relative
1884−template, it will also be sought in the `templates`
1935+path, it will also be sought in the `templates`
1885subdirectory of the user data directory.)
1936subdirectory of the user data directory.)
1887Partials may optionally be applied to variables using
1938Partials may optionally be applied to variables using
@@ -2099,7 +2150,8 @@ Currently the following pipes are predefined:
2099 including a title block in the document itself, you can
2150 including a title block in the document itself, you can
2100 set the `title-meta`, `author-meta`, and `date-meta`
2151 set the `title-meta`, `author-meta`, and `date-meta`
2101 variables. (By default these are set automatically, based
2152 variables. (By default these are set automatically, based
2102− on `title`, `author`, and `date`.)
2153+ on `title`, `author`, and `date`.) The page title in HTML
2154+ is set by `pagetitle`, which is equal to `title` by default.
2104`subtitle`
2156`subtitle`
2105: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
2157: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
@@ -2173,15 +2225,16 @@ ODT or pptx.
2173: the base script direction, either `rtl` (right-to-left)
2225: the base script direction, either `rtl` (right-to-left)
2174 or `ltr` (left-to-right).
2226 or `ltr` (left-to-right).
2176− For bidirectional documents, native pandoc `span`s and `div`s
2228+ For bidirectional documents, native pandoc `span`s and
2177− with the `dir` attribute (value `rtl` or `ltr`) can be used to
2229+ `div`s with the `dir` attribute (value `rtl` or `ltr`) can
2178− override the base direction in some output formats.
2230+ be used to override the base direction in some output
2179− This may not always be necessary if the final renderer
2231+ formats. This may not always be necessary if the final
2180− (e.g. the browser, when generating HTML) supports the
2232+ renderer (e.g. the browser, when generating HTML) supports
2181− [Unicode Bidirectional Algorithm].
2233+ the [Unicode Bidirectional Algorithm].
2183− When using LaTeX for bidirectional documents, only the `xelatex` engine
2235+ When using LaTeX for bidirectional documents, only the
2236+ `xelatex` engine is fully supported (use
2184− is fully supported (use `--pdf-engine=xelatex`).
2237+ `--pdf-engine=xelatex`).
2186[BCP 47]: https://tools.ietf.org/html/bcp47
2239[BCP 47]: https://tools.ietf.org/html/bcp47
2187[Unicode Bidirectional Algorithm]: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics
2240[Unicode Bidirectional Algorithm]: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics
@@ -2253,15 +2306,16 @@ To override or extend some [CSS] for just one document, include for example:
2253### Variables for HTML math
2306### Variables for HTML math
2255`classoption`
2308`classoption`
2256−: when using [KaTeX](#option--katex), you can render display math equations
2309+: when using [KaTeX](#option--katex), you can render display
2257− flush left using [YAML metadata](#layout) or with `-M classoption=fleqn`.
2310+math equations flush left using [YAML metadata](#layout) or with
2311+`-M classoption=fleqn`.
2259### Variables for HTML slides
2313### Variables for HTML slides
2261These affect HTML output when [producing slide shows with pandoc].
2315These affect HTML output when [producing slide shows with pandoc].
2263−All [reveal.js configuration options] are available as variables.
2317+`institute`
2264−To turn off boolean flags that default to true in reveal.js, use `0`.
2318+: author affiliations: can be a list when there are multiple authors
2266`revealjs-url`
2320`revealjs-url`
2267: base URL for reveal.js documents (defaults to
2321: base URL for reveal.js documents (defaults to
@@ -2281,6 +2335,9 @@ To turn off boolean flags that default to true in reveal.js, use `0`.
2281: additional attributes for the title slide of reveal.js slide shows.
2335: additional attributes for the title slide of reveal.js slide shows.
2282 See [background in reveal.js and beamer] for an example.
2336 See [background in reveal.js and beamer] for an example.
2338+All [reveal.js configuration options] are available as variables.
2339+To turn off boolean flags that default to true in reveal.js, use `0`.
2284[reveal.js configuration options]: https://revealjs.com/config/
2341[reveal.js configuration options]: https://revealjs.com/config/
2286### Variables for Beamer slides
2343### Variables for Beamer slides
@@ -2366,9 +2423,10 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2368`documentclass`
2425`documentclass`
2369−: document class: usually one of the standard classes, [`article`], [`book`],
2426+: document class: usually one of the standard classes,
2427+ [`article`], [`book`], and [`report`]; the [KOMA-Script]
2370− and [`report`]; the [KOMA-Script] equivalents, `scrartcl`, `scrbook`,
2428+ equivalents, `scrartcl`, `scrbook`, and `scrreprt`, which
2371− and `scrreprt`, which default to smaller margins; or [`memoir`]
2429+ default to smaller margins; or [`memoir`]
2373`geometry`
2431`geometry`
2374: option for [`geometry`] package, e.g. `margin=1in`;
2432: option for [`geometry`] package, e.g. `margin=1in`;
@@ -2393,8 +2451,9 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2396−: if true, pandoc will use document class settings for indentation (the default LaTeX template
2454+: if true, pandoc will use document class settings for
2455+ indentation (the default LaTeX template otherwise removes
2397− otherwise removes indentation and adds space between paragraphs)
2456+ indentation and adds space between paragraphs)
2399`linestretch`
2458`linestretch`
2400: adjusts line spacing using the [`setspace`]
2459: adjusts line spacing using the [`setspace`]
@@ -2419,8 +2478,8 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2419#### Fonts
2478#### Fonts
2421`fontenc`
2480`fontenc`
2422−: allows font encoding to be specified through `fontenc` package (with `pdflatex`);
2481+: allows font encoding to be specified through `fontenc` package (with
2423− default is `T1` (see [LaTeX font encodings guide])
2482+ `pdflatex`); default is `T1` (see [LaTeX font encodings guide])
2425`fontfamily`
2484`fontfamily`
2426: font package for use with `pdflatex`:
2485: font package for use with `pdflatex`:
@@ -2490,7 +2549,8 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2490: contents of acknowledgments footnote after document title
2549: contents of acknowledgments footnote after document title
2493−: include table of contents (can also be set using `--toc/--table-of-contents`)
2552+: include table of contents (can also be set using
2553+ `--toc/--table-of-contents`)
2495`toc-depth`
2555`toc-depth`
2496: level of section to include in table of contents
2556: level of section to include in table of contents
@@ -2532,12 +2592,12 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2532: font size for body text (e.g. `10pt`, `12pt`)
2592: font size for body text (e.g. `10pt`, `12pt`)
2534`headertext`, `footertext`
2594`headertext`, `footertext`
2535−: text to be placed in running header or footer (see [ConTeXt Headers and Footers]);
2595+: text to be placed in running header or footer (see [ConTeXt Headers and
2536− repeat up to four times for different placement
2596+ Footers]); repeat up to four times for different placement
2538`indenting`
2598`indenting`
2539−: controls indentation of paragraphs, e.g. `yes,small,next` (see [ConTeXt Indentation]);
2599+: controls indentation of paragraphs, e.g. `yes,small,next` (see
2540− repeat for multiple options
2600+ [ConTeXt Indentation]); repeat for multiple options
2542`interlinespace`
2602`interlinespace`
2543: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);
2603: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);
@@ -2548,16 +2608,19 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2548 repeat for multiple options
2608 repeat for multiple options
2550`linkcolor`, `contrastcolor`
2610`linkcolor`, `contrastcolor`
2551−: color for links outside and inside a page, e.g. `red`, `blue` (see [ConTeXt Color])
2611+: color for links outside and inside a page, e.g. `red`, `blue` (see
2553`linkstyle`
2614`linkstyle`
2554−: typeface style for links, e.g. `normal`, `bold`, `slanted`, `boldslanted`, `type`, `cap`, `small`
2615+: typeface style for links, e.g. `normal`, `bold`, `slanted`, `boldslanted`,
2616+ `type`, `cap`, `small`
2556`lof`, `lot`
2618`lof`, `lot`
2557: include list of figures, list of tables
2619: include list of figures, list of tables
2559`mainfont`, `sansfont`, `monofont`, `mathfont`
2621`mainfont`, `sansfont`, `monofont`, `mathfont`
2560−: font families: take the name of any system font (see [ConTeXt Font Switching])
2622+: font families: take the name of any system font (see
2623+ [ConTeXt Font Switching])
2562`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
2625`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
2563: sets margins, if `layout` is not used (otherwise `layout`
2626: sets margins, if `layout` is not used (otherwise `layout`
@@ -2572,16 +2635,18 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2572 repeat for multiple options
2635 repeat for multiple options
2575−: adds to the preamble the setup necessary to generate PDF/A of the type
2638+: adds to the preamble the setup necessary to generate PDF/A
2576− specified, e.g. `1a:2005`, `2a`. If no type is specified (i.e. the value
2639+ of the type specified, e.g. `1a:2005`, `2a`. If no type is
2640+ specified (i.e. the value is set to True, by e.g.
2577− is set to True, by e.g. `--metadata=pdfa` or `pdfa: true` in a YAML metadata
2641+ `--metadata=pdfa` or `pdfa: true` in a YAML metadata block),
2578− block), `1b:2005` will be used as default, for reasons of backwards
2642+ `1b:2005` will be used as default, for reasons of backwards
2579− compatibility. Using `--variable=pdfa` without specified value is not supported.
2643+ compatibility. Using `--variable=pdfa` without specified value
2580− To successfully generate PDF/A the required ICC color profiles have to
2644+ is not supported. To successfully generate PDF/A the required
2581− be available and the content and all included files (such as images)
2645+ ICC color profiles have to be available and the content and all
2646+ included files (such as images) have to be standard conforming.
2582− have to be standard conforming. The ICC profiles and output intent
2647+ The ICC profiles and output intent may be specified using the
2583− may be specified using the variables `pdfaiccprofile` and `pdfaintent`.
2648+ variables `pdfaiccprofile` and `pdfaintent`. See also [ConTeXt
2584− See also [ConTeXt PDFA] for more details.
2649+ PDFA] for more details.
2586`pdfaiccprofile`
2651`pdfaiccprofile`
2587: when used in conjunction with `pdfa`, specifies the ICC profile to use
2652: when used in conjunction with `pdfa`, specifies the ICC profile to use
@@ -2596,10 +2661,12 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2596 If left unspecified, `sRGB IEC61966-2.1` is used as default.
2661 If left unspecified, `sRGB IEC61966-2.1` is used as default.
2599−: include table of contents (can also be set using `--toc/--table-of-contents`)
2664+: include table of contents (can also be set using
2665+ `--toc/--table-of-contents`)
2601`whitespace`
2667`whitespace`
2602−: spacing between paragraphs, e.g. `none`, `small` (using [`setupwhitespace`])
2668+: spacing between paragraphs, e.g. `none`, `small` (using
2669+ [`setupwhitespace`])
2604`includesource`
2671`includesource`
2605: include all source documents as file attachments in the PDF file
2672: include all source documents as file attachments in the PDF file
@@ -3002,6 +3069,43 @@ This extension can be enabled/disabled for the following formats:
3002output formats
3069output formats
3003: `odt`, `opendocument`
3070: `odt`, `opendocument`
3072+#### Extension: `xrefs_name` ####
3074+Links to headings, figures and tables inside the document are
3075+substituted with cross-references that will use the name or caption
3076+of the referenced item. The original link text is replaced once
3077+the generated document is refreshed. This extension can be combined
3078+with `xrefs_number` in which case numbers will appear before the
3081+Text in cross-references is only made consistent with the referenced
3082+item once the document has been refreshed.
3084+This extension can be enabled/disabled for the following formats:
3087+: `odt`, `opendocument`
3089+#### Extension: `xrefs_number` ####
3091+Links to headings, figures and tables inside the document are
3092+substituted with cross-references that will use the number
3093+of the referenced item. The original link text is discarded.
3094+This extension can be combined with `xrefs_name` in which case
3095+the name or caption numbers will appear after the number.
3097+For the `xrefs_number` to be useful heading numbers must be enabled
3098+in the generated document, also table and figure captions must be enabled
3099+using for example the `native_numbering` extension.
3101+Numbers in cross-references are only visible in the final document once
3102+it has been refreshed.
3104+This extension can be enabled/disabled for the following formats:
3107+: `odt`, `opendocument`
3005#### Extension: `styles` #### {#ext-styles}
3109#### Extension: `styles` #### {#ext-styles}
3007When converting from docx, read all docx styles as divs (for
3111When converting from docx, read all docx styles as divs (for
@@ -3028,8 +3132,15 @@ output format.
3029#### Extension: `citations` {#org-citations}
3133#### Extension: `citations` {#org-citations}
3031−Some aspects of [Pandoc's Markdown citation syntax](#citations) are also accepted
3135+Some aspects of [Pandoc's Markdown citation syntax](#citations)
3032−in `org` input.
3136+are also accepted in `org` input.
3138+#### Extension: `element_citations` ####
3140+In the `jats` output formats, this causes reference items to
3141+be replaced with `<element-citation>` elements. These
3142+elements are not influenced by CSL styles, but all information
3143+on the item is included in tags.
3034#### Extension: `ntb` ####
3145#### Extension: `ntb` ####
@@ -3137,7 +3248,8 @@ pandoc does require the space.
3138### Heading identifiers ###
3249### Heading identifiers ###
3251+See also the [`auto_identifiers`
3140−See also the [`auto_identifiers` extension](#extension-auto_identifiers) above.
3252+extension](#extension-auto_identifiers) above.
3142#### Extension: `header_attributes` ####
3254#### Extension: `header_attributes` ####
@@ -3259,11 +3371,12 @@ block in a block quote, you need five spaces after the `>`:
3260#### Extension: `blank_before_blockquote` ####
3372#### Extension: `blank_before_blockquote` ####
3262−Standard Markdown syntax does not require a blank line before a block
3374+Standard Markdown syntax does not require a blank line before a
3263−quote. Pandoc does require this (except, of course, at the beginning of the
3375+block quote. Pandoc does require this (except, of course, at
3264−document). The reason for the requirement is that it is all too easy for a
3376+the beginning of the document). The reason for the requirement
3377+is that it is all too easy for a `>` to end up at the beginning
3265−`>` to end up at the beginning of a line by accident (perhaps through line
3378+of a line by accident (perhaps through line wrapping). So,
3266−wrapping). So, unless the `markdown_strict` format is used, the following does
3379+unless the `markdown_strict` format is used, the following does
3267not produce a nested block quote in pandoc:
3380not produce a nested block quote in pandoc:
3269 > This is a block quote.
3382 > This is a block quote.
@@ -3332,14 +3445,16 @@ this syntax:
3332 qsort (filter (>= x) xs)
3445 qsort (filter (>= x) xs)
3333 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3446 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3335−Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
3448+Here `mycode` is an identifier, `haskell` and `numberLines` are
3336−`startFrom` is an attribute with value `100`. Some output formats can use this
3449+classes, and `startFrom` is an attribute with value `100`. Some
3450+output formats can use this information to do syntax
3337−information to do syntax highlighting. Currently, the only output formats
3451+highlighting. Currently, the only output formats that uses this
3338−that uses this information are HTML, LaTeX, Docx, Ms, and PowerPoint. If
3452+information are HTML, LaTeX, Docx, Ms, and PowerPoint. If
3339−highlighting is supported for your output format and language, then the code
3453+highlighting is supported for your output format and language,
3340−block above will appear highlighted, with numbered lines. (To see which
3454+then the code block above will appear highlighted, with numbered
3341−languages are supported, type `pandoc --list-highlight-languages`.) Otherwise,
3455+lines. (To see which languages are supported, type `pandoc
3456+--list-highlight-languages`.) Otherwise, the code block above
3342−the code block above will appear as follows:
3457+will appear as follows:
3344 <pre id="mycode" class="haskell numberLines" startFrom="100">
3459 <pre id="mycode" class="haskell numberLines" startFrom="100">
@@ -3402,6 +3517,9 @@ line must begin with a space.
3402 | 200 Main St.
3517 | 200 Main St.
3403 | Berkeley, CA 94718
3518 | Berkeley, CA 94718
3520+Inline formatting (such as emphasis) is allowed in the content,
3521+but not block-level formatting (such as block quotes or lists).
3405This syntax is borrowed from [reStructuredText].
3523This syntax is borrowed from [reStructuredText].
@@ -3605,11 +3723,12 @@ a blank line, and must be followed by one or more definitions.
3605A definition begins with a colon or tilde, which may be indented one
3723A definition begins with a colon or tilde, which may be indented one
3606or two spaces.
3724or two spaces.
3608−A term may have multiple definitions, and each definition may consist of one or
3726+A term may have multiple definitions, and each definition may
3609−more block elements (paragraph, code block, list, etc.), each indented four
3727+consist of one or more block elements (paragraph, code block,
3728+list, etc.), each indented four spaces or one tab stop. The
3610−spaces or one tab stop. The body of the definition (including the first line,
3729+body of the definition (including the first line, aside from the
3611−aside from the colon or tilde) should be indented four spaces. However,
3730+colon or tilde) should be indented four spaces. However, as with
3612−as with other Markdown lists, you can "lazily" omit indentation except
3731+other Markdown lists, you can "lazily" omit indentation except
3613at the beginning of a paragraph or other block element:
3732at the beginning of a paragraph or other block element:
@@ -3635,9 +3754,10 @@ definition:
3635Note that space between items in a definition list is required.
3754Note that space between items in a definition list is required.
3636(A variant that loosens this requirement, but disallows "lazy"
3755(A variant that loosens this requirement, but disallows "lazy"
3637hard wrapping, can be activated with `compact_definition_lists`: see
3756hard wrapping, can be activated with `compact_definition_lists`: see
3638−[Non-pandoc extensions], below.)
3757+[Non-default extensions], below.)
3759+[^3]: I have been influenced by the suggestions of [David
3640−[^3]: I have been influenced by the suggestions of [David Wheeler](https://justatheory.com/2009/02/modest-markdown-proposal/).
3760+ Wheeler](https://justatheory.com/2009/02/modest-markdown-proposal/).
3642### Numbered example lists ###
3762### Numbered example lists ###
@@ -4059,10 +4179,12 @@ option is used. All of the metadata will appear in a single block
4059at the beginning of the document.
4179at the beginning of the document.
4061Note that [YAML] escaping rules must be followed. Thus, for example,
4181Note that [YAML] escaping rules must be followed. Thus, for example,
4062−if a title contains a colon, it must be quoted. The pipe character
4182+if a title contains a colon, it must be quoted, and if it contains a
4183+backslash escape, then it must be ensured that it is not treated as a
4184+[YAML escape sequence]. The pipe character (`|`) can be used to begin
4063−(`|`) can be used to begin an indented block that will be interpreted
4185+an indented block that will be interpreted literally, without need for
4064−literally, without need for escaping. This form is necessary
4186+escaping. This form is necessary when the field contains blank lines
4065−when the field contains blank lines or block-level formatting:
4187+or block-level formatting:
4068 title: 'This is the title: it contains a colon'
4190 title: 'This is the title: it contains a colon'
@@ -4076,6 +4198,12 @@ when the field contains blank lines or block-level formatting:
4076 It consists of two paragraphs.
4198 It consists of two paragraphs.
4201+The literal block after the `|` must be indented relative to the
4202+line containing the `|`. If it is not, the YAML will be invalid
4203+and pandoc will not interpret it as metadata. For an overview
4204+of the complex rules governing YAML, see the [Wikipedia entry on
4079Template variables will be set automatically from the metadata. Thus, for
4207Template variables will be set automatically from the metadata. Thus, for
4080example, in writing HTML, the variable `abstract` will be set to the HTML
4208example, in writing HTML, the variable `abstract` will be set to the HTML
4081equivalent of the Markdown in the `abstract` field:
4209equivalent of the Markdown in the `abstract` field:
@@ -4122,6 +4250,24 @@ will be interpreted as markdown. For example:
4122 \renewcommand{\section}[1]{\clearpage\oldsection{#1}}
4250 \renewcommand{\section}[1]{\clearpage\oldsection{#1}}
4253+Note: the `yaml_metadata_block` extension works with
4254+`commonmark` as well as `markdown` (and it is enabled by default
4255+in `gfm` and `commonmark_x`). However, in these formats the
4256+following restrictions apply:
4258+- The YAML metadata block must occur at the beginning of the
4259+ document (and there can be only one). If multiple files are
4260+ given as arguments to pandoc, only the first can be a YAML
4263+- The leaf nodes of the YAML structure are parsed in isolation from
4264+ each other and from the rest of the document. So, for
4265+ example, you can't use a reference link in these contexts
4266+ if the link definition is somewhere else in the document.
4268+[YAML escape sequence]: https://yaml.org/spec/1.2/spec.html#id2776092
4269+[Wikipedia entry on YAML syntax]: https://en.m.wikipedia.org/wiki/YAML#Syntax
4125## Backslash escapes
4271## Backslash escapes
4127#### Extension: `all_symbols_escapable` ####
4273#### Extension: `all_symbols_escapable` ####
@@ -4279,7 +4425,8 @@ you need to enclose text in literal `$` characters, backslash-escape
4279them and they won't be treated as math delimiters.
4425them and they won't be treated as math delimiters.
4281For display math, use `$$` delimiters. (In this case, the delimiters
4427For display math, use `$$` delimiters. (In this case, the delimiters
4282−may be separated from the formula by whitespace.)
4428+may be separated from the formula by whitespace. However, there can be
4429+no blank lines betwen the opening and closing `$$` delimiters.)
4284TeX math will be printed in all output formats. How it is rendered
4431TeX math will be printed in all output formats. How it is rendered
4285depends on the output format:
4432depends on the output format:
@@ -4397,8 +4544,8 @@ into
4398whereas `Markdown.pl` will preserve it as is.
4545whereas `Markdown.pl` will preserve it as is.
4400−There is one exception to this rule: text between `<script>` and
4547+There is one exception to this rule: text between `<script>`,
4401−`<style>` tags is not interpreted as Markdown.
4548+`<style>`, and `<textarea>` tags is not interpreted as Markdown.
4403This departure from standard Markdown should make it easier to mix
4550This departure from standard Markdown should make it easier to mix
4404Markdown with HTML block elements. For example, one can surround
4551Markdown with HTML block elements. For example, one can surround
@@ -4813,37 +4960,68 @@ Inline and regular footnotes may be mixed freely.
4814#### Extension: `citations` ####
4961#### Extension: `citations` ####
4816−Markdown citations go inside square brackets and are separated
4963+To cite a bibliographic item with an identifier foo, use the
4817−by semicolons. Each citation must have a key, composed of '@' +
4964+syntax `@foo`. Normal citations should be included in square
4818−the citation identifier from the database, and may optionally
4965+brackets, with semicolons separating distinct items:
4819−have a prefix, a locator, and a suffix. The citation key must
4966+
4967+ Blah blah [@doe99; @smith2000; @smith2004].
4969+How this is rendered depends on the citation style. In an
4970+author-date style, it might render as
4972+ Blah blah (Doe 1999, Smith 2000, 2004).
4974+In a footnote style, it might render as
4978+ [^1]: John Doe, "Frogs," *Journal of Amphibians* 44 (1999);
4979+ Susan Smith, "Flies," *Journal of Insects* (2000);
4980+ Susan Smith, "Bees," *Journal of Insects* (2004).
4982+See the [CSL user documentation] for more information about CSL
4983+styles and how they affect rendering.
4820−begin with a letter, digit, or `_`, and may contain
4985+Unless a citation key start with a letter, digit, or `_`,
4821−alphanumerics, `_`, and internal punctuation characters
4986+and contains only alphanumerics and internal punctuation
4822−(`:.#$%&-+?<>~/`). Here are some examples:
4987+characters (`:.#$%&-+?<>~/`), it must be surrounded
4823−
4988+by curly braces, which are not considered part of the key.
4824− Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
4989+In `@Foo_bar.baz.`, the key is `Foo_bar.baz`. The final
4825−
4990+period is not *internal* punctuation, so it is not included in
4826− Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
4991+the key. In `@{Foo_bar.baz.}`, the key is `Foo_bar.baz.`, including
4827−
4992+the final period. The curly braces are recommended if you use URLs as
4828− Blah blah [@smith04; @doe99].
4993+keys: `[@{https://example.com/bib?name=foobar&date=2000}, p. 33]`.
4995+Citation items may optionally include a prefix, a locator, and
4998+ Blah blah [see @doe99, pp. 33-35 and *passim*; @smith04, chap. 1].
5000+The first item (`doe99`) has prefix `see `, locator `pp. 33-35`,
5001+and suffix `and *passim*`. The second item (`smith04`) has
5002+locator `chap. 1` and no prefix or suffix.
5004+Pandoc uses some heuristics to separate the locator from the
5005+rest of the subject. It is sensitive to the locator terms
4830−`pandoc` detects locator terms in the [CSL locale files].
5006+defined in the [CSL locale files]. Either abbreviated or
4831−Either abbreviated or unabbreviated forms are accepted. In the `en-US`
5007+unabbreviated forms are accepted. In the `en-US` locale, locator
4832−locale, locator terms can be written in either singular or plural forms,
5008+terms can be written in either singular or plural forms, as
4833−as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
5009+`book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
4834−`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`, `fol.`/`fols.`;
5010+`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`,
4835−`number`, `no.`/`nos.`; `line`, `l.`/`ll.`; `note`, `n.`/`nn.`; `opus`,
5011+`fol.`/`fols.`; `number`, `no.`/`nos.`; `line`, `l.`/`ll.`;
5012+`note`, `n.`/`nn.`; `opus`, `op.`/`opp.`; `page`, `p.`/`pp.`;
4836−`op.`/`opp.`; `page`, `p.`/`pp.`; `paragraph`, `para.`/`paras.`; `part`,
5013+`paragraph`, `para.`/`paras.`; `part`, `pt.`/`pts.`; `section`,
4837−`pt.`/`pts.`; `section`, `sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`;
5014+`sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`; `verse`,
4838−`verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
5015+`v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
4839locator term is used, "page" is assumed.
5016locator term is used, "page" is assumed.
4841−`pandoc` will use heuristics to distinguish the locator
5018+In complex cases, you can force something to be treated as
4842−from the suffix. In complex cases, the locator can be enclosed
4843−in curly braces:
5019+a locator by enclosing it in curly braces or prevent parsing
5020+the suffix as locator by prepending curly braces:
4845 [@smith{ii, A, D-Z}, with a suffix]
5022 [@smith{ii, A, D-Z}, with a suffix]
4846 [@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
5023 [@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
5024+ [@smith{}, 99 years later]
4848A minus sign (`-`) before the `@` will suppress mention of
5026A minus sign (`-`) before the `@` will suppress mention of
4849the author in the citation. This can be useful when the
5027the author in the citation. This can be useful when the
@@ -4851,13 +5029,26 @@ author is already mentioned in the text:
4852 Smith says blah [-@smith04].
5030 Smith says blah [-@smith04].
4854−You can also write an in-text citation, as follows:
5032+You can also write an author-in-text citation, by omitting the
4856 @smith04 says blah.
5035 @smith04 says blah.
4858 @smith04 [p. 33] says blah.
5037 @smith04 [p. 33] says blah.
5039+This will cause the author's name to be rendered, followed by
5040+the bibliographical details. Use this form when you want to
5041+make the citation the subject of a sentence.
5043+When you are using a note style, it is usually better to let
5044+citeproc create the footnotes from citations rather than writing
5045+an explicit note. If you do write an explicit note that
5046+contains a citation, note that normal citations will be put in
5047+parentheses, while author-in-text citations will not. For
5048+this reason, it is sometimes preferable to use the
5049+author-in-text style inside notes when using a note style.
5051+[CSL user documentation]: https://citationstyles.org/authors/
4861[CSL]: https://docs.citationstyles.org/en/stable/specification.html
5052[CSL]: https://docs.citationstyles.org/en/stable/specification.html
4862[CSL markup specs]: https://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
5053[CSL markup specs]: https://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
4863[Chicago Manual of Style]: https://chicagomanualofstyle.org
5054[Chicago Manual of Style]: https://chicagomanualofstyle.org
@@ -4866,13 +5057,44 @@ You can also write an in-text citation, as follows:
4866[finding and editing styles]: https://citationstyles.org/authors/
5057[finding and editing styles]: https://citationstyles.org/authors/
4867[CSL locale files]: https://github.com/citation-style-language/locales
5058[CSL locale files]: https://github.com/citation-style-language/locales
4869−## Non-pandoc extensions
5060+## Non-default extensions
4871The following Markdown syntax extensions are not enabled by default
5062The following Markdown syntax extensions are not enabled by default
4872in pandoc, but may be enabled by adding `+EXTENSION` to the format
5063in pandoc, but may be enabled by adding `+EXTENSION` to the format
4873name, where `EXTENSION` is the name of the extension. Thus, for
5064name, where `EXTENSION` is the name of the extension. Thus, for
4874example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
5065example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
5067+#### Extension: `rebase_relative_paths` ####
5069+Rewrite relative paths for Markdown links and images, depending
5070+on the path of the file containing the link or image link. For
5071+each link or image, pandoc will compute the directory of the
5072+containing file, relative to the working directory, and prepend
5073+the resulting path to the link or image path.
5075+The use of this extension is best understood by example.
5076+Suppose you have a a subdirectory for each chapter of a book,
5077+`chap1`, `chap2`, `chap3`. Each contains a file `text.md` and a
5078+number of images used in the chapter. You would like to have
5079+`` in `chap1/text.md` refer to
5080+`chap1/spider.jpg` and `` in `chap2/text.md`
5081+refer to `chap2/spider.jpg`. To do this, use
5083+ pandoc chap*/*.md -f markdown+rebase_relative_paths
5085+Without this extension, you would have to use
5086+`` in `chap1/text.md` and
5087+`` in `chap2/text.md`. Links with
5088+relative paths will be rewritten in the same way as images.
5090+Absolute paths and URLs are not changed. Neither are empty
5091+paths or paths consisting entirely of a fragment, e.g., `#foo`.
5093+Note that relative paths in reference links and images will
5094+be rewritten relative to the file containing the link
5095+reference definition, not the file containing the reference link
5096+or image itself, if these differ.
4876#### Extension: `attributes` ####
5098#### Extension: `attributes` ####
4878Allows attributes to be attached to any inline or block-level
5100Allows attributes to be attached to any inline or block-level
@@ -5059,6 +5281,13 @@ for regular emphasis, add extra blank space around headings.
5060 [Project Gutenberg]: https://www.gutenberg.org
5282 [Project Gutenberg]: https://www.gutenberg.org
5284+#### Extension: `sourcepos` ####
5286+Include source position attributes when parsing `commonmark`.
5287+For elements that accept attributes, a `data-pos` attribute
5288+is added; other elements are placed in a surrounding
5289+Div or Span elemnet with a `data-pos` attribute.
5062## Markdown variants
5291## Markdown variants
5064In addition to pandoc's extended Markdown, the following Markdown
5293In addition to pandoc's extended Markdown, the following Markdown
@@ -5173,17 +5402,21 @@ array of YAML-encoded references, for example:
5173 language: en-GB
5402 language: en-GB
5405+If both an external bibliography and inline (YAML metadata)
5406+references are provided, both will be used. In case of
5407+conflicting `id`s, the inline references will take precedence.
5176Note that `pandoc` can be used to produce such a YAML metadata
5409Note that `pandoc` can be used to produce such a YAML metadata
5177section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
5410section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
5179 pandoc chem.bib -s -f biblatex -t markdown
5412 pandoc chem.bib -s -f biblatex -t markdown
5180 pandoc chem.json -s -f csljson -t markdown
5413 pandoc chem.json -s -f csljson -t markdown
5182−`pandoc` can also be used to produce CSL JSON bibliography
5415+Indeed, `pandoc` can convert between any of these
5183−from BibTeX, BibLaTeX, or markdown YAML:
5416+citation formats:
5185 pandoc chem.bib -s -f biblatex -t csljson
5418 pandoc chem.bib -s -f biblatex -t csljson
5186− pandoc chem.yaml -s -f markdown -t csljson
5419+ pandoc chem.yaml -s -f markdown -t biblatex
5188Running pandoc on a bibliography file with the `--citeproc`
5421Running pandoc on a bibliography file with the `--citeproc`
5189option will create a formatted bibliography in the format
5422option will create a formatted bibliography in the format
@@ -5266,11 +5499,11 @@ The CSL project provides further information on [finding and
5266editing styles].
5499editing styles].
5268The `--citation-abbreviations` option (or the
5501The `--citation-abbreviations` option (or the
5269−`citation-abbreviations` metadata field) may be used to
5502+`citation-abbreviations` metadata field) may be used to specify
5270−specify a JSON file containing abbreviations of journals
5503+a JSON file containing abbreviations of journals that should be
5271−that should be used in formatted bibliographies when
5504+used in formatted bibliographies when `form="short"` is
5272−`form="short"` is specified. The format of the file
5505+specified. The format of the file can be illustrated with an
5273−can be illustrated with an example:
5506+example:
5276 { "default": {
5509 { "default": {
@@ -5282,6 +5515,34 @@ can be illustrated with an example:
5519+## Citations in note styles
5521+Pandoc's citation processing is designed to allow you to
5522+move between author-date, numerical, and note styles without
5523+modifying the markdown source. When you're using a note
5524+style, avoid inserting footnotes manually. Instead, insert
5525+citations just as you would in an author-date style---for
5528+ Blah blah [@foo, p. 33].
5530+The footnote will be created automatically. Pandoc will take
5531+care of removing the space and moving the note before or
5532+after the period, depending on the setting of
5533+`notes-after-punctuation`, as described below in [Other relevant
5536+In some cases you may need to put a citation inside a regular
5537+footnote. Normal citations in footnotes (such as `[@foo, p.
5538+33]`) will be rendered in parentheses. In-text citations (such
5539+as `@foo [p. 33]`) will be rendered without parentheses. (A
5540+comma will be added if appropriate.) Thus:
5542+ [^1]: Some studies [@foo; @bar, p. 33] show that
5543+ frubulicious zoosnaps are quantical. For a survey
5544+ of the literature, see @baz [chap. 1].
5285## Raw content in a style
5546## Raw content in a style
5287To include raw content in a prefix, suffix, delimiter, or term,
5548To include raw content in a prefix, suffix, delimiter, or term,
@@ -5367,10 +5628,23 @@ A few other metadata fields affect bibliography formatting:
5369: The `lang` field will affect how the style is localized,
5630: The `lang` field will affect how the style is localized,
5370− for example in the translation of labels and the use
5631+ for example in the translation of labels, the use
5632+ of quotation marks, and the way items are sorted.
5371− of quotation marks. (For backwards compatibility,
5633+ (For backwards compatibility, `locale` may be used instead
5372− `locale` may be used instead of `lang`, but this use
5373− is deprecated.)
5634+ of `lang`, but this use is deprecated.)
5636+ A BCP 47 language tag is expected: for example, `en`,
5637+ `de`, `en-US`, `fr-CA`, `ug-Cyrl`. The unicode extension
5638+ syntax (after `-u-`) may be used to specify options for
5639+ collation (sorting) more precisely. Here are some examples:
5641+ - `zh-u-co-pinyin` -- Chinese with the Pinyin collation.
5642+ - `es-u-co-trad` -- Spanish with the traditional collation
5643+ (with `Ch` sorting after `C`).
5644+ - `fr-u-kb` -- French with "backwards" accent sorting
5645+ (with `coté` sorting after `côte`).
5646+ - `en-US-u-kf-upper` -- English with uppercase letters sorting
5647+ before lower (default is lower before upper).
5375`notes-after-punctuation`
5649`notes-after-punctuation`
5376: If true (the default), pandoc will put footnote citations
5650: If true (the default), pandoc will put footnote citations
@@ -5382,12 +5656,6 @@ A few other metadata fields affect bibliography formatting:
5382 punctuation.
5656 punctuation.
5391# Slide shows
5659# Slide shows
5393You can use pandoc to produce an HTML + JavaScript slide presentation
5661You can use pandoc to produce an HTML + JavaScript slide presentation
@@ -5436,18 +5704,21 @@ To produce an HTML/JavaScript slide show, simply type
5437where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
5705where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
5439−For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with the
5707+For Slidy, Slideous, reveal.js, and S5, the file produced by
5440−`-s/--standalone` option embeds a link to JavaScript and CSS files, which are
5708+pandoc with the `-s/--standalone` option embeds a link to
5709+JavaScript and CSS files, which are assumed to be available at
5441−assumed to be available at the relative path `s5/default` (for S5), `slideous`
5710+the relative path `s5/default` (for S5), `slideous` (for
5442−(for Slideous), `reveal.js` (for reveal.js), or at the Slidy website at
5711+Slideous), `reveal.js` (for reveal.js), or at the Slidy website
5443−`w3.org` (for Slidy). (These paths can be changed by setting the `slidy-url`,
5712+at `w3.org` (for Slidy). (These paths can be changed by setting
5713+the `slidy-url`, `slideous-url`, `revealjs-url`, or `s5-url`
5444−`slideous-url`, `revealjs-url`, or `s5-url` variables; see [Variables for HTML slides],
5714+variables; see [Variables for HTML slides], above.) For
5445−above.) For DZSlides, the (relatively short) JavaScript and CSS are included in
5715+DZSlides, the (relatively short) JavaScript and CSS are included
5446−the file by default.
5716+in the file by default.
5448−With all HTML slide formats, the `--self-contained` option can be used to
5718+With all HTML slide formats, the `--self-contained` option can
5449−produce a single file that contains all of the data necessary to display the
5719+be used to produce a single file that contains all of the data
5720+necessary to display the slide show, including linked scripts,
5450−slide show, including linked scripts, stylesheets, images, and videos.
5721+stylesheets, images, and videos.
5452To produce a PDF slide show using beamer, type
5723To produce a PDF slide show using beamer, type
@@ -5477,7 +5748,11 @@ rules:
5477 * A heading at the slide level always starts a new slide.
5748 * A heading at the slide level always starts a new slide.
5479 * Headings *below* the slide level in the hierarchy create
5750 * Headings *below* the slide level in the hierarchy create
5480− headings *within* a slide.
5751+ headings *within* a slide. (In beamer, a "block" will be
5752+ created. If the heading has the class `example`, an
5753+ `exampleblock` environment will be used; if it has the class
5754+ `alert`, an `alertblock` will be used; otherwise a regular
5755+ `block` will be used.)
5482 * Headings *above* the slide level in the hierarchy create
5757 * Headings *above* the slide level in the hierarchy create
5483 "title slides," which just contain the section title
5758 "title slides," which just contain the section title
@@ -5810,6 +6085,15 @@ The following fields are recognized:
5812 ~ A string value.
6087 ~ A string value.
6089+`belongs-to-collection`
6090+ ~ A string value. identifies the name of a collection to which
6091+ the EPUB Publication belongs.
6094+ ~ The `group-position` field indicates the numeric position in which
6095+ the EPUB Publication belongs relative to other works belonging to
6096+ the same `belongs-to-collection` field.
5814`cover-image`
6098`cover-image`
5815 ~ A string value (path to cover image).
6099 ~ A string value (path to cover image).
@@ -6046,7 +6330,7 @@ Then edit `my.theme` and use it like this:
6046If you are not satisfied with the built-in highlighting, or you
6330If you are not satisfied with the built-in highlighting, or you
6047want highlight a language that isn't supported, you can use the
6331want highlight a language that isn't supported, you can use the
6048`--syntax-definition` option to load a [KDE-style XML syntax definition
6332`--syntax-definition` option to load a [KDE-style XML syntax definition
6049−file](https://docs.kde.org/stable5/en/applications/katepart/highlight.html).
6333+file](https://docs.kde.org/stable5/en/kate/katepart/highlight.html).
6050Before writing your own, have a look at KDE's [repository of syntax
6334Before writing your own, have a look at KDE's [repository of syntax
6051definitions](https://github.com/KDE/syntax-highlighting/tree/master/data/syntax).
6335definitions](https://github.com/KDE/syntax-highlighting/tree/master/data/syntax).
@@ -6177,6 +6461,21 @@ subdirectory of your user data directory (see [Templates]).
6178[Lua]: https://www.lua.org
6462[Lua]: https://www.lua.org
6464+# Reproducible builds
6466+Some of the document formats pandoc targets (such as EPUB,
6467+docx, and ODT) include build timestamps in the generated document.
6468+That means that the files generated on successive builds will
6469+differ, even if the source does not. To avoid this, set the
6470+`SOURCE_DATE_EPOCH` environment variable, and the timestamp will
6471+be taken from it instead of the current time.
6472+`SOURCE_DATE_EPOCH` should contain an integer unix timestamp
6473+(specifying the number of second since midnight UTC January 1, 1970).
6475+Some document formats also include a unique identifier. For
6476+EPUB, this can be set explicitly by setting the `identifier`
6477+metadata field (see [EPUB Metadata], above).
6180# A note on security
6479# A note on security
6182If you use pandoc to convert user-contributed content in a web
6481If you use pandoc to convert user-contributed content in a web
@@ -6205,13 +6504,13 @@ application, here are some things to keep in mind:
62054. The HTML generated by pandoc is not guaranteed to be safe.
65044. The HTML generated by pandoc is not guaranteed to be safe.
6206 If `raw_html` is enabled for the Markdown input, users can
6505 If `raw_html` is enabled for the Markdown input, users can
6207 inject arbitrary HTML. Even if `raw_html` is disabled,
6506 inject arbitrary HTML. Even if `raw_html` is disabled,
6208− users can include dangerous content in attributes for
6507+ users can include dangerous content in URLs and attributes.
6209− headings, spans, and code blocks. To be safe, you should
6210− run all the generated HTML through an HTML sanitizer.
6508+ To be safe, you should run all the generated HTML through
6212# Authors
6511# Authors
6214−Copyright 2006--2020 John MacFarlane (jgm@berkeley.edu). Released
6513+Copyright 2006--2021 John MacFarlane (jgm@berkeley.edu). Released
6215under the [GPL], version 2 or greater. This software carries no
6514under the [GPL], version 2 or greater. This software carries no
6216warranty of any kind. (See COPYRIGHT for full copyright and
6515warranty of any kind. (See COPYRIGHT for full copyright and
6217warranty notices.) For a full list of contributors, see the file
6516warranty notices.) For a full list of contributors, see the file