1
0
mirror of https://github.com/matze/mtheme.git synced 2024-06-20 06:46:39 +02:00
metropolis_theme/beamerouterthememetropolis.dtx
Benjamin Weiss 1b13cf3cd9 new frame title format implementation
As also suggested on
[stackexchange](http://tex.stackexchange.com/questions/112526/errors-wit
h-makeuppercase-and-beamers-insertsectionhead) the new implementation
patches `\sectionentry`, `\beamer@section` and `\beamer@@frametitle`
instead of expanding them.

In the process I also added three more hooks:

- `mthemesectiontitleformat`
- `mthemeframetitleformat`
- `mthemeplaintitleformat`

So the user can change the behavior of each element independently. As
default the new formats are dependent on `mthemetitleformat`.

For testing purposes I integrated @elliottd s frames from this PR #94

This should fix the `allowframebreaks` issue for real now.
2015-06-22 16:38:26 +02:00

139 lines
3.8 KiB
TeX

% \iffalse meta-comment -------------------------------------------------------
% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
% contributors can be found at
%
% https://github.com/matze/mtheme/graphs/contributors
%
% and the original template was based on the HSRM theme by Benjamin Weiss.
%
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
% International License (https://creativecommons.org/licenses/by-sa/4.0/).
% ------------------------------------------------------------------------- \fi
% \iffalse
%<driver> \ProvidesFile{beamerouterthememetropolis.dtx}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerouterthememetropolis}
[2015/06/12 A Modern Beamer Theme]
%</package>
%<driver> \documentclass{ltxdoc}
%<driver> \usepackage{beamerouterthememetropolis}
%<driver> \begin{document}
%<driver> \DocInput{beamerouterthememetropolis.dtx}
%<driver> \end{document}
% \fi
% \CheckSum{0}
% \StopEventually{}
% \iffalse
%<*package>
% ------------------------------------------------------------------------- \fi
% \section{Implementation: \textsc{metropolis} outer theme}
%
% A |beamer| outer theme dictates the style of the frame elements traditionally
% set outside the body of each slide: the head, footline, and frame title.
%
%
%
% This customization will be removed in a future version.
%
% \begin{macrocode}
\def\mthemetitleformat{\scshape\MakeLowercase}
% \end{macrocode}
%
%
% \subsection{Head and footline}
%
% All good |beamer| presentations should already remove the navigation symbols,
% but \textsc{metropolis} removes them automatically (just in case).
%
% \begin{macrocode}
\setbeamertemplate{navigation symbols}{}
% \end{macrocode}
%
% The only element in the footline by default is the frame number. It can
% optionally be omitted or displayed as a fraction of the total frames.
%
% \begin{macrocode}
\setbeamertemplate{footline}{%
\begin{beamercolorbox}[%
wd=\textwidth,
ht=3ex,
dp=3ex,
leftskip=0.3cm,
rightskip=0.3cm
]{footline}%
\hfill\usebeamerfont{page number in head/foot}%
\if@noSlideNumbers%
%Purposefully left blank to display no slide number.%
\else%
\if@useTotalSlideIndicator%
\insertframenumber/\inserttotalframenumber%
\else%
\insertframenumber%
\fi%
\fi%
\end{beamercolorbox}%
}
% \end{macrocode}
%
%
%
% \subsection{Frametitle}
%
% \begin{macro}{frametitle}
%
% Template for the frame title, which is optionally underlined with a
% progress bar.
%
% \begin{macrocode}
\setbeamertemplate{frametitle}{%
\nointerlineskip
\begin{beamercolorbox}[%
wd=\paperwidth,
leftskip=0.3cm,
rightskip=0.3cm,
ht=2.5ex,
dp=1.5ex
]{frametitle}
\insertframetitle%
\end{beamercolorbox}%
\if@useTitleProgressBar
\nointerlineskip
\usebeamertemplate*{progress bar in head/foot}
\fi
\vspace{\@mtheme@voffset}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{progress bar in head/foot}
%
% Template for the progress bar optionally displayed below the frame title
% on each page. Much of this code is duplicated in the inner theme's template
% |progress bar in section page|.
%
% \begin{macrocode}
\RequirePackage{calc}
\newlength{\metropolis@progressinheadfoot}
\setbeamertemplate{progress bar in head/foot}{
\setlength{\metropolis@progressinheadfoot}{%
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{beamercolorbox}[wd=\paperwidth,ht=0.4pt,dp=0pt]{progress bar in head/foot}
\begin{tikzpicture}
\draw[bg, fill=bg] (0,0) rectangle (\paperwidth, 0.4pt);
\draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt);
\end{tikzpicture}%
\end{beamercolorbox}
}
% \end{macrocode}
% \end{macro}
%
%
%
% \iffalse
%</package>
% \fi
% \Finale
\endinput