2015-06-16 08:13:19 +02:00
|
|
|
% \iffalse meta-comment -------------------------------------------------------
|
|
|
|
% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
|
|
|
|
% contributors can be found at
|
2014-09-19 22:52:31 +02:00
|
|
|
%
|
2015-06-16 08:13:19 +02:00
|
|
|
% https://github.com/matze/mtheme/graphs/contributors
|
2014-09-19 22:52:31 +02:00
|
|
|
%
|
2015-06-16 08:13:19 +02:00
|
|
|
% and the original template was based on the HSRM theme by Benjamin Weiss.
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
2015-06-16 08:13:19 +02:00
|
|
|
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
|
|
|
|
% International License (https://creativecommons.org/licenses/by-sa/4.0/).
|
|
|
|
% ------------------------------------------------------------------------- \fi
|
2015-06-14 20:11:54 +02:00
|
|
|
% \iffalse
|
2015-11-20 09:31:58 +01:00
|
|
|
%<driver> \ProvidesFile{beamerthememetropolis.dtx}
|
2015-06-14 20:11:54 +02:00
|
|
|
%<*package>
|
2015-06-16 09:00:53 +02:00
|
|
|
\NeedsTeXFormat{LaTeX2e}
|
2015-12-04 15:42:27 +01:00
|
|
|
\ProvidesPackage{beamerthememetropolis}[2015/12/04 Metropolis Beamer theme]
|
2015-06-14 20:11:54 +02:00
|
|
|
%</package>
|
2015-06-16 09:00:53 +02:00
|
|
|
%<driver> \documentclass{ltxdoc}
|
2015-11-20 09:31:58 +01:00
|
|
|
%<driver> \usepackage{beamerthememetropolis}
|
2015-06-16 09:00:53 +02:00
|
|
|
%<driver> \begin{document}
|
2015-11-20 09:31:58 +01:00
|
|
|
%<driver> \DocInput{beamerthememetropolis.dtx}
|
2015-06-16 09:00:53 +02:00
|
|
|
%<driver> \end{document}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \fi
|
|
|
|
% \CheckSum{0}
|
|
|
|
% \StopEventually{}
|
|
|
|
% \iffalse
|
|
|
|
%<*package>
|
2015-06-16 09:00:53 +02:00
|
|
|
% ------------------------------------------------------------------------- \fi
|
2015-06-22 23:43:52 +02:00
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsection{\textsc{metropolis} main theme}
|
2015-06-16 09:00:53 +02:00
|
|
|
%
|
2015-06-22 07:24:49 +02:00
|
|
|
% The primary job of this package is to load the component sub-packages of the
|
|
|
|
% \textsc{metropolis} theme and route the theme options accordingly. It also
|
|
|
|
% provides some custom commands and environments for the user.
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% Load the required packages.
|
2015-06-14 20:11:54 +02:00
|
|
|
% \begin{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
\RequirePackage{etoolbox}
|
|
|
|
\RequirePackage{pgfopts}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsubsection{Options}
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
2015-06-30 00:00:14 +02:00
|
|
|
% \begin{macro}{\metroset}
|
2015-06-22 23:43:52 +02:00
|
|
|
% First of all we define a macro for the user to set options.
|
2015-06-14 20:11:54 +02:00
|
|
|
% \begin{macrocode}
|
2015-06-30 00:00:14 +02:00
|
|
|
\newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
% \end{macro}
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% Then we need to pass the unknown options to the sub-packages.
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
\pgfkeys{/metropolis/.cd,
|
|
|
|
.search also={
|
|
|
|
/metropolis/inner,
|
|
|
|
/metropolis/outer,
|
|
|
|
/metropolis/color,
|
2015-06-30 00:00:14 +02:00
|
|
|
},
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% We have to forwarded keys that affect multiple sub-packages manually.
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
block/.code=\pgfkeysalso{
|
|
|
|
inner/block=#1,
|
|
|
|
color/block=#1,
|
2015-06-23 14:35:04 +02:00
|
|
|
},
|
2015-06-06 09:41:09 +02:00
|
|
|
}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-12-03 20:53:25 +01:00
|
|
|
% \begin{macro}{titleformat plain}
|
|
|
|
% Control the titleformat of the plain title
|
2015-06-23 14:35:04 +02:00
|
|
|
% \begin{macrocode}
|
|
|
|
\pgfkeys{
|
2015-12-03 20:53:25 +01:00
|
|
|
/metropolis/titleformat plain/.cd,
|
2015-06-23 14:35:04 +02:00
|
|
|
.is choice,
|
2015-12-03 20:53:25 +01:00
|
|
|
regular/.code={%
|
|
|
|
\let\@metropolis@plaintitleformat\@empty%
|
|
|
|
\setbeamerfont{plain title}{shape=\normalfont}%
|
2015-06-23 14:35:04 +02:00
|
|
|
},
|
2015-12-03 20:53:25 +01:00
|
|
|
smallcaps/.code={%
|
|
|
|
\let\@metropolis@plaintitleformat\@empty%
|
|
|
|
\setbeamerfont{plain title}{shape=\scshape}%
|
|
|
|
},
|
|
|
|
allsmallcaps/.code={%
|
|
|
|
\let\@metropolis@plaintitleformat\MakeLowercase%
|
|
|
|
\setbeamerfont{plain title}{shape=\scshape}%
|
|
|
|
\PackageWarning{beamerthememetropolis}{%
|
|
|
|
Be aware that titleformat plain=allsmallcaps can lead to problems%
|
|
|
|
}
|
|
|
|
},
|
|
|
|
allcaps/.code={%
|
|
|
|
\let\@metropolis@plaintitleformat\MakeUppercase%
|
|
|
|
\setbeamerfont{plain title}{shape=\normalfont}%
|
|
|
|
\PackageWarning{beamerthememetropolis}{%
|
|
|
|
Be aware that titleformat plain=allcaps can lead to problems%
|
|
|
|
}
|
2015-06-23 14:35:04 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
2015-12-03 20:53:25 +01:00
|
|
|
% \begin{macro}{titleformat}
|
|
|
|
% Control the titleformat of every title type together
|
2015-06-23 14:35:04 +02:00
|
|
|
% \begin{macrocode}
|
|
|
|
\pgfkeys{
|
2015-12-03 20:53:25 +01:00
|
|
|
/metropolis/titleformat/.code=\pgfkeysalso{
|
|
|
|
inner/titleformat title=#1,
|
|
|
|
inner/titleformat subtitle=#1,
|
|
|
|
inner/titleformat section=#1,
|
|
|
|
outer/titleformat frame=#1,
|
|
|
|
titleformat plain=#1,
|
2015-06-23 14:35:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% For backwards compatibility with earlier betas of the theme, we implement
|
|
|
|
% deprecated option names as aliases to the corresponding |key=value| options.
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
\pgfkeys{/metropolis/.cd,
|
2015-06-30 00:00:14 +02:00
|
|
|
usetitleprogressbar/.code=\pgfkeysalso{outer/progressbar=frametitle},
|
2015-06-22 23:43:52 +02:00
|
|
|
noslidenumbers/.code=\pgfkeysalso{outer/numbering=none},
|
|
|
|
usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction},
|
|
|
|
nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none},
|
|
|
|
darkcolors/.code=\pgfkeysalso{color/background=dark},
|
|
|
|
blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill},
|
2015-01-29 23:18:55 +01:00
|
|
|
}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% Set default values for options.
|
2015-06-15 13:44:06 +02:00
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2015-06-22 23:43:52 +02:00
|
|
|
\newcommand{\@metropolis@setdefaults}{
|
|
|
|
\pgfkeys{/metropolis/.cd,
|
2015-12-03 20:53:25 +01:00
|
|
|
titleformat plain=regular,
|
2015-06-22 23:43:52 +02:00
|
|
|
}
|
2015-06-15 13:44:06 +02:00
|
|
|
}
|
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsubsection{Component sub-packages}
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
2015-06-22 07:24:49 +02:00
|
|
|
% Having processed the options, we can now load the component sub-packages of
|
|
|
|
% the theme.
|
2015-06-14 20:11:54 +02:00
|
|
|
% \begin{macrocode}
|
2015-06-22 07:24:49 +02:00
|
|
|
\useinnertheme{metropolis}
|
|
|
|
\useoutertheme{metropolis}
|
|
|
|
\usecolortheme{metropolis}
|
2015-10-24 20:00:48 +02:00
|
|
|
\usefonttheme{metropolis}
|
2015-06-22 07:24:49 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
%
|
|
|
|
% The |tol| theme for |pgfplots| is only loaded if |pgfplots| is used.
|
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
2015-06-17 08:05:14 +02:00
|
|
|
\AtEndPreamble{%
|
|
|
|
\@ifpackageloaded{pgfplots}{%
|
|
|
|
\RequirePackage{pgfplotsthemetol}
|
|
|
|
}{}
|
|
|
|
}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
%
|
|
|
|
%
|
2015-06-23 14:35:04 +02:00
|
|
|
% \subsubsection{Custom commands}
|
2015-06-22 07:24:49 +02:00
|
|
|
%
|
|
|
|
% We define custom commands in this package as their proper usage may depend
|
2015-06-22 16:38:26 +02:00
|
|
|
% on multiple sub-packages.
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% \begin{macro}{\@metropolis@plaintitleformat}
|
2015-06-23 14:35:04 +02:00
|
|
|
% Define a hook to change the case format of the plain title.
|
2015-06-22 16:38:26 +02:00
|
|
|
% \begin{macrocode}
|
2015-06-23 14:35:04 +02:00
|
|
|
\def\@metropolis@plaintitleformat#1{#1}
|
2015-06-22 16:38:26 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
2015-06-14 20:11:54 +02:00
|
|
|
%
|
|
|
|
% \begin{macro}{\plain}
|
2015-06-22 07:24:49 +02:00
|
|
|
% Creates a plain frame with dark background, suitable for displaying images
|
|
|
|
% or a few words.
|
2015-06-14 20:11:54 +02:00
|
|
|
% \begin{macrocode}
|
2014-10-09 15:10:47 +02:00
|
|
|
\newcommand{\plain}[2][]{%
|
2014-08-28 16:05:03 +02:00
|
|
|
\begingroup
|
2015-06-23 09:13:46 +02:00
|
|
|
\setbeamercolor{background canvas}{
|
|
|
|
use=palette primary,
|
|
|
|
parent=palette primary
|
|
|
|
}
|
2015-07-10 03:32:09 +02:00
|
|
|
\begin{frame}[c]{#1}
|
2015-07-17 08:59:03 +02:00
|
|
|
\begin{center}
|
|
|
|
\usebeamercolor[fg]{palette primary}
|
2015-12-03 20:53:25 +01:00
|
|
|
\usebeamerfont{plain title}
|
2015-07-17 08:59:03 +02:00
|
|
|
\@metropolis@plaintitleformat{#2}
|
|
|
|
\end{center}
|
2015-06-10 09:42:12 +02:00
|
|
|
\end{frame}
|
2014-08-28 16:05:03 +02:00
|
|
|
\endgroup
|
|
|
|
}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
|
|
|
% \begin{macro}{\mreducelistspacing}
|
|
|
|
% \begin{macrocode}
|
2014-10-27 14:40:44 +01:00
|
|
|
\newcommand{\mreducelistspacing}{\vspace{-\topsep}}
|
2015-06-14 20:11:54 +02:00
|
|
|
% \end{macrocode}
|
|
|
|
% \end{macro}
|
|
|
|
%
|
2015-06-22 23:43:52 +02:00
|
|
|
% Process package options
|
|
|
|
%
|
|
|
|
% \begin{macrocode}
|
|
|
|
\@metropolis@setdefaults
|
|
|
|
\ProcessPgfOptions{/metropolis}
|
|
|
|
% \end{macrocode}
|
|
|
|
%
|
2015-06-14 20:11:54 +02:00
|
|
|
% \iffalse
|
|
|
|
%</package>
|
|
|
|
% \fi
|
|
|
|
% \Finale
|
|
|
|
\endinput
|