
Я хотел бы иметь возможность добавлять две картинки перед заголовком на титульном листе в 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}