Defaults files
The --defaults
option may be used to specify a package of options, in
the form of a YAML file.
Fields that are omitted will just have their regular default values. So a defaults file can be as simple as one line:
verbosity: INFO
In fields that expect a file path (or list of file paths), the following syntax may be used to interpolate environment variables:
csl: ${HOME}/mycsldir/special.csl
${USERDATA}
may also be used; this will always resolve to the user
data directory that is current when the defaults file is parsed,
regardless of the setting of the environment variable USERDATA
.
${.}
will resolve to the directory containing the defaults file
itself. This allows you to refer to resources contained in that
directory:
epub-cover-image: ${.}/cover.jpg
epub-metadata: ${.}/meta.xml
resource-path:
- . # the working directory from which pandoc is run
- ${.}/images # the images subdirectory of the directory
# containing this defaults file
This environment variable interpolation syntax only works in fields that expect file paths.
Defaults files can be placed in the defaults
subdirectory of the user
data directory and used from any directory. For example, one could
create a file specifying defaults for writing letters, save it as
letter.yaml
in the defaults
subdirectory of the user data directory,
and then invoke these defaults from any directory using
pandoc --defaults letter
or pandoc -dletter
.
When multiple defaults are used, their contents will be combined.
Note that, where command-line arguments may be repeated
(--metadata-file
, --css
, --include-in-header
,
--include-before-body
, --include-after-body
, --variable
,
--metadata
, --syntax-definition
), the values specified on the
command line will combine with values specified in the defaults file,
rather than replacing them.
The following tables show the mapping between the command line and defaults file entries.
command line | defaults file |
---|---|
foo.md |
|
|
|
The value of input-files
may be left empty to indicate input from
stdin, and it can be an empty sequence []
for no input.
General options
command line | defaults file |
---|---|
--from markdown+emoji |
|
--to markdown+hard_line_breaks |
|
--output foo.pdf |
|
--output - |
|
--data-dir dir |
|
--defaults file |
|
--verbose |
|
--quiet |
|
--fail-if-warnings |
|
--sandbox |
|
--log=FILE |
|
Options specified in a defaults file itself always have priority over
those in another file included with a defaults:
entry.
verbosity
can have the values ERROR
, WARNING
, or INFO
.
Reader options
command line | defaults file |
---|---|
--shift-heading-level-by -1 |
|
|
|
--default-image-extension ".jpg" |
|
--file-scope |
|
|
|
|
|
|
|
--preserve-tabs |
|
--tab-stop 8 |
|
--track-changes accept |
|
--extract-media dir |
|
--abbreviations abbrevs.txt |
|
--trace |
|
Metadata values specified in a defaults file are parsed as literal string text, not Markdown.
Filters will be assumed to be Lua filters if they have the .lua
extension, and JSON filters otherwise. But the filter type can also be
specified explicitly, as shown. Filters are run in the order specified.
To include the built-in citeproc filter, use either citeproc
or
{type: citeproc}
.
General writer options
command line | defaults file |
---|---|
--standalone |
|
--template letter |
|
|
|
--eol nl |
|
--dpi 300 |
|
--wrap 60 |
|
--columns 72 |
|
--table-of-contents |
|
--toc |
|
--toc-depth 3 |
|
--strip-comments |
|
--no-highlight |
|
--highlight-style kate |
|
|
|
|
|
|
|
|
|
--resource-path .:foo |
|
|
|
--no-check-certificate |
|
Options affecting specific writers
command line | defaults file |
---|---|
--self-contained |
|
--link-images |
|
--html-q-tags |
|
--ascii |
|
--reference-links |
|
--reference-location block |
|
--figure-caption-position=above |
|
--table-caption-position=below |
|
--markdown-headings atx |
|
--list-tables |
|
--top-level-division chapter |
|
--number-sections |
|
--number-offset=1,4 |
|
--listings |
|
--list-of-figures |
|
--lof |
|
--list-of-tables |
|
--lot |
|
--incremental |
|
--slide-level 2 |
|
--section-divs |
|
--email-obfuscation references |
|
--id-prefix ch1 |
|
--title-prefix MySite |
|
|
|
--reference-doc my.docx |
|
--epub-cover-image cover.jpg |
|
--epub-title-page=false |
|
--epub-metadata meta.xml |
|
|
|
--split-level 2 |
|
--chunk-template="%i.html" |
|
--epub-subdirectory="" |
|
--ipynb-output best |
|
--pdf-engine xelatex |
|
|
|
Citation rendering
command line | defaults file |
---|---|
--citeproc |
|
--bibliography logic.bib |
|
--csl ieee.csl |
|
--citation-abbreviations ab.json |
|
--natbib |
|
--biblatex |
|
cite-method
can be citeproc
, natbib
, or biblatex
. This only
affects LaTeX output. If you want to use citeproc to format citations,
you should also set ‘citeproc: true’.
If you need control over when the citeproc processing is done relative
to other filters, you should instead use citeproc
in the list of
filters
(see Reader options).
Math rendering in HTML
command line | defaults file |
---|---|
|
|
|
|
|
|
|
|
|
|
In addition to the values listed above, method
can have the value
plain
.
If the command line option accepts a URL argument, an url:
field can
be added to html-math-method:
.
Options for wrapper scripts
command line | defaults file |
---|---|
--dump-args |
|
--ignore-args |
|