R Markdown PDF 幻灯片:在标题幻灯片的作者上方插入图像

问题描述 投票:0回答:1

在 R Markdown 编译为 PDF 幻灯片中,如何在标题幻灯片的标题正下方(即作者上方)包含图像?

这篇文章表明可能可以使用标题包,但我收到

\if@titlepage
的“未定义控制序列”错误。

这是我的 MWE:

---
title: "Your Presentation Title"
author: "Your Name"
date: "`r Sys.Date()`"
output:
  beamer_presentation:
header-includes:
  - \usepackage{titling}
  - \preauthor{\begin{center}\includegraphics[width=2in,height=2in]{images/my-title-image}\LARGE\\}
  - \postauthor{\end{center}}
---

# Section 1

## Slide 1

Content here.

# Section 2

## Slide 2

More content here.

我得到的错误是:

! Undefined control sequence.
l.35 \if@titlepage

有什么建议吗?

r latex r-markdown markdown beamer
1个回答
0
投票
---
title: "Your Presentation Title"
author: "Your Name"
date: "`r Sys.Date()`"
output:
  beamer_presentation:
header-includes:
  - \addtobeamertemplate{author}{\centering\includegraphics{example-image-duck}\par}{}
---

# Section 1

## Slide 1

Content here.

# Section 2

## Slide 2

More content here.

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.