]> projects.mako.cc - beamer-mako/blob - beamerouterthemedecolines.sty
a5b1da0653402d726b9398e6eeb4553a8b37971c
[beamer-mako] / beamerouterthemedecolines.sty
1 % Copyright 2007 by Marco Barisione
2 %
3 % This file may be distributed and/or modified
4 %
5 % 1. under the LaTeX Project Public License and/or
6 % 2. under the GNU Public License.
7
8 \mode<presentation>
9
10 % String used between the current page and the total page count.
11 \def\beamer@decolines@pageofpages{/}
12 \DeclareOptionBeamer{pageofpages}{\def\beamer@decolines@pageofpages{#1}}
13
14 % Show a line below the frame title.
15 \DeclareOptionBeamer{titleline}[true]{\def\beamer@decolines@titleline{#1}}
16
17 % Image used for the watermark.
18 \def\beamer@decolines@watermarkorig{}
19 \DeclareOptionBeamer{watermark}{\def\beamer@decolines@watermarkorig{#1}}
20
21 % Height of the watermark.
22 \def\beamer@decolines@watermarkheight{100px}
23 \DeclareOptionBeamer{watermarkheight}{\def\beamer@decolines@watermarkheight{#1}}
24
25 % The original image height is watermarkheightmult * watermarkheight.
26 \def\beamer@decolines@watermarkheightmult{1}
27 \DeclareOptionBeamer{watermarkheightmult}{\def\beamer@decolines@watermarkheightmult{#1}}
28
29 \ExecuteOptionsBeamer{titleline=false}
30 \ProcessOptionsBeamer
31
32 % Enable/disable the watermark.
33 \def\watermarkon{%
34   \def\beamer@decolines@watermark{\beamer@decolines@watermarkorig}%
35 }
36 \def\watermarkoff{\def\beamer@decolines@watermark{}}
37
38 % Initially enable the watermark.
39 \watermarkon
40
41 % Colors.
42 \setbeamercolor*{lineup}{parent=palette primary}
43 \setbeamercolor*{linemid}{parent=palette secondary}
44 \setbeamercolor*{linebottom}{parent=palette tertiary}
45 \setbeamercolor*{page header}{parent=titlelike}
46
47 % Lengths
48 \newlength{\headerheight}
49 \setlength{\headerheight}{.045\paperheight}
50 \newlength{\beamer@decolines@lineup}
51 \setlength{\beamer@decolines@lineup}{.025\paperheight}
52 \newlength{\beamer@decolines@linemid}
53 \setlength{\beamer@decolines@linemid}{.015\paperheight}
54 \newlength{\beamer@decolines@linebottom}
55 \setlength{\beamer@decolines@linebottom}{.01\paperheight}
56
57 % The height of the watermark part below the 3 bottom lines.
58 \newlength{\beamer@decolines@watermarkheightbottom}
59 \addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@lineup}
60 \addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@linemid}
61 \addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@linebottom}
62
63 % The height of the watermark part over the 3 bottom lines before shrinking.
64 \newlength{\beamer@decolines@watermarkheightupperorig}
65 \setlength{\beamer@decolines@watermarkheightupperorig}{\beamer@decolines@watermarkheight}
66 \addtolength{\beamer@decolines@watermarkheightupperorig}{-\beamer@decolines@watermarkheightbottom}
67 \multiply\beamer@decolines@watermarkheightupperorig by \beamer@decolines@watermarkheightmult
68
69 % Footer.
70 \defbeamertemplate*{footline}{decolines theme}
71 {
72   \leavevmode%
73   % Page number.
74   \hbox{%
75   \begin{beamercolorbox}[wd=.2\paperwidth,ht=0ex,dp=0ex,center]{}%
76     \usebeamerfont{palette primary}\insertframenumber{} \beamer@decolines@pageofpages{} \inserttotalframenumber%
77   \end{beamercolorbox}%
78   \begin{beamercolorbox}[wd=.8\paperwidth,ht=0ex,dp=0ex]{}%
79   \end{beamercolorbox}%
80   } %
81   % First line.
82   \hbox{%
83   \begin{beamercolorbox}[wd=.2\paperwidth,ht=\beamer@decolines@lineup,dp=0pt]{}%
84   \end{beamercolorbox}%
85   \begin{beamercolorbox}[wd=.8\paperwidth,ht=\beamer@decolines@lineup,dp=0pt]{lineup}%
86   \end{beamercolorbox}%
87   } %
88   % Second line.
89   \hbox{%
90   \begin{beamercolorbox}[wd=\paperwidth,ht=\beamer@decolines@linemid,dp=0pt]{linemid}%
91   \end{beamercolorbox}%
92   } %
93   % Third line.
94   \hbox{%
95   \begin{beamercolorbox}[wd=.1\paperwidth,ht=\beamer@decolines@linebottom,dp=0pt]{}%
96   \end{beamercolorbox}%
97   \begin{beamercolorbox}[wd=.9\paperwidth,ht=\beamer@decolines@linebottom,dp=0pt]{linebottom}%
98   \end{beamercolorbox}%
99   }%
100   % This seems to fix some alignment problems with the watermark. It has to be
101   % always applied if you do not want to see the footer moving up and down when
102   % moving from a page with watermark to a page without or vice versa.
103   \vskip-.5px%
104   % Watermark.
105   \if\beamer@decolines@watermark\@empty\else%
106     \vskip-\beamer@decolines@watermarkheightbottom%
107     \llap{\includegraphics[height=\beamer@decolines@watermarkheightbottom,clip=true,%
108       trim=0pt 0pt 0pt \beamer@decolines@watermarkheightupperorig]{\beamer@decolines@watermark}\hskip-\paperwidth}%
109   \fi%
110 }
111
112 \defbeamertemplate*{headline}{decolines theme}{}
113 %
114 %{
115 %  \leavevmode%
116 %  \hbox{%
117 %  \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{page header}%
118 %  \end{beamercolorbox}%
119 %  } %
120 %  \vskip0pt%
121 %}
122
123 \defbeamertemplate*{frametitle}{decolines theme}[1][left]
124 {
125   \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
126   \@tempdima=\textwidth%
127   \advance\@tempdima by\beamer@leftmargin%
128   \advance\@tempdima by\beamer@rightmargin%
129   \vbox{}\vskip-.5\beamer@leftmargin%
130   \begin{beamercolorbox}[sep=.5\beamer@leftmargin,#1,wd=\the\@tempdima]{page header}
131     \usebeamerfont{frametitle}\usebeamercolor[bg]{framesubtitle}%
132     \vbox{}\vskip0ex%
133     \if@tempswa\else\csname beamer@fte#1\endcsname\fi%
134     \strut\insertframetitle\strut\par%
135     {%
136       \ifx\insertframesubtitle\@empty%
137       \else%
138       {\usebeamerfont{framesubtitle}\usebeamercolor[bg]{framesubtitle}\insertframesubtitle\strut\par}%
139       \fi
140     }%
141     \vskip-1ex%
142     \if@tempswa\else\vskip-\beamer@leftmargin\fi
143   \end{beamercolorbox}%
144   \def\beamer@decolines@truetext{true}%
145   \ifx\beamer@decolines@titleline\beamer@decolines@truetext%
146     \vskip-.5\beamer@leftmargin%
147     \begin{beamercolorbox}[wd=\textwidth,ht=.1ex,dp=0ex]{linemid}%
148     \end{beamercolorbox}%
149   \fi
150 }
151
152 % Frame title continuations, default
153 \defbeamertemplate*{frametitle continuation}{decolines theme}{(\insertcontinuationcount)}
154
155 \defbeamertemplate*{sidebar right}{decolines theme}
156 {
157   \vskip.1\beamer@leftmargin%
158   \llap{\insertlogo\hskip.5\beamer@leftmargin}%
159   \vfill%
160   \if\beamer@decolines@watermark\@empty\else%
161   \llap{\includegraphics[height=\beamer@decolines@watermarkheight]{\beamer@decolines@watermark}}%
162   \vskip-\beamer@decolines@watermarkheightbottom%
163   \fi
164 }
165
166 \mode
167 <all>

Benjamin Mako Hill || Want to submit a patch?