f37 -> f39
[infrastructure.git] / logos / beamerthemeOnelab.sty
1 \ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/theme/beamerthemeUNLTheme.sty,v 1.10 2004/10/07 20:53:10 bourke Exp $
2
3 % This theme modifies the PaloAlto, sidebar, and sidebartab beamer themes
4 % Modifications by Chris Bourke
5 % Last modified 3/7/05
6
7 % BEGIN sidebar dimension setup
8 \newdimen\beamer@sidebarwidth
9 \newdimen\beamer@headheight
10 \usebeamerfont{frametitle}
11 \beamer@sidebarwidth=2.5\baselineskip
12 \beamer@headheight=2.5\baselineskip
13 \reset@font
14
15 \def\beamer@lefttext{left}
16
17 % Package options
18
19 \DeclareOptionBeamer{hideothersubsections}[]{\beamer@nav@subsectionstyle{show/show/hide}}
20 \DeclareOptionBeamer{hideallsubsections}[]{\beamer@nav@subsectionstyle{hide}}
21
22 \DeclareOptionBeamer{width}{\beamer@sidebarwidth=#1}
23 \DeclareOptionBeamer{height}{\beamer@headheight=#1}
24 \DeclareOptionBeamer{left}{\def\beamer@sidebarside{left}}
25 \DeclareOptionBeamer{right}{\def\beamer@sidebarside{right}}
26 \ExecuteOptionsBeamer{left}
27 \ProcessOptionsBeamer
28
29 % Default mode (<presentation> encompasses <beamer>, <handout>, and <trans> (transparencies))
30 \mode<beamer>
31
32 % All Beamer Boxes will be rounded with a drop shadow
33 \useinnertheme[shadow=true]{rounded}
34
35 % cut-pasted-n-hacked sidebar theme
36 \ifdim\beamer@headheight>0pt
37 % if head height is 0pt, use default frame title
38
39   \setbeamercolor*{frametitle}{parent=sidebar}
40
41   \defbeamertemplate*{frametitle}{sidebar theme}
42   {%
43     \nointerlineskip%
44     \vskip-\beamer@headheight%
45     \vbox to \beamer@headheight{%
46       \vfil
47       \leftskip=-\beamer@leftmargin%
48       \advance\leftskip by0.3cm%
49       \rightskip=-\beamer@rightmargin%
50       \advance\rightskip by0.3cm plus1fil%
51       {\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
52       {\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
53       \vbox{}%
54       \vskip-1em%
55       \vfil
56     }%
57   }
58
59   \defbeamertemplate*{headline}{sidebar theme}
60   {%
61     \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
62       \ifx\beamer@sidebarside\beamer@lefttext%
63       \else%
64         \hfill%
65       \fi%
66       \ifdim\beamer@sidebarwidth>0pt%
67         \usebeamercolor[bg]{logo}%
68         \vrule width\beamer@sidebarwidth height \beamer@headheight%
69         \hskip-\beamer@sidebarwidth%
70         \hbox to \beamer@sidebarwidth{\hss\vbox to
71           \beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
72       \else%
73         \vrule width0pt height \beamer@headheight%
74       \fi%
75     \end{beamercolorbox}
76   }
77 \fi
78
79
80 \def\beamer@sidebarformat#1#2#3{%
81   \begin{beamercolorbox}[wd=\beamer@sidebarwidth,leftskip=#1,rightskip=1ex plus1fil,vmode]{#2}
82     \vbox{}%
83     #3\par%
84     \vbox{}%
85     \vskip-1.5ex%
86   \end{beamercolorbox}
87 }
88
89 \defbeamertemplate*{section in sidebar}{sidebar theme}
90 {%
91   \vbox{%
92     \vskip1ex%
93     \beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionhead}%
94   }%
95 }
96
97 \defbeamertemplate*{section in sidebar shaded}{sidebar theme}
98 {%
99   \vbox{%
100     \vskip1ex%
101     \beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionhead}%
102   }%
103 }
104
105 \defbeamertemplate*{subsection in sidebar}{sidebar theme}
106 {%
107   \beamer@sidebarformat{5pt}{subsection in sidebar}{\insertsubsectionhead}%
108 }
109
110 \defbeamertemplate*{subsection in sidebar shaded}{sidebar theme}
111 {%
112   \beamer@sidebarformat{5pt}{subsection in sidebar shaded}{\insertsubsectionhead}%
113 }
114
115
116 \ifdim\beamer@sidebarwidth>0pt
117
118                                 % Sidebar
119   \setbeamersize{sidebar width \beamer@sidebarside=\beamer@sidebarwidth}
120   \defbeamertemplate*{sidebar \beamer@sidebarside}{sidebar theme}
121   {
122     \beamer@tempdim=\beamer@sidebarwidth%
123     \advance\beamer@tempdim by -6pt%
124     {\usebeamerfont{title in sidebar}%
125       \vskip1.5em%
126       \hskip3pt%
127       \usebeamercolor[fg]{title in sidebar}%
128       \insertshorttitle[width=\beamer@tempdim,center,respectlinebreaks]\par%
129       \vskip1.25em%
130     }%
131     {%
132       \hskip3pt%
133       \usebeamercolor[fg]{author in sidebar}%
134       \usebeamerfont{author in sidebar}%
135       \insertshortauthor[width=\beamer@tempdim,center,respectlinebreaks]\par%
136       \vskip1.25em%
137     }%
138     \insertverticalnavigation{\beamer@sidebarwidth}%
139     \vfill
140     \ifx\beamer@sidebarside\beamer@lefttext%
141     \else%
142       \usebeamercolor{normal text}%
143       \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
144       \vskip2pt%
145     \fi%
146   }%
147
148   \ifx\beamer@sidebarside\beamer@lefttext%
149     \defbeamertemplate*{sidebar right}{sidebar theme}
150     {%
151       \vfill%
152       \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
153       \vskip2pt}
154   \fi
155                                 % Margins
156   \setbeamersize{text margin left=0.5cm,text margin right=0.5cm}
157 \fi
158
159 %\usecolortheme{sidebartab} cut-pasted-n-hacked:
160 \setbeamercolor*{section in sidebar shaded}{parent=palette sidebar secondary}
161 \setbeamercolor*{section in sidebar}
162   {parent=section in sidebar shaded,use={sidebar,section in sidebar shaded},%
163    fg=UNL@Scarlet,bg=UNL@Cream}
164
165 \setbeamercolor*{subsection in sidebar shaded}{parent=palette sidebar primary}
166 \setbeamercolor*{subsection in sidebar}
167   {parent=subsection in sidebar shaded,use=section in sidebar,%
168    bg=section in sidebar.bg, % We simply inherit the section properties
169    fg=section in sidebar.fg} % Here too.
170
171 % We use *part* of the outer theme "shadow" but without the "split" theme
172 % This gives us a (hacked) drop shadow on the sidebar and frametitle bar
173 \pgfdeclarehorizontalshading[frametitle.bg,frametitle right.bg]{beamer@frametitleshade}{\paperheight}{%
174   color(0pt)=(frametitle.bg);
175   color(\paperwidth)=(frametitle right.bg)}
176
177 \AtBeginDocument{
178   %
179   \pgfdeclareverticalshading{beamer@topborder}{\paperwidth}{%
180     color(0pt)=(black);
181     color(1pt)=(black)}
182   \pgfdeclarehorizontalshading{beamer@sideborder}{\paperheight}{%
183     color(0pt)=(black);
184     color(1pt)=(black)}
185
186   \pgfdeclareverticalshading{beamer@topshade}{\paperwidth}{%
187     color(0pt)=(bg);
188     color(4pt)=(black!50!bg)}
189   \pgfdeclareverticalshading{beamer@topshadesidebarcover}{\beamer@sidebarwidth}{%
190     color(0pt)=(UNL@Scarlet);
191     color(4pt)=(UNL@Scarlet)}
192   \pgfdeclareverticalshading{beamer@topshadesidebarcoverwhite}{6pt}{%
193     color(0pt)=(white);
194     color(4pt)=(white)}
195
196   \pgfdeclarehorizontalshading{beamer@sideshade}{\paperheight}{%
197     color(0pt)=(black!50!bg);
198     color(4pt)=(bg)}
199 % An attempt at getting the shadings to meet nicely, FAILED
200 %  \pgfdeclarehorizontalshading{beamer@sidediagshade}{5.66pt}{%
201 %    color(0pt)=(green!50!bg);
202 %    color(5.66pt)=(bg)}
203 }
204
205 \addtobeamertemplate{headline}
206 {}
207 {%
208 %  \vskip-0.2pt
209 %drop-shadow:
210 %old: \hskip\beamer@sidebarwidth\hskip.2cm\pgfuseshading{beamer@topshade}
211 \hskip\beamer@sidebarwidth\pgfuseshading{beamer@topshadesidebarcoverwhite}\pgfuseshading{beamer@topshade}
212 %border: \hskip\beamer@sidebarwidth\hskip.2cm\pgfuseshading{beamer@topborder}
213 % Attempted to combine two drop shadows in a transition, failed
214 %*** TRY HERE INSTEAD: declare a horizontal shade, rotate it 45 degrees and clip it.
215 %  \pgfmoveto{\pgfxy{0,0}}
216 %  \pgflineto{\pgfxy{0,-2}}
217 %  \pgflineto{\pgfxy{-2,-2}}
218 %  \pgflineto{\pgfxy{2,-2}}
219 %  \pgflineto{\pgfxy{2,2}}
220 %  \pgflineto{\pgfxy{2,0}}
221 %  \pgflineto{\pgfxy{0,0}}
222 %  \pgfclip
223   \vskip-4pt
224   \pgfuseshading{beamer@topshadesidebarcover}
225   \vskip-2pt
226 }
227
228 % Add page numbering to bottom left.
229 % simply setting it (\setbeamertemplate{footline}[page number]) defaults to lower right
230 \addtobeamertemplate{footline}
231 {%
232    \usebeamercolor[fg]{author in sidebar}
233    \vskip-1cm\hskip10pt
234    %\insertpagenumber\,/\,\insertpresentationendpage\kern1em\vskip2pt%
235    \insertframenumber\,/\,\inserttotalframenumber\kern1em\vskip2pt%
236 }
237
238 \addtobeamertemplate{sidebar \beamer@sidebarside}
239 {}
240 {
241 %Want to "rewind" to the top of the sidebar, but how?
242 %drop-shadow:
243 \vskip-\paperwidth\hskip\beamer@sidebarwidth\pgfuseshading{beamer@sideshade}
244 %border: \vskip-\paperwidth\hskip\beamer@sidebarwidth\pgfuseshading{beamer@sideborder}
245 }
246 % End Shadow
247
248 \usecolortheme[RGB={140,17,17}]{structure}
249
250 % Complete color themes:
251 % albatross, beetle, crane, dove, fly, seagull
252
253 % Inner color themes:
254 % lily, orchid, rose
255
256 % Outer color themes:
257 % whale, seahorse, dolphin(?)
258
259 \usecolortheme{orchid} % Establishes inner, dark colors
260 \usecolortheme{whale}  % Establishes outer, dark colors
261
262 % Customized Various Color elements:
263 \setbeamercolor{titlelike}{fg=UNL@Cream,bg=UNL@Scarlet} %
264 \setbeamercolor{sidebar}{fg=UNL@Cream}              %
265 \setbeamercolor{frametitle}{fg=UNL@Cream}           %
266 \setbeamercolor{title in sidebar}{fg=UNL@Cream}      %
267 \setbeamercolor{author in sidebar}{fg=UNL@Cream}    %
268 %\setbeamercolor{section in sidebar}{fg=yellow}     These two do not load (are overwritten) if
269 %\setbeamercolor{subsection in sidebar}{fg=yellow}  you use the sidebartab
270 \setbeamercolor{section in sidebar shaded}{fg=UNL@Cream}
271 \setbeamercolor{subsection in sidebar shaded}{fg=UNL@Cream}
272
273 %\setbeamertemplate{blocks}[rounded]{shadow=true}
274 \setbeamercolor{block title}{fg=white,bg=black}
275 \setbeamercolor{block body}{fg=black,bg=UNL@VeryLightGrey}
276
277 % Set the UNL logo, UNL.pdf must be in the latex path or working directory
278 \setbeamercolor{logo}{fg=black,bg=white}
279 \logo{\includegraphics[height=0.75cm]{OneLab-logo-with-text-red.jpg}}
280
281 % Handout Mode - Using the default layouts, no menus, etc.
282 \mode
283 <handout>
284 \usetheme{default}
285 \usecolortheme{default}
286 \setbeamertemplate{navigation symbols}{}
287 \useinnertheme{default}
288 %reset shadow boxes to very light grey
289 \setbeamercolor{block title}{fg=black,bg=UNL@LightGrey} %
290 \setbeamercolor{block body}{fg=black,bg=UNL@VeryLightGrey} %
291
292 % Settings for every mode
293 \mode
294 <all>
295 % We like algorithms in CS, right?
296
297 \newtheorem{algorithmblock}[theorem]{Algorithm}
298 \newtheorem{exercise}[theorem]{Exercise}
299 %\newtheorem{problem}[theorem]{Problem}
300
301 %Two horrible hacks to get a "note page" after every slide.
302 \newcommand{\noteframe}{
303 \only<handout>{ %
304   \begin{frame}
305    \frametitle{Notes}
306    \begin{center}
307    \begin{tikzpicture}
308     \foreach \y in {0,1,2,3,4,5,6}
309      \draw[thick] (0,\y) -- (11,\y);
310    \end{tikzpicture}
311    \end{center}
312   \end{frame}
313   }%
314 }
315
316 \newcommand{\noteslide}{%to be used after every \framebreak
317 \only<handout>{ %
318    \begin{center}
319    \begin{tikzpicture}
320     \foreach \y in {0,1,2,3,4,5,6}
321      \draw[thick] (0,\y) -- (11,\y);
322    \end{tikzpicture}
323    \end{center}
324    \framebreak
325    }%
326 }
327
328 % We declare the main color theme: Scarlet & Cream
329 \definecolor{UNL@Scarlet}{RGB}{140,17,17}
330 % Alternate UNL@Reds: 204,0,0 (unl.edu) <--seems to be the best
331 %                     240,7,46 (logo)
332 %                     255,25,25 (original)
333 %                     140,17,17 ("scarlet")
334 \definecolor{UNL@Cream}{RGB}{245,240,219}
335 %Cream          245  240  219
336 %Cream2         245  255  250 - Whitest
337 %Dairy Cream    249  228  188 - more peachy
338 %Cream Brulee   255  229  160 - peach
339 %Cream Can      245  200   92 - Almost a peach
340 %Coconut Cream  248  247  220 - More white
341 \definecolor{UNL@DarkGrey}{RGB}{35,35,35}
342 \definecolor{UNL@Grey}{RGB}{100,100,100}
343 \definecolor{UNL@LightGrey}{RGB}{200,200,200}
344 \definecolor{UNL@VeryLightGrey}{RGB}{225,225,225}
345
346 % We enforce conformity at UNL!
347 % so we override example (greenish) and alerted (redish)
348 \setbeamercolor{block title example}{fg=white,bg=black} %
349 %\setbeamercolor{block body example}{fg=block body.fg,bg=block body.bg} %
350 \setbeamercolor{block title alerted}{fg=block title.fg,bg=block title.bg} %
351 \setbeamercolor{block body alerted}{fg=block body.fg,bg=block body.bg} %
352 \setlength{\parskip}{.25cm}
353 %\def\mathfamilydefault{\rmdefault}\beamer@sansmathfalse
354 \usefonttheme[onlymath]{serif}
355 \beamertemplatetheoremsunnumbered  %This suppresses theorem numbers