knit2pdf {knitr} | R Documentation |
Convert Rnw or Rrst files to PDF
Description
Knit the input Rnw or Rrst document, and compile to PDF using
tinytex::latexmk()
or rst2pdf()
.
Usage
knit2pdf(
input,
output = NULL,
compiler = NULL,
envir = parent.frame(),
quiet = FALSE,
...
)
Arguments
input |
Path to the input file. |
output |
Path to the output file for |
compiler |
A character string giving the LaTeX engine used to compile
the tex document to PDF. For an Rrst file, setting |
envir |
Environment in which code chunks are to be evaluated, for
example, |
quiet |
Boolean; suppress the progress bar and messages? |
... |
Value
The filename of the PDF file.
Note
The output
argument specifies the output filename to be passed
to the PDF compiler (e.g. a tex document) instead of the PDF filename.
Author(s)
Ramnath Vaidyanathan, Alex Zvoleff and Yihui Xie
Examples
#' compile with xelatex
## knit2pdf(..., compiler = 'xelatex')
#' compile a reST file with rst2pdf
## knit2pdf(..., compiler = 'rst2pdf')