Repository navigation
Expand file tree
/
Copy pathbeamerouterthemeUAM.sty
More file actions
270 lines (235 loc) · 9.76 KB
/
Copy pathbeamerouterthemeUAM.sty
File metadata and controls
270 lines (235 loc) · 9.76 KB
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
% Copyright 2009--2011 by Nico Schlömer
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
% UA page geometry
% \geometry{paperheight=7.5in,paperwidth=10.0in}
% ... Hang on! As suggested in the manual, don't mess around with beamer's
% assumed page dimensions (128mm x 96mm). Fonts, for example, do no get
% automatically scaled and will look tiny if the above is executed.
% Instead, define a multiplier 12.8/(10.0*2.54) = 64/127 and adjust all
% respective lengths.
% ----------------------------------------------------------------------------
% *** required packages <<<
% ----------------------------------------------------------------------------
\RequirePackage{calc}
\RequirePackage{ifthen}
% ----------------------------------------------------------------------------
% *** END required packages >>>
% ----------------------------------------------------------------------------
\mode<presentation>
% ----------------------------------------------------------------------------
% *** DEFINE LENGTHS <<<
% ----------------------------------------------------------------------------
\newlength{\margin}
\setlength{\margin}{0.8832cm}% 0.69in* 64/127 *2.54cm/in
\newlength{\ulogowidth}
\setlength{\ulogowidth}{2.5cm}% 0.87in* 64/127 *2.54cm/in
\newlength{\ulogoheight}
\setlength{\ulogoheight}{1.238cm}% 0.70364761837273193in* 64/127 *2.54cm/in
\ifbeamer@dark\else%
\newlength{\ulogopadding}
% padding = distance from the rightmost point of the logo to where the U starts;
% value approximately \ulogowidth*0.25
\setlength{\ulogopadding}{0.2784cm}
\fi
% ----------------------------------------------------------------------------
% *** END DEFINE LENGTHS >>>
% ----------------------------------------------------------------------------
% ----------------------------------------------------------------------------
% *** DEFINE IMAGES <<<
% ----------------------------------------------------------------------------
\pgfdeclareimage[width=\ulogowidth]{ULogo}{images/universidad-autonoma-madrid-variante}
\pgfdeclareimage[width=1.2cm]{ULogoMini}{images/universidad-autonoma-madrid-variante}
% The text logo is a bit of a special case:
% As given in the PowerPoint(R) slides, the logo is 3.12''x0.36'', the picture file
% 449px x 52px. However, in the picture file, there is a margin of
% left: 3px, right: 3px, top: 8px, bottom: 2px.
% The PDF that we use here does not have any margins, so adapt the sizes here.
\newlength{\textlogoheight}
\setlength{\textlogoheight}{0.37218461538461539cm}% 0.36in* 64/127 *2.54cm/in * 42px/52px
\ifthenelse{ \boolean{beamer@dark} \OR \boolean{beamer@darktitle} }
% then
{\pgfdeclareimage[width=\paperwidth]{uaBackgroundDark}{images/uaBackgroundDarkBlue}}
%else
{}
\ifbeamer@dark%
\pgfdeclareimage[width=\paperwidth]{uaBackgroundLight}{images/uaBackgroundLightBlue}
\else%
\newlength{\wavewidth}
\setlength{\wavewidth}{11.6352cm}% 9.09in* 64/127 *2.54cm/in
\newlength{\waveheight}
\setlength{\waveheight}{0.7936cm}% 0.62in* 64/127 *2.54cm/in
\pgfdeclareimage[width=\wavewidth,height=\waveheight]{uWave}{images/uabottomwave}
\fi
% ----------------------------------------------------------------------------
% *** END DEFINE IMAGES <<<
% ----------------------------------------------------------------------------
% ----------------------------------------------------------------------------
% *** HEADLINE <<<
% ----------------------------------------------------------------------------
\ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }{%
\defbeamertemplate*{headline}{ua theme}%
{
% page number
\ifbeamer@framenumber%
\ifnum\c@framenumber=1\else
\pgftext[right,top,at=\pgfpoint{\paperwidth-\margin}{-0.04\paperheight}]{%
\usebeamerfont{frame number in head}%
\usebeamercolor[fg]{frame number in head}%
\insertframenumber{}%
\ifbeamer@totalframenumber%
/\inserttotalframenumber%
\fi
}%
\fi
\fi%
}%
}{
\newlength{\logotopmargin}%
\setlength{\logotopmargin}{0.704cm}% 0.55in* 64/127 *2.54cm/in
\defbeamertemplate*{headline}{ua theme}%
{%
% TODO Don't \vskip if the title is too long!
\vskip\logotopmargin%
\hskip\margin%
\ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }
{%
\vskip5cm% TODO: get rid of this quirk
}
{%
\pgfuseimage{ULogoMini}%
}
}
}
% ----------------------------------------------------------------------------
% *** END HEADLINE <<<
% ----------------------------------------------------------------------------
% ----------------------------------------------------------------------------
% *** FRAMETITLE <<<
% ----------------------------------------------------------------------------
\newlength\frametitletopmargin
\ifbeamer@compress%
\setlength{\frametitletopmargin}{0.384cm}% 0.3in* 64/127 *2.54cm/in
\else
\setlength{\frametitletopmargin}{0.9472cm}% 0.74in* 64/127 *2.54cm/in
\fi
\ifbeamer@dark\else%
\newlength{\frametitlewidth}
\setlength{\frametitlewidth}{\textwidth-\ulogowidth-\ulogopadding}
\fi
\defbeamertemplate*{frametitle}{ua theme}
{%
\ifbeamer@dark%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\vskip\frametitletopmargin%
\raggedleft\insertframetitle\par%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\else%
\ifbeamer@compress%
\nointerlineskip%
\vskip-\ulogoheight%
\vbox to \ulogoheight{%
\vfil%
\leftskip=\ulogowidth%
\advance\leftskip by\ulogopadding%
% TODO To date (July 4, 2010), the beamer class cannot deal with actual
% variables as arguments to "right". Hence, use the literal.
\begin{beamercolorbox}[right=1.1136cm]{frame title}%
\hfill\insertframetitle\par%
\end{beamercolorbox}%
\vfil%
}%
\else%
\medskip%
\begin{beamercolorbox}[right]{frame title}%
\insertframetitle\par%
\end{beamercolorbox}%
\fi%
\fi%
}
% ----------------------------------------------------------------------------
% *** END FRAMETITLE >>>
% ----------------------------------------------------------------------------
% ----------------------------------------------------------------------------
% *** FOOTLINE <<<
% ----------------------------------------------------------------------------
% See the discussion above for the margin (pixel) quirks.
\newlength{\textlogobottommarginDark}
% actual bottom margin in the PowerPoint(R) theme: 7.5'' - 6.83'' - 0.36'' + 0.36'' * 2px/52px
\setlength{\textlogobottommarginDark}{0.41452307692307688cm}% (7.5'' - 6.83'' - 0.36'' + 0.36'' * 2px/52px)* 64/127 *2.54cm/in
\newcommand\uTextColorPosDark {\pgfpoint{\margin}{\textlogobottommarginDark}}
\newlength{\textlogobottommarginLight}
% actual bottom margin in the PowerPoint(R) theme: 7.5'' - 6.80'' - 0.36'' + 0.36'' * 2px/52px
\setlength{\textlogobottommarginLight}{0.45292307692307715cm}% (7.5''-6.80''-0.36''+0.36''*2px/52px)* 64/127 *2.54cm/in
\newcommand\uTextColorPosLight{\pgfpoint{\margin}{\textlogobottommarginLight}}
\newlength{\logorightmargin}%
\setlength{\logorightmargin}{12.1344cm}% 9.48in* 64/127 *2.54cm/in
\newlength{\logobottommargin}%
\setlength{\logobottommargin}{0.512cm}% 0.4in* 64/127 *2.54cm/in
\newcommand\posUlogoFoot{\pgfpoint{\logorightmargin}{\logobottommargin}}
\newcommand{\uWavePos}{\pgfpoint{\paperwidth}{0cm}}
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\defbeamertemplate*{footline}{ua theme dark}
{%
\ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }
% *** THEN *** dark footline
{%
%\pgftext[left,bottom,at=\uTextColorPosDark]{\pgfuseimage{uTextColor}}%
\pgftext[right,bottom,at=\posUlogoFoot]{\pgfuseimage{ULogo}}%
}
% *** ELSE *** light footline
{%
% bottom wave
\pgftext[right,bottom,at=\uWavePos]{\pgfuseimage{uWave}}%
% page number
\ifbeamer@framenumber%
\ifnum\c@framenumber=1\else
\pgftext[right,bottom,at=\pgfpoint{0.98\paperwidth}{0.02\paperwidth}]{%
\usebeamerfont{frame number in foot}%
\usebeamercolor[fg]{frame number in foot}\insertframenumber{}%
\ifbeamer@totalframenumber%
/\inserttotalframenumber%
\fi
}%
\fi
\fi%
}
}%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% ----------------------------------------------------------------------------
% *** END of FOOTLINE >>>
% ----------------------------------------------------------------------------
% ----------------------------------------------------------------------------
% *** MARGINS <<<
% ----------------------------------------------------------------------------
% set left and right text margins
\setbeamersize{text margin left=\margin,%
text margin right=\margin}
% ----------------------------------------------------------------------------
% *** END MARGINS >>>
% ----------------------------------------------------------------------------
% ----------------------------------------------------------------------------
% *** BACKGROUND <<<
% ----------------------------------------------------------------------------
\defbeamertemplate*{background canvas}{ua theme}
{%
\ifthenelse{ \boolean{beamer@dark} \OR \(\boolean{beamer@darktitle}\AND\c@framenumber=1\) }
% *** THEN ***
{%
\ifnum\c@framenumber=1%
\pgfuseimage{uaBackgroundDark}
\else%
\pgfuseimage{uaBackgroundLight}%
\fi%
}
% *** ELSE ***
{}
}
% ----------------------------------------------------------------------------
% *** END BACKGROUND <<<
% ----------------------------------------------------------------------------
\mode
<all>