Debian Codegraph @

texmf-dist/doc/latex/seminar/semlayer.doc

raw
1 % BEGIN semlayer.doc
2 %%
3 \def\fileversion{1.0}
4 \def\filedate{93/04/01}
5 %%
6 %% LaTeX style option `semlayer.sty'.
7 %% For use with LaTeX v2.09 and the `seminar' document style.
8 %%
9 %% COPYRIGHT 1993, by Timothy Van Zandt, [email protected]
10 %%
11 %% This file may be distributed and/or modified under the conditions of
12 %% the LaTeX Project Public License, either version 1.2 of this license
13 %% or (at your option) any later version. The latest version of this
14 %% license is in:
15 %%
16 %% http://www.latex-project.org/lppl.txt
17 %%
18 %% and version 1.2 or later is part of all distributions of LaTeX version
19 %% 1999/12/01 or later.
20 %%
21 %%
22 % **************************************************************************
23 % This is `semlayer.doc', which contains the documented code for
24 % `semlayer.sty'. You can use it in this form as the input file
25 % `semlayer.sty'. You can also create a stripped input file using
26 % sem-make.tex. You can print the documented code using sem-code.tex.
27 % sem-make.tex and sem-code.tex are distributed with seminar.sty.
28 % **************************************************************************
29 %
30 % \EndDocPreamble
31 %
32 % \CheckSum{276}
33 % \CharacterTable
34 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
35 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
36 % Digits \0\1\2\3\4\5\6\7\8\9
37 % Exclamation \! Double quote \" Hash (number) \#
38 % Dollar \$ Percent \% Ampersand \&
39 % Acute accent \' Left paren \( Right paren \)
40 % Asterisk \* Plus \+ Comma \,
41 % Minus \- Point \. Solidus \/
42 % Colon \: Semicolon \; Less than \<
43 % Equals \= Greater than \> Question mark \?
44 % Commercial at \@ Left bracket \[ Backslash \\
45 % Right bracket \] Circumflex \^ Underscore \_
46 % Grave accent \` Left brace \{ Vertical bar \|
47 % Right brace \} Tilde \~}
48 %
49 %
50 % \section{Overlays}
51 %
52 % The main thing that the "\process@slide" macro does is successively send the
53 % main slide and then each overlay and layer to a slide output routine. In
54 % order to make the definition of that macro easier to understand, we first
55 % set up the overlays interface.
56 %
57 % Overlays must be implemented by some extra macros, such as in
58 % "semcolor.sty". Specifically, the commands "\@overlay" and "\make@overlay"
59 % should be defined.
60 %
61 % The reason for including the interface in "seminar.sty" is to encourage
62 % those who implement overlays to use a uniform interface, and to illustrate
63 % how overlays work. To be honest, though, it may not be possible to implement
64 % overlays without PostScript or a graphics language with similar capabilities
65 % using the interface that is defined here and without rewriting the basic
66 % slides macros.
67 %
68 % This system of overlays is so good and the system using invisible fonts is
69 % so lousy, that no special provisions have been made for supporting the
70 % latter. Actually, overlay should (and could easily) be implemented as \TeX{}
71 % primitives, saving everyone a lot of trouble.
72 %
73 % The system for overlays is not explained here in great detail. See
74 % "semcolor.sty" and "pstricks.tex" for an example of how overlays can be
75 % implemented.
76 %
77 % \begin{macrocode}
78 \addto@hook\before@newslide{%
79 \global\def\overlay@list{}%
80 \setcounter{overlay}{0}}
81 % \end{macrocode}
82 %
83 % \begin{macro}{\process@slide,\overlay@loop,\layer@loop}
84 % "\process@slide" is the beginning of the ``output'' routine for slides.
85 % "\@slidebox" is copied to "\@@slidebox". The "\make@overlay#1" macro should
86 % set "\@slidebox" to the contents of "\@@slidebox", but with only the
87 % material for overlay "#1" visible.
88 % \begin{macrocode}
89 \newbox\@@slidebox
90 \def\process@@slide{%
91 \ifx\overlay@list\@empty
92 \finish@slide
93 \output@slide
94 \else
95 \setbox\@@slidebox\box\@slidebox
96 \make@overlay{0}%
97 \finish@slide
98 \output@slide
99 {\let\theoverlay\theslide\layer@loop{0}}%
100 \overlay@loop
101 \fi}
102 \def\overlay@loop{%
103 \begingroup
104 \overlay@prep
105 \c@overlay=1
106 \@whilenum\c@overlay<10
107 \do{%
108 \test@member{\the\c@overlay}{\overlay@list}%
109 \if@test
110 \make@overlay{\the\c@overlay}%
111 \finish@slide
112 \output@slide
113 \fi
114 \layer@loop{\the\c@overlay}%
115 \advance\c@overlay by 1}%
116 \endgroup}
117 \def\layer@loop#1{%
118 \begingroup
119 \layer@prep
120 \@for\currlayer:=\layer@list\do{%
121 \test@member{#1-\currlayer}{\overlay@list}%
122 \if@test
123 \make@overlay{#1-\currlayer}%
124 \finish@slide
125 \output@slide
126 \fi}%
127 \endgroup}
128 % \end{macrocode}
129 % \end{macro}
130 %
131 %
132 % \begin{macro}{\layer@prep,\overlay@prep}
133 % \begin{macrocode}
134 \def\layer@prep{%
135 \ifarticle\pagestyle{\layer@pagestyle}\fi
136 \let\thepage\thelayer
137 \ifx\thelayerframe\@empty\else\let\theslideframe\thelayerframe\fi
138 \let\slidelabel\layerlabel}
139 \def\overlay@prep{%
140 \ifarticle\pagestyle{\overlay@pagestyle}\fi
141 \let\thepage\theoverlay
142 \ifx\theoverlayframe\@empty\else\let\theslideframe\theoverlayframe\fi
143 \let\slidelabel\overlaylabel}
144 % \end{macrocode}
145 % \end{macro}
146 %
147 % \begin{macro}{\layerframe,\overlayframe}
148 % \begin{macrocode}
149 \def\layerframe{\@slideframe{layer}}
150 \def\overlayframe{\@slideframe{overlay}}
151 \def\thelayerframe{}
152 \def\theoverlayframe{}
153 % \end{macrocode}
154 % \end{macro}
155 %
156 % \begin{macro}{\overlaylabel,\layerlabel}
157 % \begin{macrocode}
158 \def\overlaylabel{\bf Overlay \theoverlay}
159 \def\layerlabel{\bf Layer \thelayer}
160 % \end{macrocode}
161 % \end{macro}
162 %
163 % \begin{macro}{\theoverlay,\thelayer}
164 % \begin{macrocode}
165 \newcounter{overlay}
166 \def\theoverlay{\theslide-\alph{overlay}}
167 \def\currlayer{}
168 \def\thelayer{\theoverlay-\currlayer}
169 % \end{macrocode}
170 % \end{macro}
171 %
172 % \begin{macro}{\ifoverlays,\iflayers}
173 % Overlays and layers can be turned on and off independently.
174 % \begin{macrocode}
175 \newif\ifoverlays
176 \newif\iflayers
177 \@ifundefined{@overlay}%
178 {\let\@overlay\relax}%
179 {\ifarticle\else\overlaystrue\layerstrue\fi}
180 % \end{macrocode}
181 % \end{macro}
182 %
183 % \begin{macro}{\nooverlays@err,\@overlay}
184 % "\@overlay" is set to "\relax" if it is not defined, for easy error
185 % detection.
186 % \begin{macrocode}
187 \def\nooverlays@err{%
188 \@seminarerr{You need to use additional macros for overlays,
189 e.g., semcolor.sty}\@ehd
190 \global\overlaysfalse
191 \global\layersfalse}
192 \@ifundefined{@overlay}{}{}
193 % \end{macrocode}
194 % \end{macro}
195 %
196 %
197 % \begin{macro}{\overlay}
198 % The "\overlay" command starts by checking that the argument is a number
199 % between 0 and 9. If so, "\@overlay" is invoked. Except for overlay 0, the
200 % counter for cross-references is set to "overlay", and its value is set to
201 % the argument of "\overlay".
202 % \begin{macrocode}
203 \def\overlay#1{%
204 \ifoverlays\ifx\@overlay\relax\nooverlays@err\fi\fi
205 \ifslide
206 \@tempcnta=#1
207 \@testfalse
208 \ifnum\@tempcnta>-1 \ifnum\@tempcnta<10 \@testtrue\fi\fi
209 \if@test
210 \c@overlay=\@tempcnta
211 \ifnum\c@overlay=0
212 \advance\c@slide by -1
213 \refstepcounter{slide}%
214 \else
215 \advance\c@overlay by -1
216 \refstepcounter{overlay}%
217 \ifoverlays
218 \xdef\overlay@list{\overlay@list,\the\c@overlay}%
219 \fi
220 \fi
221 \ifoverlays
222 \@overlay{\the\c@overlay}%
223 \fi
224 \else
225 \@seminarerr{\string\overlay\space argument must be
226 an integer between 0 and 9}\@eha
227 \fi
228 \else
229 \@seminarerr{\string\overlay\space can only be used
230 in slide environments}\@eha
231 \fi
232 \ignorespaces}
233 % \end{macrocode}
234 % \end{macro}
235 %
236 % \begin{macro}{\colorlayers}
237 % Color layers use the same mechanism as overlays; only the interface differs.
238 % \begin{macrocode}
239 \def\colorlayers#1{%
240 \edef\@tempc{#1}%
241 \edef\layer@list{\layer@list,#1}%
242 \def\@tempa##1{%
243 \@namedef{##1}{%
244 \iflayers\ifx\@overlay\relax\nooverlays@err\fi\fi
245 \ifslide
246 \iflayers
247 \xdef\overlay@list{\overlay@list,\the\c@overlay-##1}%
248 \@overlay{\the\c@overlay-##1}%
249 \fi
250 \else
251 \@seminarerr{Color layer `##1' can only be used in
252 slide environments}\@eha
253 \fi}}
254 \@for\@tempb:=\@tempc\do{%
255 \expandafter\@tempa\expandafter{\@tempb}}}
256 \def\layer@list{}
257 % \end{macrocode}
258 % \end{macro}
259 %
260 %
261 % \begin{macro}{\layerpagestyle,\overlaypagestyle}
262 % \begin{macrocode}
263 \def\overlaypagestyle#1{\@ifgoodps{#1}{\edef\overlay@pagestyle{#1}}}
264 \def\layerpagestyle#1{\@ifgoodps{#1}{\edef\layer@pagestyle{#1}}}
265 \overlaypagestyle{}
266 \layerpagestyle{}
267 % \end{macrocode}
268 % \end{macro}
269 %
270 \endinput
271 % END semlayer.doc