title: How to render a r-chunk code as verbatim in rmarkdown
body: <p>Consider the following <code>rmarkdown</code> document:</p>
  <pre><code>---
  output: pdf_document
  params:
    sec1: 1
  ---
  
  ```{r echo = FALSE}
  sec1_is_0 &lt;- params$sec1 == 0
  sec1_is_1 &lt;- params$sec1 == 1
  ```
      
  ## section 1
  
  ```{r a, echo = sec1_is_0, eval = FALSE}
  x &lt;- 2
  y &lt;- 3
  
  x+y
  ```
      
  ```{r b, echo = sec1_is_1, eval = FALSE}
  x &lt;- 4
  y &lt;- 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)`
  </code></pre>
  <p>How can we get this document rendered as a <code>markdown</code> file (notice <code>markdown</code> and not <code>rmarkdown</code>) such that the <code>r-chunks</code> converted to <code>verbatim</code>:</p>
  <pre><code>## section 1
  
  \begin{verbatim}
  x &lt;- 4
  y &lt;- 5
  
  x+y
  \end{verbatim}
  
  ### A
  
  9
  
  ### B
  
  5
  </code></pre>