forked from maxnoe/TUDoBeamerTheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerthemetudo.sty
294 lines (252 loc) · 8.08 KB
/
beamerthemetudo.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
\ProvidesPackage{beamerthemetudo}[2019/01/29]
% Requirements
\RequirePackage{xcolor}
\RequirePackage{ifluatex}
\RequirePackage{ifxetex}
\RequirePackage{calc}
\hypersetup{colorlinks=true, linkcolor=darkgray, urlcolor=tudark}
% define colors
\xdefinecolor{tugreen}{RGB}{132, 184, 25} % 0
\colorlet{tulight}{tugreen!20!white}
\colorlet{tudark}{tugreen!60!black}
\xdefinecolor{tuorange}{RGB}{227, 105, 19} % 3
\xdefinecolor{tuyellow}{RGB}{242, 189, 0} % 4
\xdefinecolor{tucitron}{RGB}{249, 219, 0} % 5
% a thin and clean progress bar that fits well within the overall asthetic of
% of this theme. Adapted from http://tex.stackexchange.com/a/59749 (Gonzalo Medina)
\makeatletter
\newcommand\progressbar@progressbar{} % the progress bar command
\newcount\progressbar@tmpcounta % auxiliary counter
\newcount\progressbar@tmpcountb % auxiliary counter
\newdimen\progressbar@pbht % progressbar height
\newdimen\progressbar@pbwd % progressbar width
\newdimen\progressbar@tmpdim % auxiliary dimension
\progressbar@pbwd=\paperwidth
\newcommand\progressbar@ffn{0} % needed amount of frames for title page and table of contents slide
% the progress bar
\def\progressbar@progressbar{%
\ifnum\insertframenumber>\progressbar@ffn
\progressbar@tmpcounta=\insertframenumber
\advance\progressbar@tmpcounta by -\progressbar@ffn
\progressbar@tmpcountb=\inserttotalframenumber
\advance\progressbar@tmpcountb by -\progressbar@ffn
\progressbar@tmpdim=\progressbar@pbwd
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
\centering
\begin{tikzpicture}[thin]
\draw[color=darkgray]
(3.75em,0) -- (\[email protected],0);
\draw[color=tugreen] %
(3.75em,0) -- (\[email protected], 0);
\end{tikzpicture}%
\fi%
}
\mode<presentation>
\newif\if@showtotalframes\@showtotalframesfalse
\DeclareOption{showtotalframes}{\@showtotalframestrue}
\ProcessOptions
\setbeamersize{text margin left=15pt, text margin right=15pt}
\usefonttheme{professionalfonts}
% If xelatex or lualatex, use fontspec to set fonts
\newif\if@fontspec\@fontspecfalse
\ifluatex%
\@fontspectrue
\else
\ifxetex
\@fontspectrue
\fi
\fi
\if@fontspec
\RequirePackage{fontspec}
\PassOptionsToPackage{mathrm=sym}{unicode-math}
\RequirePackage{unicode-math}
% Prefer Akkurat Office (TU Corporate Design Font), Fallback to Fira Sans
\IfFontExistsTF{Akkurat Light Office}{
\setsansfont{Akkurat Light Office}[
Scale=MatchLowercase,
BoldFont=Akkurat Office,
ItalicFont=FiraSans LightItalic
]
}{
\setsansfont{FiraSans Light}[
Scale=MatchLowercase,
BoldFont=FiraSans Medium,
]
}
\setmonofont{Fira Mono}[Scale=MatchLowercase]
\setmathfont{Fira Math}[Scale=MatchLowercase]
\else
\usepackage{FiraSans}
\fi
\setbeamertemplate{navigation symbols}{}
%% headline
\newlength{\headerheight}
\setlength{\headerheight}{0.08\paperheight}
\setbeamertemplate{headline}
{%
\vspace*{10pt}%
\leavevmode
\begin{beamercolorbox}[
wd=0.35\paperwidth,
ht=\headerheight,
leftskip=\beamer@leftmargin,
rightskip=1em,
]{headline}%
\includegraphics[height=\headerheight]{logos/tu.pdf}%
\end{beamercolorbox}%
\begin{beamercolorbox}[
wd=0.65\paperwidth,
ht=\headerheight,
leftskip=1em,
rightskip=\beamer@rightmargin,
]{headline}%
% use logo of institute:
\hfill\includegraphics[height=\headerheight]{logos/e5b.pdf}
% or use text instead:
%\usebeamerfont{institute in head/foot}\hfill\insertshortinstitute[respectlinebreaks]
\end{beamercolorbox}%
\vskip2ex%
\ifnum\insertframenumber=1%
\vspace{0.4pt}%
\else%
\hspace{\beamer@leftmargin}%
\usebeamercolor{separation line}%
% this adds the progress bar
\progressbar@progressbar%
\fi
\vskip2ex
}
\newlength{\footerleftwidth}
\setlength{\footerleftwidth}{0.2\paperwidth}
\newlength{\footercenterwidth}
\setlength{\footercenterwidth}{0.6\paperwidth}
\newlength{\footerrightwidth}
\setlength{\footerrightwidth}{0.2\paperwidth}
\setbeamertemplate{footline}
{%
\ifnum\insertframenumber=1%
\else%
\leavevmode
\begin{beamercolorbox}[
wd=\footerleftwidth,
ht=4ex,
dp=10pt,
leftskip=\beamer@leftmargin,
]{author in head/foot}%
{\usebeamerfont{author in head/foot}\insertshortauthor}%
\ifx\beamer@shortdate\empty\else%
~|~{\usebeamerfont{date in head/foot}\insertshortdate}%
\fi%
\end{beamercolorbox}%
\begin{beamercolorbox}[
wd=\footercenterwidth,
ht=3ex,
dp=10pt,
center,
]{section in head/foot}%
\ifx\insertsection\empty%
\else%
\usebeamerfont{section in head/foot}\insertsection%
\ifx\insertsubsection\empty%
\else%
:~\usebeamerfont{subsection in head/foot}\insertsubsection%
\fi
\fi%
\end{beamercolorbox}%
\begin{beamercolorbox}[
wd=\footerrightwidth,
ht=4ex,
dp=10pt,
rightskip=\beamer@rightmargin,
]{frame}%
\hfill%
\usebeamerfont{framenumber}\insertframenumber%
\if@showtotalframes%
~/~\inserttotalframenumber%
\fi%
\end{beamercolorbox}%
\fi%
}
\setbeamertemplate{title page}
{
\ifx\inserttitlegraphic\empty%
\else%
\begin{beamercolorbox}[center, wd=\textwidth]{titlegraphic}
\inserttitlegraphic%
\end{beamercolorbox}%
\vspace{10pt}%
\fi%
\ifx\inserttitle\empty\else%
\begin{beamercolorbox}[center, wd=\textwidth]{title}
\textcolor{tugreen}{\rule{\textwidth}{1pt}}\\[0.5\baselineskip]%
\usebeamerfont{title}\inserttitle
\ifx\insertsubtitle\empty%
\newline%
\else%
\\[0.5\baselineskip]%
\usebeamerfont{subtitle}%
\insertsubtitle\newline%
\fi%
\textcolor{tugreen}{\rule{\textwidth}{1pt}}%
\end{beamercolorbox}%
\vspace{\fill}
\fi%
\ifx\insertauthor\empty%
\else%
\begin{beamercolorbox}[leftskip=0.2\textwidth, rightskip=0.2\textwidth, wd=\textwidth]{author}
\centering\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}%
\vspace{1ex}%
\fi%
\ifx\insertdate\empty%
\else%
\begin{beamercolorbox}[leftskip=0.2\textwidth, rightskip=0.2\textwidth, wd=\textwidth]{date}
\centering\usebeamerfont{date}\insertdate%
\end{beamercolorbox}%
\vspace{1ex}%
\fi%
\ifx\insertinstitute\empty%
\else%
\begin{beamercolorbox}[leftskip=0.2\textwidth, rightskip=0.2\textwidth, wd=\textwidth]{institute}
\centering\usebeamerfont{institute}\insertinstitute%
\end{beamercolorbox}%
\fi%
\vspace{\fill}
}
\setbeamertemplate{itemize items}[square]
\setbeamertemplate{frametitle}{%
\usebeamerfont{frametitle}\insertframetitle%
}
%% fonts
\setbeamerfont{author}{size=\Large}
\setbeamerfont{title}{size=\huge, series=\bfseries}
\setbeamerfont{date}{size=\large, series=\bfseries}
\setbeamerfont{frametitle}{size=\large, series=\bfseries}
\setbeamerfont{framenumber}{series=\bfseries}
\setbeamerfont{institute}{size=\large}
\setbeamerfont{section in head/foot}{size=\small}
\setbeamerfont{subsection in head/foot}{size=\small}
\setbeamerfont{institute in head/foot}{size=\large}
\setbeamerfont{item}{series=\bfseries}
\setbeamerfont{itemize/enumerate body}{size=\normalfont}
\setbeamerfont{itemize/enumerate subbody}{size=\normalfont}
\setbeamerfont{itemize/enumerate subsubbody}{size=\normalfont}
\setbeamerfont{block title}{series=\bfseries}
\setbeamerfont{section in toc}{series=\bfseries}
%% colors
\setbeamercolor{section in head/foot}{fg=tugreen, bg=white}
\setbeamercolor{framenumber}{fg=tugreen, bg=white}
\setbeamercolor{normal text}{fg=darkgray, bg=white}
\setbeamercolor{alerted text}{fg=tuorange, bg=white}
\setbeamercolor{palette primary}{fg=darkgray, bg=white}
\setbeamercolor{palette secondary}{fg=tugreen, bg=white}
\setbeamercolor{title}{fg=darkgray, bg=white}
\setbeamercolor{structure}{fg=tugreen, bg=white}
\setbeamercolor{frametitle}{fg=tugreen, bg=white}
\setbeamercolor{item}{fg=tugreen, bg=white}
\setbeamercolor{block title}{fg=white, bg=tugreen}
\setbeamercolor{block body}{fg=darkgray, bg=tulight}
\setbeamercolor{section number in toc}{fg=tugreen, bg=white}
\setbeamercolor{section in toc}{fg=darkgray, bg=white}
\mode<all>