| 1 |
% \iffalse meta-comment ------------------------------------------------------- |
| 2 |
% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of |
| 3 |
% contributors can be found at |
| 4 |
% |
| 5 |
% https://github.com/matze/mtheme/graphs/contributors |
| 6 |
% |
| 7 |
% and the original template was based on the HSRM theme by Benjamin Weiss. |
| 8 |
% |
| 9 |
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 |
| 10 |
% International License (https://creativecommons.org/licenses/by-sa/4.0/). |
| 11 |
% ------------------------------------------------------------------------- \fi |
| 12 |
% \iffalse |
| 13 |
%<*package> |
| 14 |
\NeedsTeXFormat{LaTeX2e} |
| 15 |
\ProvidesPackage{beamerouterthememetropolis}[2017/01/23 Metropolis outer theme] |
| 16 |
%</package> |
| 17 |
% \fi |
| 18 |
% \CheckSum{0} |
| 19 |
% \StopEventually{} |
| 20 |
% \iffalse |
| 21 |
%<*package> |
| 22 |
% ------------------------------------------------------------------------- \fi |
| 23 |
% |
| 24 |
% \subsection{\themename outer theme} |
| 25 |
% |
| 26 |
% A |beamer| outer theme dictates the style of the frame elements traditionally |
| 27 |
% set outside the body of each slide: the head, footline, and frame title. |
| 28 |
% |
| 29 |
% |
| 30 |
% |
| 31 |
% \subsubsection{Package dependencies} |
| 32 |
% |
| 33 |
% \begin{macrocode} |
| 34 |
\RequirePackage{etoolbox} |
| 35 |
\RequirePackage{calc} |
| 36 |
\RequirePackage{pgfopts} |
| 37 |
% \end{macrocode} |
| 38 |
% |
| 39 |
% |
| 40 |
% |
| 41 |
% \subsubsection{Options} |
| 42 |
% |
| 43 |
% \begin{macro}{numbering} |
| 44 |
% Adds slide numbers to the bottom right of each slide. |
| 45 |
% \begin{macrocode} |
| 46 |
\pgfkeys{ |
| 47 |
/metropolis/outer/numbering/.cd, |
| 48 |
.is choice, |
| 49 |
none/.code=\setbeamertemplate{frame numbering}[none], |
| 50 |
counter/.code=\setbeamertemplate{frame numbering}[counter], |
| 51 |
fraction/.code=\setbeamertemplate{frame numbering}[fraction], |
| 52 |
} |
| 53 |
% \end{macrocode} |
| 54 |
% \end{macro} |
| 55 |
% |
| 56 |
% \begin{macro}{progressbar} |
| 57 |
% Adds a progress bar to the top, bottom, or frametitle of each slide. |
| 58 |
% \begin{macrocode} |
| 59 |
\pgfkeys{ |
| 60 |
/metropolis/outer/progressbar/.cd, |
| 61 |
.is choice, |
| 62 |
none/.code={% |
| 63 |
\setbeamertemplate{headline}[plain] |
| 64 |
\setbeamertemplate{frametitle}[plain] |
| 65 |
\setbeamertemplate{footline}[plain] |
| 66 |
}, |
| 67 |
head/.code={\pgfkeys{/metropolis/outer/progressbar=none} |
| 68 |
\addtobeamertemplate{headline}{}{% |
| 69 |
\usebeamertemplate*{progress bar in head/foot} |
| 70 |
} |
| 71 |
}, |
| 72 |
frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none} |
| 73 |
\addtobeamertemplate{frametitle}{}{% |
| 74 |
\usebeamertemplate*{progress bar in head/foot} |
| 75 |
} |
| 76 |
}, |
| 77 |
foot/.code={\pgfkeys{/metropolis/outer/progressbar=none} |
| 78 |
\addtobeamertemplate{footline}{}{% |
| 79 |
\usebeamertemplate*{progress bar in head/foot}% |
| 80 |
} |
| 81 |
}, |
| 82 |
} |
| 83 |
% \end{macrocode} |
| 84 |
% \end{macro} |
| 85 |
% |
| 86 |
% \begin{macro}{\metropolis@outer@setdefaults} |
| 87 |
% Sets default values for outer theme options. |
| 88 |
% \begin{macrocode} |
| 89 |
\newcommand{\metropolis@outer@setdefaults}{ |
| 90 |
\pgfkeys{/metropolis/outer/.cd, |
| 91 |
numbering=counter, |
| 92 |
progressbar=none, |
| 93 |
} |
| 94 |
} |
| 95 |
% \end{macrocode}% |
| 96 |
% \end{macro} |
| 97 |
% |
| 98 |
% |
| 99 |
% |
| 100 |
% \subsubsection{Head and footline} |
| 101 |
% |
| 102 |
% All good |beamer| presentations should already remove the navigation symbols, |
| 103 |
% but \themename removes them automatically (just in case). |
| 104 |
% |
| 105 |
% \begin{macrocode} |
| 106 |
\setbeamertemplate{navigation symbols}{} |
| 107 |
% \end{macrocode} |
| 108 |
% |
| 109 |
% \begin{macro}{frame numbering} |
| 110 |
% Templates for the frame number. Can be omitted, shown or displayed as a |
| 111 |
% fraction of the total frames. |
| 112 |
% \begin{macrocode} |
| 113 |
\defbeamertemplate{frame footer}{none}{} |
| 114 |
\defbeamertemplate{frame footer}{custom}[1]{ #1 } |
| 115 |
% \end{macrocode} |
| 116 |
% |
| 117 |
% \begin{macrocode} |
| 118 |
\defbeamertemplate{frame numbering}{none}{} |
| 119 |
\defbeamertemplate{frame numbering}{counter}{\insertframenumber} |
| 120 |
\defbeamertemplate{frame numbering}{fraction}{ |
| 121 |
\insertframenumber/\inserttotalframenumber |
| 122 |
} |
| 123 |
% \end{macrocode} |
| 124 |
% \end{macro} |
| 125 |
% |
| 126 |
% \begin{macro}{headline} |
| 127 |
% \begin{macro}{footline} |
| 128 |
% Templates for the head- and footline at the top and bottom of each frame. |
| 129 |
% \begin{macrocode} |
| 130 |
\defbeamertemplate{headline}{plain}{} |
| 131 |
\defbeamertemplate{footline}{plain}{% |
| 132 |
\begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}% |
| 133 |
\usebeamerfont{page number in head/foot}% |
| 134 |
\usebeamertemplate*{frame footer} |
| 135 |
\hfill% |
| 136 |
\usebeamertemplate*{frame numbering} |
| 137 |
\end{beamercolorbox}% |
| 138 |
} |
| 139 |
% \end{macrocode} |
| 140 |
% \end{macro} |
| 141 |
% \end{macro} |
| 142 |
% |
| 143 |
% |
| 144 |
% |
| 145 |
% \subsubsection{Frametitle} |
| 146 |
% |
| 147 |
% \begin{macro}{frametitle} |
| 148 |
% Templates for the frame title, which is optionally underlined with a |
| 149 |
% progress bar. |
| 150 |
% \begin{macrocode} |
| 151 |
\newlength{\metropolis@frametitle@padding} |
| 152 |
\setlength{\metropolis@frametitle@padding}{2.2ex} |
| 153 |
\newcommand{\metropolis@frametitlestrut@start}{ |
| 154 |
\rule{0pt}{\metropolis@frametitle@padding +% |
| 155 |
\totalheightof{% |
| 156 |
\ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}% |
| 157 |
}% |
| 158 |
}% |
| 159 |
} |
| 160 |
\newcommand{\metropolis@frametitlestrut@end}{ |
| 161 |
\rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding} |
| 162 |
} |
| 163 |
\defbeamertemplate{frametitle}{plain}{% |
| 164 |
\nointerlineskip% |
| 165 |
\begin{beamercolorbox}[% |
| 166 |
wd=\paperwidth,% |
| 167 |
sep=0pt,% |
| 168 |
leftskip=\metropolis@frametitle@padding,% |
| 169 |
rightskip=\metropolis@frametitle@padding,% |
| 170 |
]{frametitle}% |
| 171 |
\metropolis@frametitlestrut@start% |
| 172 |
\insertframetitle% |
| 173 |
\nolinebreak% |
| 174 |
\metropolis@frametitlestrut@end% |
| 175 |
\end{beamercolorbox}% |
| 176 |
} |
| 177 |
\setbeamertemplate{frametitle continuation}{% |
| 178 |
\usebeamerfont{frametitle} |
| 179 |
\romannumeral \insertcontinuationcount |
| 180 |
} |
| 181 |
% \end{macrocode} |
| 182 |
% \end{macro} |
| 183 |
% |
| 184 |
% \begin{macro}{progress bar in head/foot} |
| 185 |
% Template for the progress bar optionally displayed below the frame title |
| 186 |
% on each page. Much of this code is duplicated in the inner theme's |
| 187 |
% template |progress bar in section page|. |
| 188 |
% \begin{macrocode} |
| 189 |
\newlength{\metropolis@progressinheadfoot} |
| 190 |
\newlength{\metropolis@progressinheadfoot@linewidth} |
| 191 |
\setlength{\metropolis@progressinheadfoot@linewidth}{0.4pt} |
| 192 |
\setbeamertemplate{progress bar in head/foot}{ |
| 193 |
\nointerlineskip |
| 194 |
\setlength{\metropolis@progressinheadfoot}{% |
| 195 |
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}% |
| 196 |
}% |
| 197 |
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot} |
| 198 |
\begin{tikzpicture} |
| 199 |
\fill[bg] (0,0) rectangle (\paperwidth, \metropolis@progressinheadfoot@linewidth); |
| 200 |
\fill[fg] (0,0) rectangle (\metropolis@progressinheadfoot, \metropolis@progressinheadfoot@linewidth); |
| 201 |
\end{tikzpicture}% |
| 202 |
\end{beamercolorbox} |
| 203 |
} |
| 204 |
% \end{macrocode} |
| 205 |
% \end{macro} |
| 206 |
% |
| 207 |
% |
| 208 |
% |
| 209 |
% \begin{macro}{appendix} |
| 210 |
% Removes page numbering and per-slide progress bars when |\appendix| is |
| 211 |
% called. This makes it easier to include additional ``backup slides'' at |
| 212 |
% the end of the presentation, especially in conjunction with the package |
| 213 |
% |appendixnumberbeamer|. |
| 214 |
% \begin{macrocode} |
| 215 |
\AtBeginDocument{% |
| 216 |
\apptocmd{\appendix}{% |
| 217 |
\pgfkeys{% |
| 218 |
/metropolis/outer/.cd, |
| 219 |
numbering=none, |
| 220 |
progressbar=none} |
| 221 |
}{}{} |
| 222 |
} |
| 223 |
% \end{macrocode} |
| 224 |
% \end{macro} |
| 225 |
% \subsubsection{Process package options} |
| 226 |
% |
| 227 |
% \begin{macrocode} |
| 228 |
\metropolis@outer@setdefaults |
| 229 |
\ProcessPgfPackageOptions{/metropolis/outer} |
| 230 |
% \end{macrocode} |
| 231 |
% |
| 232 |
% \iffalse |
| 233 |
%</package> |
| 234 |
% \fi |
| 235 |
% \Finale |
| 236 |
\endinput |