如何移除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
相关产品推荐
相关产品推荐

