首页 > 解决方案 > 仅在使用 R Markdown 的投影仪暂停后显示脚注

问题描述

我正在制作 Beamer 演示文稿,并在单张幻灯片的内容之间使用暂停。我不知道如何仅在暂停后显示脚注。

这是一个例子:

---
title: ""
author: ""
date: ""
output:
  beamer_presentation
bibliography: test.bib
---

* one argument

\pause

* another argument^[This citation should appear only with point 2: @fargues2006]

# references

test.bib

@article{fargues2006,
  title = {The {{Demographic Benefit}} of {{International Migration}}: {{Hypothesis}} and {{Application}} to {{Middle Eastern}} and {{North African Contexts}}},
  author = {Fargues, Philippe},
  date = {2006},
  journaltitle = {World Bank Policy Research Paper},
  url = {http://documents.worldbank.org/curated/en/508301468280735279/pdf/wps4050.pdf},
  number = {4050}
}

在此示例中,脚注不应仅在显示第一个点时出现,而是在显示第二个点时出现。

我试图从 TeX StackExchange 应用这个答案,但没有成功。

我怎样才能做到这一点?

编辑:在@samcarter_is_at_topanswers.xyz 的回答之后,我确切地说我更喜欢不需要在文档中从markdown切换到LaTeX的解决方案,具体取决于幻灯片是否同时具有暂停和脚注。但是,我可以.tex在 YAML 中使用文件或添加 pandoc 参数(因为我认为解决方案必须是这种方式,但我可能错了)。

编辑#2:我想在这些脚注中加上参考@citationkey

还在RStudio 社区上提问

标签: rlatexr-markdownbeamer

解决方案


您可以通过使用正确的乳胶语法来解决此问题:

---
title: ""
author: ""
date: ""
output:
  beamer_presentation
---

* one argument

\pause

* ```{=latex}
another argument\footnote<.(1)->{This should appear only with point 2}
```

在此处输入图像描述

或带有隐藏的脚注:

---
title: ""
author: ""
date: ""
output:
  beamer_presentation:
    keep_tex: true
---

##  {.t}


* one argument

\pause

* ```{=latex}
another argument\only<.(1)->{\footnote{This should appear only with point 2}}
```

在此处输入图像描述

(顶部对齐是为了避免跳跃)


推荐阅读