【问题标题】:Rmarkdown beamer table of contents slides, plus grayed out for not current sectionsRmarkdown beamer 目录幻灯片,非当前部分显示为灰色
【发布时间】:2018-02-13 03:02:04
【问题描述】:

我想在开头插入目录幻灯片,但不是开头。

此外,我希望它在每个新部分到达时重复目录幻灯片,但这次除了当前部分之外所有内容都变灰,例如,请参见图片。

this 其他答案将不起作用,因为 toc: true 只是将一个目录放在开头)

Latex 中存在一些答案(请参阅here),但我不知道如何在降价中操作这些答案。更一般地说,我无法将原生 beamer 乳胶集成到 rmarkdown 中,所以如果有人能告诉我如何做到这一点,尤其是这个例子,那会很有帮助。

Beamer 序言:

output:
  beamer_presentation:
    fig_width: 7
    fig_height: 6
    fig_caption: false
#    keep_tex: true
#    toc: true
    slide_level: 3
    includes:
      in_header: ~/Google Drive/.../.../../latexbeamertheme.r
header-includes:
- \AtBeginSection[]{\begin{frame}\tableofcontents[currentsection]\end{frame}}

【问题讨论】:

  • @Kristofersen 它不是重复的,该方法可以使用 toc 解决,我不是

标签: r latex markdown r-markdown beamer


【解决方案1】:

你可以通过header-includes解决这个问题;这就是你如何在 LaTeX 文档中添加我们称之为序言的内容。这是生成演示文稿的示例代码,其中包含我认为您想要完成的内容:

---
title: "Example"
output: beamer_presentation
header-includes:
- \AtBeginSection[]{\begin{frame}\tableofcontents[currentsection]\end{frame}}
---

# Test Section One

----

Test

----

Test


# Test Section Two

----

Test

----

Test

编辑:

如果您想要或需要手动执行此操作,而不是使用header-includes 方法,您可以:

---
title: "Example"
output: beamer_presentation
---

# Test Section One

----

\tableofcontents[currentsection]

----

Test

----

Test


# Test Section Two

----

\tableofcontents[currentsection]

----

Test

----

Test

【讨论】:

  • 现在,当我将它添加到我的完整文档中时,这似乎不起作用,它已经有一个乳胶序言。会不会是它被覆盖的情况?
  • (有关 beamer markdown 的序言位,请参阅问题)
  • 是否可以发布/评论您的整个代码(或者至少是演示内容之前的所有代码以及几张幻灯片或一两张虚拟幻灯片的代码)?
  • 另外,把我发布的示例代码放在它自己的单独文档中对你来说可以吗?
  • 你想让我给你看我的乳胶前导文件的内容吗?也许是这样做的?
猜你喜欢
  • 2017-07-15
  • 2017-12-26
  • 2017-05-31
  • 1970-01-01
  • 2023-02-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-29
相关资源
最近更新 更多