title: Randomize items in rmarkdown transparently
body: <p>I have the following rmarkdown document:</p>
  <pre><code>---
  title: &quot;Untitled&quot;
  output: pdf_document
  date: '2022-04-28'
  ---
  
  ```{r setup, include=FALSE}
  knitr::opts_chunk$set(echo = TRUE)
  ```
  
  1. This is the first outer item.
      (a) A
      (b) B
  2. This is the second outer item.
      (a) C
      (b) D
  3. This is the third outer item.
      (a) E
      (b) F
  </code></pre>
  <p>I would like to randomly shuffle this list simultaneously in two ways: Inside the inner lists and outside those. Say, I want to get something like the following:</p>
  <pre><code>1. This is the second outer item. 
      (a) D 
      (b) A 
  2. This is the first outer item. 
      (a) B 
      (b) A 
  3. This is the third outer item. 
      (a) F 
      (b) E 
  </code></pre>
  <p>I know that I could accomplish that by creating the rmarkdown code by programming with strings. So, my question is: Can one achieve the goal by writing the text of the document without having to resort to programming with strings? The reason is that I would like to have a clear picture of the document as I write it, without having the text of the document buried in code. (I am aware that some programming is unavoidable though.)</p>