【问题标题】:Incremental Slides with Code/Figures in Rmarkdown to Beamer PresentationRmarkdown 中带有代码/图形的增量幻灯片到 Beamer 演示文稿
【发布时间】:2021-05-13 05:47:08
【问题描述】:

我正在尝试在 Rmarkdown 中输出一个 beamer_presentation,我想在其中显示一个代码块,然后在单击时将图形显示为该代码块的结果。我知道“xarigan”包允许这个相当简单(--),但我更喜欢使用基本 Rmarkdown,以实现重现性目的。

例子:

---
title: "Untitled"
author: "BP"
output: beamer_presentation
---

## Slide with Bullets

- Making a plot

    ```{r cars, echo= TRUE}
     plot(cars$speed, cars$distance)
    ```

理想情况下,演示文稿将显示项目符号和代码块,然后逐步构建情节。

谢谢

【问题讨论】:

标签: latex r-markdown beamer presentation


【解决方案1】:

您可以稍微修改Shaded 环境的定义

---
title: "Untitled"
author: "BP"
output: 
    beamer_presentation:
        keep_tex: true
header-includes:
   - \renewenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}\pause}        
---

## Slide with Bullets

- Making a plot

    ```{r cars, echo= TRUE}
     plot(cars$speed, cars$distance)
    ```

(如果您不想在整个文档中使用此功能,请在您的绘图周围分组执行此操作)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-23
    • 2021-06-02
    • 1970-01-01
    • 2017-07-15
    • 2017-10-16
    • 1970-01-01
    • 2023-01-25
    • 2017-12-26
    相关资源
    最近更新 更多