mirror of https://github.com/matze/mtheme.git
Merge pull request #133 from rchurchley/bugfixes
Fix title page templates
This commit is contained in:
commit
2c7c913ad0
BIN
demo/demo.pdf
BIN
demo/demo.pdf
Binary file not shown.
Binary file not shown.
|
@ -125,13 +125,11 @@
|
|||
% |beamercolorthemedefault.sty|.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\setbeamercolor{titlelike}{%
|
||||
use=normal text,
|
||||
parent=normal text
|
||||
}
|
||||
\setbeamercolor{structure}{%
|
||||
fg=normal text.fg
|
||||
}
|
||||
\setbeamercolor{titlelike}{use=normal text, parent=normal text}
|
||||
\setbeamercolor{author}{use=normal text, parent=normal text}
|
||||
\setbeamercolor{date}{use=normal text, parent=normal text}
|
||||
\setbeamercolor{institute}{use=normal text, parent=normal text}
|
||||
\setbeamercolor{structure}{use=normal text, fg=normal text.fg}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% The “primary” palette should be used for the most important navigational
|
||||
|
|
|
@ -156,102 +156,29 @@
|
|||
% \end{macrocode}
|
||||
%
|
||||
% \begin{macro}{title page}
|
||||
% Template for the title page.
|
||||
% Template for the title page. Each element is only typset if it is defined
|
||||
% by the user. If |\subtitle| is empty, for example, it won't leave a blank
|
||||
% space on the title slide.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{title page}{
|
||||
\begin{minipage}[b][\paperheight]{\textwidth}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% If the user has set a |titlegraphic|, we set it in a zero-height box so
|
||||
% it doesn't change the position of other elements.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\ifx\inserttitlegraphic\@empty\else{%
|
||||
\vbox to 0pt {
|
||||
\vspace*{2em}
|
||||
\usebeamercolor[fg]{titlegraphic}%
|
||||
\inserttitlegraphic%
|
||||
}%
|
||||
\nointerlineskip%
|
||||
}
|
||||
\fi
|
||||
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
|
||||
\vfill%
|
||||
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
|
||||
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
|
||||
\usebeamertemplate*{title separator}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% We set the title and subtitle, but only if they are defined by the user.
|
||||
% If |\subtitle| is empty, for example, it won't leave a blank space on the
|
||||
% title slide.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\ifx\inserttitle\@empty\else{{%
|
||||
\raggedright%
|
||||
\linespread{1.0}%
|
||||
\usebeamerfont{title}%
|
||||
\usebeamercolor[fg]{title}%
|
||||
\@metropolis@titleformat{\inserttitle}%
|
||||
\par%
|
||||
\vspace*{0.5em}
|
||||
}}
|
||||
\fi
|
||||
\ifx\insertsubtitle\@empty\else{{%
|
||||
\usebeamerfont{subtitle}%
|
||||
\usebeamercolor[fg]{subtitle}%
|
||||
\insertsubtitle%
|
||||
\par%
|
||||
\vspace*{0.5em}
|
||||
}}
|
||||
\fi
|
||||
% \end{macrocode}
|
||||
%
|
||||
% A horizontal rule (drawn in TikZ) separates the title and subtitle from
|
||||
% the author, date, and institution.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\begin{tikzpicture}
|
||||
\usebeamercolor{title separator}
|
||||
\draw[fg] (0, 0) -- (\textwidth, 0);
|
||||
\end{tikzpicture}%
|
||||
\par%
|
||||
\vspace*{1em}%
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Like the title and subtitle, we display the author only when it is defined.
|
||||
% But beamer's definition of |\insertauthor| is always nonempty, so we have
|
||||
% Beamer's definition of |\insertauthor| is always nonempty, so we have
|
||||
% to test another macro initialized by |\author{...}| to see if the user has
|
||||
% defined an author. This solution was suggested by Enrico Gregorio in an
|
||||
% answer to \href{https://tex.stackexchange.com/questions/241306/}{this
|
||||
% Stack Exchange question}.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\ifx\beamer@shortauthor\@empty\else{{%
|
||||
\usebeamerfont{author}%
|
||||
\usebeamercolor[fg]{author}%
|
||||
\insertauthor%
|
||||
\par%
|
||||
\vspace*{0.25em}
|
||||
}}
|
||||
\fi
|
||||
% \end{macrocode}
|
||||
%
|
||||
% The date and institute are set after the author, again provided they are
|
||||
% nonempty. Note that the default date in \LaTeX{} is |\today|, not |\empty|.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\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
|
||||
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
|
||||
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
|
||||
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
|
||||
\vfill
|
||||
\vspace*{1mm}
|
||||
\end{minipage}
|
||||
|
@ -285,6 +212,90 @@
|
|||
% \end{macro}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{title graphic}
|
||||
% Set the title graphic in a zero-height box, so it doesn't change the
|
||||
% position of other elements.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{title graphic}{
|
||||
\vbox to 0pt {
|
||||
\vspace*{2em}
|
||||
\inserttitlegraphic%
|
||||
}%
|
||||
\nointerlineskip%
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{title}
|
||||
% Set the title on the title page.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{title}{
|
||||
\raggedright%
|
||||
\linespread{1.0}%
|
||||
\@metropolis@titleformat{\inserttitle}%
|
||||
\par%
|
||||
\vspace*{0.5em}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{subtitle}
|
||||
% Set the subtitle on the title page.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{subtitle}{
|
||||
\insertsubtitle%
|
||||
\par%
|
||||
\vspace*{0.5em}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{title separator}
|
||||
% Template to set the title graphic in a zero-height box. (It won't
|
||||
% change the position of other elements.)
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{title separator}{
|
||||
\begin{tikzpicture}
|
||||
\draw[fg] (0, 0) -- (\textwidth, 0);
|
||||
\end{tikzpicture}%
|
||||
\par%
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{author}
|
||||
% Set the author on the title page.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{author}{
|
||||
\vspace*{2em}
|
||||
\insertauthor%
|
||||
\par%
|
||||
\vspace*{0.25em}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{date}
|
||||
% Set the date on the title page.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{date}{
|
||||
\insertdate%
|
||||
\par%
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{institute}
|
||||
% Set the institute on the title page.
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{institute}{
|
||||
\vspace*{3mm}
|
||||
\insertinstitute%
|
||||
\par%
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsubsection{Section page}
|
||||
|
|
Loading…
Reference in New Issue