vignette_engines {knitr} | R Documentation |
Package vignette engines
Description
Since R 3.0.0, package vignettes can use non-Sweave engines, and knitr
has provided a few engines to compile vignettes via knit()
with
different templates. See https://yihui.org/knitr/demo/vignette/ for
more information.
Note
If you use the knitr::rmarkdown
engine, please make sure that
you put rmarkdown in the ‘Suggests’ field of your
‘DESCRIPTION’ file. Also make sure pandoc
is available
during R CMD build
. If you build your package from RStudio, this
is normally not a problem. If you build the package outside RStudio, run
rmarkdown::find_pandoc()
in an R session to check if Pandoc can be
found.
When the rmarkdown package is not installed or not available, or
pandoc
cannot be found, the knitr::rmarkdown
engine will
fall back to the knitr::knitr
engine, which uses R Markdown v1 based
on the markdown package.
Examples
library(knitr)
vig_list = tools::vignetteEngine(package = "knitr")
str(vig_list)
vig_list[["knitr::knitr"]][c("weave", "tangle")]
vig_list[["knitr::knitr_notangle"]][c("weave", "tangle")]
vig_list[["knitr::docco_classic"]][c("weave", "tangle")]