View source: R/utils-conversion.R
rnw2pdf | R Documentation |
Call knit()
to compile the ‘.Rnw’ input to ‘.tex’,
and then tinytex::latexmk()
to convert ‘.tex’ to
‘.pdf’.
rnw2pdf(
input,
output = with_ext(input, "pdf"),
compiler = "xelatex",
envir = parent.frame(),
quiet = FALSE,
clean = TRUE,
error = FALSE,
...
)
input |
Path to the input file. |
output |
Path of the PDF output file. By default, it uses the same name
as the |
compiler , ... |
The LaTeX engine and other arguments to be passed to
|
envir |
Environment in which code chunks are to be evaluated, for
example, |
quiet |
Boolean; suppress the progress bar and messages? |
clean |
If |
error |
If |
This function is similar to knit2pdf()
, with the following differences:
The default compiler is "xelatex" instead of "pdflatex".
output
uses the file extension ".pdf" instead of ".tex".
Before knitting, it tries to remove the output
file and will throw a clear error if the file cannot be removed.
output
could be under any dir, not necessarily the same directory as input
.
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
).
The output
file path.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.