summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/overlays/sample.tex
blob: d48c28a161f3263d0978ee7d47783e837b3326de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
\documentclass[fontsize=9pt,landscape,parskip=half]{scrartcl}
\usepackage{scrlayer-scrpage}
\usepackage[paperwidth=128mm,
            paperheight=96mm,
            margin=8mm,
            footskip=6mm]{geometry}
\usepackage{overlays}
\usepackage[breaklinks,hidelinks]{hyperref}
\usepackage{url}
\usepackage[normalem]{ulem}
\usepackage{doc}
\usepackage{alltt}
\lofoot{\hspace{-4mm}%
        \hyperlink{titlepage}{Andreas Nolda \textbar{}
                              The \textrm{overlays} package} \textbar{}
        \hyperlink{page.\thepage}{\thepage}/%
        \pageref{lastpage}}
\cofoot{}
\renewcommand{\familydefault}{\sfdefault}
\definecolor{alert}{rgb}{0.7,0.15,0.35}
\definecolor{structure}{rgb}{0.1,0.25,0.5}
\setkomafont{pagefoot}{\color{structure}\normalfont\bfseries\scriptsize}
\addtokomafont{sectioning}{\color{structure}}
\let\hrefsave\href
\renewcommand{\href}[2]{\hrefsave{#1}{\uline{#2}}}
\frenchspacing
\sloppy

\begin{document}
\pagestyle{scrheadings}
\raggedright

\thispagestyle{empty}
\label{titlepage}
{\color{structure}%
{\Large \textbf{The \textrm{overlays} package} \\
\textit{A sample presentation}} \\[\baselineskip]
Andreas Nolda \\
\url{http://andreas.nolda.org}}\vfill
{\small Version 2.0 \\
30 September 2016}
\clearpage

\begin{fragileoverlays}{6}
\subsubsection*{Overlays}
The \textrm{overlays} package allows to write presentations with incremental
slides. It does not presuppose any specific document class. Rather, it is a
lightweight alternative to full-fledged presentation classes like
\href{http://www.ctan.org/pkg/beamer}{\textrm{beamer}}.

\visible{2-}{Every single state of a incremental slide will called an
\emph{overlay} of that slide.}

\visible{3-}{For incremental slides, the following environment is provided:}
\begin{quote}
\begin{alltt}
\visible{3-}{\alert{3}{\textbackslash{}begin\{overlays\}\{\meta{total overlay number}\}
\alert{4-}{\meta{slide content}}
\textbackslash{}end\{overlays\}}}
\end{alltt}
\end{quote}

\visible{4-}{In the slide content, the following commands can be used in order
to specify the content of the overlays:
\only{4}{\texttt{\textbackslash{}alert}.}%
\only{5}{\texttt{\textbackslash{}visible}.}%
\only{6}{\texttt{\textbackslash{}only}.}}
\end{fragileoverlays}
\clearpage

% Slide with verbatim content.

\begin{fragileoverlays}{6}
\subsubsection*{Highlightning}
For highlightning some content, the \textrm{overlays} package provides
following command:
\begin{quote}
\begin{alltt}
\alert{1}{\textbackslash{}alert\{\alert{2-5}{\meta{overlay specification}}\}\{\meta{content}\}}
\end{alltt}
\end{quote}

\visible{2-}{Overlay specifications are either
\alert{3}{single numbers},
\alert{4}{sequences of numbers}, or
\alert{5}{ranges of numbers}.
\visible{3-}{For example:
\begin{itemize}
\item{} \alert{3}{\texttt{1}}
\visible{4-}{\item{} \alert{4}{\texttt{1,4}}}
\visible{5-}{\item{} \alert{5}{\texttt{1-4}}
\item{} \alert{5}{\texttt{1-}}}
\end{itemize}}}

\visible{6}{The \texttt{alert} color is red by default and can be changed to,
say, \alert{6}{magenta} as follows:
\begin{quote}
\begin{alltt}
\textbackslash{}definecolor\{alert\}\{rgb\}\{\alert{6}{0.7,0.15,0.35}\}
\end{alltt}
\end{quote}}
\end{fragileoverlays}
\clearpage

\begin{fragileoverlays}{5}
\subsubsection*{Visibility}
The visibility of content is specified by means of the following commands:
\begin{quote}
\begin{alltt}
\alert{1-3}{\textbackslash{}visible\{\meta{overlay specification}\}\{\meta{content}\}}
\end{alltt}
\end{quote}
\begin{quote}
\begin{alltt}
\alert{1,4-}{\textbackslash{}only\{\meta{overlay specification}\}\{\meta{content}\}}
\end{alltt}
\end{quote}

\only{2,3}{The \texttt{\textbackslash{}visible} command uncovers its content on
the overlays which are specified in the overlay specification.}

\only{3}{On unspecified overlays, the content is hidden, but still takes up
space. Technically speaking, it is rendered in the \texttt{background} color,
which, by default, is white.}%
\only{4-}{
The \texttt{\textbackslash{}only} command also uncovers its content on the
overlays specified in the overlay specification.

The content is absent from unspecified overlays and does not take up space
there.}

\only{5}{This is particularly useful for alternating content.}
\end{fragileoverlays}
\clearpage

\begin{fragileoverlays}{3}
\subsubsection*{Verbatim content}
For incremental slides with verbatim content, the following environment should
be used instead of the \texttt{overlay} environment:
\begin{quote}
\begin{alltt}
\alert{1}{\textbackslash{}begin\{fragileoverlays\}\{\meta{total overlay number}\}
\meta{slide content}
\textbackslash{}end\{fragileoverlays\}}
\end{alltt}
\end{quote}

\visible{2-}{Note that the \alert{2,3}{\texttt{\textbackslash{}alert}},
\alert{2,3}{\texttt{\textbackslash{}visible}}, and
\alert{2,3}{\texttt{\textbackslash{}only}} commands themselves must not contain
verbatim commands or environments.\visible{3}{ They may be used in the content
of the \texttt{alltt} environment of the
\href{http://www.ctan.org/pkg/alltt}{\textrm{alltt} package}, though.}}
\end{fragileoverlays}
\clearpage

\begin{overlays}{6}
\subsubsection*{Caveats}
The package expects that the slide content in the \texttt{overlays} environment
fits on a single page. This can be ensured by means of
\texttt{\textbackslash{}clearpage} commands before or after the environment.

\visible{2-}{The \texttt{page} counter is not incremented between overlays.
Other counters may give rise to unexpected results.}

\visible{3-}{In the \texttt{tabular} environment, the
\alert{3}{\texttt{\textbackslash{}alert}},
\alert{4}{\texttt{\textbackslash{}visible}} and
\alert{5}{\texttt{\textbackslash{}only}} commands have to be put into braces:
\begin{quote}
\begin{tabular}[t]{ll}
outside \texttt{tabular} & inside \texttt{tabular} \\\hline
{\alert{3}{\texttt{\textbackslash{}alert\{\ldots\}\{\ldots\}}}} &
{\alert{3}{\texttt{\{\textbackslash{}alert\{\ldots\}\{\ldots\}\}}}} \\
{\visible{4-}{{\alert{4}{\texttt{\textbackslash{}visible\{\ldots\}\{\ldots\}}}}}} &
{\visible{4-}{{\alert{4}{\texttt{\{\textbackslash{}visible\{\ldots\}\{\ldots\}\}}}}}} \\
{\visible{5-}{{\alert{5}{\texttt{\textbackslash{}only\{\ldots\}\{\ldots\}}}}}} &
{\visible{5-}{{\alert{5}{\texttt{\{\textbackslash{}only\{\ldots\}\{\ldots\}\}}}}}}
\end{tabular}
\end{quote}}
\visible{6-}{In addition, make sure not to include the cell delimiter
\texttt{\&} or the row delimiter \texttt{\textbackslash{}\textbackslash{}} into
the content of these commands.}
\end{overlays}
\clearpage

\begin{overlays}{3}
\subsubsection*{Credits}
The code of the \textrm{overlays} package is inspired by
\href{http://www.ctan.org/pkg/present}{Matthias Meister's \textrm{present}
package}.

\visible{2-}{In addition, it uses
\href{http://tex.stackexchange.com/q/19000/}{an algorithm by Martin Scharrer}
for testing numbers in numerical ranges.}

\visible{3}{The code for processing overlays with verbatim content is taken from
the \textrm{texpower} package, which in turn took it from Till Tantau's
\textrm{beamer} package.}
\end{overlays}
\label{lastpage}
\end{document}