@@ -1,7 +1,7 @@
2title: Pandoc User's Guide
2title: Pandoc User's Guide
3author: John MacFarlane
3author: John MacFarlane
4−date: October 20, 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*]
@@ -665,30 +657,30 @@ header when requesting a document from a URL:
666: Specifies what to do with insertions, deletions, and comments
658: Specifies what to do with insertions, deletions, and comments
667 produced by the MS Word "Track Changes" feature. `accept` (the
659 produced by the MS Word "Track Changes" feature. `accept` (the
668− default), inserts all insertions, and ignores all
660+ default) processes all the insertions and deletions.
669− deletions. `reject` inserts all deletions and ignores
670− insertions. Both `accept` and `reject` ignore comments. `all` puts
661+ `reject` ignores them. Both `accept` and `reject` ignore comments.
671− in insertions, deletions, and comments, wrapped in spans with
662+ `all` includes all insertions, deletions, and comments, wrapped
672− `insertion`, `deletion`, `comment-start`, and `comment-end`
663+ in spans with `insertion`, `deletion`, `comment-start`, and
673− classes, respectively. The author and time of change is
664+ `comment-end` classes, respectively. The author and time of
674− included. `all` is useful for scripting: only accepting changes
665+ change is included. `all` is useful for scripting: only
675− from a certain reviewer, say, or before a certain date. If a
666+ accepting changes from a certain reviewer, say, or before a
676− paragraph is inserted or deleted, `track-changes=all` produces a
667+ certain date. If a paragraph is inserted or deleted,
668+ `track-changes=all` produces a span with the class
677− span with the class `paragraph-insertion`/`paragraph-deletion`
669+ `paragraph-insertion`/`paragraph-deletion` before the
678− before the affected paragraph break. This option only affects the
670+ affected paragraph break. This option only affects the docx
679− docx reader.
671+ reader.
681`--extract-media=`*DIR*
673`--extract-media=`*DIR*
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).
@@ -943,7 +936,9 @@ header when requesting a document from a URL:
944`--html-q-tags`
937`--html-q-tags`
946−: Use `<q>` tags for quotes in HTML.
939+: Use `<q>` tags for quotes in HTML. (This option only has an
940+ effect if the `smart` extension is enabled for the input
@@ -961,37 +956,45 @@ header when requesting a document from a URL:
961 placement of link references is affected by the
956 placement of link references is affected by the
962 `--reference-location` option.
957 `--reference-location` option.
964−`--reference-location = block`|`section`|`document`
959+`--reference-location=block`|`section`|`document`
966: Specify whether footnotes (and references, if `reference-links` is
961: Specify whether footnotes (and references, if `reference-links` is
967 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
968 current section, or the document. The default is
963 current section, or the document. The default is
969 `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.
971`--atx-headers`
974`--atx-headers`
973−: Use ATX-style headings in Markdown output. The default is
976+: *Deprecated synonym for `--markdown-headings=atx`.*
974− to use setext-style headings for levels 1 to 2, and then ATX headings.
975− (Note: for `gfm` output, ATX headings are always used.)
976− This option also affects markdown cells in `ipynb` output.
978−`--top-level-division=[default|section|chapter|part]`
978+`--top-level-division=default`|`section`|`chapter`|`part`
980−: Treat top-level headings as the given division type in LaTeX, ConTeXt,
980+: Treat top-level headings as the given division type in
981− 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
982− all headings are shifted such that the top-level heading becomes the specified
983+ shifted such that the top-level heading becomes the
983− type. The default behavior is to determine the best division type via
984+ specified type. The default behavior is to determine the
984− 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`
985− `documentclass` variable is set to `report`, `book`, or `memoir` (unless the
987+ variable is set to `report`, `book`, or `memoir` (unless the
986− `article` option is specified), `chapter` is implied as the setting for this
988+ `article` option is specified), `chapter` is implied as the
987− 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
988− `part` will cause top-level headings to become `\part{..}`, while
991+ headings to become `\part{..}`, while second-level headings
989− second-level headings remain as their default type.
992+ remain as their default type.
991`-N`, `--number-sections`
994`-N`, `--number-sections`
993−: Number section headings in LaTeX, ConTeXt, HTML, Docx, or EPUB output.
996+: Number section headings in LaTeX, ConTeXt, HTML, Docx, ms, or EPUB
994− By default, sections are not numbered. Sections with class
997+ output. By default, sections are not numbered. Sections with class
995 `unnumbered` will never be numbered, even if `--number-sections`
998 `unnumbered` will never be numbered, even if `--number-sections`
996 is specified.
999 is specified.
@@ -1324,7 +1327,10 @@ header when requesting a document from a URL:
1324: Set the `bibliography` field in the document's metadata to *FILE*,
1327: Set the `bibliography` field in the document's metadata to *FILE*,
1325 overriding any value set in the metadata. If you supply
1328 overriding any value set in the metadata. If you supply
1326 this argument multiple times, each *FILE* will be added to
1329 this argument multiple times, each *FILE* will be added to
1327− 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`).
1329`--csl=`*FILE*
1335`--csl=`*FILE*
@@ -1333,8 +1339,8 @@ header when requesting a document from a URL:
1333 `--metadata csl=FILE`.) If *FILE* is a URL, it will be
1339 `--metadata csl=FILE`.) If *FILE* is a URL, it will be
1334 fetched via HTTP. If *FILE* is not found relative to the
1340 fetched via HTTP. If *FILE* is not found relative to the
1335 working directory, it will be sought in the resource path
1341 working directory, it will be sought in the resource path
1336− and finally in the `csl` subdirectory of the
1342+ (see `--resource-path`) and finally in the `csl`
1337− pandoc user data directory.
1343+ subdirectory of the pandoc user data directory.
1339`--citation-abbreviations=`*FILE*
1345`--citation-abbreviations=`*FILE*
@@ -1343,28 +1349,31 @@ header when requesting a document from a URL:
1343 `--metadata citation-abbreviations=FILE`.)
1349 `--metadata citation-abbreviations=FILE`.)
1344 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
1345 found relative to the working directory, it will be sought
1351 found relative to the working directory, it will be sought
1346− in the resource path and finally in the `csl` subdirectory
1352+ in the resource path (see `--resource-path`) and finally in
1347− of the pandoc user data directory.
1353+ the `csl` subdirectory of the pandoc user data directory.
1349`--natbib`
1355`--natbib`
1351−: Use [`natbib`] for citations in LaTeX output. This option is not for use
1357+: Use [`natbib`] for citations in LaTeX output. This option
1352− 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
1353− use in producing a LaTeX file that can be processed with [`bibtex`].
1360+ that can be processed with [`bibtex`].
1355`--biblatex`
1362`--biblatex`
1357−: Use [`biblatex`] for citations in LaTeX output. This option is not for use
1364+: Use [`biblatex`] for citations in LaTeX output. This option
1358− 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
1359− use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
1367+ that can be processed with [`bibtex`] or [`biber`].
1361## Math rendering in HTML {.options}
1369## Math rendering in HTML {.options}
1363−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
1364−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
1365−differently from the surrounding text if needed. However, this gives acceptable
1374+surrounding text if needed. However, this gives acceptable
1366−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
1367−of the following options.
1376+`--mathjax` or another of the following options.
1369`--mathjax`[`=`*URL*]
1378`--mathjax`[`=`*URL*]
@@ -1378,10 +1387,11 @@ of the following options.
1379`--mathml`
1388`--mathml`
1381−: 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
1382− `html4` and `html5`). This is the default in `odt` output. Note that
1392+ default in `odt` output. Note that currently only Firefox
1383− currently only Firefox and Safari (and select e-book readers) natively
1393+ and Safari (and select e-book readers) natively support
1384− support MathML.
1394+ MathML.
1386`--webtex`[`=`*URL*]
1396`--webtex`[`=`*URL*]
@@ -1405,13 +1415,12 @@ of the following options.
1405`--gladtex`
1415`--gladtex`
1407: 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
1408− 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
1409− formulas and an HTML file with links to these images.
1419+ formulas and an HTML file with these images embedded.
1410− So, the procedure is:
1412 pandoc -s --gladtex input.md -o myfile.htex
1421 pandoc -s --gladtex input.md -o myfile.htex
1413− gladtex -d myfile-images myfile.htex
1422+ gladtex -d image_dir myfile.htex
1414− # produces myfile.html and images in myfile-images
1423+ # produces myfile.html and images in image_dir
1416[MathML]: https://www.w3.org/Math/
1425[MathML]: https://www.w3.org/Math/
1417[MathJax]: https://www.mathjax.org
1426[MathJax]: https://www.mathjax.org
@@ -1459,6 +1468,7 @@ Nonzero exit codes have the following meanings:
1459 24 PandocCiteprocError
1468 24 PandocCiteprocError
1460 31 PandocEpubSubdirectoryError
1469 31 PandocEpubSubdirectoryError
1461 43 PandocPDFError
1470 43 PandocPDFError
1462 47 PandocPDFProgramNotFoundError
1472 47 PandocPDFProgramNotFoundError
1463 61 PandocHttpError
1473 61 PandocHttpError
1464 62 PandocShouldNeverHappenError
1474 62 PandocShouldNeverHappenError
@@ -1471,6 +1481,7 @@ Nonzero exit codes have the following meanings:
1471 91 PandocMacroLoop
1481 91 PandocMacroLoop
1472 92 PandocUTF8DecodingError
1482 92 PandocUTF8DecodingError
1473 93 PandocIpynbDecodingError
1483 93 PandocIpynbDecodingError
1484+ 94 PandocUnsupportedCharsetError
1474 97 PandocCouldNotFindDataFileError
1485 97 PandocCouldNotFindDataFileError
1475 99 PandocResourceNotFound
1486 99 PandocResourceNotFound
1476----- ------------------------------------
1487----- ------------------------------------
@@ -1495,6 +1506,16 @@ input-files:
1495- content.md
1506- content.md
1496# 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.
1498template: letter
1519template: letter
1499standalone: true
1520standalone: true
1500self-contained: false
1521self-contained: false
@@ -1531,6 +1552,7 @@ csl: ieee
1531bibliography:
1552bibliography:
1532- foobar.bib
1553- foobar.bib
1533- barbaz.json
1554- barbaz.json
1555+citation-abbreviations: abbrevs.json
1535# Filters will be assumed to be Lua filters if they have
1557# Filters will be assumed to be Lua filters if they have
1536# the .lua extension, and json filters otherwise. But
1558# the .lua extension, and json filters otherwise. But
@@ -1551,8 +1573,11 @@ data-dir:
1551verbosity: INFO
1573verbosity: INFO
1552log-file: log.json
1574log-file: log.json
1554−# 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).
1555cite-method: citeproc
1579cite-method: citeproc
1556# part, chapter, section, or default:
1581# part, chapter, section, or default:
1557top-level-division: chapter
1582top-level-division: chapter
1558abbreviations:
1583abbreviations:
@@ -1621,7 +1646,7 @@ epub-cover-image: cover.jpg
1621reference-links: true
1646reference-links: true
1622# block, section, or document
1647# block, section, or document
1623reference-location: block
1648reference-location: block
1624−atx-headers: false
1649+markdown-headings: setext
1626# accept, reject, or all
1651# accept, reject, or all
1627track-changes: accept
1652track-changes: accept
@@ -1651,6 +1676,34 @@ one line:
1651verbosity: 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.
1654Default files can be placed in the `defaults` subdirectory of
1707Default files can be placed in the `defaults` subdirectory of
1655the user data directory and used from any directory. For
1708the user data directory and used from any directory. For
1656example, one could create a file specifying defaults for writing
1709example, one could create a file specifying defaults for writing
@@ -1878,7 +1931,8 @@ ${ styles.html() }
1880(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
1881−template, it will also be sought in the `templates`
1935+path, it will also be sought in the `templates`
1882subdirectory of the user data directory.)
1936subdirectory of the user data directory.)
1884Partials may optionally be applied to variables using
1938Partials may optionally be applied to variables using
@@ -2096,7 +2150,8 @@ Currently the following pipes are predefined:
2096 including a title block in the document itself, you can
2150 including a title block in the document itself, you can
2097 set the `title-meta`, `author-meta`, and `date-meta`
2151 set the `title-meta`, `author-meta`, and `date-meta`
2098 variables. (By default these are set automatically, based
2152 variables. (By default these are set automatically, based
2099− 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.
2101`subtitle`
2156`subtitle`
2102: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
2157: document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
@@ -2170,15 +2225,16 @@ ODT or pptx.
2170: the base script direction, either `rtl` (right-to-left)
2225: the base script direction, either `rtl` (right-to-left)
2171 or `ltr` (left-to-right).
2226 or `ltr` (left-to-right).
2173− For bidirectional documents, native pandoc `span`s and `div`s
2228+ For bidirectional documents, native pandoc `span`s and
2174− with the `dir` attribute (value `rtl` or `ltr`) can be used to
2229+ `div`s with the `dir` attribute (value `rtl` or `ltr`) can
2175− override the base direction in some output formats.
2230+ be used to override the base direction in some output
2176− This may not always be necessary if the final renderer
2231+ formats. This may not always be necessary if the final
2177− (e.g. the browser, when generating HTML) supports the
2232+ renderer (e.g. the browser, when generating HTML) supports
2178− [Unicode Bidirectional Algorithm].
2233+ the [Unicode Bidirectional Algorithm].
2180− 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
2181− is fully supported (use `--pdf-engine=xelatex`).
2237+ `--pdf-engine=xelatex`).
2183[BCP 47]: https://tools.ietf.org/html/bcp47
2239[BCP 47]: https://tools.ietf.org/html/bcp47
2184[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
@@ -2187,7 +2243,7 @@ ODT or pptx.
2187### Variables for HTML
2243### Variables for HTML
2189`document-css`
2245`document-css`
2190−: Enables inclusion of most of the CSS in the `styles.html`
2246+: Enables inclusion of most of the [CSS] in the `styles.html`
2191 [partial](#partials) (have a look with
2247 [partial](#partials) (have a look with
2192 `pandoc --print-default-data-file=templates/styles.html`).
2248 `pandoc --print-default-data-file=templates/styles.html`).
2193 Unless you use [`--css`](#option--css), this variable
2249 Unless you use [`--css`](#option--css), this variable
@@ -2211,6 +2267,10 @@ ODT or pptx.
2211`monofont`
2267`monofont`
2212: sets the CSS `font-family` property on `code` elements.
2268: sets the CSS `font-family` property on `code` elements.
2270+`monobackgroundcolor`
2271+: sets the CSS `background-color` property on `code` elements
2272+ and adds extra padding.
2214`linestretch`
2274`linestretch`
2215: sets the CSS `line-height` property on the `html` element,
2275: sets the CSS `line-height` property on the `html` element,
2216 which is preferred to be unitless.
2276 which is preferred to be unitless.
@@ -2221,18 +2281,41 @@ ODT or pptx.
2221`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
2281`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
2222: sets the corresponding CSS `padding` properties on the `body` element.
2282: sets the corresponding CSS `padding` properties on the `body` element.
2284+To override or extend some [CSS] for just one document, include for example:
2290+ font-style: italic;
2293+ background-color: #f0f0f0;
2296+ padding: 0.5em 2em 0.5em 0.5em;
2299+ border-bottom: none;
2304+[CSS]: https://developer.mozilla.org/en-US/docs/Learn/CSS
2224### Variables for HTML math
2306### Variables for HTML math
2226`classoption`
2308`classoption`
2227−: when using [KaTeX](#option--katex), you can render display math equations
2309+: when using [KaTeX](#option--katex), you can render display
2228− 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`.
2230### Variables for HTML slides
2313### Variables for HTML slides
2232These affect HTML output when [producing slide shows with pandoc].
2315These affect HTML output when [producing slide shows with pandoc].
2234−All [reveal.js configuration options] are available as variables.
2317+`institute`
2235−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
2237`revealjs-url`
2320`revealjs-url`
2238: base URL for reveal.js documents (defaults to
2321: base URL for reveal.js documents (defaults to
@@ -2252,6 +2335,9 @@ To turn off boolean flags that default to true in reveal.js, use `0`.
2252: additional attributes for the title slide of reveal.js slide shows.
2335: additional attributes for the title slide of reveal.js slide shows.
2253 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`.
2255[reveal.js configuration options]: https://revealjs.com/config/
2341[reveal.js configuration options]: https://revealjs.com/config/
2257### Variables for Beamer slides
2343### Variables for Beamer slides
@@ -2337,9 +2423,10 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2339`documentclass`
2425`documentclass`
2340−: 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]
2341− and [`report`]; the [KOMA-Script] equivalents, `scrartcl`, `scrbook`,
2428+ equivalents, `scrartcl`, `scrbook`, and `scrreprt`, which
2342− and `scrreprt`, which default to smaller margins; or [`memoir`]
2429+ default to smaller margins; or [`memoir`]
2344`geometry`
2431`geometry`
2345: option for [`geometry`] package, e.g. `margin=1in`;
2432: option for [`geometry`] package, e.g. `margin=1in`;
@@ -2364,8 +2451,9 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2367−: 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
2368− otherwise removes indentation and adds space between paragraphs)
2456+ indentation and adds space between paragraphs)
2370`linestretch`
2458`linestretch`
2371: adjusts line spacing using the [`setspace`]
2459: adjusts line spacing using the [`setspace`]
@@ -2390,8 +2478,8 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2390#### Fonts
2478#### Fonts
2392`fontenc`
2480`fontenc`
2393−: allows font encoding to be specified through `fontenc` package (with `pdflatex`);
2481+: allows font encoding to be specified through `fontenc` package (with
2394− default is `T1` (see [LaTeX font encodings guide])
2482+ `pdflatex`); default is `T1` (see [LaTeX font encodings guide])
2396`fontfamily`
2484`fontfamily`
2397: font package for use with `pdflatex`:
2485: font package for use with `pdflatex`:
@@ -2461,7 +2549,8 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
2461: contents of acknowledgments footnote after document title
2549: contents of acknowledgments footnote after document title
2464−: 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`)
2466`toc-depth`
2555`toc-depth`
2467: level of section to include in table of contents
2556: level of section to include in table of contents
@@ -2503,12 +2592,12 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2503: font size for body text (e.g. `10pt`, `12pt`)
2592: font size for body text (e.g. `10pt`, `12pt`)
2505`headertext`, `footertext`
2594`headertext`, `footertext`
2506−: 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
2507− repeat up to four times for different placement
2596+ Footers]); repeat up to four times for different placement
2509`indenting`
2598`indenting`
2510−: controls indentation of paragraphs, e.g. `yes,small,next` (see [ConTeXt Indentation]);
2599+: controls indentation of paragraphs, e.g. `yes,small,next` (see
2511− repeat for multiple options
2600+ [ConTeXt Indentation]); repeat for multiple options
2513`interlinespace`
2602`interlinespace`
2514: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);
2603: adjusts line spacing, e.g. `4ex` (using [`setupinterlinespace`]);
@@ -2519,16 +2608,19 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2519 repeat for multiple options
2608 repeat for multiple options
2521`linkcolor`, `contrastcolor`
2610`linkcolor`, `contrastcolor`
2522−: 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
2524`linkstyle`
2614`linkstyle`
2525−: 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`
2527`lof`, `lot`
2618`lof`, `lot`
2528: include list of figures, list of tables
2619: include list of figures, list of tables
2530`mainfont`, `sansfont`, `monofont`, `mathfont`
2621`mainfont`, `sansfont`, `monofont`, `mathfont`
2531−: 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])
2533`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
2625`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
2534: sets margins, if `layout` is not used (otherwise `layout`
2626: sets margins, if `layout` is not used (otherwise `layout`
@@ -2543,16 +2635,18 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2543 repeat for multiple options
2635 repeat for multiple options
2546−: 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
2547− 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.
2548− 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),
2549− block), `1b:2005` will be used as default, for reasons of backwards
2642+ `1b:2005` will be used as default, for reasons of backwards
2550− compatibility. Using `--variable=pdfa` without specified value is not supported.
2643+ compatibility. Using `--variable=pdfa` without specified value
2551− To successfully generate PDF/A the required ICC color profiles have to
2644+ is not supported. To successfully generate PDF/A the required
2552− 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.
2553− have to be standard conforming. The ICC profiles and output intent
2647+ The ICC profiles and output intent may be specified using the
2554− may be specified using the variables `pdfaiccprofile` and `pdfaintent`.
2648+ variables `pdfaiccprofile` and `pdfaintent`. See also [ConTeXt
2555− See also [ConTeXt PDFA] for more details.
2649+ PDFA] for more details.
2557`pdfaiccprofile`
2651`pdfaiccprofile`
2558: 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
@@ -2567,10 +2661,12 @@ Pandoc uses these variables when [creating a PDF] with ConTeXt.
2567 If left unspecified, `sRGB IEC61966-2.1` is used as default.
2661 If left unspecified, `sRGB IEC61966-2.1` is used as default.
2570−: 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`)
2572`whitespace`
2667`whitespace`
2573−: spacing between paragraphs, e.g. `none`, `small` (using [`setupwhitespace`])
2668+: spacing between paragraphs, e.g. `none`, `small` (using
2669+ [`setupwhitespace`])
2575`includesource`
2671`includesource`
2576: include all source documents as file attachments in the PDF file
2672: include all source documents as file attachments in the PDF file
@@ -2973,6 +3069,43 @@ This extension can be enabled/disabled for the following formats:
2973output formats
3069output formats
2974: `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`
2976#### Extension: `styles` #### {#ext-styles}
3109#### Extension: `styles` #### {#ext-styles}
2978When converting from docx, read all docx styles as divs (for
3111When converting from docx, read all docx styles as divs (for
@@ -2999,8 +3132,15 @@ output format.
3000#### Extension: `citations` {#org-citations}
3133#### Extension: `citations` {#org-citations}
3002−Some aspects of [Pandoc's Markdown citation syntax](#citations) are also accepted
3135+Some aspects of [Pandoc's Markdown citation syntax](#citations)
3003−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.
3005#### Extension: `ntb` ####
3145#### Extension: `ntb` ####
@@ -3108,7 +3248,8 @@ pandoc does require the space.
3109### Heading identifiers ###
3249### Heading identifiers ###
3251+See also the [`auto_identifiers`
3111−See also the [`auto_identifiers` extension](#extension-auto_identifiers) above.
3252+extension](#extension-auto_identifiers) above.
3113#### Extension: `header_attributes` ####
3254#### Extension: `header_attributes` ####
@@ -3230,11 +3371,12 @@ block in a block quote, you need five spaces after the `>`:
3231#### Extension: `blank_before_blockquote` ####
3372#### Extension: `blank_before_blockquote` ####
3233−Standard Markdown syntax does not require a blank line before a block
3374+Standard Markdown syntax does not require a blank line before a
3234−quote. Pandoc does require this (except, of course, at the beginning of the
3375+block quote. Pandoc does require this (except, of course, at
3235−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
3236−`>` 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,
3237−wrapping). So, unless the `markdown_strict` format is used, the following does
3379+unless the `markdown_strict` format is used, the following does
3238not produce a nested block quote in pandoc:
3380not produce a nested block quote in pandoc:
3240 > This is a block quote.
3382 > This is a block quote.
@@ -3303,14 +3445,16 @@ this syntax:
3303 qsort (filter (>= x) xs)
3445 qsort (filter (>= x) xs)
3304 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3446 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3306−Here `mycode` is an identifier, `haskell` and `numberLines` are classes, and
3448+Here `mycode` is an identifier, `haskell` and `numberLines` are
3307−`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
3308−information to do syntax highlighting. Currently, the only output formats
3451+highlighting. Currently, the only output formats that uses this
3309−that uses this information are HTML, LaTeX, Docx, Ms, and PowerPoint. If
3452+information are HTML, LaTeX, Docx, Ms, and PowerPoint. If
3310−highlighting is supported for your output format and language, then the code
3453+highlighting is supported for your output format and language,
3311−block above will appear highlighted, with numbered lines. (To see which
3454+then the code block above will appear highlighted, with numbered
3312−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
3313−the code block above will appear as follows:
3457+will appear as follows:
3315 <pre id="mycode" class="haskell numberLines" startFrom="100">
3459 <pre id="mycode" class="haskell numberLines" startFrom="100">
@@ -3373,6 +3517,9 @@ line must begin with a space.
3373 | 200 Main St.
3517 | 200 Main St.
3374 | 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).
3376This syntax is borrowed from [reStructuredText].
3523This syntax is borrowed from [reStructuredText].
@@ -3576,11 +3723,12 @@ a blank line, and must be followed by one or more definitions.
3576A 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
3577or two spaces.
3724or two spaces.
3579−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
3580−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
3581−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
3582−aside from the colon or tilde) should be indented four spaces. However,
3730+colon or tilde) should be indented four spaces. However, as with
3583−as with other Markdown lists, you can "lazily" omit indentation except
3731+other Markdown lists, you can "lazily" omit indentation except
3584at the beginning of a paragraph or other block element:
3732at the beginning of a paragraph or other block element:
@@ -3606,9 +3754,10 @@ definition:
3606Note that space between items in a definition list is required.
3754Note that space between items in a definition list is required.
3607(A variant that loosens this requirement, but disallows "lazy"
3755(A variant that loosens this requirement, but disallows "lazy"
3608hard wrapping, can be activated with `compact_definition_lists`: see
3756hard wrapping, can be activated with `compact_definition_lists`: see
3609−[Non-pandoc extensions], below.)
3757+[Non-default extensions], below.)
3759+[^3]: I have been influenced by the suggestions of [David
3611−[^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/).
3613### Numbered example lists ###
3762### Numbered example lists ###
@@ -4030,10 +4179,12 @@ option is used. All of the metadata will appear in a single block
4030at the beginning of the document.
4179at the beginning of the document.
4032Note that [YAML] escaping rules must be followed. Thus, for example,
4181Note that [YAML] escaping rules must be followed. Thus, for example,
4033−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
4034−(`|`) can be used to begin an indented block that will be interpreted
4185+an indented block that will be interpreted literally, without need for
4035−literally, without need for escaping. This form is necessary
4186+escaping. This form is necessary when the field contains blank lines
4036−when the field contains blank lines or block-level formatting:
4187+or block-level formatting:
4039 title: 'This is the title: it contains a colon'
4190 title: 'This is the title: it contains a colon'
@@ -4047,6 +4198,12 @@ when the field contains blank lines or block-level formatting:
4047 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
4050Template variables will be set automatically from the metadata. Thus, for
4207Template variables will be set automatically from the metadata. Thus, for
4051example, 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
4052equivalent of the Markdown in the `abstract` field:
4209equivalent of the Markdown in the `abstract` field:
@@ -4093,6 +4250,24 @@ will be interpreted as markdown. For example:
4093 \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
4096## Backslash escapes
4271## Backslash escapes
4098#### Extension: `all_symbols_escapable` ####
4273#### Extension: `all_symbols_escapable` ####
@@ -4250,7 +4425,8 @@ you need to enclose text in literal `$` characters, backslash-escape
4250them and they won't be treated as math delimiters.
4425them and they won't be treated as math delimiters.
4252For display math, use `$$` delimiters. (In this case, the delimiters
4427For display math, use `$$` delimiters. (In this case, the delimiters
4253−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.)
4255TeX 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
4256depends on the output format:
4432depends on the output format:
@@ -4368,8 +4544,8 @@ into
4369whereas `Markdown.pl` will preserve it as is.
4545whereas `Markdown.pl` will preserve it as is.
4371−There is one exception to this rule: text between `<script>` and
4547+There is one exception to this rule: text between `<script>`,
4372−`<style>` tags is not interpreted as Markdown.
4548+`<style>`, and `<textarea>` tags is not interpreted as Markdown.
4374This departure from standard Markdown should make it easier to mix
4550This departure from standard Markdown should make it easier to mix
4375Markdown with HTML block elements. For example, one can surround
4551Markdown with HTML block elements. For example, one can surround
@@ -4784,37 +4960,68 @@ Inline and regular footnotes may be mixed freely.
4785#### Extension: `citations` ####
4961#### Extension: `citations` ####
4787−Markdown citations go inside square brackets and are separated
4963+To cite a bibliographic item with an identifier foo, use the
4788−by semicolons. Each citation must have a key, composed of '@' +
4964+syntax `@foo`. Normal citations should be included in square
4789−the citation identifier from the database, and may optionally
4965+brackets, with semicolons separating distinct items:
4790−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.
4791−begin with a letter, digit, or `_`, and may contain
4985+Unless a citation key start with a letter, digit, or `_`,
4792−alphanumerics, `_`, and internal punctuation characters
4986+and contains only alphanumerics and internal punctuation
4793−(`:.#$%&-+?<>~/`). Here are some examples:
4987+characters (`:.#$%&-+?<>~/`), it must be surrounded
4794−
4988+by curly braces, which are not considered part of the key.
4795− Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
4989+In `@Foo_bar.baz.`, the key is `Foo_bar.baz`. The final
4796−
4990+period is not *internal* punctuation, so it is not included in
4797− Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
4991+the key. In `@{Foo_bar.baz.}`, the key is `Foo_bar.baz.`, including
4798−
4992+the final period. The curly braces are recommended if you use URLs as
4799− 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
4801−`pandoc` detects locator terms in the [CSL locale files].
5006+defined in the [CSL locale files]. Either abbreviated or
4802−Either abbreviated or unabbreviated forms are accepted. In the `en-US`
5007+unabbreviated forms are accepted. In the `en-US` locale, locator
4803−locale, locator terms can be written in either singular or plural forms,
5008+terms can be written in either singular or plural forms, as
4804−as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
5009+`book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
4805−`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`, `fol.`/`fols.`;
5010+`col.`/`cols.`; `figure`, `fig.`/`figs.`; `folio`,
4806−`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.`;
4807−`op.`/`opp.`; `page`, `p.`/`pp.`; `paragraph`, `para.`/`paras.`; `part`,
5013+`paragraph`, `para.`/`paras.`; `part`, `pt.`/`pts.`; `section`,
4808−`pt.`/`pts.`; `section`, `sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`;
5014+`sec.`/`secs.`; `sub verbo`, `s.v.`/`s.vv.`; `verse`,
4809−`verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
5015+`v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
4810locator term is used, "page" is assumed.
5016locator term is used, "page" is assumed.
4812−`pandoc` will use heuristics to distinguish the locator
5018+In complex cases, you can force something to be treated as
4813−from the suffix. In complex cases, the locator can be enclosed
4814−in curly braces:
5019+a locator by enclosing it in curly braces or prevent parsing
5020+the suffix as locator by prepending curly braces:
4816 [@smith{ii, A, D-Z}, with a suffix]
5022 [@smith{ii, A, D-Z}, with a suffix]
4817 [@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]
4819A minus sign (`-`) before the `@` will suppress mention of
5026A minus sign (`-`) before the `@` will suppress mention of
4820the author in the citation. This can be useful when the
5027the author in the citation. This can be useful when the
@@ -4822,13 +5029,26 @@ author is already mentioned in the text:
4823 Smith says blah [-@smith04].
5030 Smith says blah [-@smith04].
4825−You can also write an in-text citation, as follows:
5032+You can also write an author-in-text citation, by omitting the
4827 @smith04 says blah.
5035 @smith04 says blah.
4829 @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/
4832[CSL]: https://docs.citationstyles.org/en/stable/specification.html
5052[CSL]: https://docs.citationstyles.org/en/stable/specification.html
4833[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
4834[Chicago Manual of Style]: https://chicagomanualofstyle.org
5054[Chicago Manual of Style]: https://chicagomanualofstyle.org
@@ -4837,13 +5057,44 @@ You can also write an in-text citation, as follows:
4837[finding and editing styles]: https://citationstyles.org/authors/
5057[finding and editing styles]: https://citationstyles.org/authors/
4838[CSL locale files]: https://github.com/citation-style-language/locales
5058[CSL locale files]: https://github.com/citation-style-language/locales
4840−## Non-pandoc extensions
5060+## Non-default extensions
4842The following Markdown syntax extensions are not enabled by default
5062The following Markdown syntax extensions are not enabled by default
4843in pandoc, but may be enabled by adding `+EXTENSION` to the format
5063in pandoc, but may be enabled by adding `+EXTENSION` to the format
4844name, where `EXTENSION` is the name of the extension. Thus, for
5064name, where `EXTENSION` is the name of the extension. Thus, for
4845example, `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.
4847#### Extension: `attributes` ####
5098#### Extension: `attributes` ####
4849Allows attributes to be attached to any inline or block-level
5100Allows attributes to be attached to any inline or block-level
@@ -5030,6 +5281,13 @@ for regular emphasis, add extra blank space around headings.
5031 [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.
5033## Markdown variants
5291## Markdown variants
5035In addition to pandoc's extended Markdown, the following Markdown
5293In addition to pandoc's extended Markdown, the following Markdown
@@ -5144,17 +5402,21 @@ array of YAML-encoded references, for example:
5144 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.
5147Note that `pandoc` can be used to produce such a YAML metadata
5409Note that `pandoc` can be used to produce such a YAML metadata
5148section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
5410section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
5150 pandoc chem.bib -s -f biblatex -t markdown
5412 pandoc chem.bib -s -f biblatex -t markdown
5151 pandoc chem.json -s -f csljson -t markdown
5413 pandoc chem.json -s -f csljson -t markdown
5153−`pandoc` can also be used to produce CSL JSON bibliography
5415+Indeed, `pandoc` can convert between any of these
5154−from BibTeX, BibLaTeX, or markdown YAML:
5416+citation formats:
5156 pandoc chem.bib -s -f biblatex -t csljson
5418 pandoc chem.bib -s -f biblatex -t csljson
5157− pandoc chem.yaml -s -f markdown -t csljson
5419+ pandoc chem.yaml -s -f markdown -t biblatex
5159Running pandoc on a bibliography file with the `--citeproc`
5421Running pandoc on a bibliography file with the `--citeproc`
5160option will create a formatted bibliography in the format
5422option will create a formatted bibliography in the format
@@ -5237,11 +5499,11 @@ The CSL project provides further information on [finding and
5237editing styles].
5499editing styles].
5239The `--citation-abbreviations` option (or the
5501The `--citation-abbreviations` option (or the
5240−`citation-abbreviations` metadata field) may be used to
5502+`citation-abbreviations` metadata field) may be used to specify
5241−specify a JSON file containing abbreviations of journals
5503+a JSON file containing abbreviations of journals that should be
5242−that should be used in formatted bibliographies when
5504+used in formatted bibliographies when `form="short"` is
5243−`form="short"` is specified. The format of the file
5505+specified. The format of the file can be illustrated with an
5244−can be illustrated with an example:
5506+example:
5247 { "default": {
5509 { "default": {
@@ -5253,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].
5256## Raw content in a style
5546## Raw content in a style
5258To include raw content in a prefix, suffix, delimiter, or term,
5548To include raw content in a prefix, suffix, delimiter, or term,
@@ -5331,17 +5621,30 @@ or BibLaTeX (for `--biblatex`) format.
5332A few other metadata fields affect bibliography formatting:
5622A few other metadata fields affect bibliography formatting:
5334−`link-citation`
5624+`link-citations`
5335: If true, citations will be
5625: If true, citations will be
5336 hyperlinked to the corresponding bibliography entries
5626 hyperlinked to the corresponding bibliography entries
5337 (for author-date and numerical styles only).
5627 (for author-date and numerical styles only).
5340: The `lang` field will affect how the style is localized,
5630: The `lang` field will affect how the style is localized,
5341− 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.
5342− of quotation marks. (For backwards compatibility,
5633+ (For backwards compatibility, `locale` may be used instead
5343− `locale` may be used instead of `lang`, but this use
5344− 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).
5346`notes-after-punctuation`
5649`notes-after-punctuation`
5347: If true (the default), pandoc will put footnote citations
5650: If true (the default), pandoc will put footnote citations
@@ -5353,12 +5656,6 @@ A few other metadata fields affect bibliography formatting:
5353 punctuation.
5656 punctuation.
5362# Slide shows
5659# Slide shows
5364You can use pandoc to produce an HTML + JavaScript slide presentation
5661You can use pandoc to produce an HTML + JavaScript slide presentation
@@ -5407,18 +5704,21 @@ To produce an HTML/JavaScript slide show, simply type
5408where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
5705where `FORMAT` is either `s5`, `slidy`, `slideous`, `dzslides`, or `revealjs`.
5410−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
5411−`-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
5412−assumed to be available at the relative path `s5/default` (for S5), `slideous`
5710+the relative path `s5/default` (for S5), `slideous` (for
5413−(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
5414−`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`
5415−`slideous-url`, `revealjs-url`, or `s5-url` variables; see [Variables for HTML slides],
5714+variables; see [Variables for HTML slides], above.) For
5416−above.) For DZSlides, the (relatively short) JavaScript and CSS are included in
5715+DZSlides, the (relatively short) JavaScript and CSS are included
5417−the file by default.
5716+in the file by default.
5419−With all HTML slide formats, the `--self-contained` option can be used to
5718+With all HTML slide formats, the `--self-contained` option can
5420−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,
5421−slide show, including linked scripts, stylesheets, images, and videos.
5721+stylesheets, images, and videos.
5423To produce a PDF slide show using beamer, type
5723To produce a PDF slide show using beamer, type
@@ -5448,7 +5748,11 @@ rules:
5448 * A heading at the slide level always starts a new slide.
5748 * A heading at the slide level always starts a new slide.
5450 * Headings *below* the slide level in the hierarchy create
5750 * Headings *below* the slide level in the hierarchy create
5451− 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.)
5453 * Headings *above* the slide level in the hierarchy create
5757 * Headings *above* the slide level in the hierarchy create
5454 "title slides," which just contain the section title
5758 "title slides," which just contain the section title
@@ -5781,6 +6085,15 @@ The following fields are recognized:
5783 ~ 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.
5785`cover-image`
6098`cover-image`
5786 ~ A string value (path to cover image).
6099 ~ A string value (path to cover image).
@@ -6017,7 +6330,7 @@ Then edit `my.theme` and use it like this:
6017If you are not satisfied with the built-in highlighting, or you
6330If you are not satisfied with the built-in highlighting, or you
6018want highlight a language that isn't supported, you can use the
6331want highlight a language that isn't supported, you can use the
6019`--syntax-definition` option to load a [KDE-style XML syntax definition
6332`--syntax-definition` option to load a [KDE-style XML syntax definition
6020−file](https://docs.kde.org/stable5/en/applications/katepart/highlight.html).
6333+file](https://docs.kde.org/stable5/en/kate/katepart/highlight.html).
6021Before 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
6022definitions](https://github.com/KDE/syntax-highlighting/tree/master/data/syntax).
6335definitions](https://github.com/KDE/syntax-highlighting/tree/master/data/syntax).
@@ -6148,6 +6461,21 @@ subdirectory of your user data directory (see [Templates]).
6149[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).
6151# A note on security
6479# A note on security
6153If you use pandoc to convert user-contributed content in a web
6481If you use pandoc to convert user-contributed content in a web
@@ -6176,13 +6504,13 @@ application, here are some things to keep in mind:
61764. The HTML generated by pandoc is not guaranteed to be safe.
65044. The HTML generated by pandoc is not guaranteed to be safe.
6177 If `raw_html` is enabled for the Markdown input, users can
6505 If `raw_html` is enabled for the Markdown input, users can
6178 inject arbitrary HTML. Even if `raw_html` is disabled,
6506 inject arbitrary HTML. Even if `raw_html` is disabled,
6179− users can include dangerous content in attributes for
6507+ users can include dangerous content in URLs and attributes.
6180− headings, spans, and code blocks. To be safe, you should
6181− run all the generated HTML through an HTML sanitizer.
6508+ To be safe, you should run all the generated HTML through
6183# Authors
6511# Authors
6185−Copyright 2006--2020 John MacFarlane (jgm@berkeley.edu). Released
6513+Copyright 2006--2021 John MacFarlane (jgm@berkeley.edu). Released
6186under the [GPL], version 2 or greater. This software carries no
6514under the [GPL], version 2 or greater. This software carries no
6187warranty of any kind. (See COPYRIGHT for full copyright and
6515warranty of any kind. (See COPYRIGHT for full copyright and
6188warranty notices.) For a full list of contributors, see the file
6516warranty notices.) For a full list of contributors, see the file