knitr (version 1.2)

knit2pdf: Convert Rnw or Rrst files to PDF using knit() and texi2pdf() or rst2pdf()

Description

Knit the input Rnw or Rrst document, and compile to PDF using texi2pdf or rst2pdf.

Usage

knit2pdf(input, output = NULL, compiler = NULL, envir = parent.frame(), encoding = getOption("encoding"), 
    ...)

Arguments

output
the output filename to be passed to the PDF compiler (e.g. a tex document)
compiler
a character string which gives the LaTeX program used to compile the tex document to PDF (by default it uses the default setting of texi2pdf, which is often PDFLaTeX); this argument will be us
...
options to be passed to texi2pdf or rst2pdf
input
path of the input file
envir
the environment in which the code chunks are to be evaluated (can use new.env() to guarantee an empty new environment)
encoding
the encoding of the input file; see file

Value

  • The filename of the PDF file.

See Also

knit, texi2pdf, rst2pdf

Examples

Run this code
#' compile with xelatex
## knit2pdf(..., compiler = 'xelatex')

#' compile a reST file with rst2pdf
## knit2pdf(..., compiler = 'rst2pdf')

Run the code above in your browser using DataCamp Workspace