0

I have some large code chunks that exceed the length of one slide. I want the code to easily split across two slides. This comes up when I want to display a large function that I can't easily split across two R code chunks. I also regularly print my slides to pdf for later annotation, so the scrollable code isn't helpful.

Is there any straightfoward way to do this?

I tried adding something like knitr::asis_output("\n\n---\n\n") into an R code chunk to manually add the slide break, following Inserting a slide break within a code chunk in rmarkdown

but this didn't work.

  • Instead, may be you can try for vertical scrolling?! – shafee Nov 22 '22 at 10:03
  • 1
    Maybe try ```` knitr::asis::output("\n```\n\n---\n\n```{.r}\n") ````. Edit: ugh, StackOverflow doesn't implement the CommonMark spec correctly. There are three backticks on each side surrounding the `\n\n---\n\n`. – tarleb Nov 22 '22 at 11:39

0 Answers0