如何在RMarkdown Beamer演示中调换日期与标题图位置?
调整Beamer幻灯片标题页的Logo与日期位置
要实现将Logo置于作者下方、日期放在幻灯片底部的需求,只需在原YAML配置中添加LaTeX代码重定义标题页模板即可,修改后的完整配置如下:
title: "Project name" author: "**Author1**, Author2" date: "Conference, 2024" output: beamer_presentation header-includes: - \usepackage{booktabs} - \makeatletter - \setbeamertemplate{title page}{ \vbox{} \vfill \begingroup \centering \usebeamercolor{title}\usebeamerfont{title}\inserttitle\par \vskip1em \usebeamercolor{author}\usebeamerfont{author}\insertauthor\par \vskip1em \inserttitlegraphic\par \vfill \usebeamercolor{date}\usebeamerfont{date}\insertdate\par \endgroup \vskip0pt } - \makeatother - \titlegraphic{\includegraphics[width = 2cm]{logo.png}}
关键调整说明:
\makeatletter和\makeatother是LaTeX标准命令,用于允许修改Beamer内部的模板定义- 重定义的
title page模板按照标题→作者→Logo→日期的顺序排列元素 \vfill命令自动分配垂直空间,将日期推至页面底部;\vskip1em控制元素间的固定垂直间距\inserttitlegraphic调用设置好的Logo图片,精准放置在作者信息下方
内容的提问来源于stack exchange,提问作者Mr Frog
相关产品推荐
相关产品推荐

