问题描述
在以下 RMarkdown MWE 中:
---
title: "Untitled"
output:
beamer_presentation:
slide_level: 2
---
# Paragraph
## Slide
Hello
>- This is the first item
>- This is the second item
```{r}
a <- 2+2
```
我希望代码块在第二个列表项显示在生成的 PDF 文件中时显示,而不是在显示第一项时显示代码块。
解决方法
将代码包含在 >
块中。这行得通,
---
title: "Untitled"
output:
beamer_presentation:
slide_level: 2
---
# Paragraph
## Slide
Hello
>- This is the first item
>- This is the second item
>
> ```{r}
> a <- 2+2
> ```