generatePDF: Convert an .Rnw file to a PDF

View source: R/generatePDF.R

generatePDFR Documentation

Convert an .Rnw file to a PDF

Description

This function is designed to handle the production task of a 'standard' PDF process. It is designed to build using pdflatex (unless otherwise specified) an adequate number of times to enable full typesetting to occur after taking into account items like contents pages, glossaries, and figures.

Usage

generatePDF(
  srcpath = getwd(),
  srcname,
  destpath = getwd(),
  destname = srcname,
  DATED = FALSE,
  CLEANUP = TRUE,
  QUIET = FALSE,
  envir = new.env(parent = .GlobalEnv),
  ...
)

Arguments

srcpath

Location of .Rnw file, default is current directory

srcname

Rnw file name without extension e.g. 'Style'

destpath

Location of PDF file to be sent to, default is current directory

destname

PDF file name without extension e.g. 'Style_output'

DATED

Boolean indicating whether PDF file name should include yyyymmdd added to it

CLEANUP

Boolean indicating whether ancillary files should be removed after production

QUIET

Boolean indicating whether console output should be limited

envir

Set default environment for knitr to run in - prevents a data.table issue

...

Allows additional parameters to be passed to the knit2pdf function

See Also

knit2pdf

Other helper: CJ.dt(), convertToXML(), pounds_format(), sanitise(), thousands_format(), wordwrap()

Examples

## Not run: 
# simple call
generatePDF(srcname='basic')

# complex call
generatePDF(
srcname='basic',
destpath=getwd(),
destname='basic',
DATED=TRUE,
CLEANUP=FALSE,
QUIET=TRUE,
compiler='xelatex')

## End(Not run)


optiRum documentation built on May 5, 2022, 1:05 a.m.