Consider the following rmarkdown document:
---
output: pdf_document
params:
sec1: 1
---
```{r echo = FALSE}
sec1_is_0 <- params$sec1 == 0
sec1_is_1 <- params$sec1 == 1
```
## section 1
```{r a, echo = sec1_is_0, eval = FALSE}
x <- 2
y <- 3
x+y
```
```{r b, echo = sec1_is_1, eval = FALSE}
x <- 4
y <- 5
x+y
```
### A
```{r a, echo = FALSE, eval = sec1_is_0, results='hide'}
```
```{r b, echo = FALSE, eval = sec1_is_1, results='hide'}
```
`r round(x+y, 3)`
### B
```{r b, echo = FALSE, eval = sec1_is_0, results='hide'}
```
```{r a, echo = FALSE, eval = sec1_is_1, results='hide'}
```
`r round(x+y, 3)`
How can we get this document rendered as a markdown file (notice markdown and not rmarkdown) such that the r-chunks converted to verbatim:
## section 1
\begin{verbatim}
x <- 4
y <- 5
x+y
\end{verbatim}
### A
9
### B
5