Debian Codegraph @

texmf-dist/source/latex/beamertheme-metropolis/beamerthememetropolis.dtx

raw
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{beamerthememetropolis}
16 [2017/01/23 v1.2 Metropolis Beamer theme]
17 %</package>
18 % \fi
19 % \CheckSum{0}
20 % \StopEventually{}
21 % \iffalse
22 %<*package>
23 % ------------------------------------------------------------------------- \fi
24 %
25 % \subsection{\themename parent theme}
26 %
27 % The primary job of this package is to load the component sub-packages of the
28 % \themename theme and route the theme options accordingly. It also
29 % provides some custom commands and environments for the user.
30 %
31 %
32 %
33 % \subsubsection{Package dependencies}
34 %
35 % \begin{macrocode}
36 \RequirePackage{etoolbox}
37 \RequirePackage{pgfopts}
38 % \end{macrocode}
39 %
40 %
41 %
42 % \subsubsection{Options}
43 %
44 % Most options are passed off to the component sub-packages.
45 %
46 % \begin{macrocode}
47 \pgfkeys{/metropolis/.cd,
48 .search also={
49 /metropolis/inner,
50 /metropolis/outer,
51 /metropolis/color,
52 /metropolis/font,
53 }
54 }
55 % \end{macrocode}
56 %
57 % \begin{macro}{titleformat plain}
58 % Controls the formatting of the text on standout ``plain'' frames.
59 % \begin{macrocode}
60 \pgfkeys{
61 /metropolis/titleformat plain/.cd,
62 .is choice,
63 regular/.code={%
64 \let\metropolis@plaintitleformat\@empty%
65 \setbeamerfont{standout}{shape=\normalfont}%
66 },
67 smallcaps/.code={%
68 \let\metropolis@plaintitleformat\@empty%
69 \setbeamerfont{standout}{shape=\scshape}%
70 },
71 allsmallcaps/.code={%
72 \let\metropolis@plaintitleformat\MakeLowercase%
73 \setbeamerfont{standout}{shape=\scshape}%
74 \PackageWarning{beamerthememetropolis}{%
75 Be aware that titleformat plain=allsmallcaps can lead to problems%
76 }
77 },
78 allcaps/.code={%
79 \let\metropolis@plaintitleformat\MakeUppercase%
80 \setbeamerfont{standout}{shape=\normalfont}%
81 \PackageWarning{beamerthememetropolis}{%
82 Be aware that titleformat plain=allcaps can lead to problems%
83 }
84 },
85 }
86 % \end{macrocode}
87 % \end{macro}
88 %
89 % \begin{macro}{titleformat}
90 % Sets a standard format for titles, subtitles, section titles, frame
91 % titles, and the text on standout ``plain'' frames.
92 % \begin{macrocode}
93 \pgfkeys{
94 /metropolis/titleformat/.code=\pgfkeysalso{
95 font/titleformat title=#1,
96 font/titleformat subtitle=#1,
97 font/titleformat section=#1,
98 font/titleformat frame=#1,
99 titleformat plain=#1,
100 }
101 }
102 % \end{macrocode}
103 % \end{macro}
104 %
105 % For backwards compatibility with earlier betas of the theme, we implement
106 % deprecated option names as aliases to the corresponding |key=value| options.
107 %
108 % \begin{macrocode}
109 \pgfkeys{/metropolis/.cd,
110 usetitleprogressbar/.code=\pgfkeysalso{outer/progressbar=frametitle},
111 noslidenumbers/.code=\pgfkeysalso{outer/numbering=none},
112 usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction},
113 nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none},
114 darkcolors/.code=\pgfkeysalso{color/background=dark},
115 blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill},
116 }
117 % \end{macrocode}
118 %
119 % Set default values for options.
120 %
121 % \begin{macrocode}
122 \newcommand{\metropolis@setdefaults}{
123 \pgfkeys{/metropolis/.cd,
124 titleformat plain=regular,
125 }
126 }
127 % \end{macrocode}
128 %
129 %
130 %
131 % \subsubsection{Component sub-packages}
132 %
133 % Having processed the options, we can now load the component sub-packages of
134 % the theme.
135 %
136 % \begin{macrocode}
137 \useinnertheme{metropolis}
138 \useoutertheme{metropolis}
139 \usecolortheme{metropolis}
140 \usefonttheme{metropolis}
141 % \end{macrocode}
142 %
143 % The |tol| theme for |pgfplots| is only loaded if |pgfplots| is used.
144 %
145 % \begin{macrocode}
146 \AtEndPreamble{%
147 \@ifpackageloaded{pgfplots}{%
148 \RequirePackage{pgfplotsthemetol}
149 }{}
150 }
151 % \end{macrocode}
152 %
153 %
154 %
155 % \subsubsection{Custom commands}
156 %
157 % The parent theme defines custom commands as their proper usage may depend
158 % on multiple sub-packages.
159 %
160 % \begin{macro}{\metroset}
161 % Allows the user to change options midway through a presentation.
162 % \begin{macrocode}
163 \newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}}
164 % \end{macrocode}
165 % \end{macro}
166 %
167 % \begin{macro}{\plain}
168 % Creates a plain frame with dark background, suitable for displaying images
169 % or a few words. The format of the text can be set with the
170 % |titleformat plain| option.
171 % \begin{macrocode}
172 \def\metropolis@plaintitleformat#1{#1}
173 \newcommand{\plain}[2][]{%
174 \PackageWarning{beamerthememetropolis}{%
175 The syntax `\plain' may be deprecated in a future version of Metropolis.
176 Please use a frame with [standout] instead.
177 }
178 \begin{frame}[standout]{#1}
179 \metropolis@plaintitleformat{#2}
180 \end{frame}
181 }
182 % \end{macrocode}
183 % \end{macro}
184 %
185 % \begin{macro}{\mreducelistspacing}
186 % \begin{macrocode}
187 \newcommand{\mreducelistspacing}{\vspace{-\topsep}}
188 % \end{macrocode}
189 % \end{macro}
190 %
191 %
192 %
193 % \subsubsection{Process package options}
194 %
195 % \begin{macrocode}
196 \metropolis@setdefaults
197 \ProcessPgfOptions{/metropolis}
198 % \end{macrocode}
199 %
200 % \iffalse
201 %</package>
202 % \fi
203 % \Finale
204 \endinput