-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbeamerouterthemeprogressbar.sty
executable file
·201 lines (160 loc) · 7.23 KB
/
beamerouterthemeprogressbar.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
\ProvidesPackage{beamerouterthemeprogressbar}[2007/06/21]
% Beamer theme by Sylvain Bouveret <sylvain[dot]bouveret[aT]cert[DoT]fr>
% jun. 2007 version 0.32
%
% based on the LaTeX-Beamer package :
% Copyright 2003 by Till Tantau <[email protected]>
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 2.
\RequirePackage{tikz}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Some color definitions...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamercolor{progressbar primary}{parent=palette primary}
\setbeamercolor{progressbar secondary}{parent=palette secondary}
\setbeamercolor{progressbar tertiary}{parent=palette tertiary}
\setbeamercolor{progressbar quaternary}{parent=palette quaternary}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Some computations dedicated to the progressbar...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newdimen\progressbar@currentbarlength
\newdimen\progressbar@framenumberrectangle
\newdimen\progressbar@titlerectangle
\newdimen\progressbar@leftbar
\newdimen\progressbar@barlengthmm
\newcount\progressbar@tmpresult
\newcount\progressbar@numer
\newcount\progressbar@denom
\newcount\progressbar@barlength
\progressbar@framenumberrectangle=\paperwidth
\progressbar@titlerectangle=\paperwidth
\advance\progressbar@framenumberrectangle by -0.9cm
\advance\progressbar@titlerectangle by -1.1cm
\progressbar@barlength=115 % (in millimeters)
\progressbar@barlengthmm=\progressbar@barlength mm
\progressbar@leftbar=\progressbar@titlerectangle
\advance\progressbar@leftbar by -\progressbar@barlength mm
\def\insertprogressbar{
\ifnum\inserttotalframenumber=1\else
\progressbar@numer=\insertframenumber
\advance\progressbar@numer by -1
\progressbar@denom=\inserttotalframenumber
\advance\progressbar@denom by -1
\progressbar@tmpresult=\progressbar@barlength
\multiply\progressbar@tmpresult by \progressbar@numer
\divide\progressbar@tmpresult by \progressbar@denom
\progressbar@currentbarlength=\progressbar@tmpresult mm
\begin{tikzpicture}
\shade[top color=bg, bottom color=bg!80!fg] (0, 0) rectangle (\paperwidth, 0.6cm);
\shade[left color=bg,right color=bg!70!fg] (.5\paperwidth, 0.2cm) rectangle (\paperwidth, 0.22cm);
\draw (\progressbar@framenumberrectangle, 0.21cm) node [anchor=mid west, draw=bg!70!fg, fill=bg] {\color{structure.fg!70!bg}\insertframenumber~/~\inserttotalframenumber};
\draw (\progressbar@titlerectangle, 0.32cm) node [anchor=south east] {\color{bg!70!fg}\inserttitle};
\fill (\progressbar@leftbar, 0.12cm) [fill=bg, rounded corners=0.1cm] rectangle (\progressbar@titlerectangle, 0.3cm);
\ifnum\insertframenumber=1\else
\shade[left color=progressbar primary.fg!10!bg, right color=progressbar primary.fg!20!bg, rounded corners=0.1cm] (\progressbar@leftbar, 0.12cm) rectangle ++(\progressbar@currentbarlength, 0.2cm);
\fi
\draw (\progressbar@leftbar, 0.11cm) [draw=bg!70!fg, rounded corners=0.1cm] rectangle ++(\progressbar@barlengthmm, 0.2cm);
\end{tikzpicture}
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Definition of the customized templates...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>
\newlength\progressbar@sectionboxwidth
\newlength\progressbar@sectionboxheight
\newbox\progressbar@sectionbox
\newbox\progressbar@sectionboxbox
\usesectionheadtemplate
{\hfill
\setbox\progressbar@sectionbox=\hbox{\insertsectionhead}%
\progressbar@sectionboxwidth=\wd\progressbar@sectionbox
\advance\progressbar@sectionboxwidth by 4pt
\setbox\progressbar@sectionbox=\hbox{\pgfinterruptpicture t \endpgfinterruptpicture}%
\progressbar@sectionboxheight=\ht\progressbar@sectionbox
\advance\progressbar@sectionboxheight by 4pt
\begin{tikzpicture}
\useasboundingbox (-0.5\progressbar@sectionboxwidth, 0pt) rectangle (0.5\progressbar@sectionboxwidth, \progressbar@sectionboxheight);
\draw[anchor=base] (0pt, 2pt) node {\color{structure.fg!80!bg} \insertsectionhead};
\draw[rounded corners=3pt, draw=structure.fg!80!bg] (-0.5\progressbar@sectionboxwidth, 0pt) rectangle (0.5\progressbar@sectionboxwidth, \progressbar@sectionboxheight);
\end{tikzpicture}
}
{\hfill
\setbox\progressbar@sectionbox=\hbox{\pgfinterruptpicture\insertsectionhead\endpgfinterruptpicture}%
\progressbar@sectionboxwidth=\wd\progressbar@sectionbox
\advance\progressbar@sectionboxwidth by 4pt
\setbox\progressbar@sectionboxbox=\hbox{\pgfinterruptpicture t \endpgfinterruptpicture}%
\progressbar@sectionboxheight=\ht\progressbar@sectionboxbox
\advance\progressbar@sectionboxheight by 4pt
\begin{tikzpicture}
\useasboundingbox (-0.5\progressbar@sectionboxwidth, 0pt) rectangle (0.5\progressbar@sectionboxwidth, \progressbar@sectionboxheight);
\draw[anchor=base] (0pt, 2pt) node {\color{structure.fg!50!bg} \insertsectionhead};
\end{tikzpicture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Headline...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\defbeamertemplate*{headline}{progressbar theme}{
\leavevmode%
\begin{beamercolorbox}[wd=\paperwidth,ht=4ex,dp=1.125ex]{}%
\insertsectionnavigationhorizontal{\paperwidth}{}{}%\hskip0pt plus1filll}{}%
\end{beamercolorbox}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Footline...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\defbeamertemplate*{footline}{progressbar theme}{
% \begin{beamercolorbox}[wd=\paperwidth,ht=0.6cm,dp=0ex]{progressbar in head/foot}%
% \insertprogressbar
% \end{beamercolorbox}%
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Title page...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\institute{(void)}
\defbeamertemplate*{title page}{progressbar theme}{
\pgfdeclarehorizontalshading{separationtitlepagelineshading}{0.5pt}{color(0cm)=(bg); color(0.5\textwidth)=(structure.fg); color(\textwidth)=(bg)}
\makeatletter
\begin{center}
\textbf{\textcolor{structure.fg}\large\inserttitle} \\[\baselineskip]
{\footnotesize CDS meeting - February 14th, 2018}
\pgfuseshading{separationtitlepagelineshading}
\vskip\baselineskip
\insertauthor\\[\baselineskip]
\ifx\insertinstitute\@empty \else\footnotesize\insertinstitute\\[\baselineskip]\fi
\insertlogo
\vskip\baselineskip
\end{center}
\makeatother
}
\setbeamertemplate{title page}[mytitlepage]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Background...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\defbeamertemplate*{background canvas}{progressbar theme}{\pgfuseshading{background shading}}%[action]
%\AtBeginDocument{%
% {
% \usebeamercolor{progressbar primary}
% \pgfdeclareverticalshading{background shading}{\the\paperwidth}{color(0cm)=(normal text.bg); color(0.8\paperheight)=(normal text.bg); color(0.95\paperheight)=(progressbar primary.bg); color(\paperheight)=(progressbar primary.bg)
% }
% }
%}
\mode
<all>
\makeatother