-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeamerthemeETHbeamer.sty
339 lines (285 loc) · 12 KB
/
beamerthemeETHbeamer.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
%==============================================================================
%
% Created by Karl Wuest
% ETHbeamer 1.0.7
% 2016-06-29
% ETH corporate design
% Based on LaTex ETH Presentation Template by Dieter Hennig
%
%==============================================================================
% === optional department logo ================================================
\newif\ifdeplogo
\deplogotrue % Department-Logo for leftside footer
% === font ====================================================================
\usepackage[T1]{fontenc}% for correct hyphenation and T1 encoding
\linespread{1.12} % enlarge line space
\usepackage{lmodern} % latin modern font
\usepackage[scaled=.95]{helvet}% helvetica as the origin of arial
\usepackage[helvet]{sfmath} % for the mathematical enviroments
\renewcommand{\familydefault}{\sfdefault}
\usepackage{microtype} % for character protrusion and font expansion
% === colors ==================================================================
\usepackage{xcolor} % color package; load before tocstyle
\usepackage{tikz, datetime, textpos}
\usepackage{calc}
% ==== new colours ===========================================================
\definecolor{ETHa}{RGB}{31,64,122} % ETH1
\definecolor{ETHb}{RGB}{72,90,44} % ETH2
\definecolor{ETHc}{RGB}{18,105,176} % ETH3
\definecolor{ETHd}{RGB}{114,121,28} % ETH4
\definecolor{ETHe}{RGB}{145,5,106} % ETH5
\definecolor{ETHf}{RGB}{111,111,100} % ETH6
\definecolor{ETHg}{RGB}{168,50,45} % ETH7
\definecolor{ETHh}{RGB}{0,122,150} % ETH8
\definecolor{ETHi}{RGB}{149,96,19} % ETH9
\newcommand*{\colorETHa}[1]{\textcolor{ETHa}{#1}}
\newcommand*{\colorETHb}[1]{\textcolor{ETHb}{#1}}
\newcommand*{\colorETHc}[1]{\textcolor{ETHc}{#1}}
\newcommand*{\colorETHd}[1]{\textcolor{ETHd}{#1}}
\newcommand*{\colorETHe}[1]{\textcolor{ETHe}{#1}}
\newcommand*{\colorETHf}[1]{\textcolor{ETHf}{#1}}
\newcommand*{\colorETHg}[1]{\textcolor{ETHg}{#1}}
\newcommand*{\colorETHh}[1]{\textcolor{ETHh}{#1}}
\newcommand*{\colorETHi}[1]{\textcolor{ETHi}{#1}}
% ==== old colors =============================================================
\definecolor{ETHblue}{RGB}{51,89,148} % for Department-Logo (#335994)
\definecolor{ETHlightblue}{RGB}{100,149,224}
\definecolor{ETHbrown}{RGB}{148,116,51}
\definecolor{ETHred}{RGB}{161,82,71}
\definecolor{ETHdarkgray}{rgb}{0.282,0.322,0.361} % for box (#48525c)
\newcommand*{\ETHblue}[1]{\textcolor{ETHblue}{#1}}
\newcommand*{\ETHlightblue}[1]{\textcolor{ETHlightblue}{#1}}
\newcommand*{\ETHbrown}[1]{\textcolor{ETHbrown}{#1}}
\newcommand*{\ETHred}[1]{\textcolor{ETHred}{#1}}
\newcommand*{\ETHdarkgray}[1]{\textcolor{ETHdarkgray}{#1}}
\colorlet{ETHcolor1}{ETHc}
\colorlet{ETHcolor2}{ETHc}
%\setbeamercolor*{title page header}{fg=white}
\setbeamercolor*{subtitle}{fg=white}
\setbeamercolor*{author}{fg=white}
\setbeamercolor*{institute}{fg=white}
\setbeamercolor*{date}{fg=white}
\setbeamercolor*{item}{fg=black}
\setbeamercolor*{frametitle}{fg=black}
\setbeamercolor*{block title}{fg=black}
\setbeamercolor*{block title example}{fg=black}
\setbeamercolor*{section in toc}{fg=black}
\setbeamercolor*{section page}{fg=black}
\setbeamerfont{section page}{size=\LARGE}
\setbeamerfont{title}{size=\Large,series=\bfseries}
\setbeamerfont{subtitle}{size=\large,series=\bfseries}
\setbeamerfont{author}{size=\small}
\setbeamerfont{institute}{size=\scriptsize}
\setbeamerfont{date}{size=\small}
\newenvironment{xplainframe}{\bgroup\begin{frame}[plain]}{\end{frame}\egroup}
% === coloured Bar setting =======================
\newcommand*{\eth@barbreit}{\paperwidth-4mm} % Breite
\newcommand*{\eth@barhoch}{8.75mm} % Hoehe
\newcommand*{\eth@baruhh}{2.5mm} % untere Hoehe
\newcommand*{\eth@baruhb}{2.5mm} % untere Breite
\newcommand*{\eth@shiftx}{9.5mm-\paperwidth}%118.5mm} % x shift
\newcommand*{\eth@shifty}{5.5mm-\paperheight}%90.5mm} % y shift
\newcommand*{\anchorheight}{\the\paperheight-\eth@barhoch-2mm}
\newcommand*{\titleanchorheight}{7.5mm}
\newcommand*{\eth@hintergrundbreite}{\paperwidth-9mm} % Breite
\newcommand*{\eth@hintergrundhoehe}{0.5\paperheight-8mm}%40mm} % Hoehe
% === default background ============================================================
\defbeamertemplate*{background}{xplainframe}{%
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\hspace{2mm}\draw[ETHcolor1,fill=ETHcolor1] (0,\eth@barhoch + \anchorheight)-- %
(\eth@barbreit,\eth@barhoch + \anchorheight)--(\eth@barbreit, \anchorheight)-- %
(\eth@barbreit-\eth@baruhb, \anchorheight)-- (\eth@barbreit-\eth@baruhb,\eth@baruhh + \anchorheight) -- %
(\eth@baruhb,\eth@baruhh + \anchorheight)--(\eth@baruhb, \anchorheight)-- (0, \anchorheight) -- %
(0,\eth@barhoch + \anchorheight); %
\node [shift={(\eth@shiftx,\eth@shifty + \anchorheight)}] at (current page.north east){\includegraphics[width=12.8mm]{eth_logo_kurz_neg_13.pdf}};%
\end{tikzpicture}
}
\newcommand{\setdefaultbg}{
\setbeamertemplate{background}[xplainframe]
}
% === title frame background =========================================================
\newcommand{\settitlebg}{
\setbeamercolor*{title page header}{fg=white}
\setbeamercolor*{title}{fg=white}
\setbeamertemplate{background}
{
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\node [shift={(-0.5\paperwidth,-\paperheight-19mm + \anchorheight)}] at (current page.north east)
%% backside of the ETH dome
{\includegraphics[width=\the\paperwidth-9mm,trim={0mm 35mm 0mm 28mm},clip]{title.jpg}};
\hspace{2mm}\draw[ETHcolor1,fill=ETHcolor1] (0,\eth@barhoch + \anchorheight)-- %
(\eth@barbreit,\eth@barhoch + \anchorheight)--(\eth@barbreit, \anchorheight)-- %
(\eth@barbreit-\eth@baruhb, \anchorheight)-- (\eth@barbreit-\eth@baruhb,\eth@baruhh + \anchorheight) -- %
(\eth@baruhb,\eth@baruhh + \anchorheight)--(\eth@baruhb, \anchorheight)-- (0, \anchorheight) -- %
(0,\eth@barhoch + \anchorheight); %
\node [shift={(\eth@shiftx,\eth@shifty + \anchorheight)}] at (current page.north east){\includegraphics[width=12.8mm]{eth_logo_kurz_neg_13.pdf}};%
\hspace{2.5mm}\draw[ETHcolor2,fill=ETHcolor2]%
(0,\eth@hintergrundhoehe+\titleanchorheight)--(\eth@hintergrundbreite,\eth@hintergrundhoehe+\titleanchorheight)%
--(\eth@hintergrundbreite,\titleanchorheight)--(0,\titleanchorheight)--(0,\eth@hintergrundhoehe+\titleanchorheight);
\end{tikzpicture}
}
}
\newcommand{\titleframe}{
\settitlebg
\frame{\maketitle}
\setdefaultbg
}
\newenvironment{titlestyleframe}{
\setbeamercolor*{frametitle}{fg=white}
\setbeamercolor*{item}{fg=white}
\setbeamertemplate{frametitle}{
\vspace{5cm}
\begin{beamercolorbox}{frametitle}
\insertframetitle
\end{beamercolorbox}
}
\settitlebg
\begin{frame}
\color{white}
}
{
\end{frame}
\setdefaultbg
}
% === minimal slide =========================================================
\newcommand{\setminimalbg}{
\setbeamertemplate{background}{%
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\hspace{2mm}\draw[white,fill=white] (0,\eth@barhoch + \anchorheight)-- %
(\eth@barbreit,\eth@barhoch + \anchorheight)--(\eth@barbreit, \anchorheight)-- %
(\eth@barbreit-\eth@baruhb, \anchorheight)-- (\eth@barbreit-\eth@baruhb,\eth@baruhh + \anchorheight) -- %
(\eth@baruhb,\eth@baruhh + \anchorheight)--(\eth@baruhb, \anchorheight)-- (0, \anchorheight) -- %
(0,\eth@barhoch + \anchorheight); %
\node [shift={(\eth@shiftx,\eth@shifty + \anchorheight)}] at (current page.north east){\includegraphics[width=12.8mm]{eth_logo_kurz_pos_13.pdf}};%
\end{tikzpicture}
}
}
\newenvironment{minimalframe}{
\setminimalbg
\begin{frame}
}
{
\end{frame}
\setdefaultbg
}
% === inverse slide =======================================================
\newcommand*{\eth@inverserhintergrundhoehe}{\paperheight-15.85mm}%80.15mm}
\newcommand{\setinvertedbg}{
\setbeamertemplate{background}{%
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);
\hspace{2mm}\draw[ETHcolor1,fill=ETHcolor1] (0,\eth@barhoch + \anchorheight)-- %
(\eth@barbreit,\eth@barhoch + \anchorheight)--(\eth@barbreit, \anchorheight)-- %
(\eth@barbreit-\eth@baruhb, \anchorheight)-- (\eth@barbreit-\eth@baruhb,\eth@baruhh + \anchorheight) -- %
(\eth@baruhb,\eth@baruhh + \anchorheight)--(\eth@baruhb, \anchorheight)-- (0, \anchorheight) -- %
(0,\eth@barhoch + \anchorheight); %
\node [shift={(\eth@shiftx,\eth@shifty + \anchorheight)}] at (current page.north east){\includegraphics[width=12.8mm]{eth_logo_kurz_neg_13.pdf}};%
\draw[ETHcolor2,fill=ETHcolor2]%
(\eth@baruhb,\eth@inverserhintergrundhoehe + \titleanchorheight)--(\eth@hintergrundbreite+\eth@baruhb,\eth@inverserhintergrundhoehe + \titleanchorheight)%
--(\eth@hintergrundbreite+\eth@baruhb,\titleanchorheight)--(\eth@baruhb,\titleanchorheight)--(\eth@baruhb,\eth@inverserhintergrundhoehe+\titleanchorheight);
\end{tikzpicture}
}
}
\newcommand{\fgcolor}{black}
\setbeamercolor{normal text}{fg=\fgcolor}
\newenvironment{inverseframe}{
\setinvertedbg
\setbeamercolor*{frametitle}{fg=white}
\setbeamercolor*{item}{fg=white}
\begin{frame}
\color{white}
}
{
\end{frame}
\setdefaultbg
}
% === title page layout ==============================================================
\setbeamertemplate{title page}{
\setbeamertemplate{background}[title page]
\begin{textblock*}{\textwidth}(-0.3cm,1.8cm)
\begin{beamercolorbox}{title page header}
\usebeamerfont{title}\usebeamercolor{title}\inserttitle%
\end{beamercolorbox}%
\ifx\insertsubtitle\@empty
\else
\begin{beamercolorbox}{subtitle}
\usebeamerfont{subtitle}\insertsubtitle%
\end{beamercolorbox}
\fi
\vspace{0.2cm}
\begin{beamercolorbox}{author}
\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}
\ifx\insertinstitute\@empty
\else
\begin{beamercolorbox}{institute}
\usebeamerfont{institute}\insertinstitute%
\end{beamercolorbox}
\fi
\ifx\insertdate\@empty
\else
\begin{beamercolorbox}{date}
\usebeamerfont{date}\insertdate%
\end{beamercolorbox}
\fi
\end{textblock*}
}
% === frametitle ======================================================================
\setbeamertemplate{frametitle}{
\vspace{1cm}
\begin{beamercolorbox}{frametitle}
\insertframetitle
\end{beamercolorbox}
}
% === footer ===========================================================================
\newcommand{\deplogo}{Deplogo}
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=3ex,left]{fg=black,bg=white}%
\ifdeplogo
\hspace*{4.5mm}\includegraphics[height=1.8ex]{\deplogo}
\fi
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=2ex,right]{fg=black,bg=white}%
\usebeamerfont{author in head/foot}\insertshortauthor
\hspace*{3mm}\insertshortdate \hspace*{3mm} \insertframenumber{}\hspace*{4.5mm}
\end{beamercolorbox}}%
\vskip0pt%
}
% === Remove spacing in toc ============================================================
%\makeatletter
%\patchcmd{\beamer@sectionintoc}
% {\vfill}
% {\vskip\itemsep}
% {}
% {}
%\makeatother
% === items ============================================================================
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{itemize item}[circle]
\setbeamertemplate{itemize subitem}{\bf --}
\setbeamertemplate{itemize subsubitem}[triangle]
% ==== commands ================================================================
% === decoration
\usetikzlibrary{decorations.pathmorphing,shadows}
% === box
\newcommand*{\ETHbox}[2]{
\vspace{1em}
\begin{tikzpicture}[ETHnodestyle/.style={rectangle,rounded
corners,draw=ETHdarkgray!40!white,
thick,inner sep=2mm,text justified,top color=ETHcolor2!30!white, bottom color=ETHcolor2,above}]%
\node[ETHnodestyle,at={(0.5*#1+2mm+0.4pt,0)}]{%
\begin{minipage}[t]{#1}
#2
\end{minipage}%
};
\end{tikzpicture}%
}
% === labels
\newcommand*{\ETHitem}{\raisebox{1pt}{\tikz\fill[sharp
corners](0,0)rectangle+(3.4pt,3.4pt);}}