EVOLUTION-MANAGER
Edit File: vignetteEngine.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Set or Get a Vignette Processing Engine</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for vignetteEngine {tools}"><tr><td>vignetteEngine {tools}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Set or Get a Vignette Processing Engine</h2> <h3>Description</h3> <p>Vignettes are normally processed by <code><a href="../../utils/html/Sweave.html">Sweave</a></code>, but package writers may choose to use a different engine (e.g., one provided by the <a href="https://CRAN.R-project.org/package=knitr"><span class="pkg">knitr</span></a>, <a href="https://CRAN.R-project.org/package=noweb"><span class="pkg">noweb</span></a> or <a href="https://CRAN.R-project.org/package=R.rsp"><span class="pkg">R.rsp</span></a> packages). This function is used by those packages to register their engines, and internally by <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> to retrieve them. </p> <h3>Usage</h3> <pre> vignetteEngine(name, weave, tangle, pattern = NULL, package = NULL, aspell = list()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>the name of the engine.</p> </td></tr> <tr valign="top"><td><code>weave</code></td> <td> <p>a function to convert vignette source files to PDF/HTML or intermediate LaTeX output.</p> </td></tr> <tr valign="top"><td><code>tangle</code></td> <td> <p>a function to convert vignette source files to <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> code.</p> </td></tr> <tr valign="top"><td><code>pattern</code></td> <td> <p>a regular expression pattern for the filenames handled by this engine, or <code>NULL</code> for the default pattern.</p> </td></tr> <tr valign="top"><td><code>package</code></td> <td> <p>the package registering the engine. By default, this is the package calling <code>vignetteEngine</code>.</p> </td></tr> <tr valign="top"><td><code>aspell</code></td> <td> <p>a list with element names <code>filter</code> and/or <code>control</code> giving the respective arguments to be used when spell checking the text in the vignette source file with <code><a href="../../utils/html/aspell.html">aspell</a></code>.</p> </td></tr> </table> <h3>Details</h3> <p>If <code>weave</code> is missing, <code>vignetteEngine</code> will return the currently registered engine matching <code>name</code> and <code>package</code>. </p> <p>If <code>weave</code> is <code>NULL</code>, the specified engine will be deleted. </p> <p>Other settings define a new engine. The <code>weave</code> and <code>tangle</code> functions must be defined with argument lists compatible with <code>function(file, ...)</code>. Currently the <code>...</code> arguments may include logical argument <code>quiet</code> and character argument <code>encoding</code>; others may be added in future. These are described in the documentation for <code><a href="../../utils/html/Sweave.html">Sweave</a></code> and <code><a href="../../utils/html/Sweave.html">Stangle</a></code>. </p> <p>The <code>weave</code> and <code>tangle</code> functions should return the filename of the output file that has been produced. Currently the <code>weave</code> function, when operating on a file named ‘<span class="file"><name> <pattern></span>’ must produce a file named ‘<span class="file"><name>[.](tex|pdf|html)</span>’. The ‘<span class="file">.tex</span>’ files will be processed by <code>pdflatex</code> to produce ‘<span class="file">.pdf</span>’ output for display to the user; the others will be displayed as produced. The <code>tangle</code> function must produce a file named ‘<span class="file"><name>[.][rRsS]</span>’ containing the executable <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> code from the vignette. The <code>tangle</code> function may support a <code>split = TRUE</code> argument, and then it should produce files named ‘<span class="file"><name>.*[.][rRsS]</span>’. </p> <p>The <code>pattern</code> argument gives a regular expression to match the extensions of files which are to be processed as vignette input files. If set to <code>NULL</code>, the default pattern <code>"[.][RrSs](nw|tex)$"</code> is used. </p> <h3>Value</h3> <p>If the engine is being deleted, <code>NULL</code>. Otherwise a list containing components </p> <table summary="R valueblock"> <tr valign="top"><td><code>name</code></td> <td> <p>The name of the engine</p> </td></tr> <tr valign="top"><td><code>package</code></td> <td> <p>The name of its package</p> </td></tr> <tr valign="top"><td><code>pattern</code></td> <td> <p>The pattern for vignette input files</p> </td></tr> <tr valign="top"><td><code>weave</code></td> <td> <p>The weave function</p> </td></tr> <tr valign="top"><td><code>tangle</code></td> <td> <p>The tangle function</p> </td></tr> </table> <h3>Author(s)</h3> <p>Duncan Murdoch and Henrik Bengtsson. </p> <h3>See Also</h3> <p><code><a href="../../utils/html/Sweave.html">Sweave</a></code> and the ‘Writing R Extensions’ manual. </p> <h3>Examples</h3> <pre> str(vignetteEngine("Sweave")) </pre> <hr /><div style="text-align: center;">[Package <em>tools</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>