Debian Codegraph @

texmf-dist/source/latex/beamercolorthemeowl/beamercolorthemeowl.dtx

raw
1 % \iffalse meta-comment ------------------------------------------------------
2 % Copyright 2016 Ross Churchley. Contributions to this package are welcome at
3 %
4 % https://github.com/rchurchley/beamercolortheme-owl
5 %
6 % This work may be distributed and/or modified under the conditions of the
7 % LaTeX Project Public License, either version 1.3 of this license or (at
8 % your option) any later version. The latest version of this license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % and version 1.3 or later is part of all distributions of LaTeX version
13 % 2005/12/01 or later.
14 % ------------------------------------------------------------------------- \fi
15 % \iffalse
16 %<driver> \ProvidesFile{beamercolorthemeowl.dtx}
17 %<*package>
18 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
19 \ProvidesPackage{beamercolorthemeowl}
20 [2016/03/15 v0.1.1 A visible colour theme for Beamer presentations]
21 %</package>
22 %
23 %<*driver>
24 \documentclass[12pt]{ltxdoc}
25 \usepackage{beamercolorthemeowl}
26 \IfFileExists{FiraSans.sty}{\usepackage[sfdefault, light]{FiraSans}}{}
27 \IfFileExists{FiraMono.sty}{\usepackage{FiraMono}}{}
28 \usepackage[parfill]{parskip}
29 \usepackage{setspace}
30 \onehalfspacing
31 \usepackage[colorlinks=true, linkcolor=OwlRed, urlcolor=OwlBlue]{hyperref}
32 \usepackage{graphicx}
33 \usepackage{geometry}
34 \usepackage{listings}
35 \lstset{%
36 basicstyle=\ttfamily\small,
37 breaklines=true,
38 breakatwhitespace=true,
39 gobble=2,
40 aboveskip=1em,
41 belowskip=1em
42 }
43 \lstMakeShortInline|
44
45 \usepackage{readprov}
46 \ReadPackageInfos{beamercolorthemeowl}
47 \begin{document}
48 \DocInput{beamercolorthemeowl.dtx}
49 \end{document}
50 %</driver>
51 % \fi
52 % \CheckSum{0}
53 %
54 %
55 % \title{The \texttt{owl} Beamer colour theme}
56 % \author{Ross Churchley\\ \texttt{[email protected]}}
57 % \date{\fileversion, dated \filedate}
58 %
59 % \maketitle
60 %
61 % \begin{quote}\itshape
62 % ``The effectiveness of a colour scheme is heavily dependent on the conditions
63 % you present in. Colours that look nice on a computer screen may be
64 % invisible projected; colours that stand out in a lit room may strain the
65 % eyes in a dark room. If possible, you should carefully choose from Beamer's
66 % wide variety of colour themes to find one that fits your presentation's
67 % individual needs.''
68 % \end{quote}
69 %
70 % The above paragraph would be excellent advice, except for one thing ---
71 % only a handful of pre-selected colour themes are publicly available for
72 % Beamer. The vast majority of Beamer presentations use one of the
73 % \href{https://mpetroff.net/files/beamer-theme-matrix/}{built-in colour
74 % themes}, which are effective in some conditions but inadequate in others.
75 % The goal of this package is to reduce the number of situations you
76 % find yourself without any good colour options. |owl| is a flexible dark or
77 % light colour theme designed for maximum readability in environments where
78 % most themes fall flat.
79 %
80 %
81 % \clearpage
82 % \singlespacing
83 % \tableofcontents
84 % \onehalfspacing
85 %
86 % \section{Usage}
87 %
88 % Once you have downloaded and installed the |beamercolorowl| package, using
89 % it is a piece of cake:
90 %
91 % \begin{lstlisting}
92 % \usecolortheme{owl}
93 % \end{lstlisting}
94 %
95 % Unlike many Beamer themes, |owl| defaults to a ``dark'' theme with white
96 % text on a black background.
97 % This is particularly recommended for presentations with low ambient lighting,
98 % where it has the most advantages (see Section~\ref{sec:bg}).
99 %
100 % If you expect to present in a brightly-lit room or with a weak projector,
101 % you may wish to use to use the |snowy| option to use black text on a white
102 % background:
103 %
104 % \begin{lstlisting}
105 % \usecolortheme[snowy]{owl}
106 % \end{lstlisting}
107 %
108 % In addition to setting the colour scheme of your slides, |owl| redefines the
109 % redefines the basic colour names |red|, |green|, |blue|, |yellow|,
110 % |violet|, |brown|, |orange|, and |cyan| to hues that are more visible when
111 % when displayed by some projectors. If you do not want these colour names to
112 % be redefined, use the |cautious| option when loading |owl|:
113 %
114 % \begin{lstlisting}
115 % \usecolortheme[cautious]{owl}
116 % \end{lstlisting}
117 %
118 % In either case, |owl|-defined colours will be available as |OwlRed|,
119 % |OwlGreen|, |OwlBlue|, and so forth.
120 %
121 %
122 %
123 % \iffalse Package options
124 \RequirePackage{etoolbox}
125 \newtoggle{snowy}
126 \newtoggle{cautious}
127 \@ifclassloaded{beamer}{
128 \DeclareOptionBeamer{snowy}{\toggletrue{snowy}}
129 \DeclareOptionBeamer{cautious}{\toggletrue{cautious}}
130 \ProcessOptionsBeamer
131 }{}
132 % \fi
133 %
134 %
135 %
136 % \section{The Background}
137 % \label{sec:bg}
138 %
139 % \subsection{Dark background (default)}
140 %
141 % By default, |owl| is a dark colour theme. This isn't just because owls are
142 % usually nocturnal --- a black background actually offers several advantages.
143 %
144 % \begin{itemize}
145 % \item In low-light environments, a dark background helps to reduce
146 % eye strain and focus attention on the content of your slides.
147 % \item Laser pointers are more visible against dark backgrounds. It's also
148 % easier to interact directly with your slides when the projector
149 % isn't shining as bright a light at your eyes and body.
150 % \item With a perfectly black background, there is no visual distinction
151 % between the frame margin and the surrounding projector screen.
152 % Because of this, less space needs to be dedicated to the margins of
153 % each slide; you could afford to use a larger font size, say, to
154 % increase visibility of the content.
155 % \end{itemize}
156 %
157 % There are a few caveats to using a black background. First and foremost,
158 % when applying a black background to an existing presentation, it is
159 % important to check that your figures and charts look all right.
160 % Diagrams created with TikZ or PGFPlots are easily adjusted to a new colour
161 % scheme; images generated from external tools may need to be re-exported,
162 % edited with an image editing program, or
163 % \href{http://tex.stackexchange.com/questions/34110/}{preprocessed} with the
164 % |convert| utility.
165 %
166 %
167 % \subsection{Light background}
168 %
169 % If your presentation or environment prevent you from using a dark
170 % background, but you still want to use the other colours in |owl|'s palette,
171 % you can use the |snowy| option to switch to a light theme. (Snowy owls, of
172 % course, are diurnal and have white plumage.)
173 %
174 % \begin{lstlisting}[title={\itshape Implementation}]
175 \@ifclassloaded{beamer}{
176 \iftoggle{snowy}{
177 \setbeamercolor{normal text}{fg=black, bg=white}
178 }{
179 \setbeamercolor{normal text}{fg=white, bg=black}
180 }
181 }{}
182 % \end{lstlisting}
183 %
184 %
185 %
186 % \section{The Colours}
187 %
188 % The projectors I encounter regularly tend to have very bright green channels
189 % and dim red and blue channels: the default |green| is sometimes so
190 % bright as to be indistinguishable from white, while even pure |red| and
191 % |blue| are still too dim to tell apart from black. The |owl| colour theme
192 % provides a basic colour palette that attempts to compensate for this.
193 %
194 % \subsection{Primary colours}
195 %
196 % \begin{description}
197 % \item[\textcolor{OwlBlue}{OwlBlue}]
198 % is a greenish blue, bright enough to be legible on a dark
199 % background.
200 % \item[\textcolor{OwlGreen}{OwlGreen}]
201 % is a darker green than the default, and with a slightly yellower hue
202 % to help distinguish it from |OwlBlue|.
203 % \item[\textcolor{OwlRed}{OwlRed}]
204 % is a pinkish magenta, which combines the (individually dim) red and
205 % blue channels on the projector to produce enough light to be legible.
206 % \item[\textcolor{OwlYellow}{OwlYellow}]
207 % is a gold colour of moderate brightness.
208 % \end{description}
209 %
210 % In addition to being distinguishable from white and black, these colours have
211 % been chosen to be as distinct as possible from one another. Even so, it is
212 % always a good idea to take care when selecting colours for your presentation.
213 % For audience members with red-green colour vision deficiencies, |OwlGreen|
214 % and |OwlYellow| may be difficult to tell apart, while |OwlRed| may be
215 % difficult to distinguish from light grey or white.
216 %
217 % \begin{lstlisting}[title={\itshape Implementation}]
218 \RequirePackage{xcolor}
219 \definecolor{OwlRed}{RGB}{ 255, 92, 168}
220 \definecolor{OwlGreen}{RGB}{ 90, 168, 0}
221 \definecolor{OwlBlue}{RGB}{ 0, 152, 233}
222 \definecolor{OwlYellow}{RGB}{ 242, 147, 24}
223 % \end{lstlisting}
224 %
225 % \subsection{Secondary colours}
226 %
227 % The |owl| colour theme also provides names for certain combinations of the
228 % above colours:
229 % \textcolor{OwlViolet}{\bfseries OwlViolet},
230 % \textcolor{OwlBrown}{\bfseries OwlBrown},
231 % \textcolor{OwlOrange}{\bfseries OwlOrange}, and
232 % \textcolor{OwlCyan}{\bfseries OwlCyan}.
233 % These should be used sparingly; if possible, it is preferable to use only
234 % two or three colours in a presentation.
235 %
236 % \begin{lstlisting}[title={\itshape Implementation}]
237 \colorlet{OwlViolet}{OwlRed!50!OwlBlue}
238 \colorlet{OwlBrown}{OwlRed!50!OwlGreen}
239 \colorlet{OwlOrange}{OwlRed!50!OwlYellow}
240 \colorlet{OwlCyan}{OwlGreen!50!OwlBlue}
241 % \end{lstlisting}
242 %
243 %
244 % \subsection{Redefines \LaTeX\ colours}
245 %
246 % Unless the |cautious| option is used, |owl| redefines the built-in colours
247 % |red|, |green|, |blue|, |yellow|, |violet|, |brown|, |orange|, and |cyan|
248 % to the above values. This allows you to create diagrams in TikZ or PGFPlots
249 % that use |owl|'s legible colours in your presentation but are still easy
250 % reuse in other contexts.
251 %
252 % \begin{lstlisting}[title={\itshape Implementation}]
253 \iftoggle{cautious}{}{
254 \colorlet{red}{OwlRed}
255 \colorlet{green}{OwlGreen}
256 \colorlet{blue}{OwlBlue}
257 \colorlet{yellow}{OwlYellow}
258 \colorlet{violet}{OwlViolet}
259 \colorlet{brown}{OwlBrown}
260 \colorlet{orange}{OwlOrange}
261 \colorlet{cyan}{OwlCyan}
262 }
263 % \end{lstlisting}
264 %
265 %
266 %
267 % \section{Implementation: Beamer colour definitions}
268 %
269 % The Beamer colours set by |owl| all derive from the definitions of
270 % |normal text|, |alerted text|, and |example text|. This makes it easy for
271 % you to tweak the theme; for example, you can add
272 % \begin{lstlisting}
273 % \setbeamercolor*{alerted text}{fg=OwlBlue}
274 % \setbeamercolor*{example text}{fg=OwlYellow}
275 % \end{lstlisting}
276 % to your preamble to change the highlight colours of the theme.
277 %
278 % \begin{lstlisting}
279 \@ifclassloaded{beamer}{
280 \setbeamercolor*{alerted text}{
281 fg=OwlRed
282 }
283 \setbeamercolor*{example text}{
284 fg=OwlGreen
285 }
286 % \end{lstlisting}
287 %
288 % \subsection{Title page}
289 % \begin{lstlisting}
290 \setbeamercolor*{title}{
291 use=normal text,
292 fg=normal text.fg
293 }
294 \setbeamercolor*{title in sidebar}{
295 use=normal text,
296 fg=normal text.fg
297 }
298 \setbeamercolor*{titlelike}{
299 use=normal text,
300 parent=normal text.fg
301 }
302 \setbeamercolor*{author}{
303 use=normal text,
304 parent=normal text.fg
305 }
306 \setbeamercolor*{date}{
307 use=normal text,
308 parent=normal text.fg
309 }
310 \setbeamercolor*{institute}{
311 use=normal text,
312 parent=normal text.fg
313 }
314 % \end{lstlisting}
315 %
316 % \subsection{Palettes}
317 % \begin{lstlisting}
318 \setbeamercolor*{structure}{
319 use=normal text,
320 fg=normal text.fg!50!normal text.bg
321 }
322 \setbeamercolor*{palette primary}{
323 use=normal text,
324 fg=normal text.fg!90!normal text.bg,
325 bg=normal text.bg!90!normal text.fg
326 }
327 \setbeamercolor*{palette secondary}{
328 use=normal text,
329 fg=alerted text.fg!75!normal text.bg,
330 bg=normal text.bg!90!normal text.fg
331 }
332 \setbeamercolor*{palette tertiary}{
333 use=normal text,
334 fg=example text.fg!75!normal text.bg,
335 bg=normal text.bg!90!normal text.fg
336 }
337 \setbeamercolor*{palette quaternary}{
338 use=normal text,
339 fg=normal text.fg!75!normal text.bg,
340 bg=normal text.bg!90!normal text.fg
341 }
342 \setbeamercolor*{sidebar}{
343 use=normal text,
344 fg=normal text.fg!80!normal text.bg,
345 bg=normal text.bg!80!normal text.fg
346 }
347 \setbeamercolor*{palette sidebar primary}{
348 use=palette primary,
349 parent=palette primary
350 }
351 \setbeamercolor*{palette sidebar secondary}{
352 use=palette primary,
353 parent=palette primary
354 }
355 \setbeamercolor*{palette sidebar tertiary}{
356 use=palette quaternary,
357 parent=palette quaternary
358 }
359 \setbeamercolor*{palette sidebar quaternary}{
360 use=palette quaternary,
361 parent=palette quaternary
362 }
363 \setbeamercolor*{frametitle}{
364 use=palette primary,
365 parent=palette primary
366 }
367 % \end{lstlisting}
368 %
369 % \subsection{Blocks}
370 % \begin{lstlisting}
371 \setbeamercolor*{block title}{
372 use=normal text,
373 fg=normal text.fg,
374 bg=
375 }
376 \setbeamercolor{block body}{
377 bg=
378 }
379 \setbeamercolor*{block title alerted}{%
380 use={block title, alerted text},
381 fg=alerted text.fg,
382 bg=block title.bg
383 }
384 \setbeamercolor*{block title example}{%
385 use={block title, example text},
386 fg=example text.fg,
387 bg=block title.bg
388 }
389 \setbeamercolor*{block body alerted}{
390 use=block body,
391 parent=block body
392 }
393 \setbeamercolor*{block body example}{
394 use=block body,
395 parent=block body
396 }
397 % \end{lstlisting}
398 %
399 %
400 % \subsection{Tweaks to Beamer}
401 %
402 % Since |owl| does not set a background colour for |block| environments,
403 % it also prevents the built-in themes from adding drop shadows to blocks.
404 % Finally, |owl| fixes a pet peeve of mine and disables the navigation symbols
405 % that often appear at the bottom right of Beamer presentations.
406 %
407 % \begin{lstlisting}
408 \def\beamer@themerounded@shadow{false}
409 \setbeamertemplate{navigation symbols}{}
410 }{}
411 % \end{lstlisting}
412 %
413 %
414 %
415 % \section{License and contributions}
416 %
417 % |owl| may be distributed and/or modified under the conditions of the
418 % \href{http://www.latex-project.org/lppl.txt}{LaTeX Project Public License}
419 % version 1.3 or later. The Current Maintainer of this work is Ross Churchley
420 % (|[email protected]|), who welcomes contributions to the package
421 % \href{https://github.com/rchurchley/beamercolortheme-owl}{on GitHub}.
422 %
423 % The goal of |owl| is to provide colours that are as visible as possible,
424 % even in unfavourable presenting conditions. This can be challenging to test
425 % with only one pair of eyes and a handful of projectors!
426 % If you have used |owl| or seen it used, we would greatly appreciate your
427 % opinion on how it performed. Please open a GitHub Issue or privately email
428 % the Current Maintainer with as much of the following information as you can:
429 %
430 % \begin{itemize}
431 % \item The version of |owl| used.
432 % \item The Beamer theme, if any, that was used together with |owl|.
433 % \item Whether |owl| was used as a dark or light theme.
434 % \item Details on the room (auditorium, large room, small room, \ldots)
435 % \item Details on the lighting conditions (brightly lit, dark, windows,
436 % \ldots)
437 % \item Details, if known, on the reporter's vision (glasses, colour
438 % deficiencies, \ldots)
439 % \item Your opinion on:
440 % \begin{itemize}
441 % \item whether normal text was visible against the background.
442 % \item whether the provided colours (|OwlRed|, |OwlBlue|, etc) were
443 % legible against the background.
444 % \item whether the provided colours (|OwlRed|, |OwlBlue|, etc) were
445 % distinguishable from each other and from the normal text
446 % colour.
447 % \end{itemize}
448 % \end{itemize}
449 %
450 % We also welcome technical feedback and bug reports in the form of
451 % GitHub Issues and pull requests.
452 %
453 %
454 % \clearpage
455 % \newgeometry{margin=1in}
456 % \section{Examples}
457 %
458 % \begin{center}
459 % \textit{Pittsburgh}
460 %
461 % \includegraphics[scale=0.2]{ex/Pittsburgh-dark/Pittsburgh-owl-1.png}
462 % \includegraphics[scale=0.2]{ex/Pittsburgh-dark/Pittsburgh-owl-2.png}
463 %
464 % \textit{Hannover}
465 %
466 % \includegraphics[scale=0.2]{ex/Hannover-dark/Hannover-owl-1.png}
467 % \includegraphics[scale=0.2]{ex/Hannover-dark/Hannover-owl-2.png}
468 %
469 % \href{https://github.com/matze/mtheme}{\itshape metropolis}
470 %
471 % \includegraphics[scale=0.2]{ex/metropolis-dark/metropolis-owl-1.png}
472 % \includegraphics[scale=0.2]{ex/metropolis-dark/metropolis-owl-2.png}
473 %
474 % \clearpage
475 %
476 % \textit{Pittsburgh} (|snowy owl|)
477 %
478 % \includegraphics[scale=0.2]{ex/Pittsburgh-light/Pittsburgh-owl-1.png}
479 % \includegraphics[scale=0.2]{ex/Pittsburgh-light/Pittsburgh-owl-2.png}
480 %
481 % \textit{Hannover} (|snowy owl|)
482 %
483 % \includegraphics[scale=0.2]{ex/Hannover-light/Hannover-owl-1.png}
484 % \includegraphics[scale=0.2]{ex/Hannover-light/Hannover-owl-2.png}
485 %
486 % \href{https://github.com/matze/mtheme}{\itshape metropolis} (|snowy owl|)
487 %
488 % \includegraphics[scale=0.2]{ex/metropolis-light/metropolis-owl-1.png}
489 % \includegraphics[scale=0.2]{ex/metropolis-light/metropolis-owl-2.png}
490 % \end{center}
491 %
492 % \restoregeometry
493 % \clearpage
494 %
495 % \Finale
496 \endinput