我希望能够在 Beamer 的标题页上的标题前添加两张图片,如下所示:
我使用了这个命令\titlegraphic{\includegraphics[height=4cm]{Picture}}
,但没有达到目标
\documentclass{beamer}
\titlegraphic{\includegraphics[height=4cm]{picture1}}
\titlegraphic{\includegraphics[height=4cm]{picture2}}
\title{TITLE}
\subtitle{\textbf{Subtitle}}
\author{Author}
\institute{University }
\setbeamercolor{title}{bg=orange,fg=white}
\begin{document}
\maketitle
\end{document}
答案1
一个快速的单行解决方案是使用以下命令:
\addtobeamertemplate{title page}{\includegraphics[scale=.05]{lion} \hfill \includegraphics[scale=.05]{lion}}{}
这样你就会有类似这样的结果:
\documentclass{beamer}
\addtobeamertemplate{title page}{\includegraphics[scale=.05]{lion} \hfill \includegraphics[scale=.05]{lion}}{}
\title{TITLE}
\subtitle{subtitle}
\author{Author}
\institute{University}
\setbeamercolor{title}{bg=orange,fg=white}
\begin{document}
\maketitle
\end{document}
如果您需要更多无法通过addtobeamertemplate
宏获得的自定义功能,则应创建自定义title page
模板。default
模板可以在中找到,beamerinnerthemedefault.sty
并且经过请求的修改后将如下所示:
\makeatletter
\setbeamertemplate{title page}
{
\includegraphics[scale=.05]{lion} \hfill \includegraphics[scale=.05]{lion} % new code
\vbox{}
\vfill
\begingroup
\centering
\begin{beamercolorbox}[sep=8pt,center]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\endgroup
\vfill
}
\makeatother
通过适当的更改,您可以添加垂直空间或者重新定位图片或任何您喜欢的内容。
答案2
我也经常需要这样做。\titlegraphic
我通常不使用,而是使用以下方法:
\begin{frame}
\begin{columns}
\column{0.5\textwidth}
\flushleft
\includegraphics{leftpicture}
\column{0.5\textwidth}
\flushright
\includegraphics{rightpicture}
\end{columns}
\titlepage
\end{frame}
甚至
\begin{frame}
\hbox to \textwidth{
\includegraphics{leftpicture}
\hfill
\includegraphics{rightpicture}
}
\titlepage
\end{frame}