Chunk literals

2020

If you try to include an R Markdown chunk inside a fenced code block, as in the fontawesome note, you may find that R Markdown will instead run the chunk instead of displaying it (yikes).

A solution courtesy of Rstudio Support1 Stephens, 2019. shows that you can prefix the problematic code chunk with an empty inline R statement, and then wrap that in a four-tick markdown block, as follows:

````markdown
```{r setup, include=FALSE}
htmltools::tagList(rmarkdown::html_dependency_font_awesome())
```
````

which, when rendered, will display as:

```{r setup, include=FALSE}
htmltools::tagList(rmarkdown::html_dependency_font_awesome())
```