Use adapted CAES theme
[matthijs/master-project/haskell-symposium-talk.git] / beamerouterthemecaes.sty
1 %%
2 %% beamercolorthemecaes.sty
3 %%
4 %% Copyright (C) 2008 CAES (http://caes.ewi.utwente.nl)
5 %%
6 %% Authors         : Pascal Wolkotte
7 %% Created On      : March 13 2008
8 %%
9 %% $Author: bakkerv $
10 %% $Date: 2008-03-25 10:31:52 +0100 (Tue, 25 Mar 2008) $
11 %% $Revision: 45 $
12 %% $HeadURL: https://ewi630/svn/general/templates/caes/trunk/beamerouterthemecaes.sty $
13 %%
14 \makeatletter
15
16 \def\footlinetitle{title}
17 \def\beamer@theme@footline{title}
18 \DeclareOptionBeamer{footline}{\def\beamer@theme@footline{#1}}
19
20 \newif\ifbeamer@theme@logoUT
21 \def\hidelogoUT{ \beamer@theme@logoUTfalse }
22 \def\showlogoUT{ \beamer@theme@logoUTtrue }
23 \showlogoUT
24
25 \ProcessOptionsBeamer
26
27 \usetikzlibrary{positioning}
28 \usetikzlibrary{fadings}
29
30 \def\getcoordinates{
31         \node[coordinate] (titlepos) at (.95\paperwidth,-.217\paperheight) {};
32         \node[coordinate] (topleft) at (.05\paperwidth,-.225\paperheight) {};
33         \node[coordinate] (TL) at (0,0) {};
34         \node[coordinate] (BR) at (\paperwidth,-\textheight) {};
35         \node[coordinate] (F1) at (.65\paperwidth,-.25\textheight) {};
36         \node[coordinate] (F2) at (.95\paperwidth,-.5\textheight) {};
37         \node[coordinate] (F1m) at (.35\paperwidth,-.25\textheight) {};
38         \node[coordinate] (F2m) at (.05\paperwidth,-.5\textheight) {};
39 }
40
41 % -- Shading function. From 0 - 50 no transparency and from 50 - 100 transparency
42 \pgfdeclarehorizontalshading{shading}{100bp}{ color(0bp)=(transparent!0); color(25bp)=(transparent!0); color(60bp)=(transparent!0); color(75bp)=(transparent!100); color(100bp)=(transparent!100)}
43 \pgfdeclarefading{fading}{\pgfuseshading{shading}}
44 \def\placehorzfading#1{
45         \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{#1}{-\paperheight}}
46         \pgfsetfadingforcurrentpath{fading}{}
47         \pgfusepath{discard}
48 }
49 \pgfdeclarefading{LRfading}{
50 \begin{tikzpicture}[line width=0pt]
51         \getcoordinates
52         \fill[pgftransparent!0] (TL -| F1m) rectangle (BR -| F1);
53         \shade[left color=pgftransparent!0, right color=pgftransparent!100] (TL -| F1) rectangle (BR -| F2);
54         \shade[right color=pgftransparent!0, left color=pgftransparent!100] (TL -| F2m) rectangle (BR -| F1m);
55 \end{tikzpicture}
56 }
57 \pgfdeclarefading{BRfading}{
58 \begin{tikzpicture}[line width=0pt]
59         \getcoordinates
60         \fill[pgftransparent!0] (TL) rectangle (F1);
61         \begin{scope}
62         \path[clip] (F1) -- (F2) -- (BR) |- (TL) -- cycle;
63         \shade[left color=pgftransparent!0, right color=pgftransparent!100] (TL -| F1) rectangle (BR -| F2);
64         \end{scope}
65         \begin{scope}
66         \path[clip] (F1) -- (F2) -- (BR) -| (TL) -- cycle;
67         \shade[top color=pgftransparent!0, bottom color=pgftransparent!100] (TL |- F1) rectangle (BR |- F2);
68         \end{scope}
69 \end{tikzpicture}
70 }
71
72 \mode<presentation>
73
74 % -- Headline and footline --
75 \pgfdeclareimage[interpolate=true, height=.1\paperheight]{ut_logo}{ut_logo_blue}
76
77 % -- HEADER --
78
79 %Select the correct logo
80
81 \defbeamertemplate{headline}{empty}{%
82         \begin{tikzpicture}
83                 \path[use as bounding box] (0,0) rectangle (\paperwidth,-.11\paperheight);
84         \end{tikzpicture}
85 }
86 \def\UTheadline{
87                 \begin{scope}
88                         \placehorzfading{.95\paperwidth}
89                         \node[fill=ut_blue,  line width=0pt, minimum height=.033\paperheight, minimum width=.95\paperwidth, anchor=north west] (bart) at (0,0) {};
90                         \placehorzfading{.8\paperwidth}
91                         \node[fill=ut_orange,line width=0pt, minimum height=.043\paperheight, minimum width=.8\paperwidth, below=0pt of bart.south west, anchor=north west] (barm) {};
92                         \placehorzfading{.675\paperwidth}
93                         \node[fill=ut_lightblue, line width=0pt, minimum height=.032\paperheight, minimum width=.675\paperwidth, below=0pt of barm.south west, anchor=north west] (barb) {};
94                 \end{scope}
95                 \ifbeamer@theme@logoUT
96                         \path (\paperwidth,-.11\paperheight) node[above left=0pt and 3pt, line width=0pt,inner sep=0pt] {\pgfuseimage{ut_logo}};
97                 \fi
98 }
99 \pgfdeclareimage[interpolate=true, height=.1\paperheight]{logoNWchameleonA}{chameleonA}
100 \pgfdeclareimage[interpolate=true, height=.14\paperheight]{logoNWchameleonB}{chameleonB}
101 \pgfdeclareimage[interpolate=true, height=0.55\paperheight]{logoPoles}{poles_shaded}
102 \pgfdeclareimage[interpolate=true, height=0.14\paperheight]{logoSloth}{sloth}
103
104 \defbeamertemplate*{headline}{chameleonA theme}{%
105         \begin{tikzpicture}
106                 \getcoordinates
107                 \path[use as bounding box] (0,0) rectangle (\paperwidth,-.11\paperheight);
108                 \UTheadline
109                 \path (0,-.12\paperheight) node[above right=0pt, line width=0pt,inner sep=0pt] {\pgfuseimage{logoNWchameleonA}};
110         \end{tikzpicture}
111 }
112 \defbeamertemplate{headline}{chameleonB theme}{%
113         \begin{tikzpicture}
114                 \getcoordinates
115                 \path[use as bounding box] (0,0) rectangle (\paperwidth,-.11\paperheight);
116                 \UTheadline
117                 \path (-10pt,-.16\paperheight) node[above right=0pt, line width=0pt,inner sep=0pt] {\pgfuseimage{logoNWchameleonB}};
118         \end{tikzpicture}
119 }
120 \defbeamertemplate{headline}{energy theme}{%
121         \begin{tikzpicture}
122                 \getcoordinates
123                 \path[use as bounding box] (0,0) rectangle (\paperwidth,-.11\paperheight);
124                 \UTheadline
125                 \path (-3.2pt,-.16\paperheight) node[above right=0pt, line width=0pt,inner sep=0pt] {\pgfuseimage{logoSloth}};
126         \end{tikzpicture}
127 }
128
129 \defbeamertemplate{headline}{caes theme}{%
130         \begin{tikzpicture}
131                 \getcoordinates
132                 \path[use as bounding box] (0,0) rectangle (\paperwidth,-.11\paperheight);
133                 \UTheadline
134         \end{tikzpicture}
135 }
136
137 % -- FOOTER --
138 \defbeamertemplate{footline}{empty}{%
139         \leavevmode%
140         \begin{tikzpicture}[remember picture]
141                 \path[clip,use as bounding box] (0,0) rectangle (\paperwidth,-.08\paperheight);
142         \end{tikzpicture}
143 }
144 \defbeamertemplate*{footline}{caes theme}{%
145         \leavevmode%
146         \begin{tikzpicture}[remember picture]
147                 \path[clip,use as bounding box] (0,0) rectangle (\paperwidth,-.08\paperheight);
148                 \draw[ut_orange,semithick] (.05\paperwidth,0) node[coordinate] (footerleft) {} -- node[coordinate] (footercenter) {} ++(.9\paperwidth,0pt) node [coordinate] (footerright) {};
149                 \path (footerleft)   node[below right=1ex and 0ex] {\inserttitle\ - \insertsubtitle};
150                 \path (footercenter) node[below=1ex] {\insertshortdate};
151                 \path (footerright)  node[below left=1ex and 0ex] {\insertframenumber / \inserttotalframenumber};
152         \end{tikzpicture}
153 }
154
155 % -- BACKGROUND --
156 \defbeamertemplate{background}{empty}{}%
157
158 %\ifbeamer@theme@background@soc
159         \pgfdeclareimage[interpolate=true, width=.65\paperwidth]{soc_bg}{soc_bg}
160 %\fi
161 \defbeamertemplate*{background}{soc theme}{
162         \begin{tikzpicture}[remember picture, overlay]
163                 \getcoordinates
164         % Custom background
165         \makeatletter
166         \ifbeamer@plainframe\else
167                 \path (\paperwidth,-\paperheight) node[above left, inner sep=0pt, line width=0pt,rotate=-15,yshift=-20mm,xshift=5mm] {\pgfuseimage{soc_bg}};
168         \fi
169         \makeatother
170         \end{tikzpicture}
171 }
172 \defbeamertemplate{background}{electricity poles}{
173         \begin{tikzpicture}[remember picture, overlay]
174                 \getcoordinates
175         % Custom background
176         \makeatletter
177         \ifbeamer@plainframe\else
178                 \path (\paperwidth,-\paperheight) node[anchor=south east,inner sep=0pt, line width=0pt] {\pgfuseimage{logoPoles}};
179         \fi
180         \makeatother
181         \end{tikzpicture}
182 }
183
184
185 % -- Navigation symbols --
186 \setbeamertemplate{navigation symbols}[vertical]
187 \defbeamertemplate{navigation symbols}{none}{}
188
189 % -- Frame title: default --
190 \defbeamertemplate{frametitle}{noleft}{
191         \nointerlineskip
192         \begin{beamercolorbox}[wd=\paperwidth,ht=.115\paperheight,dp=0pt]{}
193         \begin{tikzpicture}
194                 \node[anchor=base east, inner xsep=0pt] (frametitle) at (.93\paperwidth,.02\paperwidth) {\usebeamerfont{frametitle}\insertframetitle};
195                 \path[use as bounding box] (0,0) rectangle (\paperwidth,.115\paperheight);
196                 \node[coordinate] (grayline) at (.05\paperwidth,0) {};
197                 \ifx\insertframesubtitle\@empty\else%                           
198                         \node[inner xsep=1ex, anchor=north east] (subtitle) at (frametitle.base east) {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle};
199                         \node[coordinate] (grayline) at (grayline |- subtitle.south) {};
200                 \fi%
201                 \begin{scope} % Lines   
202                         \pgfsetfading{LRfading}{\pgftransformshift{\pgfpoint{.5\paperwidth}{-.5\textheight}}} 
203                         \draw[gray!50,ultra thin] (grayline) -- +(.9\paperwidth,0);
204                 \end{scope}
205         \end{tikzpicture}
206         \end{beamercolorbox}
207         \vskip-.25em %Line 110 beamerbaseframe.sty
208         \vskip-.2cm %Line 248 beamerbaseframe.sty
209         \vskip.02\paperwidth
210 }
211 \defbeamertemplate*{frametitle}{caes theme}{
212         \nointerlineskip
213         \begin{beamercolorbox}[wd=\paperwidth]{}
214
215         \begin{tikzpicture}
216                 \node[anchor=base east, inner xsep=0pt] (frametitle) at (.93\paperwidth,.02\paperwidth) {\usebeamerfont{frametitle}\insertframetitle};
217                 \node[coordinate] (grayline) at (.05\paperwidth,0) {};
218                 \ifx\insertframesubtitle\@empty\else%                           
219                         \node[inner xsep=1ex, inner ysep=0pt, anchor=base east] (subtitle) at ([yshift=-.04\paperwidth] frametitle.base east) {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle};
220                         \node[coordinate] (grayline) at ([yshift=-0.02\paperwidth] grayline |- subtitle.base) {};
221                 \fi%
222
223                 \path[use as bounding box] (TL |- grayline.south) rectangle (\paperwidth,.115\paperheight);
224                 
225                 \begin{scope} % Lines   
226                         \pgfsetfading{BRfading}{\pgftransformshift{\pgfpoint{.5\paperwidth}{-.5\textheight}}} 
227                         \draw[gray!50,ultra thin] (grayline) +(.9\paperwidth,0) -| +(0,-.5\textheight);
228                 \end{scope}
229         \end{tikzpicture}
230         \end{beamercolorbox}
231         \vskip-.25em %Line 110 beamerbaseframe.sty
232         \vskip-.2cm %Line 248 beamerbaseframe.sty
233         \vskip.01\paperwidth
234 }
235
236 \setbeamersize{text margin left=0.07\paperwidth, text margin right=0.07\paperwidth}
237
238 \makeatother
239
240 \mode
241 <all>