Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created January 2, 2013 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/4436776 to your computer and use it in GitHub Desktop.
Save ramnathv/4436776 to your computer and use it in GitHub Desktop.
Highlight using Native R Highlighter

Highlight using Native R Highlighter

I want code chunks to be highlighted using native R highlighter.

First, let me set up the options accordingly

opts_knit$set(use.highlight = TRUE)
opts_chunk$set(highlight = TRUE)
pat_md()
render_html()

Now a code chunk

library(ggplot2)
qplot(wt, mpg, data = mtcars)
## Highlight using Native R Highlighter
I want code chunks to be highlighted using native R highlighter.
First, let me set up the options accordingly
```{r}
opts_knit$set(use.highlight = TRUE)
opts_chunk$set(highlight = TRUE)
pat_md()
render_html()
```
Now a code chunk
```{r eval = F}
library(ggplot2)
qplot(wt, mpg, data = mtcars)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment