【问题标题】:Rmarkdown presentation slide tickersRmarkdown 演示文稿幻灯片代码
【发布时间】:2015-02-20 09:02:09
【问题描述】:

我正在使用 rmarkdown 在 RStudio 中进行投影仪演示。我想在演示文稿的顶部获得幻灯片代码。德累斯顿主题应该支持那些代码Dresden

那么是否可以通过使用 rmarkdown 来获取这些代码?当我编织 pdf 时,我得到的演示文稿没有幻灯片代码。

示例代码:

---
title: "Example"
output: beamer_presentation
theme: Dresden
---

# R Markdown

This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.

# Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

# Slide with R Code and Output

```{r}
summary(cars)
```

# Slide with Plot

```{r, echo=FALSE}
plot(cars)
```

【问题讨论】:

    标签: r rstudio r-markdown


    【解决方案1】:

    我认为slide_level 选项可能是您正在寻找的:

    slide_level 选项定义了定义单个幻灯片的标题级别。默认情况下,这是层次结构中的最高标题级别,紧随其后的是内容,而不是文档中某处的另一个标题。可以通过指定显式 slide_level 来覆盖此默认值 documentation source

    例如slide_level: 2:

    ---
    title: "Example"
    output: 
      beamer_presentation:
        slide_level: 2
    theme: Dresden
    ---
    

    为您提供以下输出

    但是您需要为幻灯片标题提供较低级别的标题,例如

    # R Markdown
    
    ## Description
    This is an R Markdown presentation. Markdown is a simple formatting 
    syntax for authoring HTML, PDF, and MS Word documents. For more 
    details on using R Markdown see <http://rmarkdown.rstudio.com>.
    
    When you click the **Knit** button a document will be generated that 
    includes both content as well as the output of any embedded R code 
    chunks within the document.
    

    编辑要获得与您附加的图像相同的输出,您可以按以下方式对演示文稿进行分区:

    ---
    title: "Example"
    output: 
      beamer_presentation:
        slide_level: 3
    theme: Dresden
    ---
    # Section 1
    ## Subsection 1
    ### Title A
    ### Title B
    ## Subsection 2
    ### Title A
    ## Subsection 3
    ### Title A
    ### Title B
    ### Title C
    # Section 2
    ## Subsection 1
    ### Title A
    ### Title B
    

    并生成以下演示标题:

    【讨论】:

    • 好吧,我可以做到,但我正在寻找与问题图片完全相同的解决方案,我可能需要将问题修改得更准确。
    • 嗯,我不确定您是否对此解决方案感兴趣,但您提供的标题很容易获得 - 我已在答案中添加内容
    猜你喜欢
    • 2017-10-16
    • 1970-01-01
    • 2021-05-13
    • 2023-02-23
    • 2023-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-19
    相关资源
    最近更新 更多