EVOLUTION-MANAGER
Edit File: knit_theme.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: Syntax highlighting themes</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 knit_theme {knitr}"><tr><td>knit_theme {knitr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Syntax highlighting themes</h2> <h3>Description</h3> <p>This object can be used to set or get themes in <span class="pkg">knitr</span> for syntax highlighting. </p> <h3>Usage</h3> <pre> knit_theme </pre> <h3>Format</h3> <p>An object of class <code>list</code> of length 2. </p> <h3>Details</h3> <p>We can use <code>knit_theme$set(theme)</code> to set the theme, and <code>knit_theme$get(theme)</code> to get a theme. The <code>theme</code> is a character string for both methods (either the name of the theme, or the path to the CSS file of a theme), and for the <code>set()</code> method, it can also be a list returned by the <code>get()</code> method. See examples below. </p> <h3>Note</h3> <p>The syntax highlighting here only applies to ‘<span class="file">.Rnw</span>’ (LaTeX) and ‘<span class="file">.Rhtml</span>’ (HTML) documents, and it does not work for other types of documents, such as ‘<span class="file">.Rmd</span>’ (R Markdown, which has its own syntax highlighting themes; see <a href="http://rmarkdown.rstudio.com">http://rmarkdown.rstudio.com</a>). </p> <h3>Author(s)</h3> <p>Ramnath Vaidyanathan and Yihui Xie </p> <h3>References</h3> <p>For a preview of all themes, see <a href="https://gist.github.com/yihui/3422133">https://gist.github.com/yihui/3422133</a>. </p> <h3>Examples</h3> <pre> opts_knit$set(out.format = "latex") knit_theme$set("edit-vim") knit_theme$get() # names of all available themes thm = knit_theme$get("acid") # parse the theme to a list knit_theme$set(thm) opts_knit$set(out.format = NULL) # restore option </pre> <hr /><div style="text-align: center;">[Package <em>knitr</em> version 1.29 <a href="00Index.html">Index</a>]</div> </body></html>