Debian Codegraph @

texmf-dist/source/latex/moloch/beamerfontthememoloch.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 %% ---------------------------------------------------------------------------
12 %% Copyright 2024 Johan Larsson and contributors
13 % ------------------------------------------------------------------------- \fi
14 % \iffalse
15 %<*package>
16 \NeedsTeXFormat{LaTeX2e}
17 \ProvidesPackage{beamerfontthememoloch}[2025-12-18 v2.1.0 Moloch font theme]
18 %</package>
19 % \fi
20 % \CheckSum{0}
21 % \StopEventually{}
22 % \iffalse
23 %<*package>
24 % ------------------------------------------------------------------------- \fi
25 %
26 % \subsection{Moloch Font Theme}
27 %
28 % The Moloch font theme defines the fonts used throughout the presentation.
29 %
30 % \subsection{Package Dependencies}%
31 %
32 % \begin{macrocode}
33 \RequirePackage{etoolbox}
34 \RequirePackage{pgfopts}
35 % \end{macrocode}
36 %
37 % \subsection{General Font Definitions}
38 %
39 % \begin{macrocode}
40 \setbeamerfont{title}{size=\Large, series=\bfseries}
41 \setbeamerfont{author}{size=\small}
42 \setbeamerfont{date}{size=\small}
43 \setbeamerfont{section title}{size=\Large, series=\bfseries}
44 \setbeamerfont{block title}{size=\normalsize, series=\bfseries}
45 \setbeamerfont{block title alerted}{size=\normalsize, series=\bfseries}
46 \setbeamerfont*{subtitle}{size=\large}
47 \setbeamerfont{frametitle}{size=\large, series=\bfseries}
48 \setbeamerfont{framesubtitle}{size=\small}
49 \setbeamerfont{caption}{size=\small}
50 \setbeamerfont{caption name}{series=\bfseries}
51 \setbeamerfont{description item}{series=\bfseries}
52 \setbeamerfont{standout}{size=\Large, series=\bfseries}
53 % \end{macrocode}
54 %
55 %
56 %
57 % \subsection{Title Format Options}
58 %
59 % \begin{macro}{titleformat title}
60 % Controls the format of the title.
61 % \begin{macrocode}
62 \pgfkeys{
63 /moloch/font/titleformat title/.cd,
64 .is choice,
65 regular/.code={%
66 \let\moloch@titleformat\@empty%
67 \setbeamerfont{title}{shape=\normalfont}%
68 },
69 smallcaps/.code={%
70 \let\moloch@titleformat\@empty%
71 \setbeamerfont{title}{shape=\scshape}%
72 },
73 allsmallcaps/.code={%
74 \let\moloch@titleformat\lowercase%
75 \setbeamerfont{title}{shape=\scshape}%
76 \PackageNote{beamerthememoloch}{%
77 Be aware that titleformat title=allsmallcaps can
78 lead to problems}
79 },
80 allcaps/.code={%
81 \let\moloch@titleformat\uppercase%
82 \setbeamerfont{title}{shape=\normalfont}
83 \PackageNote{beamerthememoloch}{%
84 Be aware that titleformat title=allcaps can lead to problems%
85 }
86 },
87 }
88 % \end{macrocode}
89 % \end{macro}
90 %
91 % \begin{macro}{titleformat subtitle}
92 % Control the format of the subtitle.
93 % \begin{macrocode}
94 \pgfkeys{
95 /moloch/font/titleformat subtitle/.cd,
96 .is choice,
97 regular/.code={%
98 \let\moloch@subtitleformat\@empty%
99 \setbeamerfont{subtitle}{shape=\normalfont}%
100 },
101 smallcaps/.code={%
102 \let\moloch@subtitleformat\@empty%
103 \setbeamerfont{subtitle}{shape=\scshape}%
104 },
105 allsmallcaps/.code={%
106 \let\moloch@subtitleformat\MakeLowercase%
107 \setbeamerfont{subtitle}{shape=\scshape}%
108 \PackageNote{beamerthememoloch}{%
109 Be aware that titleformat subtitle=allsmallcaps
110 can lead to problems}
111 },
112 allcaps/.code={%
113 \let\moloch@subtitleformat\MakeUppercase%
114 \setbeamerfont{subtitle}{shape=\normalfont}%
115 \PackageNote{beamerthememoloch}{%
116 Be aware that titleformat subtitle=allcaps can
117 lead to problems}
118 },
119 }
120 % \end{macrocode}
121 % \end{macro}
122 %
123 % \begin{macro}{titleformat section}
124 % Controls the format of the section title.
125 % \begin{macrocode}
126 \pgfkeys{
127 /moloch/font/titleformat section/.cd,
128 .is choice,
129 regular/.code={%
130 \let\moloch@sectiontitleformat\@empty%
131 \setbeamerfont{section title}{shape=\normalfont}%
132 },
133 smallcaps/.code={%
134 \let\moloch@sectiontitleformat\@empty%
135 \setbeamerfont{section title}{shape=\scshape}%
136 },
137 allsmallcaps/.code={%
138 \let\moloch@sectiontitleformat\MakeLowercase%
139 \setbeamerfont{section title}{shape=\scshape}%
140 \PackageNote{beamerthememoloch}{%
141 Be aware that titleformat section=allsmallcaps
142 can lead to problems}
143 },
144 allcaps/.code={%
145 \let\moloch@sectiontitleformat\MakeUppercase%
146 \setbeamerfont{section title}{shape=\normalfont}%
147 \PackageNote{beamerthememoloch}{%
148 Be aware that titleformat section=allcaps
149 can lead to problems}
150 },
151 }
152 % \end{macrocode}
153 % \end{macro}
154 %
155 % \begin{macro}{frametitleformat}
156 % Control the format of the frame title.
157 % \begin{macrocode}
158 \pgfkeys{
159 /moloch/font/titleformat frame/.cd,
160 .is choice,
161 regular/.code={%
162 \let\moloch@frametitleformat\@empty%
163 \setbeamerfont{frametitle}{shape=\normalfont}%
164 },
165 smallcaps/.code={%
166 \let\moloch@frametitleformat\@empty%
167 \setbeamerfont{frametitle}{shape=\scshape}%
168 },
169 allsmallcaps/.code={%
170 \let\moloch@frametitleformat\MakeLowercase%
171 \setbeamerfont{frametitle}{shape=\scshape}%
172 \PackageNote{beamerthememoloch}{%
173 Be aware that titleformat frame=allsmallcaps
174 can lead to problems}
175 },
176 allcaps/.code={%
177 \let\moloch@frametitleformat\MakeUppercase%
178 \setbeamerfont{frametitle}{shape=\normalfont}
179 \PackageNote{beamerthememoloch}{%
180 Be aware that titleformat frame=allcaps can lead to problems%
181 }
182 },
183 }
184 % \end{macrocode}
185 % \end{macro}
186 %
187 % \begin{macro}{titleformat aliases}
188 % Allows \verb|titleformat title| et al. to be used in the \verb|\usetheme|
189 % declaration, where \LaTeX{} automatically removes all spaces.
190 % \begin{macrocode}
191 \pgfkeys{
192 /moloch/font/.cd,
193 titleformattitle/.code=\pgfkeysalso{titleformat title=#1},
194 titleformatsubtitle/.code=\pgfkeysalso{titleformat subtitle=#1},
195 titleformatsection/.code=\pgfkeysalso{titleformat section=#1},
196 titleformatframe/.code=\pgfkeysalso{titleformat frame=#1},
197 }
198 % \end{macrocode}
199 % \end{macro}
200 %
201 % \begin{macro}{\moloch@font@setdefaults}
202 % Sets default values for font theme options.
203 % \begin{macrocode}
204 \newcommand{\moloch@font@setdefaults}{
205 \pgfkeys{/moloch/font/.cd,
206 titleformat title=regular,
207 titleformat subtitle=regular,
208 titleformat section=regular,
209 titleformat frame=regular,
210 }
211 }
212 % \end{macrocode}
213 % \end{macro}
214 %
215 % We first define hooks to change the case format of the titles.
216 %
217 % \begin{macrocode}
218 \def\moloch@titleformat#1{#1}
219 \def\moloch@subtitleformat#1{#1}
220 \def\moloch@sectiontitleformat#1{#1}
221 \def\moloch@frametitleformat#1{#1}
222 % \end{macrocode}
223 %
224 % To make the uppercase and lowercase macros work in the title, subtitle, etc.,
225 % we have to patch the appropriate \verb|beamer| commands that set their values.
226 % This solution was suggested by Enrico Gregorio in an answer to
227 % \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange
228 % question}.
229 %
230 %
231 % \subsection{Process Package Options}
232 %
233 % \begin{macrocode}
234 \moloch@font@setdefaults
235 \ProcessPgfPackageOptions{/moloch/font}
236 % \end{macrocode}
237 % \iffalse
238 %</package>
239 % \fi
240 % \Finale
241 \endinput