| 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 |
%% --------------------------------------------------------------------------- |
| 12 |
%% Copyright 2024 Johan Larsson and contributors |
| 13 |
% ------------------------------------------------------------------------- \fi |
| 14 |
% \iffalse |
| 15 |
%<*package> |
| 16 |
\NeedsTeXFormat{LaTeX2e} |
| 17 |
\ProvidesPackage{beamerouterthememoloch}[2025-12-18 v2.1.0 Moloch outer theme] |
| 18 |
%</package> |
| 19 |
% \fi |
| 20 |
% \CheckSum{0} |
| 21 |
% \StopEventually{} |
| 22 |
% \iffalse |
| 23 |
%<*package> |
| 24 |
% ------------------------------------------------------------------------- \fi |
| 25 |
% |
| 26 |
% \subsection{Moloch Outer Theme} |
| 27 |
% |
| 28 |
% A \verb|beamer| outer theme dictates the style of the frame elements traditionally |
| 29 |
% set outside the body of each slide: the head, footline, and frame title. |
| 30 |
% |
| 31 |
% |
| 32 |
% |
| 33 |
% \subsection{Package Dependencies} |
| 34 |
% |
| 35 |
% \begin{macrocode} |
| 36 |
\RequirePackage{calc} |
| 37 |
\RequirePackage{pgfopts} |
| 38 |
% \end{macrocode} |
| 39 |
% |
| 40 |
% |
| 41 |
% \subsection{Memoization and Tikz Externalization} |
| 42 |
% |
| 43 |
% To avoid generating externalized figures of the progressbar we have to disable |
| 44 |
% them with ``tikzexternalenable'' and ``tikzexternaldisable''. However, if the |
| 45 |
% ``external'' library is not loaded we would get undefined control sequence |
| 46 |
% problems, hence we define them as no-ops if they are not defined yet. |
| 47 |
% We do the same for the ``mmzUnmemoizable'' command from the memoize package, in |
| 48 |
% order to avoid memoization of the progress bars. |
| 49 |
% |
| 50 |
% \begin{macrocode} |
| 51 |
\providecommand{\tikzexternalenable}{} |
| 52 |
\providecommand{\tikzexternaldisable}{} |
| 53 |
\providecommand{\mmzUnmemoizable}{} |
| 54 |
% \end{macrocode} |
| 55 |
% |
| 56 |
% \subsection{Options} |
| 57 |
% |
| 58 |
% \begin{macro}{progressbar} |
| 59 |
% Adds a progress bar to the top, bottom, or frametitle of each slide. |
| 60 |
% \begin{macrocode} |
| 61 |
\pgfkeys{ |
| 62 |
/moloch/outer/progressbar/.cd, |
| 63 |
.is choice, |
| 64 |
none/.code={% |
| 65 |
\setbeamertemplate{headline}[plain] |
| 66 |
\setbeamertemplate{frametitle}[plain] |
| 67 |
\setbeamertemplate{footline}[plain] |
| 68 |
}, |
| 69 |
head/.code={\pgfkeys{/moloch/outer/progressbar=none} |
| 70 |
\addtobeamertemplate{headline}{}{% |
| 71 |
\usebeamertemplate*{progress bar in head/foot} |
| 72 |
} |
| 73 |
}, |
| 74 |
frametitle/.code={\pgfkeys{/moloch/outer/progressbar=none} |
| 75 |
\addtobeamertemplate{frametitle}{}{% |
| 76 |
\usebeamertemplate*{progress bar in head/foot} |
| 77 |
} |
| 78 |
}, |
| 79 |
foot/.code={\pgfkeys{/moloch/outer/progressbar=none} |
| 80 |
\addtobeamertemplate{footline}{}{% |
| 81 |
\usebeamertemplate*{progress bar in head/foot}% |
| 82 |
} |
| 83 |
}, |
| 84 |
} |
| 85 |
% \end{macrocode} |
| 86 |
% \end{macro} |
| 87 |
% |
| 88 |
% \begin{macro}{progressbar linewidth} |
| 89 |
% Sets the linewidth of the progress bar for sectionpages and frames. |
| 90 |
% \begin{macrocode} |
| 91 |
\newlength{\moloch@progressonsectionpage} |
| 92 |
\newlength{\moloch@progressonsectionpage@linewidth} |
| 93 |
\newlength{\moloch@progressinheadfoot} |
| 94 |
\newlength{\moloch@progressinheadfoot@linewidth} |
| 95 |
\pgfkeys{ |
| 96 |
/moloch/outer/.cd, |
| 97 |
progressbarlinewidth/.code={ |
| 98 |
\setlength{\moloch@progressonsectionpage@linewidth}{#1} |
| 99 |
\setlength{\moloch@progressinheadfoot@linewidth}{#1} |
| 100 |
}, |
| 101 |
} |
| 102 |
% \end{macrocode} |
| 103 |
% \end{macro} |
| 104 |
% |
| 105 |
% \begin{macro}{progressbar aliases} |
| 106 |
% Allows \verb|progressbar linewidth| to be used in \verb|\molochset|. |
| 107 |
% \begin{macrocode} |
| 108 |
\pgfkeys{ |
| 109 |
/moloch/outer/.cd, |
| 110 |
progressbar linewidth/.code=\pgfkeysalso{progressbarlinewidth=#1}, |
| 111 |
} |
| 112 |
% \end{macrocode} |
| 113 |
% \end{macro} |
| 114 |
% |
| 115 |
% \begin{macro}{frametitle margin} |
| 116 |
% Sets the margins of the frame title. |
| 117 |
% \begin{macrocode} |
| 118 |
\pgfkeys{ |
| 119 |
/moloch/outer/.cd, |
| 120 |
frametitlemarginleft/.code=\renewcommand{\moloch@frametitle@margin@left}{#1}, |
| 121 |
frametitlemarginright/.code=\renewcommand{\moloch@frametitle@margin@right}{#1}, |
| 122 |
frametitlemargintop/.code=\renewcommand{\moloch@frametitle@margin@top}{#1}, |
| 123 |
frametitlemarginbottom/.code=\renewcommand{\moloch@frametitle@margin@bottom}{#1}, |
| 124 |
} |
| 125 |
% \end{macrocode} |
| 126 |
% \end{macro} |
| 127 |
% |
| 128 |
% \begin{macro}{frametitle margin aliases} |
| 129 |
% Allows \verb|frametitle margin x| to be used in \verb|\molochset|. |
| 130 |
% \begin{macrocode} |
| 131 |
\pgfkeys{ |
| 132 |
/moloch/outer/.cd, |
| 133 |
frametitle margin left/.code=\pgfkeysalso{frametitlemarginleft=#1}, |
| 134 |
frametitle margin right/.code=\pgfkeysalso{frametitlemarginright=#1}, |
| 135 |
frametitle margin top/.code=\pgfkeysalso{frametitlemargintop=#1}, |
| 136 |
frametitle margin bottom/.code=\pgfkeysalso{frametitlemarginbottom=#1}, |
| 137 |
} |
| 138 |
% \end{macrocode} |
| 139 |
% |
| 140 |
% \begin{macro}{\moloch@outer@setdefaults} |
| 141 |
% Sets default values for outer theme options. |
| 142 |
% \begin{macrocode} |
| 143 |
\newcommand{\moloch@outer@setdefaults}{ |
| 144 |
\pgfkeys{/moloch/outer/.cd, |
| 145 |
progressbar=none, |
| 146 |
progressbar linewidth=1pt, |
| 147 |
} |
| 148 |
} |
| 149 |
% \end{macrocode}% |
| 150 |
% \end{macro} |
| 151 |
% |
| 152 |
% \subsection{Deprecated Options} |
| 153 |
% |
| 154 |
% These options are deprecated and will be removed in a future version. |
| 155 |
% |
| 156 |
% \begin{macro}{numbering} |
| 157 |
% Adds slide numbers to the bottom right of each slide. |
| 158 |
% \begin{macrocode} |
| 159 |
\pgfkeys{ |
| 160 |
/moloch/outer/numbering/.cd, |
| 161 |
.is choice, |
| 162 |
none/.code={% |
| 163 |
\PackageWarning{moloch}{The ``numbering'' option is deprecated. |
| 164 |
Use beamer's ``page number in head/foot'' template instead}% |
| 165 |
\setbeamertemplate{page number in head/foot}[default] |
| 166 |
}, |
| 167 |
counter/.code={% |
| 168 |
\PackageWarning{moloch}{The ``numbering'' option is deprecated. |
| 169 |
Use beamer's ``page number in head/foot'' template instead}% |
| 170 |
\setbeamertemplate{page number in head/foot}[framenumber] |
| 171 |
}, |
| 172 |
fraction/.code={% |
| 173 |
\PackageWarning{moloch}{The ``numbering'' option is deprecated. |
| 174 |
Use beamer's ``page number in head/foot'' template instead}% |
| 175 |
\setbeamertemplate{page number in head/foot}[totalframenumber] |
| 176 |
}, |
| 177 |
} |
| 178 |
% \end{macrocode} |
| 179 |
% \end{macro} |
| 180 |
% |
| 181 |
% \subsection{Slide Numbering} |
| 182 |
% |
| 183 |
% Moloch defaults to numbering frames. To modify this, simply copy this line to your |
| 184 |
% preamble and replace \verb|framenumber|. |
| 185 |
% |
| 186 |
% \begin{macrocode} |
| 187 |
\setbeamertemplate{page number in head/foot}[framenumber] |
| 188 |
% \end{macrocode} |
| 189 |
% |
| 190 |
% \subsection{Head and Footline} |
| 191 |
% |
| 192 |
% All good \verb|beamer| presentations should already remove the navigation symbols, |
| 193 |
% but Moloch removes them automatically (just in case). |
| 194 |
% |
| 195 |
% \begin{macrocode} |
| 196 |
\setbeamertemplate{navigation symbols}{} |
| 197 |
% \end{macrocode} |
| 198 |
% |
| 199 |
% |
| 200 |
% \begin{macro}{headline} |
| 201 |
% |
| 202 |
% Template for the headline at the top of each frame, which is empty by default. |
| 203 |
% |
| 204 |
% \begin{macrocode} |
| 205 |
\defbeamertemplate{headline}{plain}{} |
| 206 |
% \end{macrocode} |
| 207 |
% |
| 208 |
% \end{macro} |
| 209 |
% |
| 210 |
% \begin{macro}{footline} |
| 211 |
% |
| 212 |
% Template for the footline at the bottom of each frame, which includes the |
| 213 |
% slide number on the right. |
| 214 |
% |
| 215 |
% \begin{macrocode} |
| 216 |
\defbeamertemplate{footline}{plain}{% |
| 217 |
\begin{beamercolorbox}[ |
| 218 |
leftskip=4pt,% |
| 219 |
rightskip=5pt,% |
| 220 |
wd=\textwidth,% |
| 221 |
]{footline}% |
| 222 |
\usebeamercolor[fg]{page number in head/foot}% |
| 223 |
\usebeamerfont{page number in head/foot}% |
| 224 |
\usebeamertemplate*{frame footer}% |
| 225 |
\hfill% |
| 226 |
\usebeamertemplate*{page number in head/foot}\vskip4pt% |
| 227 |
\end{beamercolorbox}% |
| 228 |
} |
| 229 |
% \end{macrocode} |
| 230 |
% \end{macro} |
| 231 |
% |
| 232 |
% |
| 233 |
% |
| 234 |
% \subsection{Frametitle} |
| 235 |
% |
| 236 |
% \begin{macro}{frametitle} |
| 237 |
% Templates for the frame title, which is optionally underlined with a |
| 238 |
% progress bar. |
| 239 |
% \begin{macrocode} |
| 240 |
\newcommand{\moloch@frametitlestrut@start}{% |
| 241 |
\rule{0pt}{\moloch@frametitle@margin@top + \ht\strutbox}% |
| 242 |
}% |
| 243 |
|
| 244 |
\newcommand{\moloch@frametitlestrut@end}{% |
| 245 |
\rule[-\moloch@frametitle@margin@bottom]{0pt}{\moloch@frametitle@margin@bottom}% |
| 246 |
} |
| 247 |
|
| 248 |
\newcommand{\moloch@frametitle@margin@left}{\dimexpr0.85\ht\strutbox\relax} |
| 249 |
\newcommand{\moloch@frametitle@margin@right}{\dimexpr0.85\ht\strutbox\relax} |
| 250 |
\newcommand{\moloch@frametitle@margin@top}{\dimexpr\ht\strutbox\relax} |
| 251 |
\newcommand{\moloch@frametitle@margin@bottom}{\dimexpr\ht\strutbox\relax} |
| 252 |
|
| 253 |
\defbeamertemplate{frametitle}{plain}{% |
| 254 |
\nointerlineskip% |
| 255 |
\begin{beamercolorbox}[% |
| 256 |
wd=\paperwidth,% |
| 257 |
leftskip=\moloch@frametitle@margin@left,% |
| 258 |
rightskip=\the\glueexpr \moloch@frametitle@margin@right plus 1fil\relax,% |
| 259 |
]{frametitle}% |
| 260 |
\usebeamerfont{frametitle}% |
| 261 |
\moloch@frametitlestrut@start% |
| 262 |
\moloch@frametitleformat{\insertframetitle}% |
| 263 |
{% |
| 264 |
\ifx\insertframesubtitle\@empty% |
| 265 |
\else% |
| 266 |
{% |
| 267 |
\par% |
| 268 |
\usebeamerfont{framesubtitle}% |
| 269 |
\usebeamercolor[fg]{framesubtitle}% |
| 270 |
\insertframesubtitle% |
| 271 |
}% |
| 272 |
\fi |
| 273 |
}% |
| 274 |
\moloch@frametitlestrut@end% |
| 275 |
\end{beamercolorbox}% |
| 276 |
} |
| 277 |
\setbeamertemplate{frametitle continuation}{% |
| 278 |
\romannumeral\insertcontinuationcount} |
| 279 |
% \end{macrocode} |
| 280 |
% \end{macro} |
| 281 |
% |
| 282 |
% \begin{macro}{progress bar in head/foot} |
| 283 |
% Template for the progress bar optionally displayed below the frame title |
| 284 |
% on each page. Much of this code is duplicated in the inner theme's |
| 285 |
% template \verb|progress bar in section page|. |
| 286 |
% \begin{macrocode} |
| 287 |
\setbeamertemplate{progress bar in head/foot}{ |
| 288 |
\nointerlineskip% |
| 289 |
\pgfmathsetlength{\moloch@progressinheadfoot}{% |
| 290 |
\paperwidth * min(1,\insertframenumber/\inserttotalframenumber)% |
| 291 |
}% |
| 292 |
\begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot} |
| 293 |
\tikzexternaldisable% |
| 294 |
\begin{tikzpicture} |
| 295 |
\mmzUnmemoizable% |
| 296 |
\fill[bg] |
| 297 |
(0,0) |
| 298 |
rectangle |
| 299 |
(\paperwidth, \moloch@progressinheadfoot@linewidth); |
| 300 |
\fill[fg] |
| 301 |
(0,0) |
| 302 |
rectangle |
| 303 |
(\moloch@progressinheadfoot, \moloch@progressinheadfoot@linewidth); |
| 304 |
\end{tikzpicture} |
| 305 |
\tikzexternalenable% |
| 306 |
\end{beamercolorbox} |
| 307 |
} |
| 308 |
% \end{macrocode} |
| 309 |
% \end{macro} |
| 310 |
% |
| 311 |
% \subsection{Process Package Options} |
| 312 |
% |
| 313 |
% \begin{macrocode} |
| 314 |
\moloch@outer@setdefaults |
| 315 |
\ProcessPgfPackageOptions{/moloch/outer} |
| 316 |
% \end{macrocode} |
| 317 |
% |
| 318 |
% \iffalse |
| 319 |
%</package> |
| 320 |
% \fi |
| 321 |
% \Finale |
| 322 |
\endinput |