Tidy up title page code

- improves readability with conditional indenting.
- makes code more version-control-friendly by putting each formatting command on its own line.
- factors duplicated styles out of \if@noSmallCapitals.
- documents beamer bug(?) causing \insertauthor to never be empty.
This commit is contained in:
Ross Churchley 2015-04-29 16:55:07 -07:00
parent 702a821d93
commit b486ee92b6
1 changed files with 69 additions and 38 deletions

View File

@ -63,55 +63,86 @@
%{{{ --- Titlepage --------------------
\def\maketitle{\ifbeamer@inframe\titlepage\else\frame[plain]{\titlepage}\fi}
\def\titlepage{\usebeamertemplate{title page}}
\setbeamertemplate{title page}
{
\begin{minipage}[b][\paperheight]{\textwidth}
\vspace*{\@mtheme@voffset}
\ifx\inserttitlegraphic\@empty%
\else%
{
\ifx\inserttitlegraphic\@empty\else
{% \inserttitlegraphic is nonempty
\vbox to 0pt
{% display title graphic without changing the position of other elements
\vspace*{2em}
\usebeamercolor[fg]{titlegraphic}%
\inserttitlegraphic{}%
\inserttitlegraphic%
}%
\nointerlineskip%
}%
\fi%
\vfill
\ifx\inserttitle\@empty%
\else%
\if@noSmallCapitals%
{\raggedright\linespread{1.0}\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par}%
\else%
{\raggedright\linespread{1.0}\usebeamerfont{title}\usebeamercolor[fg]{title}\scshape\MakeLowercase{\inserttitle}\par}%
\fi%
\vspace*{0.5em}
\fi%
\ifx\insertsubtitle\@empty%
\else%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\vspace*{0.5em}
\fi%
\begin{tikzpicture}\draw[alerted text.fg] (0, 0) -- (\textwidth, 0);\end{tikzpicture}%
\vspace*{1em}
\ifx\insertauthor\@empty%
\else%
{\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor\par}%
\vspace*{0.25em}
\fi%
\ifx\insertdate\@empty%
\else%
{\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate\par}%
\fi%
\ifx\insertinstitute\@empty%
\else%
\vspace*{3mm}
{\usebeamerfont{institute}\usebeamercolor[fg]{institute}\insertinstitute\par}%
\fi%
}
\fi
\vfill%
\ifx\inserttitle\@empty\else
{{% \inserttitle is nonempty
\raggedright%
\linespread{1.0}%
\usebeamerfont{title}%
\usebeamercolor[fg]{title}%
\if@noSmallCapitals%
\inserttitle%
\else%
\scshape\MakeLowercase{\inserttitle}%
\fi%
\vspace*{0.5em}
}}
\fi
\ifx\insertsubtitle\@empty\else
{{% \insertsubtitle is nonempty
\usebeamerfont{subtitle}%
\usebeamercolor[fg]{subtitle}%
\insertsubtitle%
\vspace*{0.5em}%
}}
\fi
\begin{tikzpicture}
\draw[alerted text.fg] (0, 0) -- (\textwidth, 0);
\end{tikzpicture}%
\vspace*{1em}%
\ifx\insertauthor\@empty\else
{{% \insertauthor is always nonempty by beamer's definition, so this
% code is always inserted:
\usebeamerfont{author}%
\usebeamercolor[fg]{author}%
\insertauthor%
\par%
\vspace*{0.25em}
}}
\fi
\ifx\insertdate\@empty\else
{{% \insertdate is nonempty
\usebeamerfont{date}%
\usebeamercolor[fg]{date}%
\insertdate%
\par%
}}
\fi
\ifx\insertinstitute\@empty\else
{{% \insertinstitute is nonempty
\vspace*{3mm}
\usebeamerfont{institute}%
\usebeamercolor[fg]{institute}%
\insertinstitute%
\par%
}}
\fi
\vfill
\vspace*{\@mtheme@voffset}
\end{minipage}