pdfGenerate {WebAnalytics} | R Documentation |
Generate a PDF using the R API for TinyTeX
Description
This function calls brew to generate a TeX document and then calls the TinyTeX API to generate a PDF from the LaTeX document in the specified work directory.
The function does not attempt to install TinyTex itself, this must be done by the user calling the tinytex::install_tinytex()
function. The first time that this function is called to generate a report, provided that TinyTeX is has been installed with default settings, it will install the required LaTeX packages for the report. This may take some time.
Tinytex has been observed to run glacially slowly on Windows. For some users it may be preferable (and far quicker) to install some version of xelatex and run it with it set to automatically download packages.
Usage
pdfGenerate(configFile, templateFile="sampleRfile.R", workDir=".")
Arguments
configFile |
The name of the config file to use. If this parameter is omitted, the work directory is searched for a file whose name ends, case insensitively, in |
templateFile |
This defaults to |
workDir |
The directory to use for document generation. This directory must contain the template and any associated support files, such as the LaTeX document class. |
Value
Returns the name of the generated PDF.
Author(s)
Greg Hunt <greg@firmansyah.com>
Examples
## Not run:
filesDir = paste0(tempdir(),"/ex")
wkDir = paste0(tempdir(),"/ey")
configVariableSet("config.workdir", filesDir)
# setup the work directory
workingDirectoryPopulate(wkDir)
pdfGenerate(workDir=wkDir)
## End(Not run)