metropolis_theme/source/beamerthememetropolis.dtx

213 lines
5.9 KiB
Plaintext
Raw Permalink Normal View History

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
%<*package>
2015-06-16 09:00:53 +02:00
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerthememetropolis}
2017-01-23 12:55:26 +01:00
[2017/01/23 v1.2 Metropolis Beamer theme]
2015-06-14 20:11:54 +02:00
%</package>
% \fi
% \CheckSum{0}
% \StopEventually{}
% \iffalse
%<*package>
2015-06-16 09:00:53 +02:00
% ------------------------------------------------------------------------- \fi
2015-06-22 23:43:52 +02:00
%
% \subsection{\themename parent 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
% \themename theme and route the theme options accordingly. It also
2015-06-22 07:24:49 +02:00
% provides some custom commands and environments for the user.
2015-06-14 20:11:54 +02:00
%
2016-02-07 07:26:41 +01:00
%
%
% \subsubsection{Package dependencies}
%
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}
%
%
%
2016-02-07 07:26:41 +01:00
% \subsubsection{Options}
%
% Most options are passed off to the component 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,
2016-02-07 05:43:18 +01:00
/metropolis/font,
}
}
2015-06-14 20:11:54 +02:00
% \end{macrocode}
%
% \begin{macro}{titleformat plain}
2016-02-07 07:26:41 +01:00
% Controls the formatting of the text on standout ``plain'' frames.
% \begin{macrocode}
\pgfkeys{
/metropolis/titleformat plain/.cd,
.is choice,
2015-12-03 20:53:25 +01:00
regular/.code={%
\let\metropolis@plaintitleformat\@empty%
\setbeamerfont{standout}{shape=\normalfont}%
},
2015-12-03 20:53:25 +01:00
smallcaps/.code={%
\let\metropolis@plaintitleformat\@empty%
\setbeamerfont{standout}{shape=\scshape}%
2015-12-03 20:53:25 +01:00
},
allsmallcaps/.code={%
\let\metropolis@plaintitleformat\MakeLowercase%
\setbeamerfont{standout}{shape=\scshape}%
2015-12-03 20:53:25 +01:00
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allsmallcaps can lead to problems%
2015-12-03 20:53:25 +01:00
}
},
allcaps/.code={%
\let\metropolis@plaintitleformat\MakeUppercase%
\setbeamerfont{standout}{shape=\normalfont}%
2015-12-03 20:53:25 +01:00
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allcaps can lead to problems%
2015-12-03 20:53:25 +01:00
}
},
}
% \end{macrocode}
% \end{macro}
%
2015-12-03 20:53:25 +01:00
% \begin{macro}{titleformat}
2016-02-07 07:26:41 +01:00
% Sets a standard format for titles, subtitles, section titles, frame
% titles, and the text on standout ``plain'' frames.
% \begin{macrocode}
\pgfkeys{
2015-12-03 20:53:25 +01:00
/metropolis/titleformat/.code=\pgfkeysalso{
font/titleformat title=#1,
font/titleformat subtitle=#1,
font/titleformat section=#1,
font/titleformat frame=#1,
titleformat plain=#1,
}
}
% \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,
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-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}
\newcommand{\metropolis@setdefaults}{
2015-06-22 23:43:52 +02:00
\pgfkeys{/metropolis/.cd,
titleformat plain=regular,
2015-06-22 23:43:52 +02:00
}
2015-06-15 13:44:06 +02:00
}
% \end{macrocode}
%
% To avoid generating externalized figures of the progressbar we have to disable
% them with ``tikzexternalenable'' and ``tikzexternaldisable''. However, if the
% ``external'' libray is not loaded we would get undefined control sequence
% problems, hence we define them as no-ops if they are not defined yet.
2015-06-14 20:11:54 +02:00
%
% \begin{macrocode}
2017-02-24 11:25:25 +01:00
\providecommand{\tikzexternalenable}{}
\providecommand{\tikzexternaldisable}{}
% \end{macrocode}
2015-06-14 20:11:54 +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.
2016-02-07 07:26:41 +01:00
%
2015-06-14 20:11:54 +02:00
% \begin{macrocode}
2015-06-22 07:24:49 +02:00
\useinnertheme{metropolis}
\useoutertheme{metropolis}
\usecolortheme{metropolis}
\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
%
%
% \subsubsection{Custom commands}
2015-06-22 07:24:49 +02:00
%
2016-02-07 07:26:41 +01:00
% The parent theme defines custom commands as their proper usage may depend
% on multiple sub-packages.
%
2016-02-07 07:26:41 +01:00
% \begin{macro}{\metroset}
% Allows the user to change options midway through a presentation.
% \begin{macrocode}
\newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}}
% \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
2016-02-07 07:26:41 +01:00
% or a few words. The format of the text can be set with the
% |titleformat plain| option.
2015-06-14 20:11:54 +02:00
% \begin{macrocode}
\def\metropolis@plaintitleformat#1{#1}
2014-10-09 15:10:47 +02:00
\newcommand{\plain}[2][]{%
\PackageWarning{beamerthememetropolis}{%
The syntax `\plain' may be deprecated in a future version of Metropolis.
Please use a frame with [standout] instead.
}
\begin{frame}[standout]{#1}
\metropolis@plaintitleformat{#2}
\end{frame}
}
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}
%
2016-02-07 07:26:41 +01:00
%
%
% \subsubsection{Process package options}
2015-06-22 23:43:52 +02:00
%
% \begin{macrocode}
\metropolis@setdefaults
2015-06-22 23:43:52 +02:00
\ProcessPgfOptions{/metropolis}
% \end{macrocode}
%
2015-06-14 20:11:54 +02:00
% \iffalse
%</package>
% \fi
% \Finale
\endinput