I want to demonstrate how to write RMarkdown, where said RMarkdown demonstration is embedded within an RMarkdown document used to create the course material. Within this fenced code block, I don't want knitr to execute the chunk.
I want to put something like this into my "top level" Rmarkdown document, and have everything that's between the outer fences be printed verbatim in fixed width in the output HTML document, rather than having knitr evaluate the inner embedded R code chunk and inline code.
```
---
title: "RMarkdown teaching demo"
author: "whoever"
---
# Major heading
Here's some text in your RMarkdown document. Here's a code chunk:
```{r, eval=FALSE}
head(mtcars)
```
Now we're back into regular markdown in our embedded document.
Here's inline code that I don't want executed either;
e.g. mean of mpg is `r mean(mtcars$mpg)`.
```
I've tried the zero-width space trick in knitr example 65, but this fails when trying to compile to PDF (I need both HTML and PDF).