Searches for the
pandoc executable in a few places and use the
highest version found, unless a specific version is requested.
find_pandoc(cache = TRUE, dir = NULL, version = NULL)
Whether to search for
pandoc again if a Pandoc
directory containing the
pandoc executable of the expected
version (if provided) has been found previously. Search again if
cache = FALSE.
A character vector of potential directory paths under which
pandoc may be found. If not provided, this function searches for
pandoc from the environment variable RSTUDIO_PANDOC (the
RStudio IDE will set this variable to the directory of Pandoc bundled with
the IDE), the environment variable PATH, and the directory
The version of Pandoc to look for (e.g.,
not provided, this function searches for the highest version under the
A list containing the directory and version of Pandoc (if found).
Usually you do not need to install Pandoc if you use the RStudio IDE,
because the IDE has bundled a version of Pandoc. If you have installed a
version of Pandoc by yourself and want to use this version instead, you may
dir argument of this function.
rmarkdown::find_pandoc() #> $version #>  ‘2.19.2’ #> #> $dir #>  "/usr/bin" #> rmarkdown::find_pandoc(dir = '~/Downloads/Pandoc') #> $version #>  ‘2.19.2’ #> #> $dir #>  "/usr/bin" #> rmarkdown::find_pandoc(version = '2.7.3') #> $version #>  ‘0’ #> #> $dir #> NULL #>