Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pandoc_args

Functions for generating pandoc command line arguments


Description

Functions that assist in creating various types of pandoc command line arguments (e.g. for templates, table of contents, highlighting, and content includes).

Usage

pandoc_variable_arg(name, value)

pandoc_metadata_arg(name, value)

pandoc_include_args(in_header = NULL, before_body = NULL, after_body = NULL)

pandoc_highlight_args(highlight, default = "tango")

pandoc_latex_engine_args(latex_engine)

pandoc_toc_args(toc, toc_depth = 3)

pandoc_citeproc_args()

pandoc_lua_filter_args(lua_files)

Arguments

name

Name of template variable to set.

value

Value of template variable (defaults to true if missing).

in_header

One or more files with content to be included in the header of the document.

before_body

One or more files with content to be included before the document body.

after_body

One or more files with content to be included after the document body.

highlight

The name of a pandoc syntax highlighting theme.

default

The highlighting theme to use if "default" is specified.

latex_engine

LaTeX engine for producing PDF output. Options are "pdflatex", "lualatex", "xelatex", and "tectonic".

toc

TRUE to include a table of contents in the output.

toc_depth

Depth of headers to include in table of contents.

lua_files

Character vector of file paths to Lua filter files. Paths will be transformed by pandoc_path_arg.

Details

Non-absolute paths for resources referenced from the in_header, before_body, and after_body parameters are resolved relative to the directory of the input document.

Value

A character vector with pandoc command line arguments.

About Pandoc citeproc

For Pandoc version before 2.11, a pandoc filter pandoc-citeproc is used. Since Pandoc 2.11, the feature is built-in and activated using --citeproc flag. pandoc_citeproc_arg will return the correct switches depending on the Pandoc version in use.

Examples

## Not run: 
library(rmarkdown)

pandoc_include_args(before_body = "header.htm")
pandoc_include_args(before_body = "header.tex")

pandoc_highlight_args("kate")

pandoc_latex_engine_args("pdflatex")

pandoc_toc_args(toc = TRUE, toc_depth = 2)

## End(Not run)

rmarkdown

Dynamic Documents for R

v2.10
GPL-3
Authors
JJ Allaire [aut], Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>), Jonathan McPherson [aut], Javier Luraschi [aut], Kevin Ushey [aut], Aron Atkins [aut], Hadley Wickham [aut], Joe Cheng [aut], Winston Chang [aut], Richard Iannone [aut] (<https://orcid.org/0000-0003-3925-190X>), Andrew Dunning [ctb] (<https://orcid.org/0000-0003-0464-5036>), Atsushi Yasumoto [ctb, cph] (<https://orcid.org/0000-0002-8335-495X>, Number sections Lua filter), Barret Schloerke [ctb], Carson Sievert [ctb] (<https://orcid.org/0000-0002-4958-2844>), Christophe Dervieux [ctb], Devon Ryan [ctb] (<https://orcid.org/0000-0002-8549-0971>), Frederik Aust [ctb] (<https://orcid.org/0000-0003-4900-788X>), Jeff Allen [ctb], JooYoung Seo [ctb] (<https://orcid.org/0000-0002-4064-6012>), Malcolm Barrett [ctb], Rob Hyndman [ctb], Romain Lesur [ctb], Roy Storey [ctb], Ruben Arslan [ctb], Sergio Oller [ctb], RStudio, PBC [cph], jQuery Foundation [cph] (jQuery library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/rmd/h/jquery-AUTHORS.txt), jQuery UI contributors [ctb, cph] (jQuery UI library; authors listed in inst/rmd/h/jqueryui-AUTHORS.txt), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), Alexander Farkas [ctb, cph] (html5shiv library), Scott Jehl [ctb, cph] (Respond.js library), Ivan Sagalaev [ctb, cph] (highlight.js library), Greg Franko [ctb, cph] (tocify library), John MacFarlane [ctb, cph] (Pandoc templates), Google, Inc. [ctb, cph] (ioslides library), Dave Raggett [ctb] (slidy library), W3C [cph] (slidy library), Dave Gandy [ctb, cph] (Font-Awesome), Ben Sperry [ctb] (Ionicons), Drifty [cph] (Ionicons), Aidan Lister [ctb, cph] (jQuery StickyTabs), Benct Philip Jonsson [ctb, cph] (pagebreak Lua filter), Albert Krewinkel [ctb, cph] (pagebreak Lua filter)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.