我想在 Beamer 的标题框中添加自定义图像。为此,我使用:
\documentclass[10pt]{beamer}
\usetheme{default}
\usecolortheme{seahorse}
\usefonttheme{professionalfonts}
\usepackage[utf8]{inputenc}
\author{usernumber}
\title{title}
\logo{logo}
\institute{institute}
\date{date}
\titlegraphic{\includegraphics[height=.5\textheight]{image}}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
这会导致图像出现在日期下方。是否可以将图像放在作者、机构和日期旁边?移动图像的最简单方法是什么?
答案1
您可以使用\defbeamertemplate*{title page}
来定义您自己的自定义标题框架模板。为此,我从中复制了标题页模板beamerinnerthemedefault.sty
(您通过加载)并添加了 minipage 环境,以确保标题图像与作者、机构和日期并排显示。(在以下 MWE 中\usetheme{default}
使用突出显示了添加的行)%<------
\documentclass[10pt]{beamer}
\usetheme{default}
\usecolortheme{seahorse}
\usefonttheme{professionalfonts}
\makeatletter
\defbeamertemplate*{title page}{mycustomtitlepage}[1][]
{
\vbox{}
\vfill
\begingroup
\centering
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{minipage}{0.5\textwidth} %<------
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\end{minipage}% %<------
\begin{minipage}{0.5\textwidth}%<------
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\end{minipage}%<------
\endgroup
\vfill
}
\makeatother
\author{usernumber}
\title{title}
\logo{logo}
\institute{institute}
\date{date}
\titlegraphic{\includegraphics[width=\linewidth]{example-image}}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}