如何在显示相应列表项时显示代码块?
How to display code chunk when the corresponding list item is displayed?
在以下 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
> ```
在以下 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
> ```