I would like to highligh certain lines of code chunk of a Rmarkdown document. I have discovered the "xaringa" which uses a particular template (different from Rmarkdown) to generate HTML only slides. Following, there is a minimal example:
example
---
title: "Presentation Ninja"
output:
xaringan::moon_reader:
nature:
highlightLines: true
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```
# Some Tips
An example of using the trailing comment `#<<` to highlight lines:
```{r tidy=FALSE, eval=FALSE}
library(ggplot2)
ggplot(mtcars) +
aes(mpg, disp) +
geom_point() + #<<
geom_smooth() #<<
```
end example
The problem is that I would like to compile it both as PDF slides and HTML slides, preferible with standard Rmarkdown templates.
Isaac.