-
Notifications
You must be signed in to change notification settings - Fork 6
/
beamerinnerthemeprogressbar.sty
346 lines (297 loc) · 14.7 KB
/
beamerinnerthemeprogressbar.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
339
340
341
342
343
344
345
346
\ProvidesPackage{beamerinnerthemeprogressbar}[2007/06/21]
% Beamer theme by Sylvain Bouveret <sylvain[dot]bouveret[aT]cert[DoT]fr>
% sep. 2010 version 0.42
%
% 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}
\usetikzlibrary{fadings}
\RequirePackage{ifthen}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Processing options...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\def\progressbar@headline{none}%
\def\progressbar@frametitle{picture-section}%
\def\progressbar@imagename{images/umd_cbcb_logo_black}%
\def\progressbar@titlepage{picture}%
\define@key{progressbar}{headline}[none]{%
\def\progressbar@headline{#1}%
}
\define@key{progressbar}{frametitle}[picture]{%
\def\progressbar@frametitle{#1}%
}
\define@key{progressbar}{imagename}{%
\def\progressbar@imagename{#1}%
\pgfdeclareimage[width=\textwidth,interpolate=true]{headlineimage}{\progressbar@imagename}
}
\define@key{progressbar}{titlepage}[picture]{%
\def\progressbar@titlepage{#1}%
}
\def\progressbaroptions#1{\setkeys{progressbar}{#1}}
\def\insertintermediateframenumber{\inserttotalframenumber}
% This piece of code is just to make the code Babel-compliant with every
% language.
% It comes from:
% http://forum.mathematex.net/latex-f6/beamer-et-shorthandoff-t3851.html
\makeatletter
\newboolean{@twopt} \setboolean{@twopt}{false}
\newcommand*{\twoptoff}{\ifnum \catcode`\;=13 \catcode`\;=12 \setboolean{@twopt}{true} \fi}
\newcommand*{\twopton}{\if@twopt \catcode`\;=13 \setboolean{@twopt}{false} \fi}
%
%
\mode<presentation>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Bibliography...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\biblio}[1]{
\begin{center}
\usebeamercolor{block body}
\begin{tikzpicture}
\draw node[draw=black!20!bg, fill=bg, rounded corners=2pt] {\parbox{0.95\textwidth}{\vskip-0.1cm\putbib[#1]\vskip0.1cm}};
\end{tikzpicture}
\twopton{}
\end{center}
}
\defbeamertemplate*{bibliography item}{progressbar theme}{
\begin{tikzpicture}[rounded corners=1pt]
\useasboundingbox (-0.1, 0.3) rectangle (0.4, 0.5);
\fill[fill=structure.fg!25!structure.bg] (0, 0.25) rectangle (0.4, 0.5);
\shade[bottom color=structure.bg,top color=structure.fg!25!structure.bg] (0, 0) -- (0.3, 0) -- (0.4, 0.12) -- (0.4, 0.3) -- (0, 0.3) -- cycle;
\shade[left color=structure.bg,right color=structure.fg!30!structure.bg] (0,0.27) .. controls (0.25,0.25) .. (0.4,0.5) -- (0,0.5) -- cycle;
\fill[fill=structure.bg!80!structure.fg] (0,0) rectangle (0.3,0.05);
\shade[left color=structure.bg!95!structure.fg,right color=structure.bg!80!structure.fg] (0,0) rectangle (0.05,0.5);
\shade[left color=structure.bg,right color=structure.bg!50!structure.fg,shading angle=45] (0.3,0) -- (0.3,0.12) -- (0.4,0.12) -- cycle;
\draw[draw=structure.fg!35!structure.bg] (0,0) -- (0.3,0) -- (0.4,0.12) -- (0.4,0.5) -- (0,0.5) -- cycle;
\draw[draw=structure.fg!35!structure.bg](0.3,0) -- (0.3,0.12) -- (0.4,0.12);
\end{tikzpicture}
}
\def\bibitem{\@ifnextchar<{\beamer@bibitem@store}{\gdef\beamer@bibstore{}\beamer@plainbibitem}}
\def\beamer@bibitem@store<#1>{\gdef\beamer@bibstore{<#1>}\beamer@plainbibitem}
\def\beamer@plainbibitem{\@ifnextchar[\@lbibitem\beamer@bibitem}
\def\@lbibitem[#1]#2{\expandafter\item\beamer@bibstore[\@biblabel{#1}\hfill]%
\@ifundefined{beamerbib@#2@\the\c@framenumber}{\if@filesw%
{\let\protect\noexpand%
\immediate\write\@auxout%
{\string\bibcite{#2}{\noexpand\hyperlink{beamerbib#2}{#1}}}}\fi%
\global\@namedef{beamerbib@#2@\the\c@framenumber}{\relax}%
\hypertarget{beamerbib#2}{}%
}{}%
\def\newblock{\beamer@newblock}\newblock\hskip-0.8ex}% This is really dirty !
% \hbox{}\ignorespaces}
\def\beamer@bibitem#1{\@bibitem{#1}\ignorespaces}
\def\@bibitem#1{\expandafter\item\beamer@bibstore\@ifundefined{beamerbib@#1@\the\c@framenumber}%
{\if@filesw \immediate\write\@auxout
{\string\bibcite{#1}{\noexpand\hyperlink{beamerbib#1}{\the\value{\@listctr}}}}\fi%
\global\@namedef{beamerbib@#1@\the\c@framenumber}{\relax}%
\hypertarget{beamerbib#1}{}}%
{}%
\def\newblock{\beamer@newblock}\newblock}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Blocks...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% A factorized code for blocks (strictly equivalent to the following
%% commented one, but cleaner)... By Cédric Mauclair (Onera)
%%
%%% \newbox\progressbar@blockbox
%%% \newlength\progressbar@blockboxwidth
%%% \newlength\progressbar@blockboxheight
%%%
%%% \def\myunskip{\vskip0.1cm}
%%% \let\progressbar@origcramped=\beamer@cramped
%%%
%%% \newcommand{\defblock}[1][]{
%%% \setbeamertemplate{block \ifx#1\@empty\else#1\space\fi begin}{%
%%% \global\let\beamer@firstlineitemizeunskip=\myunskip%
%%% \def\beamer@cramped{\itemsep0cm\topsep0cm\vskip-0.6cm\relax}%
%%% \setbox\progressbar@blockbox=\hbox to 0.95\textwidth\bgroup\vbox\bgroup\raggedright\begin{minipage}{0.95\textwidth} \ifx\insertblocktitle\@empty\else{\usebeamerfont{block title\ifx#1\@empty\else\space#1\fi}\usebeamercolor[fg]{block title\ifx#1\@empty\else\space#1\fi}\insertblocktitle}\\[-0.3cm]\twoptoff{}% JustTo be "babel-safe"
%%% \usebeamercolor{block title\ifx#1\@empty\else\space#1\fi} \tikz\draw[fg!50!bg] (0,0) -- (\textwidth,0);\twopton{}\\\fi\usebeamerfont{block body\ifx#1\@empty\else\space#1\fi}\usebeamercolor[fg]{block body\ifx#1\@empty\else\space#1\fi} } \setbeamertemplate{block \ifx#1\@empty\else#1\space\fi end}{%
%%% \end{minipage}\egroup\egroup%
%%% \usebeamercolor{block title\ifx#1\@empty\else\space#1\fi}
%%% \begin{center}\begin{tikzpicture} \draw node[draw=fg!50!bg,fill=bg,rounded corners=2pt] {\box\progressbar@blockbox};
%%% \end{tikzpicture} \end{center} } }
%%%
%%% \defblock
%%% \defblock[example]
%%% \defblock[alerted]
%%
%% A factorized code for blocks (strictly equivalent to the following
%% commented one, but cleaner)... By Cédric Mauclair (Onera)
%%
\newbox\progressbar@blockbox
% The ultimate trick to prevent the itemize-inside-blocks bug from happening...
\let\progressbar@tempitemize=\itemize
\def\progressbar@itemize{\ifhmode\else\vskip-0.85\topsep\fi\progressbar@tempitemize}
%
\defbeamertemplate*{block begin}{progressbar theme}
{
\setbox\progressbar@blockbox=\hbox to 0.95\textwidth\bgroup\vbox\bgroup\raggedright\begin{minipage}{0.95\textwidth} \ifx\insertblocktitle\@empty\else{\usebeamerfont{block title}\usebeamercolor{block title}\emph{\insertblocktitle}}\\[-0.3cm]% Just to be "babel-safe"
\twoptoff{}\tikz\draw[black!20!bg] (0, 0) -- (\textwidth, 0);\twopton{}\fi\usebeamerfont{block body}\global\let\itemize=\progressbar@itemize\par
}
\defbeamertemplate*{block end}{progressbar theme}
{
\global\let\itemize=\progressbar@tempitemize\end{minipage}\egroup\egroup
\usebeamercolor{block body}
{\centering
\begin{tikzpicture}
\draw (0, 0) node[draw=fg!20!bg,fill=bg, rounded corners=2pt] (box) {\box\progressbar@blockbox};
\end{tikzpicture}}
}
\defbeamertemplate*{block alerted begin}{progressbar theme}
{
\setbox\progressbar@blockbox=\hbox to 0.95\textwidth\bgroup\vbox\bgroup\raggedright\begin{minipage}{0.95\textwidth}{\usebeamerfont{block title alerted}\color{alerted text.fg}\insertblocktitle}\\[-0.3cm]\twoptoff{}% Just to be "babel-safe"
\usebeamercolor{block body alerted}
\tikz\draw[fg!20!bg] (0, 0) -- (\textwidth, 0);\twopton{}\usebeamerfont{block body alerted}\usebeamercolor{block body}\global\let\itemize=\progressbar@itemize\par
}
\defbeamertemplate*{block alerted end}{progressbar theme}
{
\global\let\itemize=\progressbar@tempitemize\end{minipage}\egroup\egroup
\usebeamercolor{block body alerted}
{\centering
\begin{tikzpicture}
\draw node[draw=fg!20!bg,fill=bg, rounded corners=2pt] {\box\progressbar@blockbox};
\end{tikzpicture}}
}
\defbeamertemplate*{block example begin}{progressbar theme}
{
\setbox\progressbar@blockbox=\hbox to 0.95\textwidth\bgroup\vbox\bgroup\raggedright\begin{minipage}{0.95\textwidth}{\usebeamerfont{block title example}\color{example text.fg}\insertblocktitle}\\[-0.3cm]\twoptoff{}% Just to be "babel-safe"
\usebeamercolor{block body example}
\tikz\draw[fg!20!bg] (0, 0) -- (\textwidth, 0);\twopton{}\usebeamerfont{block body example}\usebeamercolor{block body}\global\let\itemize=\progressbar@itemize\par
}
\defbeamertemplate*{block example end}{progressbar theme}
{
\global\let\itemize=\progressbar@tempitemize\end{minipage}\egroup\egroup
\usebeamercolor{block body example}
{\centering
\begin{tikzpicture}
\draw node[draw=fg!20!bg,fill=bg, rounded corners=2pt] {\box\progressbar@blockbox};
\end{tikzpicture}}
}
\defbeamertemplate*{block gblock begin}{progressbar theme}
{
\setbox\progressbar@blockbox=\hbox to 0.95\textwidth\bgroup\vbox\bgroup\raggedright\begin{minipage}{0.95\textwidth}{\usebeamerfont{block title example}\color{example text.fg}\insertblocktitle}\\[-0.3cm]\twoptoff{}% Just to be "babel-safe"
\usebeamercolor{block body example}
\tikz\draw[fg!20!bg] (0, 0) -- (\textwidth, 0);\twopton{}\usebeamerfont{block body example}\usebeamercolor{block body}\global\let\itemize=\progressbar@itemize\par
}
\defbeamertemplate*{block gblock end}{progressbar theme}
{
\global\let\itemize=\progressbar@tempitemize\end{minipage}\egroup\egroup
\usebeamercolor{block body example}
{\centering
\begin{tikzpicture}
\draw node[draw=fg!20!bg,fill=bg, rounded corners=2pt] {\box\progressbar@blockbox};
\end{tikzpicture}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Frame title...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\progressbar@separator{--}
\ifx\progressbar@imagename\@relax
\else
\pgfdeclareimage[width=0.30\textwidth,interpolate=true]{headlineimage}{\progressbar@imagename}
\fi
\ifx\progressbar@frametitle\@relax
\def\progressbar@frametitle{normal}
\fi
\defbeamertemplate*{frametitle}{progressbar theme}{
\edef\tempa{normal}
\ifx\progressbar@frametitle\tempa
\begin{centering}
\textbf{\insertframetitle}
\par
\end{centering}
\else
\edef\tempa{picture-subsection}
\ifx\progressbar@frametitle\tempa
\parbox[c]{0.13\textwidth}{\pgfuseimage{headlineimage}}
\parbox[c]{0.85\textwidth}{
\usebeamercolor{frametitle}{\scriptsize \ifx\insertsection\@empty\ \else\insertsection\fi\ifx\insertsubsection\@empty\else\ \progressbar@separator\ \insertsubsection\fi}\\[-0.3cm]\rule{0.7\textwidth}{0.5pt}\par%\vskip-1cm\rule{0.7\textwidth}{0.5pt}\par
\textbf{\vphantom{Hp}\insertframetitle}
}
\else
\edef\tempa{ckcompliant}
\ifx\progressbar@frametitle\tempa
\vskip2ex
%\parbox[c]{0.3\textwidth}{\pgfuseimage{headlineimage}}
\parbox[c]{0.9\textwidth}{
\textbf{\vphantom{Hp}\insertframetitle}
\usebeamercolor{frametitle}{}\\[-0.3cm]\rule{0.7\textwidth}{0.5pt}\par%
% \insertsubsection\fi}\\[-0.3cm]\rule{0.7\textwidth}{0.5pt}\par%\vskip-1cm\rule{0.7\textwidth}{0.5pt}\par
}
\else
\parbox[c]{0.13\textwidth}{\pgfuseimage{headlineimage}}
\parbox[c]{0.85\textwidth}{
\usebeamercolor{frametitle}{\scriptsize \ifx\insertsection\@empty\ \else\insertsection\fi}\\[-0.3cm]\rule{0.7\textwidth}{0.5pt}\par%\vskip-1cm\rule{0.7\textwidth}{0.5pt}\par
\textbf{\vphantom{Hp}\insertframetitle}
}
\fi
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Items...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\setbeamertemplate{items}[circle]
%\setbeamertemplate{itemize item}{\begin{tikzpicture}\draw[draw=progressbar@bgblue!60!white,fill=progressbar@bgblue!40!white] (0, 0) circle (0.07);\end{tikzpicture}}
\setbeamertemplate{itemize item}[triangle]
\setbeamertemplate{itemize subitem}[triangle]
% \setbeamertemplate{itemize item}{
% \begin{tikzpicture}\shade[ball color=fg!80!bg] (0, 0) circle (0.07);\draw[draw=fg!50!black!90!bg] (0, 0) circle (0.07);\end{tikzpicture}%
% }
% \setbeamertemplate{itemize subitem}{\begin{tikzpicture}\shade[ball color=fg!80!white] (0, 0) circle (0.05);\draw[draw=fg!50!black!90!bg] (0, 0) circle (0.05);\end{tikzpicture}}
% \setbeamertemplate{itemize subsubitem}{\begin{tikzpicture}\shade[ball color=fg!80!white] (0, 0) circle (0.05);\draw[draw=fg!50!black!90!bg] (0, 0) circle (0.05);\end{tikzpicture}}
% \setbeamertemplate{enumerate item}{\raisebox{-0.4ex}{\begin{tikzpicture}\shade[ball color=structure.fg!80!white] (0, 0) circle (0.07);\draw (0, 0) node [draw=structure.fg!50!black!90!bg, inner sep=1pt] {\tiny\color{white}\bf\insertenumlabel};\end{tikzpicture}}}
% \setbeamertemplate{enumerate subitem}{\raisebox{-0.4ex}{\begin{tikzpicture}\shade[ball color=structure.fg!80!white] (0, 0) circle (0.07);\draw (0, 0) node [draw=structure.fg!50!black!90!bg, inner sep=1pt] {\tiny\color{white}\bf\insertenumlabel};\end{tikzpicture}}}
\setbeamertemplate{enumerate item}{\raisebox{-0.4ex}{\begin{tikzpicture}\node [draw=fg!50!black!90!bg, inner sep=1pt, shading=ball, circle, ball color=fg!80!white] {\tiny\color{bg}\bf\insertenumlabel};\end{tikzpicture}}}
\setbeamertemplate{enumerate subitem}{\raisebox{-0.4ex}{\begin{tikzpicture}\node [draw=fg!50!black!90!bg, inner sep=1pt, shading=ball,circle, ball color=fg!80!white] {\tiny\color{bg}\bf\insertenumlabel};\end{tikzpicture}}}
\normalsize
\pgfdeclareradialshading[bg,parent.bg]{tocsphere}{\pgfpoint{-0.5ex}{0.6ex}}%
{%
color(0cm)=(structure.fg!35!white);
color(0.44ex)=(structure.fg!75!white);
color(0.88ex)=(structure.fg!70!black!90!bg);
color(1.2ex)=(structure.fg!50!black!90!bg);
color(1.3ex)=(structure.fg!50!black!90!bg)}
\pgfdeclareradialshading[structure.fg,bg]{bigsphere}{\pgfpoint{-0.1849315ex}{.2260273ex}}%
{%
color(0cm)=(structure.fg!15);
color(0.1643835ex)=(structure.fg!75);
color(0.3287671ex)=(structure.fg!70!black);
color(0.4520547ex)=(structure.fg!50!black);
color(0.53ex)=(structure.fg!50!black)}
\pgfdeclareradialshading[structure.fg,bg]{smallsphere}{\pgfpoint{-0.1479452ex}{0.18287671ex}}%
{%
color(0cm)=(structure.fg!15);
color(0.1315068ex)=(structure.fg!75);
color(0.2630136ex)=(structure.fg!70!black);
color(0.36164383ex)=(structure.fg!50!black);
color(0.427ex)=(bg)}
\setbeamertemplate{section in toc}
{\leavevmode%
\raisebox{-0.5ex}{\begin{tikzpicture}\node [draw=fg!50!black!90!bg, inner sep=1.5pt, shading=ball, circle, ball color=fg!80!white] {\scriptsize\color{bg}\bf\inserttocsectionnumber};\end{tikzpicture}}
\inserttocsection\par
}
\mode<handout>
\setbeamertemplate{frametitle}{
\setbeamercolor{frametitle}{fg=structure.fg,bg=white}
\usebeamercolor{frametitle}
{\color{fg}\bf \insertframetitle}
}
\mode
<all>
%%% Local Variables:
%%% TeX-master: "~/texmf/tex/latex/beamer/test/test.tex"
%%% End: