knitr (version 0.5)

knit_theme: Syntax highlighting themes

Description

This object can be used to set or get themes in knitr for syntax highlighting.

Usage

knit_theme

Arguments

format

List of 2 $ set:function (theme) $ get:function (theme = NULL)

Details

We can use knit_theme$set(theme) to set the theme, and knit_theme$get(theme) to get a theme. The theme 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 set() method, it can also be a list returned by the get() method. See examples below.

References

https://github.com/downloads/yihui/knitr/knitr-themes.pdf (its Rnw source is at https://github.com/yihui/knitr/blob/master/inst/examples/knitr-themes.Rnw)

See Also

eclipse_theme (use Eclipse themes)

Examples

Run this code
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)

Run the code above in your browser using DataCamp Workspace