| 1 |
\documentclass[fontsize=9pt,landscape,parskip=half]{scrartcl} |
| 2 |
\usepackage{scrlayer-scrpage} |
| 3 |
\usepackage[paperwidth=128mm, |
| 4 |
paperheight=96mm, |
| 5 |
margin=8mm, |
| 6 |
footskip=6mm]{geometry} |
| 7 |
\usepackage{overlays} |
| 8 |
\usepackage[breaklinks,hidelinks]{hyperref} |
| 9 |
\usepackage{doc} |
| 10 |
\usepackage{alltt} |
| 11 |
\lofoot{\hspace{-4mm}% |
| 12 |
\hyperlink{titlepage}{Andreas Nolda \textbar{} |
| 13 |
The \textrm{overlays} package} \textbar{} |
| 14 |
\hyperlink{page.\thepage}{\thepage}/% |
| 15 |
\pageref{lastpage}} |
| 16 |
\cofoot{} |
| 17 |
\renewcommand{\familydefault}{\sfdefault} |
| 18 |
\definecolor{alert}{rgb}{0.7,0.15,0.35} |
| 19 |
\definecolor{structure}{rgb}{0.1,0.25,0.5} |
| 20 |
\setkomafont{pagefoot}{\color{structure}\normalfont\bfseries\scriptsize} |
| 21 |
\addtokomafont{sectioning}{\color{structure}} |
| 22 |
\frenchspacing |
| 23 |
\sloppy |
| 24 |
|
| 25 |
\begin{document} |
| 26 |
\pagestyle{scrheadings} |
| 27 |
\raggedright |
| 28 |
|
| 29 |
\thispagestyle{empty} |
| 30 |
\label{titlepage} |
| 31 |
{\color{structure}% |
| 32 |
{\Large \textbf{The \textrm{overlays} package} \\ |
| 33 |
\textit{A sample presentation}} \\[\baselineskip] |
| 34 |
Andreas Nolda \\ |
| 35 |
\url{https://andreas.nolda.org}}\vfill |
| 36 |
{\small Version 2.12 \\ |
| 37 |
23 February 2021} |
| 38 |
\clearpage |
| 39 |
|
| 40 |
\begin{fragileoverlays}{6} |
| 41 |
\subsubsection*{Overlays} |
| 42 |
The \textrm{overlays} package allows to write presentations with incremental |
| 43 |
slides. It does not presuppose any specific document class. Rather, it is a |
| 44 |
lightweight alternative to full-fledged presentation classes like |
| 45 |
\href{http://www.ctan.org/pkg/beamer}{\textrm{beamer}}. |
| 46 |
|
| 47 |
\visible{2-}{Every single state of a incremental slide will called an |
| 48 |
\emph{overlay} of that slide.} |
| 49 |
|
| 50 |
\visible{3-}{For incremental slides, the following environment is provided:} |
| 51 |
\begin{quote} |
| 52 |
\begin{alltt} |
| 53 |
\visible{3-}{\alert{3}{\textbackslash{}begin\{overlays\}\{\meta{total overlay number}\} |
| 54 |
\alert{4-}{\meta{slide content}} |
| 55 |
\textbackslash{}end\{overlays\}}} |
| 56 |
\end{alltt} |
| 57 |
\end{quote} |
| 58 |
|
| 59 |
\visible{4-}{In the slide content, the following commands can be used in order |
| 60 |
to specify the content of the overlays: |
| 61 |
\only{4}{\texttt{\textbackslash{}alert}.}% |
| 62 |
\only{5}{\texttt{\textbackslash{}visible}.}% |
| 63 |
\only{6}{\texttt{\textbackslash{}only}.}} |
| 64 |
\end{fragileoverlays} |
| 65 |
\clearpage |
| 66 |
|
| 67 |
% Slide with verbatim content. |
| 68 |
|
| 69 |
\begin{fragileoverlays}{6} |
| 70 |
\subsubsection*{Highlightning} |
| 71 |
For highlightning some content, the \textrm{overlays} package provides |
| 72 |
following command: |
| 73 |
\begin{quote} |
| 74 |
\begin{alltt} |
| 75 |
\alert{1}{\textbackslash{}alert\{\alert{2-5}{\meta{overlay specification}}\}\{\meta{content}\}} |
| 76 |
\end{alltt} |
| 77 |
\end{quote} |
| 78 |
|
| 79 |
\visible{2-}{Overlay specifications are either |
| 80 |
\alert{3}{single numbers}, |
| 81 |
\alert{4}{sequences of numbers}, or |
| 82 |
\alert{5}{ranges of numbers}. |
| 83 |
\visible{3-}{For example: |
| 84 |
\begin{itemize} |
| 85 |
\item{} \alert{3}{\texttt{1}} |
| 86 |
\visible{4-}{\item{} \alert{4}{\texttt{1,4}}} |
| 87 |
\visible{5-}{\item{} \alert{5}{\texttt{1-4}} |
| 88 |
\item{} \alert{5}{\texttt{1-}}} |
| 89 |
\end{itemize}}} |
| 90 |
|
| 91 |
\visible{6}{The \texttt{alert} color is red by default and can be changed to, |
| 92 |
say, \alert{6}{magenta} as follows: |
| 93 |
\begin{quote} |
| 94 |
\begin{alltt} |
| 95 |
\textbackslash{}definecolor\{alert\}\{rgb\}\{\alert{6}{0.7,0.15,0.35}\} |
| 96 |
\end{alltt} |
| 97 |
\end{quote}} |
| 98 |
\end{fragileoverlays} |
| 99 |
\clearpage |
| 100 |
|
| 101 |
\begin{fragileoverlays}{5} |
| 102 |
\subsubsection*{Visibility} |
| 103 |
The visibility of content is specified by means of the following commands: |
| 104 |
\begin{quote} |
| 105 |
\begin{alltt} |
| 106 |
\alert{1-3}{\textbackslash{}visible\{\meta{overlay specification}\}\{\meta{content}\}} |
| 107 |
\end{alltt} |
| 108 |
\end{quote} |
| 109 |
\begin{quote} |
| 110 |
\begin{alltt} |
| 111 |
\alert{1,4-}{\textbackslash{}only\{\meta{overlay specification}\}\{\meta{content}\}} |
| 112 |
\end{alltt} |
| 113 |
\end{quote} |
| 114 |
|
| 115 |
\only{2,3}{The \texttt{\textbackslash{}visible} command uncovers its content on |
| 116 |
the overlays which are specified in the overlay specification.} |
| 117 |
|
| 118 |
\only{3}{On unspecified overlays, the content is hidden, but still takes up |
| 119 |
space. Technically speaking, it is rendered in the \texttt{background} color, |
| 120 |
which, by default, is white.}% |
| 121 |
\only{4-}{ |
| 122 |
The \texttt{\textbackslash{}only} command also uncovers its content on the |
| 123 |
overlays specified in the overlay specification. |
| 124 |
|
| 125 |
The content is absent from unspecified overlays and does not take up space |
| 126 |
there.} |
| 127 |
|
| 128 |
\only{5}{This is particularly useful for alternating content.} |
| 129 |
\end{fragileoverlays} |
| 130 |
\clearpage |
| 131 |
|
| 132 |
\begin{fragileoverlays}{3} |
| 133 |
\subsubsection*{Verbatim content} |
| 134 |
For incremental slides with verbatim content, the following environment should |
| 135 |
be used instead of the \texttt{overlays} environment: |
| 136 |
\begin{quote} |
| 137 |
\begin{alltt} |
| 138 |
\alert{1}{\textbackslash{}begin\{fragileoverlays\}\{\meta{total overlay number}\} |
| 139 |
\meta{slide content} |
| 140 |
\textbackslash{}end\{fragileoverlays\}} |
| 141 |
\end{alltt} |
| 142 |
\end{quote} |
| 143 |
|
| 144 |
\visible{2-}{Note that the \alert{2,3}{\texttt{\textbackslash{}alert}}, |
| 145 |
\alert{2,3}{\texttt{\textbackslash{}visible}}, and |
| 146 |
\alert{2,3}{\texttt{\textbackslash{}only}} commands themselves must not contain |
| 147 |
verbatim commands or environments.\visible{3}{ They may be used in the content |
| 148 |
of the \texttt{alltt} environment of the |
| 149 |
\href{http://www.ctan.org/pkg/alltt}{\textrm{alltt} package}, though.}} |
| 150 |
\end{fragileoverlays} |
| 151 |
\clearpage |
| 152 |
|
| 153 |
\begin{overlays}{3} |
| 154 |
\subsubsection*{Caveats} |
| 155 |
The package expects that the slide content in the \alert{1}{\texttt{overlays}} |
| 156 |
environment fits on a single page. This can be ensured by means of |
| 157 |
\texttt{\textbackslash{}clearpage} commands before or after the environment. |
| 158 |
|
| 159 |
\visible{2-}{The \texttt{page} and \texttt{equation} counters are not |
| 160 |
incremented between overlays. Other counters can be saved between overlays, too, |
| 161 |
by means of the command |
| 162 |
\alert{2}{\texttt{\textbackslash{savecounterbetweenoverlays\{\meta{counter name}\}}}}.} |
| 163 |
|
| 164 |
\visible{3-}{Series of first-level lists specified by the \texttt{series} and |
| 165 |
\texttt{resume} keys of the \textrm{enumitem} package can be saved between |
| 166 |
overlays by means of the command |
| 167 |
\alert{3}{\texttt{\textbackslash{saveseriesbetweenoverlays\{\meta{series |
| 168 |
name}\}}}}, provided that the series name matches the basename of the list |
| 169 |
counter (i.e. the counter name without the final \texttt{i}).} |
| 170 |
\end{overlays} |
| 171 |
\clearpage |
| 172 |
|
| 173 |
\begin{overlays}{4} |
| 174 |
\subsubsection*{Further caveats} |
| 175 |
\visible{1-}{In the \texttt{tabular} environment, the |
| 176 |
\alert{1}{\texttt{\textbackslash{}alert}}, |
| 177 |
\alert{2}{\texttt{\textbackslash{}visible}} and |
| 178 |
\alert{3}{\texttt{\textbackslash{}only}} commands have to be put into braces: |
| 179 |
\begin{quote} |
| 180 |
\begin{tabular}[t]{ll} |
| 181 |
outside \texttt{tabular} & inside \texttt{tabular} \\\hline |
| 182 |
{\alert{1}{\texttt{\textbackslash{}alert\{\ldots\}\{\ldots\}}}} & |
| 183 |
{\alert{1}{\texttt{\{\textbackslash{}alert\{\ldots\}\{\ldots\}\}}}} \\ |
| 184 |
{\visible{2-}{{\alert{2}{\texttt{\textbackslash{}visible\{\ldots\}\{\ldots\}}}}}} & |
| 185 |
{\visible{2-}{{\alert{2}{\texttt{\{\textbackslash{}visible\{\ldots\}\{\ldots\}\}}}}}} \\ |
| 186 |
{\visible{3-}{{\alert{3}{\texttt{\textbackslash{}only\{\ldots\}\{\ldots\}}}}}} & |
| 187 |
{\visible{3-}{{\alert{3}{\texttt{\{\textbackslash{}only\{\ldots\}\{\ldots\}\}}}}}} |
| 188 |
\end{tabular} |
| 189 |
\end{quote}} |
| 190 |
\visible{4}{In addition, make sure not to include the cell delimiter |
| 191 |
\texttt{\&} or the row delimiter \texttt{\textbackslash{}\textbackslash{}} into |
| 192 |
the content of these commands.} |
| 193 |
\end{overlays} |
| 194 |
\clearpage |
| 195 |
|
| 196 |
\begin{overlays}{3} |
| 197 |
\subsubsection*{Non-interactive versions} |
| 198 |
Overlay processing can be switched off by means of the command |
| 199 |
\alert{1}{\texttt{\textbackslash{}overlaysoff}}. If used in the preamble, this |
| 200 |
command typesets only the last overlay of each incremental slide in the |
| 201 |
presentation. |
| 202 |
|
| 203 |
\visible{2-}{Similarly, the command |
| 204 |
\alert{2}{\texttt{\textbackslash{}alertsoff}} removes highlights in |
| 205 |
\texttt{alert} color.} |
| 206 |
|
| 207 |
\visible{3}{Both commands may be useful for non-interactive versions of a |
| 208 |
presentation, such as a presentation provided as a download.} |
| 209 |
\end{overlays} |
| 210 |
\clearpage |
| 211 |
|
| 212 |
\begin{overlays}{3} |
| 213 |
\subsubsection*{Credits} |
| 214 |
The code of the \textrm{overlays} package is inspired by Matthias Meister's |
| 215 |
\href{http://www.ctan.org/pkg/present}{\textrm{present} package}. |
| 216 |
|
| 217 |
\visible{2-}{In addition, it uses an algorithm by Martin Scharrer for testing |
| 218 |
numbers in numerical ranges (cf. \url{http://tex.stackexchange.com/q/19000}).} |
| 219 |
|
| 220 |
\visible{3}{The code for saving counters between overlays as well as the code |
| 221 |
for overlays with verbatim content is taken from the |
| 222 |
\href{http://www.ctan.org/pkg/texpower}{\textrm{texpower} package}, which in |
| 223 |
turn is based on Till Tantau's |
| 224 |
\href{http://www.ctan.org/pkg/beamer}{\textrm{beamer} package}.} |
| 225 |
\end{overlays} |
| 226 |
\label{lastpage} |
| 227 |
\end{document} |