Debian Codegraph @

man/knit_theme.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/themes.R
3 \docType{data}
4 \name{knit_theme}
5 \alias{knit_theme}
6 \title{Syntax highlighting themes}
7 \format{
8 An object of class \code{list} of length 2.
9 }
10 \usage{
11 knit_theme
12 }
13 \description{
14 This object can be used to set or get themes in \pkg{knitr} for syntax
15 highlighting.
16 }
17 \details{
18 We can use \code{knit_theme$set(theme)} to set the theme, and
19 \code{knit_theme$get(theme)} to get a theme. The \code{theme} is a character
20 string for both methods (either the name of the theme, or the path to the CSS
21 file of a theme), and for the \code{set()} method, it can also be a list
22 returned by the \code{get()} method. See examples below.
23 }
24 \note{
25 The syntax highlighting here only applies to \file{.Rnw} (LaTeX) and
26 \file{.Rhtml} (HTML) documents, and it does not work for other types of
27 documents, such as \file{.Rmd} (R Markdown, which has its own syntax
28 highlighting themes; see \url{https://rmarkdown.rstudio.com}).
29 }
30 \examples{
31 opts_knit$set(out.format = "latex")
32 knit_theme$set("edit-vim")
33
34 knit_theme$get() # names of all available themes
35
36 thm = knit_theme$get("acid") # parse the theme to a list
37 knit_theme$set(thm)
38
39 opts_knit$set(out.format = NULL) # restore option
40 }
41 \references{
42 For a preview of all themes, see
43 \url{https://gist.github.com/yihui/3422133}.
44 }
45 \author{
46 Ramnath Vaidyanathan and Yihui Xie
47 }
48 \keyword{datasets}