-
Notifications
You must be signed in to change notification settings - Fork 1
/
beamerthemeCEA.sty
402 lines (349 loc) · 14.9 KB
/
beamerthemeCEA.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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
\mode<presentation>
% fonts
\usefonttheme{professionalfonts} % turn off Beamer math replacements
% set computer modern sans serif greeks and symbols
\SetSymbolFont{letters}{normal}{OML}{cmssm}{m}{it}
\SetSymbolFont{largesymbols}{normal}{OMX}{cmssex}{m}{n}
\RequirePackage{helvet} % must be loaded before sfmath
\RequirePackage{sfmath}
\SetMathAlphabet{\mathbb}{normal}{U}{dsss}{m}{n}
\RequirePackage[cal=zapfc, calscaled=1.15]{mathalfa}
% layout and graphics
\RequirePackage[T1]{fontenc} % seems necessary to get correct \textgreater
% \RequirePackage{enumitem} % incompatible with beamer
\RequirePackage{calc}
\RequirePackage{array}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{graphicx}
\RequirePackage{tikz}
\RequirePackage{lettrine}
\newcommand*{\CEAi}{\raisebox{.25ex}{\includegraphics[height=.5ex]{graphics/bullet1.png}}}
\newcommand*{\CEAii}{\raisebox{.25ex}{\includegraphics[height=.5ex]{graphics/bullet2.png}}}
\newlength{\CEAilen} \setlength{\CEAilen}{\widthof{\CEAi}}
\newlength{\CEAiilen} \setlength{\CEAiilen}{\widthof{\CEAii}}
\newlength{\CEAilensep} \setlength{\CEAilensep}{\CEAilen+3mm}
\newlength{\CEAiilensep} \setlength{\CEAiilensep}{\CEAiilen+3mm}
% \setlist[itemize,1]{label=\CEAi,labelsep=3mm,labelwidth=\CEAilen,leftmargin=\CEAilensep,itemindent=0pt} % enumitem incompatible with beamer
% \setlist[itemize,2]{label=\CEAii,labelsep=3mm,labelwidth=\CEAiilen,leftmargin=\CEAiilensep,itemindent=0pt} % enumitem incompatible with beamer
\setbeamertemplate{itemize item}{\tiny\raise1pt\hbox{\donotcoloroutermaths$\blacksquare$}}
\setbeamertemplate{itemize subitem}{\tiny\raise0.5pt\hbox{\textcolor{black}{$\blacksquare$}}}
\newcommand{\insertseminar}{}
\newcommand{\insertshortseminar}{}
\newcommand{\insertdepartment}{}
\newcommand{\insertshortdepartment}{}
\newcommand{\insertservice}{}
\newcommand{\insertshortservice}{}
\newcommand{\insertframetitlelogo}{}
\newcommand{\inserttitlepagelogo}{}
\newcommand{\inserttitlepagepicture}{}
\newcommand{\insertCEAname}{}
\newcommand{\insertCEAcenter}{}
\newcommand{\insertaddr}{}
\newcommand{\inserttel}{}
\newcommand{\insertfax}{}
\newcommand{\insertCEAstatus}{}
\newcommand{\insertCEArcs}{}
\newcommand{\insertCEAmerci}{}
\newcommand{\insertCEAemail}{}
\newcommand{\seminar}[2][\insertseminar]{
\renewcommand{\insertshortseminar}{#1}
\renewcommand{\insertseminar}{#2}
}
\newcommand{\department}[2][\insertdepartment]{
\renewcommand{\insertshortdepartment}{#1}
\renewcommand{\insertdepartment}{#2}
}
\newcommand{\service}[2][\insertservice]{
\renewcommand{\insertshortservice}{#1}
\renewcommand{\insertservice}{#2}
}
\newcommand{\CEAname}[1]{\renewcommand{\insertCEAname}{#1}}
\newcommand{\CEAcenter}[1]{\renewcommand{\insertCEAcenter}{#1}}
\newcommand{\addr}[1]{\renewcommand{\insertaddr}{#1}}
\newcommand{\tel}[1]{\renewcommand{\inserttel}{#1}}
\newcommand{\fax}[1]{\renewcommand{\insertfax}{#1}}
\newcommand{\CEAstatus}[1]{\renewcommand{\insertCEAstatus}{#1}}
\newcommand{\CEArcs}[1]{\renewcommand{\insertCEArcs}{#1}}
\newcommand{\CEAemail}[1]{\renewcommand{\insertCEAemail}{#1}}
\newcommand{\CEAmerci}[1]{\renewcommand{\insertCEAmerci}{#1}}
\newcommand{\frametitlelogo}[1]{\renewcommand{\insertframetitlelogo}{#1}}
\newcommand{\titlepagelogo}[1]{\renewcommand{\inserttitlepagelogo}{#1}}
\newcommand{\titlepagepicture}[1]{\renewcommand{\inserttitlepagepicture}{#1}}
% some length
\newlength{\textleftmargin}
\setlength{\textleftmargin}{9mm}
\newlength{\textrightmargin}
\setlength{\textrightmargin}{9mm}
\newlength{\titlepagebannerwidth}
\setlength{\titlepagebannerwidth}{0.6\paperwidth}
\newlength{\frametitleheight}
\setlength{\frametitleheight}{0.1\paperheight}
\newlength{\frametitlemargin}
\setlength{\frametitlemargin}{22mm}
\newlength{\footlinesep}
\setlength{\footlinesep}{3.5mm}
\newlength{\lastpagebannerwidth}
\setlength{\lastpagebannerwidth}{0.3\paperwidth}
\newlength{\titlepagepicturewidth}
\newlength{\titleverticalspace}
\setbeamersize{sidebar width left=0pt,sidebar width right=0pt,
text margin left=\textleftmargin,text margin right=\textrightmargin}
\makeatletter
% something between scriptsize and tiny
\newcommand\notsotiny{\@setfontsize\notsotiny\@vipt\@viipt}
%% Define a HUGE
\newcommand\HUGE{\@setfontsize\Huge{27}{38}}
\makeatother
\setbeamerfont{title}{size=\Large, series=\bfseries}
\setbeamerfont{subtitle}{size=\large, series=\mdseries}
\setbeamerfont{block title}{size=\normalsize}
\setbeamerfont{frametitle}{size=\Large, series=\bfseries}
\setbeamerfont{framesubtitle}{size=\large, series*={m}}
\setbeamerfont{author}{size=\scriptsize}
\setbeamerfont{date}{size=\scriptsize}
\setbeamerfont{footline}{size=\notsotiny}
\setbeamerfont{impressum}{size=\Tiny}
\setbeamerfont{status}{size=\TINY}
\setbeamerfont{section in toc}{series=\bfseries}
\setbeamerfont{section number projected}{series=\bfseries, size=\large}
% color theme
\definecolor{CEAgray}{rgb}{.15,.15,.15} % 38 38 38
\definecolor{CEAlightgray}{rgb}{.55,.55,.55} % 141 141 141
\definecolor{CEAred}{rgb}{.89,.0,.10} % 229 0 25
\definecolor{CEAgreen}{rgb}{.59,.76,.12} % 150 195 30
\definecolor{CEAblue}{rgb}{.24,.29,.51} % 62 74 131
\setbeamercolor{title}{fg=CEAgray}
\setbeamercolor{normal text}{fg=CEAgray}
\setbeamercolor{frametitle}{fg=CEAred}
\setbeamercolor{framesubtitle}{fg=CEAred}
\setbeamercolor{structure}{fg=CEAred}
\setbeamercolor{footline}{fg=CEAlightgray}
\setbeamercolor{page number}{fg=CEAred}
\setbeamercolor{impressum}{fg=white}
\setbeamercolor{service}{fg=CEAblue}
\setbeamercolor{alerted text}{fg=CEAred}
\setbeamercolor{section in toc}{fg=black}
\setbeamercolor{section number projected}{fg=CEAred,bg=white}
\setbeamercolor*{block title}{fg=white,bg=black}
\setbeamercolor*{block body}{fg=black,bg=black!5}
\setbeamercolor*{block title alerted}{fg=white,bg=CEAred}
\setbeamercolor*{block body alerted}{fg=CEAred,bg=CEAred!5}
\setbeamercolor*{block title example}{fg=white,bg=CEAblue}
\setbeamercolor*{block body example}{fg=CEAblue,bg=CEAblue!5}
\setbeamertemplate{navigation symbols}{}
% \setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{headline}{}
% \setbeamertemplate{section in toc}[square]
\setbeamertemplate{section in toc}{%
\leavevmode\leftskip=1.75ex%
\llap{%
\usebeamerfont*{section number projected}%
\usebeamercolor[bg]{section number projected}%
\vrule width2.25ex height1.85ex depth.4ex%
\hskip-2.25ex%
\hbox to2.25ex{\hfil\color{fg}\inserttocsectionnumber.\hfil}}%
\kern1.25ex\inserttocsection\par}
\pgfdeclareimage[interpolate=true,width=\paperwidth,height=\paperheight]{background1}{graphics/background-1.pdf}
\pgfdeclareimage[interpolate=true,width=\paperwidth,height=\paperheight]{background2}{graphics/background-2.pdf}
\pgfdeclareimage[interpolate=true,width=\paperwidth,height=\paperheight]{backgroundwhite}{graphics/background-white-forphoto.pdf}
\newcommand{\insertcealogo}{\includegraphics[height=4ex]{graphics/LOGO-CEA_ORIGINAL.pdf}}
\setbeamertemplate{background}{
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle (\the\paperwidth,\the\paperheight);
\newcommand\tempa{}
\ifx\inserttitlepagepicture\tempa%
\pgftext[at=\pgfpoint{0}{0},left,base]{\pgfuseimage{background1}};
\else%
\pgftext[at=\pgfpoint{0}{0},left,base]{\includegraphics[height=\paperheight,width=\paperwidth]{\inserttitlepagepicture}}
\pgftext[at=\pgfpoint{0}{0},left,base]{\pgfuseimage{backgroundwhite}};
\fi%
\ifnum\thepage>1\relax%
\useasboundingbox (0,0) rectangle (\the\paperwidth,\the\paperheight);
\pgftext[at=\pgfpoint{0}{0},left,base]{\pgfuseimage{background2}};
\fi
\end{tikzpicture}
}
\defbeamertemplate*{title page}{CEA}[1][]{
\begin{textblock*}{\widthof{\inserttitlepagelogo}}[0,2.2](\textleftmargin,\paperheight)
\vfill \inserttitlepagelogo \vspace*{12.5mm}
\end{textblock*}
% set title banner width depending on whether we have a picture or not
\newcommand\tempa{}
\ifx\inserttitlepagepicture\tempa%
\setlength{\titleverticalspace}{2.5ex}
\else%
\setlength{\titlepagepicturewidth}{0.4\paperwidth}
\setlength{\titlepagebannerwidth}{0.4\paperwidth}
\setlength{\titleverticalspace}{1.5ex}
\fi%
\begin{textblock*}{\titlepagebannerwidth}[0,-0.15](\textleftmargin,.37\paperheight)
\begin{beamercolorbox}[left,#1]{title}
\usebeamerfont{title}\inserttitle
\end{beamercolorbox}%
\ifx\insertsubtitle\@empty%
\vspace{3ex}
\else%
\vspace{1.5ex}
\begin{beamercolorbox}[left,#1]{subtitle}
\usebeamerfont{subtitle}\insertsubtitle
\end{beamercolorbox}%
\fi%
\vspace{\titleverticalspace}
\begin{beamercolorbox}[left,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}%
\vspace{\titleverticalspace}
\begin{beamercolorbox}[left,#1]{seminar}
\usebeamerfont{seminar}\insertseminar
\end{beamercolorbox}%
\vspace{1ex}
\begin{beamercolorbox}[left,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}%
\end{textblock*}
}
\defbeamertemplate*{frametitle}{CEA}[1][]{
\begin{textblock*}{\paperwidth}[0.08,0.75](\frametitlemargin,.8\frametitleheight)
\begin{beamercolorbox}{frametitle}
\usebeamerfont{frametitle}\insertframetitle
\end{beamercolorbox}
\end{textblock*}
\begin{textblock*}{\paperwidth}[1.17,1.1](\paperwidth,.8\frametitleheight)
\hfill \insertframetitlelogo \hspace*{2mm}
\end{textblock*}
\ifx\insertframesubtitle\@empty%
\vspace{1\frametitleheight}
\else% subtitle height is .6 title height
\begin{textblock*}{\paperwidth}[0,.5](\frametitlemargin,1.3\frametitleheight)
\begin{beamercolorbox}{framesubtitle}
\usebeamerfont*{framesubtitle}\insertframesubtitle
\end{beamercolorbox}%
\end{textblock*}
\vspace{1.1\frametitleheight} % for some reasons (why?), the full 1.6 is too big
\fi
}
\defbeamertemplate*{footline}{CEA}[1][]{
\leavevmode%
\hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=\footlinesep,leftskip=0.4\textleftmargin,rightskip=.3cm]{footline}%
\raisebox{-1.2ex}{\insertcealogo}\hspace{5pt}
\usebeamerfont{footline}
\insertshortauthor{}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=\footlinesep,right,leftskip=.3cm,rightskip=0.85\textrightmargin,#1]{footline}%
\usebeamerfont{footline}
\hfill\insertshortseminar{} \hspace{20pt} \insertshortdate{} \hspace{20pt} \textbf{\usebeamercolor[fg]{page number}\insertframenumber{} / \inserttotalframenumber}
\end{beamercolorbox}}%
\vskip0pt%
}
\defbeamertemplate*{last page}{CEA}[1][]{
\begin{textblock*}{\paperwidth}[1,0](\paperwidth,0pt)
\includegraphics[height=\paperheight]{graphics/background-1.pdf}
\end{textblock*}
\begin{textblock*}{\widthof{\inserttitlepagelogo}}[.26,2.2](.5\titlepagebannerwidth,\paperheight)
\vfill \inserttitlepagelogo \vspace*{12.5mm}
\end{textblock*}
\begin{textblock*}{0.6\paperwidth}[0.9,-3](0.6\paperwidth,.37\paperheight)
\begin{beamercolorbox}[left,#1]{title}
\usebeamerfont{title}\Large\insertCEAmerci
\end{beamercolorbox}%
\end{textblock*}
\begin{textblock*}{0.6\paperwidth}[-0.15,-2](0.6\paperwidth,.37\paperheight)
\begin{beamercolorbox}[left,#1]{author}
\usebeamerfont{author}\textbf{\insertCEAcenter}\\\insertaddr\\\insertCEAemail
\end{beamercolorbox}%
\end{textblock*}
}
\newcommand{\tocframe}[1]{
\begin{frame}
\frametitle{#1}
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[width=\paperwidth]{graphics/background-toc}
};
\end{tikzpicture}
\tableofcontents
\end{frame}
}
\newcommand{\tocframecurrent}[1]{
\begin{frame}
\frametitle{#1}
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[width=\paperwidth]{graphics/background-toc}
};
\end{tikzpicture}
\tableofcontents[current]
\end{frame}
}
\newcommand{\sepframewhite}[1]{
\begin{frame}[c]
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[width=\paperwidth]{graphics/background-white}
};
\end{tikzpicture}
\begin{textblock*}{0.6\paperwidth}[0,0](0.27\paperwidth,0.42\paperheight)
\textbf{\HUGE \lettrine[lraise=0.1, nindent=0em, slope=-.5em]{\color{CEAred}\insertsectionnumber.}{}\insertsection}
\vspace{2ex} #1
\end{textblock*}
\end{frame}
}
\newcommand{\sepframered}[1]{
\setbeamercolor{footline}{fg=white}
\setbeamercolor{page number}{fg=white}
\renewcommand{\insertcealogo}{\includegraphics[height=4ex]{graphics/LOGO-CEA_ROUGE-SUR-BLANC.pdf}}
\begin{frame}[c]
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[width=\paperwidth]{graphics/background-red}
};
\end{tikzpicture}
\begin{textblock*}{0.6\paperwidth}[0,0](0.27\paperwidth,0.42\paperheight)
{\color{white}
\textbf{\HUGE \lettrine[lraise=0.1, nindent=0em, slope=-.5em]{\insertsectionnumber.}{}\insertsection}
\vspace{2ex} #1}
\end{textblock*}
\end{frame}
\setbeamercolor{footline}{fg=CEAlightgray}
\setbeamercolor{page number}{fg=CEAred}
\renewcommand{\insertcealogo}{\includegraphics[height=4ex]{graphics/LOGO-CEA_ORIGINAL.pdf}}
}
\newcommand{\sepframeblack}[1]{
\setbeamercolor{footline}{fg=white}
\setbeamercolor{page number}{fg=white}
\begin{frame}[c]
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[width=\paperwidth]{graphics/background-black}
};
\end{tikzpicture}
\begin{textblock*}{0.6\paperwidth}[0,0](0.27\paperwidth,0.42\paperheight)
{\color{white}
\textbf{\HUGE \lettrine[lraise=0.1, nindent=0em, slope=-.5em]{\color{CEAred} \insertsectionnumber.}{}\insertsection}
\vspace{2ex} #1}
\end{textblock*}
\end{frame}
\setbeamercolor{footline}{fg=CEAlightgray}
\setbeamercolor{page number}{fg=CEAred}
}
\newcommand{\sepframeblue}[1]{
\setbeamercolor{footline}{fg=white}
\setbeamercolor{page number}{fg=white}
\begin{frame}[c]
\begin{tikzpicture}[remember picture,overlay]
\node[at=(current page.center)] {
\includegraphics[width=\paperwidth]{graphics/background-blue}
};
\end{tikzpicture}
\begin{textblock*}{0.6\paperwidth}[0,0](0.27\paperwidth,0.42\paperheight)
{\color{white}
\textbf{\HUGE \lettrine[lraise=0.1, nindent=0em, slope=-.5em]{\insertsectionnumber.}{}\insertsection}
\vspace{2ex} #1}
\end{textblock*}
\end{frame}
\setbeamercolor{footline}{fg=CEAlightgray}
\setbeamercolor{page number}{fg=CEAred}
}
\mode<all>
\newcommand{\myexample}[1]{\textcolor{CEAblue}{#1}}
%\input{appendixnumberbeamer.sty}