Usage
rnw2pdf(
input,
output = with_ext(input, "pdf"),
compiler = "xelatex",
envir = parent.frame(),
quiet = FALSE,
clean = TRUE,
error = FALSE,
...
)Arguments
- input
Path to the input file.
- output
Path of the PDF output file. By default, it uses the same name as the
input, but changes the file extension to ".pdf".- compiler, ...
The LaTeX engine and other arguments to be passed to
tinytex::latexmk(). The default compiler isxelatex.- envir
Environment in which code chunks are to be evaluated, for example,
parent.frame(),new.env(), orglobalenv()).- quiet
Boolean; suppress the progress bar and messages?
- clean
If
TRUE, the intermediate files will be removed.- error
If
FALSE, knitting stops when any error occurs.
Details
This function is similar to knit2pdf(), with the following differences:
The default compiler is "xelatex" instead of "pdflatex".
outputuses the file extension ".pdf" instead of ".tex".Before knitting, it tries to remove the
outputfile and will throw a clear error if the file cannot be removed.outputcould be under any dir, not necessarily the same directory asinput.It cleans up intermediate files by default, including the ".tex" file.
It stops knitting when any error occurs (by setting the chunk option
error = FALSE).