-
Notifications
You must be signed in to change notification settings - Fork 2
/
beamerouterthemedecolines.sty
182 lines (162 loc) · 6.33 KB
/
beamerouterthemedecolines.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
% Copyright 2007 by Marco Barisione
% Copyright 2011 by Henricus Bouwmeester
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
\mode<presentation>
% String used between the current page and the total page count.
\def\beamer@decolines@pageofpages{/}
\DeclareOptionBeamer{pageofpages}{\def\beamer@decolines@pageofpages{#1}}
% Show the date in the title page
\DeclareOptionBeamer{showdate}[true]{\def\beamer@decolines@showdate{#1}}
% Show a line below the frame title.
\DeclareOptionBeamer{titleline}[true]{\def\beamer@decolines@titleline{#1}}
% Image used for the watermark.
\def\beamer@decolines@watermarkorig{}
\DeclareOptionBeamer{watermark}{\def\beamer@decolines@watermarkorig{#1}}
% Height of the watermark.
\def\beamer@decolines@watermarkheight{100pt}
\DeclareOptionBeamer{watermarkheight}{\def\beamer@decolines@watermarkheight{#1}}
% The original image height is watermarkheightmult * watermarkheight.
\def\beamer@decolines@watermarkheightmult{1}
\DeclareOptionBeamer{watermarkheightmult}{\def\beamer@decolines@watermarkheightmult{#1}}
\ExecuteOptionsBeamer{titleline=false}
\ProcessOptionsBeamer
% Enable/disable the watermark.
\def\watermarkon{%
\def\beamer@decolines@watermark{\beamer@decolines@watermarkorig}%
}
\def\watermarkoff{\def\beamer@decolines@watermark{}}
% Initially enable the watermark.
\watermarkon
% Colors.
\setbeamercolor*{lineup}{parent=palette primary}
\setbeamercolor*{linemid}{parent=palette quaternary}
\setbeamercolor*{linebottom}{parent=palette tertiary}
\setbeamercolor*{linetitle}{fg=white,bg=CULightGray}
\setbeamercolor*{page header}{parent=titlelike}
% Lengths
\newlength{\headerheight}
\setlength{\headerheight}{.045\paperheight}
\newlength{\beamer@decolines@lineup}
\setlength{\beamer@decolines@lineup}{.0075\paperheight}
\newlength{\beamer@decolines@linemid}
\setlength{\beamer@decolines@linemid}{.045\paperheight}
\newlength{\beamer@decolines@linebottom}
\setlength{\beamer@decolines@linebottom}{.001\paperheight}
% The height of the watermark part below the 3 bottom lines.
\newlength{\beamer@decolines@watermarkheightbottom}
\addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@lineup}
\addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@linemid}
\addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@linebottom}
% The height of the watermark part over the 3 bottom lines before shrinking.
\newlength{\beamer@decolines@watermarkheightupperorig}
\setlength{\beamer@decolines@watermarkheightupperorig}{\beamer@decolines@watermarkheight}
\addtolength{\beamer@decolines@watermarkheightupperorig}{-\beamer@decolines@watermarkheightbottom}
\multiply\beamer@decolines@watermarkheightupperorig by \beamer@decolines@watermarkheightmult
% Footer.
\defbeamertemplate*{footline}{decolines theme}
{
\leavevmode%
% Black line.
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=.05pt,dp=0pt]{linemid}%
\end{beamercolorbox}%
} %
% CUGold line.
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=2pt,dp=0pt]{lineup}%
\end{beamercolorbox}%
} %
% Black footer bar
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=12pt,dp=0pt]{linemid}%
\begin{columns}
\column{.01\paperwidth}
\column{.49\paperwidth}
\begin{flushleft}
\usebeamerfont{pagenumber}\hspace{1em} \insertshortauthor \hspace{1em} $\vert$ \hspace{1em} \insertshortinstitute%
\end{flushleft}
\column{.48\paperwidth}
\begin{flushright}
\usebeamerfont{pagenumber}\hspace{1em} \insertshorttitle \hspace{1em} $\vert$ \hspace{1em} \insertframenumber{} \beamer@decolines@pageofpages{} \inserttotalframenumber%
\end{flushright}
\column{.02\paperwidth}
\end{columns}
\phantom{XX}
\end{beamercolorbox}%
} %
% This seems to fix some alignment problems with the watermark. It has to be
% always applied if you do not want to see the footer moving up and down when
% moving from a page with watermark to a page without or vice versa.
\vskip-.5pt%
% Watermark.
\if\beamer@decolines@watermark\@empty\else%
\vskip-\beamer@decolines@watermarkheightbottom%
\llap{\includegraphics[height=\beamer@decolines@watermarkheightbottom,clip=true,%
trim=0pt 0pt 0pt \beamer@decolines@watermarkheightupperorig]{\beamer@decolines@watermark}\hskip-\paperwidth}%
\fi%
}
\defbeamertemplate*{headline}{decolines theme}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{}%
\ifx\insertsection\@empty
\else
{
{\usebeamerfont{headsection}\hspace{1em} \color{CUGold}\insertsection}
\ifx\insertsubsection\@empty
\else
{\hspace{0.5em}$\vert$ \hspace{0.5em}{\usebeamerfont{headsubsection}\color{CUDarkGray}\insertsubsection}}%
\fi
}
\fi
\end{beamercolorbox}%
} %
\vskip0pt%
}
\defbeamertemplate*{frametitle}{decolines theme}[1][left]
{
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\vbox{}\vskip-.5\beamer@leftmargin%
\begin{beamercolorbox}[sep=\beamer@leftmargin,#1,wd=\the\@tempdima]{}
\usebeamerfont{frametitle}\usebeamercolor[bg]{framesubtitle}%
\vbox{}\vskip0ex%
\if@tempswa\else\csname beamer@fte#1\endcsname\fi%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[bg]{framesubtitle}\insertframesubtitle\strut\par}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-\beamer@leftmargin\fi
\end{beamercolorbox}%
\def\beamer@decolines@truetext{true}%
\ifx\beamer@decolines@titleline\beamer@decolines@truetext%
\vskip-.5\beamer@leftmargin%
\begin{beamercolorbox}[wd=\textwidth,ht=.1ex,dp=0ex]{linetitle}%
\end{beamercolorbox}%
\fi
}
% Frame title continuations, default
\defbeamertemplate*{frametitle continuation}{decolines theme}{(\insertcontinuationcount)}
\defbeamertemplate*{sidebar right}{decolines theme}
{
\vskip.1\beamer@leftmargin%
\llap{\insertlogo\hskip.5\beamer@leftmargin}%
\vfill%
\if\beamer@decolines@watermark\@empty\else%
\llap{\includegraphics[height=\beamer@decolines@watermarkheight]{\beamer@decolines@watermark}}%
\vskip-\beamer@decolines@watermarkheightbottom%
\fi
}
\mode
<all>