forked from UCL/ucl-beamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamerouterthemeucltitlebanner.sty
68 lines (59 loc) · 1.89 KB
/
beamerouterthemeucltitlebanner.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
% Puts the frame title in the banner
% TODO:
% title page
\DeclareOptionBeamer{small}{%
\setbeamertemplate{banner}[ucl][1]%
\setbeamertemplate{frametitle}[one line]%
}
\DeclareOptionBeamer{large}{%
\setbeamertemplate{banner}[ucl][1.5]%
\setbeamertemplate{frametitle}[two lines]%
}
% reset headline to default
\setbeamertemplate{headline}[default]
% set the colours from banner
\setbeamercolor*{frametitle}{use=banner,fg=banner.fg}
% puts the title on one line, and subtitle below
\defbeamertemplate{frametitle}{two lines}{%
\begin{beamercolorbox}[ignorebg,ht=\bannerheight]{frametitle}%
\vbox to\bannerheight{
\vspace{1ex}%
\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
\fi
}%
\vfil%
}
\end{beamercolorbox}
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}
% puts the title and subtitle on the same line
\defbeamertemplate{frametitle}{one line}{%
\begin{beamercolorbox}[ignorebg,ht=\bannerheight]{frametitle}%
\vbox to\bannerheight{
\vspace{1ex}%
\usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}%
\strut\insertframetitle\strut%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\hspace{0.6em}\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut}%
\fi
}%
\par%
\vfil%
}
\end{beamercolorbox}
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}
% this ensures the title page doesn't overlap the banner
\addtobeamertemplate{title page}{%
\vspace{\bannerheight}%
\ifbeamercolorempty[bg]{banner stripe}{}{\vspace{\stripeheight}}%
}{}
\ExecuteOptionsBeamer{large}
\ProcessOptionsBeamer