-
Notifications
You must be signed in to change notification settings - Fork 25
/
beamerthemeucl.sty
157 lines (136 loc) · 4.94 KB
/
beamerthemeucl.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
\usetheme{default}
\usecolortheme{ucl}
\RequirePackage{calc}
% the height of the banner (after scaling)
\newlength\bannerheight%
% the height of the banner stripe: according to UCL style this should be the
% height of the tower
\newlength\stripeheight%
% the amount to trim off the banner (before scaling)
\newlength\bannerimagetrim%
% UCL banner template
\defbeamertemplate*{banner}{ucl}[1][1]{%
\uclcolorname{banner.bg}{\ucl@bannercolorname}%
\includegraphics[width=\paperwidth,trim=\bannerimagetrim{} 0 0 0]%
{banners/uclbanner\ucl@bannercolorname}%
}
[action]{% set lengths when loading template
\setlength\bannerimagetrim{363bp-363bp/\real{#1}}
\settoheight\bannerheight{\usebeamertemplate*{banner}}
\setlength\stripeheight{0.1875\bannerheight}
}
% blank banner, for when you don't want UCL banner on every page
\defbeamertemplate{banner}{blank}{%
\hspace{\beamer@leftmargin}%
\begin{beamercolorbox}[wd=\paperwidth,ht=\bannerheight]{banner}%
\end{beamercolorbox}
}
% if you don't want a banner at all.
\defbeamertemplate{banner}{empty}{%
}
% draw the banner on the background
\defbeamertemplate*{background}{ucl}{% for everything else
\hspace{\beamer@leftmargin}%
\begin{beamercolorbox}[wd=\paperwidth]{banner stripe}%
\usebeamertemplate*{banner}\par%
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
\end{beamercolorbox}%
}
% The default headline is just empty space.
% this ensures content doesn't overlap
\defbeamertemplate*{headline}{ucl}{%
\vspace{\bannerheight}%
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}
% Section / Subsection
\defbeamertemplate{headline}{section}{%
\begin{beamercolorbox}[ignorebg,ht=\bannerheight]{section in head/foot}%
\vbox to\bannerheight{ % chktex 1
\usebeamerfont{section in head/foot}%
\vspace{1em}%
\hspace{1em}\insertsectionhead%
\ifx\insertsubsectionhead\@empty%
\else%
{\usebeamerfont{subsection in head/foot}%
\usebeamercolor[fg]{subsection in head/foot}%
\,/\,\insertsubsectionhead}%
\fi%
\par%
\vfil}%
\end{beamercolorbox}%
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}
% Miniframes
\defbeamertemplate{headline}{miniframes}[1][0.6\paperwidth]{%
\begin{beamercolorbox}[ignorebg,ht=\bannerheight]{section in head/foot}%
\vbox to\bannerheight{ % chktex 1
\vspace{1ex}%
\insertnavigation{#1}%
\par%
\vfil}%
\end{beamercolorbox}%
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}
% use boxes instead of circles
\setbeamertemplate{mini frames}[box]
% Department and subdepartment/slogan in the headline
\defbeamertemplate{headline}{department}{%
\begin{beamercolorbox}[ignorebg,ht=\bannerheight]{section in head/foot}%
\vbox to\bannerheight{ % chktex 1
\vfil%
\usebeamerfont*{section in head/foot}%
\usebeamercolor[fg]{section in head/foot}%
\hspace{1em}%
\usebeamertemplate{department}%
\par%
\usebeamerfont*{subsection in head/foot}%
\usebeamercolor[fg]{subsection in head/foot}%
\vspace*{.5ex}%
\hspace{1em}%
\usebeamertemplate{subdepartment}%
\par%
\vfil}%
\end{beamercolorbox}%
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}
\patchcmd{\beamer@calculateheadfoot}{\advance\footheight by 4pt}{\advance\footheight by 1em}{}{} % chktex 1
\defbeamertemplate{footline}{author title date}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\usebeamertemplate*{slide counter}\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
% Slide counter
\defbeamertemplate*{slide counter}{frametotal}[1][]{%
\usebeamercolor[fg]{date in head/foot}%
#1~\insertframenumber\ \vrule width0.3pt height5pt\ \inserttotalframenumber%
}
\defbeamertemplate{slide counter}{frameonly}[1][]{%
\usebeamercolor[fg]{date in head/foot}%
#1~\insertframenumber%
}
\defbeamertemplate{slide counter}{empty}{%
}
% Reduce margins
\setbeamersize{text margin left=1.4em,text margin right=1.4em}
% make everything rectangle-y
\useinnertheme{rectangles}
% use the Helvetica font
\usepackage[scaled]{helvet}
\usepackage{eulervm}
%%% the UCL font is actually Arial, if you want to use it, you should install
%%% the font using the getnonfreefonts script, then it can be loaded by the
%%% following:
% \usepackage[T1]{fontenc}
% \usepackage{uarial}
% \renewcommand{\familydefault}{\sfdefault}