我需要创建像第一张图片这样的标题页和其他幻灯片,比如第二张图片。我还需要添加徽标作为图像(到页眉、页脚)和页脚,就像这样..(标题页中的不同页脚)我使用了\usetheme{Madrid}
。我该如何正确添加这些
答案1
有一种可能性是:\titlepagefootline
在包含标题页的框架之前和\mainfootline
此框架之后使用。还提供了新命令 \supervisor、\departament 和 \defense,分别用于添加有关主管、部门和“辩护”文本的信息。
要将大学徽标放在标题页和内部框架中,请将 替换ctanlion
为包含徽标的图像文件的名称,在我的示例中,这两个地方都使用了ctanlion
。由于我没有关于徽标尺寸的任何具体信息,也许您需要修改一些长度:
\documentclass{beamer}
\usetheme{Madrid}
\def\supervisor#1{\gdef\insertsupervisor{#1}}
\def\departament#1{\gdef\insertdepartament{#1}}
\def\defensetext#1{\gdef\insertdefensetext{#1}}
\supervisor{}
\departament{}
\defensetext{}
\makeatletter
\defbeamertemplate*{title page}{mydefault}[1][]
{
\vbox{}
\vspace*{-8ex}
\begin{beamercolorbox}[wd=\paperwidth,sep=8pt,left,#1]{institute}
{\usebeamercolor[fg]{titlegraphic}\raisebox{-.3\height}{\inserttitlegraphic}}\quad
{\usebeamerfont{institute}\insertinstitute}
\end{beamercolorbox}
\vfill
\begin{centering}
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{author}\insertsupervisor\par\medskip
\insertauthor
\end{beamercolorbox}
\end{centering}
\vfill
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}
}
\newcommand\mainfootline{%
\titlegraphic{\includegraphics[height=3ex]{ctanlion}}
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=4.25ex,dp=1ex,left]{author in head/foot}%
\raisebox{.8\baselineskip}{\parbox[t][4ex][t]{.333333\paperwidth}{\raggedright\hskip1ex\usebeamerfont{author in head/foot}%
\raisebox{-,5\height}{\inserttitlegraphic}\hskip2ex\insertshortinstitute}}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=4.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\raisebox{.8\baselineskip}{\parbox[t][4ex][t]{.333333\paperwidth}{\centering\insertdefensetext\par\insertdepartament}}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=4.25ex,dp=1ex,right]{date in head/foot}%
\raisebox{.8\baselineskip}{\parbox[t][4ex][t]{.333333\paperwidth}{\raggedleft\usebeamerfont{date in head/foot}\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}}}
\end{beamercolorbox}}%
\vskip0pt%
}%
}
\newcommand\titlepagefootline{%
\setbeamertemplate{footline}
{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=.25ex,dp=2ex,center]{institute}
\large\insertdepartament
\end{beamercolorbox}%
}%
}%
}
\makeatother
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{frametitle}[default][center]
\setbeamertemplate{title page}[mydefault]
\setbeamerfont{institute}{size=\LARGE}
\setbeamerfont{title}{size=\LARGE}
\setbeamerfont{author}{size=\large}
\setbeamerfont{institute}{size=\LARGE}
\title{The Title}
\institute{The Institute}
\supervisor{The Supervisor}
\author[Author]{The Author \\ 2876547}
\titlegraphic{\includegraphics[height=1cm]{ctanlion}}
\departament{The Departament}
\defensetext{Defense}
\date{}
\begin{document}
\titlepagefootline
\begin{frame}
\maketitle
\end{frame}
\mainfootline
\begin{frame}
\frametitle{Test Frame Title}
Test
\end{frame}
\end{document}