| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/utils-conversion.R |
| 3 |
\name{knit2pdf} |
| 4 |
\alias{knit2pdf} |
| 5 |
\title{Convert Rnw or Rrst files to PDF} |
| 6 |
\usage{ |
| 7 |
knit2pdf( |
| 8 |
input, |
| 9 |
output = NULL, |
| 10 |
compiler = NULL, |
| 11 |
envir = parent.frame(), |
| 12 |
quiet = FALSE, |
| 13 |
... |
| 14 |
) |
| 15 |
} |
| 16 |
\arguments{ |
| 17 |
\item{input}{Path to the input file.} |
| 18 |
|
| 19 |
\item{output}{Path to the output file for \code{knit()}. If \code{NULL}, this |
| 20 |
function will try to guess a default, which will be under the current |
| 21 |
working directory.} |
| 22 |
|
| 23 |
\item{compiler}{A character string giving the LaTeX engine used to compile |
| 24 |
the tex document to PDF. For an Rrst file, setting \code{compiler} to |
| 25 |
\code{'rst2pdf'} will use \code{\link{rst2pdf}} to compile the rst file to |
| 26 |
PDF using the ReportLab open-source library.} |
| 27 |
|
| 28 |
\item{envir}{Environment in which code chunks are to be evaluated, for |
| 29 |
example, \code{\link{parent.frame}()}, \code{\link{new.env}()}, or |
| 30 |
\code{\link{globalenv}()}).} |
| 31 |
|
| 32 |
\item{quiet}{Boolean; suppress the progress bar and messages?} |
| 33 |
|
| 34 |
\item{...}{Options to be passed to \code{tinytex::\link[tinytex]{latexmk}()} |
| 35 |
or \code{\link{rst2pdf}()}.} |
| 36 |
} |
| 37 |
\value{ |
| 38 |
The filename of the PDF file. |
| 39 |
} |
| 40 |
\description{ |
| 41 |
Knit the input Rnw or Rrst document, and compile to PDF using |
| 42 |
\code{tinytex::\link[tinytex]{latexmk}()} or \code{\link{rst2pdf}()}. |
| 43 |
} |
| 44 |
\note{ |
| 45 |
The \code{output} argument specifies the output filename to be passed |
| 46 |
to the PDF compiler (e.g. a tex document) instead of the PDF filename. |
| 47 |
} |
| 48 |
\examples{ |
| 49 |
#' compile with xelatex |
| 50 |
## knit2pdf(..., compiler = 'xelatex') |
| 51 |
|
| 52 |
#' compile a reST file with rst2pdf |
| 53 |
## knit2pdf(..., compiler = 'rst2pdf') |
| 54 |
} |
| 55 |
\author{ |
| 56 |
Ramnath Vaidyanathan, Alex Zvoleff and Yihui Xie |
| 57 |
} |