The function pandoc_to()
returns the Pandoc output format, and
pandoc_from()
returns Pandoc input format. pandoc_to(fmt)
allows to check the current output format against a set of format names. Both
are to be used with R Markdown documents.
These functions may be useful for conditional output that depends on the
output format. For example, you may write out a LaTeX table in an R Markdown
document when the output format is LaTeX, and an HTML or Markdown table when
the output format is HTML. Use pandoc_to(fmt)
to test a more specific
Pandoc format.
Internally, the Pandoc output format of the current R Markdown document is
stored in knitr::opts_knit$get('rmarkdown.pandoc.to')
, and the
Pandoc input format in
knitr::opts_knit$get('rmarkdown.pandoc.from')