|
Structural variables
Pandoc sets these variables automatically in response to options or document contents; users can also modify them. These vary depending on the output format, and include the following:
body
- body of document
date-meta
- the
date variable converted to ISO 8601 YYYY-MM-DD, included in all HTML based formats (dzslides, epub, html, html4, html5, revealjs, s5, slideous, slidy). The recognized formats for date are: mm/dd/yyyy , mm/dd/yy , yyyy-mm-dd (ISO 8601), dd MM yyyy (e.g. either 02 Apr 2018 or 02 April 2018 ), MM dd, yyyy (e.g. Apr. 02, 2018 or April 02, 2018), yyyy[mm[dd]]](e.g. 20180402, 201804 or 2018 ).
header-includes
- contents specified by
-H/--include-in-header (may have multiple values)
include-before
- contents specified by
-B/--include-before-body (may have multiple values)
include-after
- contents specified by
-A/--include-after-body (may have multiple values)
meta-json
- JSON representation of all of the document’s metadata. Field values are transformed to the selected output format.
numbersections
- non-null value if
-N/--number-sections was specified
sourcefile , outputfile
source and destination filenames, as given on the command line. sourcefile can also be a list if input comes from multiple files, or empty if input is from stdin. You can use the following snippet in your template to distinguish them:
$if(sourcefile)$
$for(sourcefile)$
$sourcefile$
$endfor$
$else$
(stdin)
$endif$
Similarly, outputfile can be - if output goes to the terminal.
If you need absolute paths, use e.g. $curdir$/$sourcefile$ .
curdir
- working directory from which pandoc is run.
toc
- non-null value if
--toc/--table-of-contents was specified
toc-title
- title of table of contents (works only with EPUB, opendocument, odt, docx, pptx, beamer, LaTeX)
|