【问题标题】:How to display code chunk when the corresponding list item is displayed?显示相应列表项时如何显示代码块?
【发布时间】:2021-08-11 16:26:26
【问题描述】:

在以下 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 文件中显示第二个列表项时显示代码块,而不是在显示第一个项目时显示代码块。

【问题讨论】:

    标签: r r-markdown beamer


    【解决方案1】:

    &gt; 块中包含代码。这行得通,

    ---
    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
    >   ```
    

    【讨论】:

      猜你喜欢
      • 2010-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-08
      • 2015-12-27
      • 2021-06-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多