-
Notifications
You must be signed in to change notification settings - Fork 1
/
beamerinnerthememetropolis.sty
264 lines (264 loc) · 7.48 KB
/
beamerinnerthememetropolis.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
%%
%% This is file `beamerinnerthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerinnerthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% 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{beamerinnerthememetropolis}[2015/06/12 Metropolis inner theme]
\RequirePackage{etoolbox}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
\pgfkeys{
/metropolis/inner/block/.cd,
.is choice,
transparent/.code=\setlength{\@metropolis@blockskip}{0ex},
fill/.code=\setlength{\@metropolis@blockskip}{1ex},
}
\pgfkeys{
/metropolis/inner/titleformat/.cd,
.is choice,
regular/.code=\renewcommand{\@metropolis@titleformat}{},
lowercase/.code={%
\renewcommand{\@metropolis@titleformat}{\MakeLowercase}
},
uppercase/.code={%
\renewcommand{\@metropolis@titleformat}{\MakeUppercase}
},
}
\pgfkeys{
/metropolis/inner/sectiontitleformat/.cd,
.is choice,
regular/.code=\renewcommand{\@metropolis@sectiontitleformat}{},
lowercase/.code={%
\renewcommand{\@metropolis@sectiontitleformat}{\MakeLowercase}
},
uppercase/.code={%
\renewcommand{\@metropolis@sectiontitleformat}{\MakeUppercase}
},
}
\pgfkeys{
/metropolis/inner/sectionpage/.cd,
.is choice,
none/.code=\@metropolis@sectionpage@none,
progressbar/.code=\@metropolis@sectionpage@progressbar,
}
\newcommand{\@metropolis@inner@setdefaults}{
\pgfkeys{/metropolis/inner/.cd,
sectionpage=progressbar,
block=transparent,
titleformat=lowercase,
sectiontitleformat=lowercase,
}
}
\def\@metropolis@titleformat#1{#1}
\def\@metropolis@sectiontitleformat#1{#1}
\patchcmd{\sectionentry}
{\def\insertsectionhead{#2}}
{\def\insertsectionhead{\@metropolis@sectiontitleformat{#2}}}
{}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed.}}
\patchcmd{\beamer@section}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\@metropolis@sectiontitleformat{#1}}}}
{}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed.}}
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
\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
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
\vfill
\vspace*{1mm}
\end{minipage}
}
\def\maketitle{%
\ifbeamer@inframe
\titlepage
\else
\frame[plain]{\titlepage}
\fi
}
\def\titlepage{%
\usebeamertemplate{title page}
}
\setbeamertemplate{title graphic}{
\vbox to 0pt {
\vspace*{2em}
\inserttitlegraphic%
}%
\nointerlineskip%
}
\setbeamertemplate{title}{
\raggedright%
\linespread{1.0}%
\@metropolis@titleformat{\inserttitle}%
\par%
\vspace*{0.5em}
}
\setbeamertemplate{subtitle}{
\insertsubtitle%
\par%
\vspace*{0.5em}
}
\setbeamertemplate{title separator}{
\begin{tikzpicture}
\draw[fg] (0, 0) -- (\textwidth, 0);
\end{tikzpicture}%
\par%
}
\setbeamertemplate{author}{
\vspace*{2em}
\insertauthor%
\par%
\vspace*{0.25em}
}
\setbeamertemplate{date}{
\insertdate%
\par%
}
\setbeamertemplate{institute}{
\vspace*{3mm}
\insertinstitute%
\par%
}
\newcommand{\@metropolis@sectionpage@none}{
\AtBeginSection{
% intenionally empty
}
}
\defbeamertemplate{section page}{progressbar}{
\centering
\begin{minipage}{22em}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\\[-1ex]
\usebeamertemplate*{progress bar in section page}
\end{minipage}
\par
}
\newcommand{\@metropolis@sectionpage@progressbar}{
\setbeamertemplate{section page}[progressbar]
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[plain,c]{\sectionpage}
\fi
}
}
\newlength{\metropolis@progressonsectionpage}
\setbeamertemplate{progress bar in section page}{
\setlength{\metropolis@progressonsectionpage}{%
\textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{tikzpicture}
\draw[bg, fill=bg] (0,0) rectangle (\textwidth, 0.4pt);
\draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressonsectionpage, 0.4pt);
\end{tikzpicture}%
}
\def\inserttotalframenumber{100}
\newlength{\@metropolis@blockskip}
\setbeamertemplate{block begin}{%
\vspace*{1ex}
\begin{beamercolorbox}[%
ht=2.4ex,
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip]{block title}
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
\vspace*{-1pt}
\usebeamerfont{block body}%
\begin{beamercolorbox}[%
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip,
vmode]{block body}%
}
\setbeamertemplate{block end}{%
\end{beamercolorbox}
\vspace*{0.2ex}
}
\setbeamertemplate{block alerted begin}{%
\vspace*{1ex}
\begin{beamercolorbox}[%
ht=2.4ex,
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip]{block title alerted}
\usebeamerfont*{block title alerted}\insertblocktitle%
\end{beamercolorbox}%
\vspace*{-1pt}
\usebeamerfont{block body alerted}%
\begin{beamercolorbox}[%
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip,
vmode]{block body}%
}
\setbeamertemplate{block alerted end}{%
\end{beamercolorbox}
\vspace*{0.2ex}
}
\setbeamertemplate{block example begin}{%
\vspace*{1ex}
\begin{beamercolorbox}[%
ht=2.4ex,
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip]{block title example}
\usebeamerfont*{block title example}\insertblocktitle%
\end{beamercolorbox}%
\vspace*{-1pt}
\usebeamerfont{block body example}%
\begin{beamercolorbox}[%
dp=1ex,
leftskip=\@metropolis@blockskip,
rightskip=\@metropolis@blockskip,
vmode]{block body}%
}
\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%
}
\setlength{\parskip}{0.5em}
\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{}%
}
\@metropolis@inner@setdefaults
\ProcessPgfPackageOptions{/metropolis/inner}
\endinput
%%
%% End of file `beamerinnerthememetropolis.sty'.