You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除R Markdown Beamer演示文稿的默认标题页?

移除R Markdown Beamer默认标题页并自定义标题页

取消默认标题页

在YAML元数据中添加header-includes参数,通过LaTeX命令禁用默认标题页的生成:

---
title: "Some Title"
author:  "tlmoore"
output: beamer_presentation
latex_engine: lualatex
classoption: "aspectratio=169, 10pt"
header-includes:
  - \AtBeginDocument{\let\maketitle\relax}
---

\AtBeginDocument{\let\maketitle\relax}会覆盖Beamer默认的标题页生成命令,使其不再执行。

自定义标题页

取消默认标题页后,直接用Beamer的LaTeX语法编写你想要的标题页,放在R Markdown内容的最开头即可:

\begin{frame}
  \centering
  {\Huge \bfseries 我的自定义标题 \par}
  \vspace{1.5cm}
  {\Large 作者:tlmoore \par}
  \vspace{2cm}
  {\small 2024年5月 \par}
\end{frame}

完整可运行示例

---
title: "Some Title"
author:  "tlmoore"
output: beamer_presentation
latex_engine: lualatex
classoption: "aspectratio=169, 10pt"
header-includes:
  - \AtBeginDocument{\let\maketitle\relax}
---

\begin{frame}
  \centering
  {\Huge \bfseries 我的自定义标题 \par}
  \vspace{1.5cm}
  {\Large 作者:tlmoore \par}
  \vspace{2cm}
  {\small 2024年5月 \par}
\end{frame}

## First slide

Some text here

编译这个文档后,默认标题页会被移除,只显示你自定义的标题页。

内容的提问来源于stack exchange,提问作者tlmoore

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 20:57:27