tools (version 3.3)

vignetteEngine: Set or Get a Vignette Processing Engine

Description

Vignettes are normally processed by Sweave, but package writers may choose to use a different engine (e.g., one provided by the knitr, noweb or R.rsp packages). This function is used by those packages to register their engines, and internally by R

Usage

vignetteEngine(name, weave, tangle, pattern = NULL,
	       package = NULL, aspell = list())

Arguments

name
the name of the engine.
weave
a function to convert vignette source files to LaTeX output.
tangle
a function to convert vignette source files to Rcode.
pattern
a regular expression pattern for the filenames handled by this engine, or NULL for the default pattern.
package
the package registering the engine. By default, this is the package calling vignetteEngine.
aspell
a list with element names filter and/or control giving the respective arguments to be used when spell checking the text in the vignette source file with aspell.

Value

  • If the engine is being deleted, NULL. Otherwise a list containing components
  • nameThe name of the engine
  • packageThe name of its package
  • patternThe pattern for vignette input files
  • weaveThe weave function
  • tangleThe tangle function

code

"[.][RrSs](nw|tex)$"

file

.*[.][rRsS]

Details

If weave is missing, vignetteEngine will return the currently registered engine matching name and package.

If weave is NULL, the specified engine will be deleted.

Other settings define a new engine. The weave and tangle functions must be defined with argument lists compatible with function(file, ...). Currently the ... arguments may include logical argument quiet and character argument encoding; others may be added in future. These are described in the documentation for Sweave and Stangle.

The weave and tangle functions should return the filename of the output file that has been produced. Currently the weave function, when operating on a file named must produce a file named [.](tex|pdf|html). The .tex files will be processed by pdflatex to produce .pdf output for display to the user; the others will be displayed as produced. The tangle function must produce a file named [.][rRsS] containing the executable R

See Also

Sweave and the Writing R Extensions manual.

Examples

Run this code
str(vignetteEngine("Sweave"))

Run the code above in your browser using DataLab