-
Notifications
You must be signed in to change notification settings - Fork 2
/
beamerinnerthememetroazwei.sty
293 lines (292 loc) · 8.82 KB
/
beamerinnerthememetroazwei.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
%%
%% variation of metropolis theme for the A2 collaboration
%% ---------------------------------------------------------------------------
%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
%% contributors can be found at
%%
%% https://github.com/matze/mtheme/graphs/contributors
%%
%% and the original template was based on the HSRM theme by Benjamin Weiss.
%%
%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
%% International License (https://creativecommons.org/licenses/by-sa/4.0/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerinnerthememetroazwei}[2017/12/07 metroazwei inner theme]
\RequirePackage{etoolbox}
\RequirePackage{keyval}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
\pgfkeys{
/metroazwei/inner/sectionpage/.cd,
.is choice,
none/.code=\metroazwei@disablesectionpage,
simple/.code={\metroazwei@enablesectionpage
\setbeamertemplate{section page}[simple]},
progressbar/.code={\metroazwei@enablesectionpage
\setbeamertemplate{section page}[progressbar]},
}
\pgfkeys{
/metroazwei/inner/subsectionpage/.cd,
.is choice,
none/.code=\metroazwei@disablesubsectionpage,
simple/.code={\metroazwei@enablesubsectionpage
\setbeamertemplate{section page}[simple]},
progressbar/.code={\metroazwei@enablesubsectionpage
\setbeamertemplate{section page}[progressbar]},
}
\newcommand{\metroazwei@inner@setdefaults}{
\pgfkeys{/metroazwei/inner/.cd,
sectionpage=progressbar,
subsectionpage=none
}
}
\setbeamersize{text margin left=2em,text margin right=2em}
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\vfill%
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
\usebeamertemplate*{title separator}
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
\usebeamertemplate*{date}
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
\vfill
\vspace*{1mm}
\end{minipage}
}
\def\maketitle{%
\ifbeamer@inframe
\titlepage
\else
\frame[plain,noframenumbering]{\titlepage}
\fi
}
\def\titlepage{%
\usebeamertemplate{title page}
}
\setbeamertemplate{title graphic}{
\vbox to 0pt {
\vspace*{1em}
\hfill
\inserttitlegraphic%
}%
\nointerlineskip%
}
\setbeamertemplate{title}{
\raggedright%
\linespread{1.0}%
\inserttitle%
\par%
\vspace*{0.5em}
}
\setbeamertemplate{subtitle}{
\raggedright%
\insertsubtitle%
\par%
\vspace*{0.5em}
}
\newlength{\metroazwei@titleseparator@linewidth}
\setlength{\metroazwei@titleseparator@linewidth}{0.8pt} % changed from 0.4pt
\setbeamertemplate{title separator}{
\tikzexternaldisable%
\begin{tikzpicture}
\fill[fg] (0,0) rectangle (\textwidth, \metroazwei@titleseparator@linewidth);
\end{tikzpicture}%
\tikzexternalenable%
\par%
}
\setbeamertemplate{date}{
\hfill
\insertdate%
\par%
}
\setbeamertemplate{author}{
\vspace*{1em} % 2em
\insertauthor%
%\par%
\vspace*{0.5em}
}
\setbeamertemplate{institute}{
%\vspace*{0.25em}
\insertinstitute%
\par%
}
\defbeamertemplate{section page}{simple}{
\begin{center}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\par
\ifx\insertsubsectionhead\@empty\else
\usebeamercolor[fg]{subsection title}
\usebeamerfont{subsection title}
\insertsubsectionhead
\fi
\end{center}
}
\defbeamertemplate{section page}{progressbar}{
\centering
\begin{minipage}{22em}
\raggedright
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\\[-1ex]
\usebeamertemplate*{progress bar in section page}
\par
\ifx\insertsubsectionhead\@empty\else%
\usebeamercolor[fg]{subsection title}%
\usebeamerfont{subsection title}%
\insertsubsectionhead
\fi
\end{minipage}
\par
\vspace{\baselineskip}
}
\newcommand{\metroazwei@disablesectionpage}{
\AtBeginSection{
% intentionally empty
}
}
\newcommand{\metroazwei@enablesectionpage}{
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[plain,c,noframenumbering]{\sectionpage}
\fi
}
}
\setbeamertemplate{subsection page}{%
\usebeamertemplate*{section page}
}
\newcommand{\metroazwei@disablesubsectionpage}{
\AtBeginSubsection{
% intentionally empty
}
}
\newcommand{\metroazwei@enablesubsectionpage}{
\AtBeginSubsection{
\ifbeamer@inframe
\subsectionpage
\else
\frame[plain,c,noframenumbering]{\subsectionpage}
\fi
}
}
\newlength{\metroazwei@progressonsectionpage}
\newlength{\metroazwei@progressonsectionpage@linewidth}
\setlength{\metroazwei@progressonsectionpage@linewidth}{1.2pt} % changed from 0.4
\setbeamertemplate{progress bar in section page}{
\setlength{\metroazwei@progressonsectionpage}{%
\textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\tikzexternaldisable%
\begin{tikzpicture}
\fill[bg] (0,0) rectangle (\textwidth, \metroazwei@progressonsectionpage@linewidth);
\fill[fg] (0,0) rectangle (\metroazwei@progressonsectionpage, \metroazwei@progressonsectionpage@linewidth);
\end{tikzpicture}%
\tikzexternalenable%
}
\def\inserttotalframenumber{100}
\newlength{\metroazwei@blocksep}
\newlength{\metroazwei@blockadjust}
\setlength{\metroazwei@blocksep}{1.25ex} % changed from 0.75
\setlength{\metroazwei@blockadjust}{0.25ex}
\providecommand{\metroazwei@strut}{%
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
}
\newcommand{\metroazwei@block}[1]{
\par\vskip\medskipamount%
\setlength{\parskip}{0pt}
\ifbeamercolorempty[bg]{block title#1}{%
\begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
\ifbeamercolorempty[bg]{block title}{%
\begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
}%
{%
\begin{beamercolorbox}[
sep=\dimexpr\metroazwei@blocksep-\metroazwei@blockadjust\relax,
leftskip=\metroazwei@blockadjust,
rightskip=\dimexpr\metroazwei@blockadjust plus 4em\relax
]{block title#1}%
}}%
\usebeamerfont*{block title#1}%
\metroazwei@strut%
\insertblocktitle%
\metroazwei@strut%
\end{beamercolorbox}%
\nointerlineskip%
\ifbeamercolorempty[bg]{block body#1}{%
\begin{beamercolorbox}[vmode]{block body#1}}{
\ifbeamercolorempty[bg]{block body}{%
\begin{beamercolorbox}[vmode]{block body#1}%
}{%
\begin{beamercolorbox}[sep=\metroazwei@blocksep, vmode]{block body#1}%
\vspace{-\metroazwei@parskip}
}}%
\vspace{0ex} % no idea but it works
\usebeamerfont{block body#1}%
\setlength{\parskip}{\metroazwei@parskip}%
}
\setbeamertemplate{block begin}{\metroazwei@block{}}
\setbeamertemplate{block alerted begin}{\metroazwei@block{ alerted}}
\setbeamertemplate{block example begin}{\metroazwei@block{ example}}
\setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{itemize items}{\textbullet}
\setbeamertemplate{caption label separator}{: }
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{footnote}{%
\parindent 0em\noindent%
\raggedright
\usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
\newlength{\metroazwei@parskip}
\setlength{\metroazwei@parskip}{0.5em}
\setlength{\parskip}{\metroazwei@parskip}
\linespread{1.15}
\define@key{beamerframe}{c}[true]{% centered
\beamer@frametopskip=0pt plus 1fill\relax%
\beamer@framebottomskip=0pt plus 1fill\relax%
\beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
\beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
\def\beamer@initfirstlineunskip{}%
}
\providebool{metroazwei@standout}
\define@key{beamerframe}{standout}[true]{%
\booltrue{metroazwei@standout}
\begingroup
\setkeys{beamerframe}{c}
\setkeys{beamerframe}{noframenumbering}
\ifbeamercolorempty[bg]{palette primary}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=-palette primary.fg
}
}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=palette primary.bg
}
}
\setbeamercolor{local structure}{
fg=palette primary.fg
}
\centering
\usebeamercolor[fg]{palette primary}
\usebeamerfont{standout}
}
\apptocmd{\beamer@reseteecodes}{%
\ifbool{metroazwei@standout}{
\endgroup
\boolfalse{metroazwei@standout}
}{}
}{}{}
\metroazwei@inner@setdefaults
\ProcessPgfPackageOptions{/metroazwei/inner}
\endinput
%%
%% End of file `beamerinnerthememetroazwei.sty'.