forked from PoisotLab/PLPT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerthemepl.sty
268 lines (227 loc) · 6.38 KB
/
beamerthemepl.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
% Beamer mtheme
%
% Copyright 2014 Matthias Vogelgesang
% Licensed under CC-BY-SA 4.0 International.
%
% The initial template comes from the HSRM beamer theme by Benjamin Weiss, which
% you can find at https://github.com/hsrmbeamertheme/hsrmbeamertheme.
%
\ProvidesPackage{beamerthemepl}
\newif\if@useTitleProgressBar
\newif\if@protectFrameTitle
\@useTitleProgressBarfalse
\@protectFrameTitletrue
\newlength{\@pltheme@voffset}
\setlength{\@pltheme@voffset}{1.1em}
\DeclareOptionBeamer{noprogressbar}{\@useTitleProgressBarfalse}
\DeclareOptionBeamer{unprotectframetitle}{\@protectFrameTitlefalse}
\DeclareOptionBeamer{nooffset}{\setlength{\@pltheme@voffset}{0em}}
\DeclareOptionBeamer*{%
\PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}%
}
\ProcessOptionsBeamer
\mode<presentation>
\newcount\sobre@angcur
\newcount\sobre@angtot \sobre@angtot360
\newcount\sobre@framecnt
\newcount\sobre@frametot
\RequirePackage{etoolbox}
\RequirePackage{tikz}
\RequirePackage{xifthen}
\RequirePackage{pgfplots}
\RequirePackage{minted}
\RequirePackage{graphicx}
\RequirePackage[scale=2]{ccicons}
\RequirePackage[absolute, overlay]{textpos}
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}
\usetikzlibrary{fadings}
\usecolortheme{pl}
\usefonttheme{pl}
\newcommand{\reference}[1]{%
\begin{tikzpicture}[remember picture, overlay]%
\node[anchor=south west,] at (current page.south west) {\color{plFG}\tiny #1};%
\end{tikzpicture}%
}
\def\maketitle{\ifbeamer@inframe\titlepage\else\frame[plain]{\titlepage}\fi}
\def\titlepage{\usebeamertemplate{title page}}
\setbeamertemplate{title page}
{
\begin{picture}(0,0)
\put(-28.5,-175){%
\pgfuseimage{titlebackground}
}
\put(398, 100){\color{white}\tiny\ccby}%
\put(0,-145){%
\begin{minipage}[b][4.5cm][t]{0.5\textwidth}
\color{plST}
{\usebeamerfont{title}\inserttitle\\[0.2cm]}
{\usebeamerfont{subtitle}\insertsubtitle\\[0.9cm]}
\vfill
{\usebeamerfont{author}\insertauthor\\ \usebeamerfont{institute}\insertinstitute\par}
{\usebeamerfont{date}\insertdate}
\end{minipage}
}
\end{picture}
}
\makeatletter
%{{{ --- Commands ---------------------
\newcommand{\insertsectionHEAD}{%
\expandafter\insertsectionHEADaux\insertsectionhead}
\newcommand{\insertsectionHEADaux}[3]{#3}
%}}}
%{{{ --- Itemize ----------------------
\setlength{\leftmargini}{1em}
% Actually one level should be enough but ...
\setlength{\leftmarginii}{1em}
\setlength{\leftmarginiii}{1em}
\newcommand{\itemBullet}{$\cdot$}
\setbeamertemplate{itemize item}{\itemBullet}
\setbeamertemplate{itemize subitem}{\itemBullet}
\setbeamertemplate{itemize subsubitem}{\itemBullet}
\setlength{\parskip}{0.5em}
%}}}
\makeatletter
\newif\ifbeamer%
\pgfkeys{/visual counter/.cd,
thickness/.store in=\thickness,
thickness=0.4ex,
radius/.store in=\radius,
radius=1.2ex,
segment distance/.store in=\segdist,
segment distance=8,
color current frame/.store in=\colcurrframe,
color current frame=plST!45,
color old frame/.store in=\cololdframe,
color old frame=plST,
color next frame/.store in=\colnextframe,
color next frame=plFG!15,
current value/.store in=\currentv,
current value=1,
total value/.store in=\totalv,
total value=5,
beamer/.is if=beamer,
beamer/.default=false,
countdown/.code={
\begin{tikzpicture}[fill color/.style={}]
\ifbeamer
\pgfkeys{/visual counter/.cd,
current value=\insertframenumber,
total value=\inserttotalframenumber,
}
\fi
\def\current{\currentv}
\def\tot{\totalv}
\def\radiusout{\radius}
\def\radiusin{\radius-\thickness}
\foreach \s[] in {1,...,\tot}
{
\ifnum\s>\current%
\tikzset{fill color/.append style={\colnextframe}}%
\fi%
\ifnum\s=\current%
\tikzset{fill color/.append style={\colcurrframe}}%
\fi%
\ifnum\s<\current%
\tikzset{fill color/.append style={\cololdframe}}%
\fi%
\fill[fill color]
({90-360/\tot * (\s - 1)-\segdist}:\radiusout) arc
({90-360/\tot * (\s - 1)-\segdist}:{90-360/\tot * (\s)+\segdist}:\radiusout) --
({90-360/\tot * (\s)+\segdist}:\radiusin) arc
({90-360/\tot * (\s)+\segdist}:{90-360/\tot * (\s - 1)-\segdist}:\radiusin);
}
\end{tikzpicture}
}
}
\newcommand{\setvcoptions}[1]{
\pgfkeys{/visual counter/.cd,#1}
}
\newcommand{\addvisualcounter}{%
\tikz\node[/visual counter/.cd, beamer=true,countdown]{};
}
% Let's change some options:
\setvcoptions{
segment distance=8,
thickness=0.6ex
}
% Insert frame with section title at every section start
\AtBeginSection[]
{
\begingroup
\setbeamercolor{background canvas}{parent=palette primary}
\begin{frame}[plain]
\begin{picture}(0,0)
\put(-28.5,-175){%
\pgfuseimage{titlebackground}
}
\put(-28.5,-175){\tikz \fill [plBG] (1,1) rectangle (13,12);}%
\put(0,-145){%
\begin{minipage}[b][4.5cm][t]{0.5\textwidth}
\color{plST}\Large\mdseries\insertsectionHEAD
\end{minipage}
}
\end{picture}
\end{frame}
\endgroup
}
\setbeamertemplate{caption label separator}{: }
\setbeamertemplate{caption}[numbered]
\usenavigationsymbolstemplate{}
\setbeamertemplate{footline}
{%
\vspace{\@pltheme@voffset}
}
\setbeamertemplate{footnote}
{%
\parindent 0em\noindent%
\raggedright
\usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
\setbeamertemplate{frametitle}{%
\vspace{\@pltheme@voffset}%
\if@protectFrameTitle%
\usebeamerfont{frametitle}\protect\MakeUppercase{\insertframetitle}\\
\else%
\usebeamerfont{frametitle}\MakeUppercase{\insertframetitle}\\
\fi%
\begin{picture}(0,0)
\put(-24.5, 7.5){\addvisualcounter}
\end{picture}
\vspace{\@pltheme@voffset}%
}
\pgfplotsset{
compat=1.12,
scale only axis,
tick align=outside,
every axis/.append style={
line width=0.2pt,
font=\normalsize\bfseries\rmfamily,
plFG,
},
xlabel style={
at={(ticklabel cs:0)},
anchor=north west,
},
ylabel style={
at={(ticklabel cs:0)},
anchor=south west,
},
tick label style={
font=\small\mdseries,
plFG,
},
major grid style={
dotted,
plFG!50!plBG
},
disable thousands separator/.style={
/pgf/number format/.cd,
1000 sep={}
}
}
\mode<all>
\let\otp\titlepage
\renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
\newcommand{\mreducelistspacing}{\vspace{-\topsep}}
\linespread{1.15}