2015-06-18 08:46:34 +02:00
|
|
|
% \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}
|
2015-12-04 15:42:27 +01:00
|
|
|
\ProvidesPackage{beamerouterthememetropolis}[2015/12/04 Metropolis outer theme]
|
2015-06-18 08:46:34 +02:00
|
|
|
%</package>
|
|
|
|
%<driver> \documentclass{ltxdoc}
|
|
|
|
%<driver> \usepackage{beamerouterthememetropolis}
|
|
|
|
%<driver> \begin{document}
|
|
|
|
%<driver> \DocInput{beamerouterthememetropolis.dtx}
|
|
|
|
%<driver> \end{document}
|
|
|
|
% \fi
|
|
|
|
% \CheckSum{0}
|
|
|
|
% \StopEventually{}
|
|
|
|
% \iffalse
|
|
|
|
%<*package>
|
|
|
|
% ------------------------------------------------------------------------- \fi
|
2015-06-22 23:43:52 +02:00
|
|
|
%
|
2016-02-07 04:07:48 +01:00
|
|
|
% \subsection{\themename outer theme}
|
2015-06-18 09:22:03 +02:00
|
|
|
%
|
|
|
|
% 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.
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% Load required packages.
|
|
|
|
% \begin{macrocode}
|
2015-06-23 14:35:04 +02:00
|
|
|
\RequirePackage{etoolbox}
|
2015-06-22 23:43:52 +02:00
|
|
|
\RequirePackage{calc}
|
|
|
|
\RequirePackage{pgfopts}
|
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-18 09:22:03 +02:00
|
|
|
%
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsubsection{Options}
|
2015-06-22 07:24:49 +02:00
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% \begin{macro}{numbering}
|
|
|
|
% This option controls the page numbering.
|
2015-06-22 07:24:49 +02:00
|
|
|
% \begin{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
\pgfkeys{
|
|
|
|
/metropolis/outer/numbering/.cd,
|
|
|
|
.is choice,
|
|
|
|
none/.code=\setbeamertemplate{frame numbering}[none],
|
|
|
|
counter/.code=\setbeamertemplate{frame numbering}[counter],
|
|
|
|
fraction/.code=\setbeamertemplate{frame numbering}[fraction],
|
|
|
|
}
|
2015-06-22 07:24:49 +02:00
|
|
|
% \end{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
% \end{macro}
|
|
|
|
%
|
|
|
|
% \begin{macro}{progressbar}
|
|
|
|
% This option controls the progressbar.
|
|
|
|
% \begin{macrocode}
|
|
|
|
\pgfkeys{
|
|
|
|
/metropolis/outer/progressbar/.cd,
|
|
|
|
.is choice,
|
2015-07-10 08:09:39 +02:00
|
|
|
none/.code={%
|
|
|
|
\setbeamertemplate{headline}[plain]
|
|
|
|
\setbeamertemplate{frametitle}[plain]
|
|
|
|
\setbeamertemplate{footline}[plain]
|
|
|
|
},
|
|
|
|
head/.code={\pgfkeys{/metropolis/outer/progressbar=none}
|
2015-12-03 20:53:25 +01:00
|
|
|
\addtobeamertemplate{headline}{}{%
|
|
|
|
\usebeamertemplate*{progress bar in head/foot}
|
|
|
|
}
|
2015-07-10 08:09:39 +02:00
|
|
|
},
|
|
|
|
frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none}
|
2015-12-03 20:53:25 +01:00
|
|
|
\addtobeamertemplate{frametitle}{}{%
|
|
|
|
\usebeamertemplate*{progress bar in head/foot}
|
|
|
|
}
|
2015-07-10 08:09:39 +02:00
|
|
|
},
|
|
|
|
foot/.code={\pgfkeys{/metropolis/outer/progressbar=none}
|
2015-12-03 20:53:25 +01:00
|
|
|
\addtobeamertemplate{footline}{}{%
|
|
|
|
\usebeamertemplate*{progress bar in head/foot}%
|
|
|
|
}
|
2015-07-10 08:09:39 +02:00
|
|
|
},
|
2015-06-23 14:35:04 +02:00
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
|
|
|
% \begin{macro}{frametitleformat}
|
2015-12-03 20:53:25 +01:00
|
|
|
% Control the titleformat of the frame title
|
2015-06-23 14:35:04 +02:00
|
|
|
% \begin{macrocode}
|
|
|
|
\pgfkeys{
|
2016-02-07 05:19:36 +01:00
|
|
|
/metropolis/outer/titleformat-frame/.cd,
|
2015-06-23 14:35:04 +02:00
|
|
|
.is choice,
|
2015-07-16 06:07:31 +02:00
|
|
|
regular/.code={%
|
2016-02-07 04:24:47 +01:00
|
|
|
\let\metropolis@frametitleformat\@empty%
|
2015-12-03 20:53:25 +01:00
|
|
|
\setbeamerfont{frametitle}{shape=\normalfont}%
|
2016-02-07 04:24:47 +01:00
|
|
|
\renewcommand{\metropolis@frametitlestrut}{%
|
2015-11-16 18:02:50 +01:00
|
|
|
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}%
|
|
|
|
}
|
|
|
|
},
|
2015-12-03 20:53:25 +01:00
|
|
|
smallcaps/.code={%
|
2016-02-07 04:24:47 +01:00
|
|
|
\let\metropolis@frametitleformat\@empty%
|
2015-12-03 20:53:25 +01:00
|
|
|
\setbeamerfont{frametitle}{shape=\scshape}%
|
2016-02-07 04:24:47 +01:00
|
|
|
\renewcommand{\metropolis@frametitlestrut}{%
|
2015-12-03 20:53:25 +01:00
|
|
|
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}%
|
|
|
|
}
|
|
|
|
},
|
|
|
|
allsmallcaps/.code={%
|
2016-02-07 04:24:47 +01:00
|
|
|
\let\metropolis@frametitleformat\MakeLowercase%
|
2015-12-03 20:53:25 +01:00
|
|
|
\setbeamerfont{frametitle}{shape=\scshape}%
|
2016-02-07 04:24:47 +01:00
|
|
|
\renewcommand{\metropolis@frametitlestrut}{%
|
2015-11-16 18:02:50 +01:00
|
|
|
\vphantom{abcdefghijklmnopqrstuvwxyz}%
|
|
|
|
}
|
2015-12-03 20:53:25 +01:00
|
|
|
\PackageWarning{beamerthememetropolis}{%
|
2016-02-07 05:19:36 +01:00
|
|
|
Be aware that titleformat-frame=allsmallcaps can lead to problems%
|
2015-12-03 20:53:25 +01:00
|
|
|
}
|
2015-11-16 18:02:50 +01:00
|
|
|
},
|
2015-12-03 20:53:25 +01:00
|
|
|
allcaps/.code={%
|
2016-02-07 04:24:47 +01:00
|
|
|
\let\metropolis@frametitleformat\MakeUppercase%
|
2015-12-03 20:53:25 +01:00
|
|
|
\setbeamerfont{frametitle}{shape=\normalfont}
|
2016-02-07 04:24:47 +01:00
|
|
|
\renewcommand{\metropolis@frametitlestrut}{%
|
2015-11-16 18:02:50 +01:00
|
|
|
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
|
|
|
|
}
|
2015-12-03 20:53:25 +01:00
|
|
|
\PackageWarning{beamerthememetropolis}{%
|
2016-02-07 05:19:36 +01:00
|
|
|
Be aware that titleformat-frame=allcaps can lead to problems%
|
2015-12-03 20:53:25 +01:00
|
|
|
}
|
2015-11-16 18:02:50 +01:00
|
|
|
},
|
2015-06-22 23:43:52 +02:00
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
2016-02-07 04:24:47 +01:00
|
|
|
% \begin{macro}{\metropolis@outer@setdefaults}
|
2015-06-22 23:43:52 +02:00
|
|
|
% Set default values for outer theme options.
|
|
|
|
% \begin{macrocode}
|
2016-02-07 04:24:47 +01:00
|
|
|
\newcommand{\metropolis@outer@setdefaults}{
|
2015-06-22 23:43:52 +02:00
|
|
|
\pgfkeys{/metropolis/outer/.cd,
|
|
|
|
numbering=counter,
|
|
|
|
progressbar=none,
|
2016-02-07 05:19:36 +01:00
|
|
|
titleformat-frame=regular,
|
2015-06-22 23:43:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
% \end{macrocode}%
|
|
|
|
% \end{macro}
|
|
|
|
%
|
2015-06-22 07:24:49 +02:00
|
|
|
%
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsubsection{Head and footline}
|
2015-06-18 09:22:03 +02:00
|
|
|
%
|
|
|
|
% All good |beamer| presentations should already remove the navigation symbols,
|
2016-02-07 04:07:48 +01:00
|
|
|
% but \themename removes them automatically (just in case).
|
2015-06-18 09:22:03 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
|
|
|
\setbeamertemplate{navigation symbols}{}
|
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-07-10 08:09:39 +02:00
|
|
|
% Templates for the frame number. Can be omitted, shown or displayed as a
|
2015-06-22 23:43:52 +02:00
|
|
|
% fraction of the total frames.
|
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2015-07-10 08:09:39 +02:00
|
|
|
\defbeamertemplate{frame numbering}{none}{}
|
|
|
|
\defbeamertemplate{frame numbering}{counter}{\insertframenumber}
|
2015-06-22 23:43:52 +02:00
|
|
|
\defbeamertemplate{frame numbering}{fraction}{
|
|
|
|
\insertframenumber/\inserttotalframenumber
|
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-18 09:22:03 +02:00
|
|
|
% \begin{macrocode}
|
2015-07-10 08:09:39 +02:00
|
|
|
\defbeamertemplate{headline}{plain}{}
|
|
|
|
\defbeamertemplate{footline}{plain}{%
|
|
|
|
\begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}%
|
|
|
|
\hfill%
|
|
|
|
\usebeamerfont{page number in head/foot}%
|
|
|
|
\usebeamertemplate*{frame numbering}
|
2015-06-18 09:22:03 +02:00
|
|
|
\end{beamercolorbox}%
|
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
%
|
|
|
|
%
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsubsection{Frametitle}
|
|
|
|
%
|
2016-02-07 04:24:47 +01:00
|
|
|
% \begin{macro}{\metropolis@frametitleformat}
|
2015-06-23 14:35:04 +02:00
|
|
|
% Define a hook to change the case format of the frame title.
|
|
|
|
% \begin{macrocode}
|
2016-02-07 04:24:47 +01:00
|
|
|
\def\metropolis@frametitleformat#1{#1}
|
2015-06-23 14:35:04 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
|
|
|
% To make the |\MakeLowercase| and |\MakeUppercase| macros work in the
|
|
|
|
% frame title we have to patch |\beamer@@frametitle|. This solution was
|
|
|
|
% suggested by Enrico Gregorio in an answer to
|
|
|
|
% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange
|
|
|
|
% question}.
|
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
|
|
|
\patchcmd{\beamer@@frametitle}
|
|
|
|
{\beamer@ifempty{#2}{}{%
|
2015-12-03 20:53:25 +01:00
|
|
|
\gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space%
|
|
|
|
\usebeamertemplate*{frametitle continuation}\fi}}%
|
2015-06-23 14:35:04 +02:00
|
|
|
\gdef\beamer@frametitle{#2}%
|
|
|
|
\gdef\beamer@shortframetitle{#1}%
|
|
|
|
}}
|
|
|
|
{\beamer@ifempty{#2}{}{%
|
2016-02-07 04:24:47 +01:00
|
|
|
\gdef\insertframetitle{{\metropolis@frametitleformat{#2}\ifnum%
|
2015-12-03 20:53:25 +01:00
|
|
|
\beamer@autobreakcount>0\relax{}\space%
|
|
|
|
\usebeamertemplate*{frametitle continuation}\fi}}%
|
2015-06-23 14:35:04 +02:00
|
|
|
\gdef\beamer@frametitle{#2}%
|
|
|
|
\gdef\beamer@shortframetitle{#1}%
|
|
|
|
}}
|
|
|
|
{}
|
2015-12-03 20:53:25 +01:00
|
|
|
{\PackageError{beamerouterthememetropolis}{Patching frame title failed}}
|
2015-06-23 14:35:04 +02:00
|
|
|
% \end{macrocode}
|
2015-06-18 09:22:50 +02:00
|
|
|
%
|
|
|
|
% \begin{macro}{frametitle}
|
|
|
|
%
|
2015-06-30 00:00:14 +02:00
|
|
|
% Templates for the frame title, which is optionally underlined with a
|
2015-06-23 14:35:04 +02:00
|
|
|
% progress bar.
|
2015-06-18 09:22:50 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2016-02-07 04:24:47 +01:00
|
|
|
\newlength{\metropolis@frametitlestrut}
|
2015-06-30 00:00:14 +02:00
|
|
|
\defbeamertemplate{frametitle}{plain}{%
|
2015-07-21 03:24:05 +02:00
|
|
|
\nointerlineskip%
|
2015-06-30 00:00:14 +02:00
|
|
|
\begin{beamercolorbox}[%
|
2015-07-21 03:24:05 +02:00
|
|
|
wd=\paperwidth,%
|
|
|
|
sep=1.5ex,%
|
|
|
|
]{frametitle}%
|
2016-02-07 04:24:47 +01:00
|
|
|
\metropolis@frametitlestrut\insertframetitle\metropolis@frametitlestrut%
|
2015-06-30 00:00:14 +02:00
|
|
|
\end{beamercolorbox}%
|
|
|
|
}
|
2015-06-18 09:22:50 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
|
|
|
% \begin{macro}{progress bar in head/foot}
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% 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|.
|
2015-06-18 09:22:50 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
|
|
|
\newlength{\metropolis@progressinheadfoot}
|
2015-06-30 00:00:14 +02:00
|
|
|
\setbeamertemplate{progress bar in head/foot}{
|
2015-06-22 23:43:52 +02:00
|
|
|
\nointerlineskip
|
2015-06-18 09:22:50 +02:00
|
|
|
\setlength{\metropolis@progressinheadfoot}{%
|
|
|
|
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
|
|
|
|
}%
|
2015-07-10 08:09:39 +02:00
|
|
|
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
|
2015-06-18 09:22:50 +02:00
|
|
|
\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}
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% Process package options
|
2015-06-18 09:22:50 +02:00
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% \begin{macrocode}
|
2016-02-07 04:24:47 +01:00
|
|
|
\metropolis@outer@setdefaults
|
2015-06-22 23:43:52 +02:00
|
|
|
\ProcessPgfPackageOptions{/metropolis/outer}
|
|
|
|
% \end{macrocode}
|
2015-06-18 09:22:50 +02:00
|
|
|
%
|
2015-06-18 08:46:34 +02:00
|
|
|
% \iffalse
|
|
|
|
%</package>
|
|
|
|
% \fi
|
|
|
|
% \Finale
|
|
|
|
\endinput
|