I'd like to add an interactive map (a leaflet) to my HTML document, but this can't be done in a PDF document since they are static.
I know that Rmarkdown can choose to evaluate a chunk depending on a global variable, like this:
```{r setup}
ev_cars = TRUE
```
## First chunk
```{r cars, eval=ev_cars}
summary(cars)
```
I guess my question is "does knitr set a global variable indicating whether it is knitting an html_document or a pdf_document" ?
thanks