Reputation: 83
In a xaringan presentation I want to show how to put R Code in an R Markdown document. Which leads me to the dangerous waters of verbatim R Markdown in an xaringan (R Markdown) document.
Displaying verbatim inline code works as long as there is no R code chunk on a later slide. If there is a code chunk later on, all slide separation following the verbatim inline code break. They are displayed as horizontal lines. If I remove the code chunk and leave everything else untouched, the slide separation works again properly.
I read #7 in the knitr FAQ and the mentioned blog post as well as stuff on stackoverflow and R Views. I have no idea what confuses xaringan.
Content of test_verbatim.Rmd
document:
---
title: "Verbatim Inline Code"
output: xaringan::moon_reader
---
# Before
empty
---
# Current
This will show a verbatim inline R expression `` `r
1+1` `` in the output.
---
# After
An R Code Chunk breaks the slide separator. Without the chunk, slide separation works. Even an inline R expression is okay.
```{r}
1 + 1
```
---
I want separate slides (Before
, Current
& After
) with verbatim R Markdown and R code chunks but get horizontal lines on the slide Current
instead of slide separation.
Upvotes: 5
Views: 640