【问题标题】:Adding a footnote / thanks to Rmarkdown title slide添加脚注/感谢 Rmarkdown 标题幻灯片
【发布时间】:2016-05-15 16:52:30
【问题描述】:

我必须在标题幻灯片中添加一个说明,说明我的资金来源。我能够通过以下方式在 LyX / LaTeX 中做到这一点:

\author{Michael Chirico\thanks{These people gave me money}, Other Authors}

我无法在 Rmarkdown 中重现这一点。 site 提到使用 [^] 锚定来标记脚注,这在其他幻灯片中效果很好,但我无法在标题中使用它:

---
title: "Title"
author: "Michael Chirico[^thanks], Other Authors"
date: "February 10, 2016"
output: beamer_presentation

[^thanks]: These people gave me money
---

.pdf 可以编译,但没有标题幻灯片。我认为这是编译日志的相关部分:

pandoc:无法解析 YAML 标头:UnexpectedEvent {_received = Just (EventSequenceStart Nothing), _expected = Nothing} "source"(第 1 行,第 1 列)

如果我将[^thanks] 移到页眉之外,.pdf 会编译,但标题页(也没有其他任何地方)上没有页脚,[^thanks] 会按原样显示在标题幻灯片上。

如何在标题幻灯片中添加脚注/感谢部分?

【问题讨论】:

    标签: r knitr r-markdown pandoc beamer


    【解决方案1】:

    您可以使用inline note。常规脚注语法是[^note_call],然后是[^note_call]: note_content 换行。内联注释的语法就是^[note_content]

    ---
    title: "Title"
    author: "Michael Chirico^[These people gave me money], Other Authors"
    date: "February 10, 2016"
    output: beamer_presentation
    ---
    

    另一个允许更大灵活性但仅限于投影仪输出的解决方案是更改模板。

    【讨论】:

    • 这看起来很完美。有什么真正的区别吗? (除了链接中提到的:“与常规注释不同,[内联注释]不能包含多个段落”)
    • 我不这么认为,pandoc 将两种语法都解析为 Note 元素。您可以使用pandoc -t native 编译您的文档来检查
    • 遗憾的是,这不适用于 .Rpres 格式(不是 Q 中问过这个问题,但我认为该解决方案适用于两者)
    • 截至 2017 年 11 月,也不适用于一般的 Rmarkdown 文档。
    猜你喜欢
    • 2016-08-15
    • 1970-01-01
    • 2022-08-21
    • 2021-10-08
    • 2022-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多