seminar.sty

A L^{A}TEX style for slides and notes

Documented Code

Timothy Van Zandt^{∗}

8 May 1992 Version 0.92

seminar.sty is a L^{A}TEX document style for typesetting slides or transparencies, and accompanying notes.

This is the documented code. There is also a User’s Guide, which contains installation instructions.

Contents

1 Overview 1 2 Useful hacks 1 3 Auxilary files and style options 2 4 Document hooks 3 5 Slide-making macros 4 6 Rotation 9 7 Overlays 11 8 Page numbering in the slides format 14 9 Slide output routines 15

10 The \init@slide and \@slideboxrestore macros  19

11 Slide frames 23 12 Slide styles 25 13 Page styles 26 14 Magnification 27 15 Page parameters 30 16 Titles 32 17 Omitting and including notes 33 18 Omitting and including slides 34 19 Font size declarations 36 20 The \twoup macro 38 21 No notes 40 22 Configuration file 40 Index 41 Overview 1

∗Author’s address: Department of Economics, Princeton University, Princeton, NJ 08544-1021, USA. Internet: tvz@Princeton.EDU

1 Overview

In principle, a slides style is a simple matter; just a question of resetting the magnification and changing a few page parameters. However, allowing notes and slides to be put in the same file but treated differently, and allowing everything to be printed in various formats, complicates things a bit. As usual, the codes starts by checking that the file is not loaded, and announcing the file on the terminal.

55 \@ifundefined{@seminarerr}{}{\endinput}
56 \typeout{Document Style: `seminar' v\fileversion \space
57 <\filedate> (tvz)}

2 Useful hacks

\test@member

The second argument to \test@member is a comma-separated list. \test@member checks whether the first argument is a member of this list (after expanding both the list and the first argument), setting \if@test appropriately.

58 \def\test@member#1#2{%
59 \edef\@tempg{,#2,#1,}%
60 \edef\@temph{####1,#1,}%
61 \expandafter\def\expandafter\@temph\@temph##2\@nil{%
62  \def\@tempg{##2}%
63  \ifx\@tempg\@empty\@testfalse\else\@testtrue\fi}%
64 \expandafter\@temph\@tempg\@nil}
\addto@hook

The first argument of \addto@hook is a token register. \addto@hook adds its second argument to this register. This is a standard macro in the Mainz distribution, but we have separated the additions with \relax to avoid interference.

65 \def\addto@hook#1#2{#1\expandafter{\the#1\relax#2}}
\@seminarerr

2 seminar.sty: Documented Code

\@seminarerr is analogous to \@latexerr.
66 \def\@seminarerr#1#2{%
67 \edef\@tempc{#2}\expandafter\errhelp\expandafter{\@tempc}%
68 \typeout{seminar.sty error.\space\space\space
69  Type \space H <return> \space for immediate help.}%
70 \errmessage{#1}}
\addto@preamblecmds

Various commands used in this style are added to \@preamblecmds. This macros makes it easier to do this as we go along.

71 \def\addto@preamblecmds#1{%
72 \begingroup
73  \def\do{\noexpand\do\noexpand}%
74  \xdef\@preamblecmds{\@preamblecmds\do#1}%
75 \endgroup}
76 \addto@preamblecmds{\addto@preamblecmds\do\@preamblecmds}

3 Auxilary files and style options

The formats and selections are specified using style options, but these do not correspond to independent files. Customization of one of the versions does not require modifying this style file, because all versiondependent code in this file can be overridden.

77 \newif\ifslides\slidestrue
78 \newif\ifarticle
79 \newif\ifslidesonly
80 \newif\ifnotes
81 \newif\ifnotesonly
82 \def\ds@article{\articletrue\slidesfalse}
83 \def\ds@slidesonly{\slidesonlytrue\notesfalse\notesonlyfalse}
84 \def\ds@notes{\notestrue\slidesonlyfalse\notesonlyfalse}
85 \def\ds@notesonly{\notesonlytrue\slidesonlyfalse\notesfalse}

This style is based in part on the L^{A}TEX article style, which we now input. article.sty takes care of executing the options.

86 \input{article.sty}

xcomment.sty contains the macros for omitting notes, and is only required for the slidesonly selection.

87 \ifslidesonly

Document hooks 3

88 \@ifundefined{xcomment@@@}{\input{xcomment.sty}}{}
89 \fi

4 Document hooks

\document

\document is redefined to incorporate hooks, in the following order:

    \endgroup
    \the\before@document
    \begingroup
    \document
    \the\after@document
    \xcomment@hook
\before@document and \after@document are token registers that can

be added to using \addto@hook. These will be used for things like

invoking \landscape and \slidefonts. \xcomment@hook is a com-

mand sequence that will be used to invoke the xcomment macros for commenting out the notes in the slidesonly selection. Messing with the definition of \document creates potential conflicts with other optional style files that do the same. However, we add these commands in a very friendly way: (i) it shouldn’t cause problems even if \document does not have its standard definition, and (ii) if some other macros subsequently change the definition of \document in the same way, seminar.sty should not break. Styles designed specifically for use with seminar.sty should use \before@document to add their own modifications to the \document command.

In the code below, \before@document and \after@document are used

as temporary token registers during the modification of \document.

90 \newtoks\before@document
91 \newtoks\after@document
92 \let\xcomment@hook\relax
93 \before@document{\endgroup\the\before@document\begingroup}
94 \after@document{\the\after@document\xcomment@hook}
95 \expandafter\@temptokena\expandafter{\document}
96 \edef\document{\the\before@document
97 \the\@temptokena\the\after@document}
98 \before@document{}
99 \after@document{}

\enddocument

Now we do something similar with \end@document, adding the token register \before@enddocument to the beginning of the definition of

\enddocument
100 \newtoks\before@enddocument
101 \before@enddocument{\the\before@enddocument}
102 \expandafter\@temptokena\expandafter{\enddocument}
103 \edef\enddocument{\the\before@enddocument\the\@temptokena}
104 \before@enddocument{}

\landscape, \iflandscape

\iflandscape controls whether \landscape is invoked at the beginning of the document. \landscape is defined here to warn the user to print in landscape mode.

105 \newif\iflandscape
106 \ifslides\landscapetrue\fi
107 \addto@hook\before@document{%
108 \iflandscape\landscape\fi}
109 \addto@preamblecmds{%
110 \landscapetrue\do\landscapefalse\do\landscape}
111 \def\landscape{\addto@hook\before@enddocument{%
112 \typeout{^^J
113 *******************************************************^^J
114 ***** !! PRINT THIS DOCUMENT IN LANDSCAPE MODE !! *****^^J
115 *******************************************************}}}

5 Slide-making macros

A slide environment puts its contents in a minipage inside a box. The box is then manipulated (rotated, framed, etc), before being sent to the output. The macros that make up the slide environments are quite modular, which facilitates customization. This section contains those parts that are independent of the version.

\theslide
116 \newcounter{slide}
117 \def\theslide{\arabic{slide}}

Slide-making macros 5

\slidewidth, \slideheight, \@slidewidth, \@slideheight
118 \newdimen\slidewidth \slidewidth 8.5in
119 \newdimen\slideheight \slideheight 6.3in
120 \newdimen\@slidewidth
121 \newdimen\@slideheight
\@slidebox

The slide environments create a box called \@slidebox, and then perform various operations on this box. The “embellished” slidebox has

the register \emb@slidebox.
122 \newbox\@slidebox
123 \newbox\emb@slidebox
\if@slide, \if@landscape

\if@slide is true for either slide environment. This allows commands to be active only in slide environments (important for overlays, for example). \if@landscape is true for landscape slides, and false for portrait slides. This allows embellishments to customize their behavior, although it is not actually used by any of the macros defined in

seminar.sty.
124 \newif\if@slide
125 \newif\if@landscape
\@landscapeonly, \landscapeonly, \portraitonly

\@landscapeonly is defined to be 1 if only landscape slides should be printed, -1 if only portrait slides should be printed, and 0 if both orientations should be printed.

126 \def\@landscapeonly{0}
127 \def\landscapeonly{\def\@landscapeonly{1}}
128 \def\portraitonly{\def\@landscapeonly{-1}}
\NestedSlide@Error

We will check for nested slide environments, and attempt to recover the best we can. Otherwise, forgetting the end of a slide environment could cause TEX to procede to the end of the document without generating any input, and then give unlightening error messages.

129 \def\NestedSlide@Error#1{%

130 \if@slide
131  \endgroup
132  \@seminarerr{Nested slide environments. Perhaps missing
133  \string\end{\@currenvir}. May be fatal}\@ehd
134  \expandafter\end\expandafter{\@currenvir}%
135  \@slidefalse\def\next{\begin{slide#1}}%
136 \else
137  \@slidetrue
138  \def\next{\@ifnextchar [{\@nameuse{@slide#1}}%
139  {\@nameuse{@slide#1}[\slidewidth,\slideheight]}}%
140 \fi
141 \next}

\before@slide, \after@slide

Commands can be added to these hooks using \addto@hook.

142 \newtoks\before@slide
143 \ifslides\before@slide{\clearpage}\fi
144 \newtoks\after@slide

\begin@slidebox, \end@slidebox

Because we want to be able to include slides as floats, we put slides in a box rather than using TEX’s page-cutting routines. This has two disadvantages:

• Changes to parameters that are used in the slide “output” routines within a slide environment are local to the box that contains the slide.

• There is no way to define a longslide environment, where the contents spill from one page to the other.

The first problem is a minor inconvenience for which there is a workaround; see the description of \slide@parameters below. The second problem is not likely to arise, because that is an odd way to make slides, but it would be nice to have such a feature. It would be possible, but much too complicated, to allow such an environment while retaining the features of the article format.

\begin@slidebox and \end@slidebox are adaptations of \minipage

and \endminipage. Thus, the contents of a slide environment is put in

a minipage of width \@slidewidth. The commands \init@slide and

Slide-making macros 7

\slidebox@restore customize numerous command and macros for the slide environments.

After ending the minipage, \restore@slideparameters is globally defined so that it resets selected slide parameters to the values they have within the slide environment; these values are then used when framing and otherwise embellishing the slide. Then the slide is vertically centered in a \vbox of height \@slideheight. If overlays have been used in the slide, then \overlay{0} is added to this box. Since \overlay{0} generally involves specials, we don’t want to add it to a slide box unless we have to.

145 \def\begin@slidebox{\setbox\@slidebox=\vbox\bgroup\begingroup
146 \hsize\@slidewidth\textwidth\hsize
147 \columnwidth\hsize\linewidth\hsize
148 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}%
149 \c@mpfootnote\z@
150 \let\@footnotetext\@mpfootnotetext
151 \let\@listdepth\@mplistdepth \@mplistdepth\z@
152 \global\@minipagetrue
153 \everypar{\global\@minipagefalse\everypar{}}%
154 \init@slide\slidebox@restore\slidefonts
155 \the\slide@hook\everyslide\ignorespaces}
156 \def\end@slidebox{\par\vskip-\lastskip
157 \ifvoid\@mpfootins\else
158 \vskip\skip\@mpfootins\footnoterule\unvbox\@mpfootins\fi
159 \global\@minipagefalse
160 \expandafter\xdef\expandafter\restore@slideparameters
161  \expandafter{\the\slide@parameters}%
162 \endgroup\egroup
163 \restore@slideparameters
164 \ifx\overlay@list\@empty\overlaysfalse\else\overlaystrue\fi
165 \setbox\@slidebox=\vbox to \@slideheight{{%
166  \ifoverlays\overlay{0}\fi\vfill\box\@slidebox\vfill}}}%

\slide@parameters

The token register \slide@parameters contains commands for getting the values of slide parameters from inside the slide box to where they are needed during the processing of the slide. Additional commands can be added with \addto@hook. Before adding tokens to the register,

see the use of \slide@parameters and \restore@parameters in the

\end@slidebox, \endslide and \endslide* macros, and the various

examples of tokens added to \slide@parameters throughout this file.

167 \newtoks\slide@parameters
\slide, \endslide

The slide environment creates landscape slides. \beginslide scales the dimensions, and then invokes the hook \before@slide; this is a token register which can be used, for example, to clear the page and play with slide numbering.

168 \def\slide{\NestedSlide@Error{}}
169 \def\@slide[#1,#2]{%
170 \the\before@slide
171 \@landscapetrue
172 \setslidelength{\@slidewidth}{#1}%
173 \setslidelength{\@slideheight}{#2}%
174 \begin@slidebox}

Then the slide rotation \slide@rotation is set to \l@rotation; this value will be used in the slide output routines. \os@test checks whether according to some \onlyslides or \notslides command, this slide should not be output; \os@test is defined in Section 18. \process@slide begins the slide output routine, which is defined in Section 9. The hook \after@slide is a token register that can be used, for example, to reset the numbering of notes.

175 \def\endslide{\end@slidebox
176 \edef\slide@rotation{\l@rotation}%
177 \ifnotesonly\else\ifnum\@landscapeonly>-1
178  \os@test\if@test\process@slide\fi
179 \fi\fi
180 \the\after@slide}
\slide*, \endslide*

The slide* environment is just like the slide environment, except that the dimensions are switched and the rotation is different.

181 \@namedef{slide*}{\NestedSlide@Error{*}}
182 \@namedef{@slide*}[#1,#2]{%
183 \the\before@slide
184 \@landscapefalse

Rotation 9

185 \setslidelength{\@slideheight}{#1}%
186 \setslidelength{\@slidewidth}{#2}%
187 \begin@slidebox}
188 \@namedef{endslide*}{\end@slidebox
189 \edef\slide@rotation{\p@rotation}%
190 \ifnotesonly\else\ifnum\@landscapeonly<1
191  \os@test\if@test\process@slide\fi
192 \fi\fi
193 \the\after@slide}

6 Rotation

Rotation macros must be implemented by \special’s, such as in semcolor.sty. The interface for rotation is built into seminar.sty, however. To implement a rotation rot, two commands must be defined:

\rotb@rot This macro should take a box register, #1, rotate its contents, and set #1 to the new box. Examples are given in

    semcolor.sty.

\rotm@rot This macro should switch the margins around for a rotated page. Examples are given below.

There are three “reserved” rotations: none should perform no rotation at all. left should rotate a box 90^{∘}, and right should rotate a box

270^{∘}. \rotm@none, \rotm@left and \rotm@right are defined below,

but can be redefined by macros implementing rotation; the reason for defining them below is to provide examples. \rotb@none is also defined below. \rotb@left and \rotb@right are not implemented here since they require \special’s.

\rotb@none

Only the null rotation, \rotb@none, is defined here.

194 \let\rotb@none\@gobble
\p@rotation, \l@rotation, \slide@rotation, \sliderotation

\p@rotation should be set to the rotation for portrait slides, and \l@rotation should be set to the rotation for landscape slides. In principle, it is possible for each of these to do active rotations, but the interface is set up so that at most one type of slide is rotated. One specifies the direction of rotation, and which slides are rotated, and these two parameters can be set independently.

195 \def\p@rotation{\slide@rotation}
196 \def\l@rotation{none}
197 \def\slide@rotation{none}
198 \def\sliderotation#1{%
199 \@ifundefined{rotb@#1}%
200  {\@seminarerr{Rotation `#1' undefined}\@eha}%
201  {\def\slide@rotation{#1}}}
202 \addto@hook\slide@parameters{%
203 \noexpand\def\noexpand\slide@rotation{\slide@rotation}}
\ifrotateheaders

In the slides style, the slides can either be rotated before being placed on the page, or the whole page can be rotated. The difference, of course, is that the latter rotates the headers, but the former does not. \ifrotateheaders controls which procedure is used.

204 \newif\ifrotateheaders
205 \addto@hook\slide@parameters{%
206 \ifrotateheaders\noexpand\rotateheaderstrue\else
207  \noexpand\rotateheadersfalse\fi}
\rotm@none, \rotm@left, \rotm@right, \rotm@down

Macros implementing rotation also have to worry about defining \rotm@rot so that it switches the page parameters for rotated pages,

used when \ifrotateheaders is true.
208 \ifslides
209 \let\rotm@none\relax
210 \let\rotm@down\relax
211 \def\rotm@left{%
212  \@tempdima\textwidth
213  \textwidth\textheight
214  \textheight\@tempdima
215  \@tempdima\oddsidemargin
216  \oddsidemargin\topmargin
217  \advance\oddsidemargin by \headheight
218  \advance\oddsidemargin by \headsep
219  \topmargin\@tempdima

Overlays 11

220  \advance\topmargin by -\headheight
221  \advance\topmargin by -\headsep}
222 \def\rotm@right{%
223  \@tempdima\textwidth
224  \textwidth\textheight
225  \textheight\@tempdima
226  \@tempdima\oddsidemargin
227  \oddsidemargin\topmargin
228  \advance\oddsidemargin by \headheight
229  \advance\oddsidemargin by \headsep
230  \topmargin\@tempdima
231  \footskip
232  \advance\topmargin by 4\footskip}
233 \let\rotm@right\rotm@left
234 \fi

7 Overlays

The main thing that the \process@slide macro does is successively send the main slide and then each overlay and layer to a slide output routine. In order to make the definition of that macro easier to understand, we first set up the overlays interface.

Overlays must be implemented by some extra macros, such as in semcolor.sty. Specifically, the commands \@overlay and \make@overlay should be defined, and the conditionals \ifoverlays and \iflayers need to be activated.

The reason for including the interface in seminar.sty is to encourage those who implement overlays to use a uniform interface, and to illustrate how overlays work. To be honest, though, it may not be possible to implement overlays without PostScript or a graphics language with similar capabilities using the interface that is defined here and without rewriting the basic slides macros. However, this system of overlays is so good and the system using invisible fonts is so lousy, that no special provisions have been made for supporting the latter. Actually, overlay should (and could easily) be implemented as TEX primitives, saving everyone a lot of trouble.

The system for overlays is not explained here in great detail. Turn to the documentation of semcolor.sty and pstricks.tex for an example of how overlays can be implemented.

\theoverlay, \thelayer
235 \newcounter{overlay}
236 \def\theoverlay{\theslide-\alph{overlay}}
237 \def\n@layer{}
238 \def\thelayer{\theoverlay-\n@layer}

\ifoverlays, \iflayers

Overlays and layers can be turned on and off independently, but it is up to the macros that implement overlays to include the commands

\newif\ifoverlay and \newif\iflayers.
239 \let\ifoverlays\iffalse
240 \let\iflayers\iffalse
241 \def\overlaystrue{%
242 \@seminarerr{Overlays are not implemented}\@eha}
243 \let\layerstrue\overlaystrue
244 \let\overlaysfalse\relax
245 \let\layersfalse\relax

\@overlay, \make@overlay

These are the default definitions of \@overlay and \make@overlay.

246 \def\@overlay#1{\@seminarerr{Overlays are not implemented.
247 You shouldn't have been able to get this far}\@ehd}
248 \def\make@overlay#1{\@seminarerr{Overlays are not implemented.
249 You shouldn't have been able to get this far}\@ehd}

\overlay

The \overlay command starts by checking that the argument is a number between 0 and 9. If so, \@overlay is invoked. Except for overlay 0, the counter for cross-references is set to overlay, and its value is set to the argument of \overlay.

250 \def\overlay#1{%
251 \if@slide
252  \@tempcnta=#1
253  \@testfalse
254  \ifnum\@tempcnta>-1\ifnum\@tempcnta<10\@testtrue\fi\fi

Overlays 13

255  \if@test
256  \c@overlay=\@tempcnta
257  \ifnum\c@overlay=0
258  \advance\c@slide by -1
259  \refstepcounter{slide}%
260  \else
261  \advance\c@overlay by -1
262  \refstepcounter{overlay}%
263  \ifoverlays
264  \xdef\overlay@list{\overlay@list,\the\c@overlay}%
265  \fi
266  \fi
267  \ifoverlays
268  \@overlay{\the\c@overlay}%
269  \fi
270  \else
271  \@seminarerr{\string\overlay\space argument must be
272  an integer between 0 and 9}\@eha
273  \fi
274 \else
275  \@seminarerr{\string\overlay\space can only be used
276  in slide environments}\@eha
277 \fi
278 \ignorespaces}

 \colorlayers

Color layers use the same mechanism as overlays; only the interface differs.

279 \def\colorlayers#1{%
280 \edef\@tempc{#1}%
281 \edef\layer@list{\layer@list,#1}%
282 \def\@tempa##1{%
283  \@namedef{##1}{%
284  \if@slide
285  \iflayers
286  \xdef\overlay@list{\overlay@list,\the\c@overlay-##1}%
287  \@overlay{\the\c@overlay-##1}%
288  \fi
289  \else
290  \@seminarerr{Color layer `##1' can only be used in
291  slide environments}\@eha

292  \fi}}
293 \@for\@tempb:=\@tempc\do{%
294  \expandafter\@tempa\expandafter{\@tempb}}}
295 \def\layer@list{}
296 \addto@hook\slide@parameters{%
297 \noexpand\def\noexpand\layer@list{\layer@list}}

8 Page numbering in the slides format

Here is one last thing before we get to the slide output routines. In the slides format, we let the page counter be stepped as usual by the output routine, but we don’t use it for anything except perhaps to keep track of the absolute page number. Instead, we have a counter note to keep track of the pages of notes, and \thepage is set to \thenote for notes, \theslide for slides, \theoverlay for overlays, and \thelayer for layers.

\c@note

The note counter has to be stepped by the output routine, and reset by the slide environments. In the article format, we just make the note counter the same as the page counter.

298 \ifslides
299 \newcounter{note}
300 \def\thenote{\theslide-\arabic{note}}
301 \def\thepage{\thenote}
302 \addto@hook\after@slide{\setcounter{note}{1}}
303 \expandafter\def\expandafter\@outputpage\expandafter{%
304  \@outputpage\stepcounter{note}}
305 \else
306 \let\c@note\c@page
307 \def\p@note{\p@page}
308 \def\thenote{\thepage}
309 \fi

Which counter should the dvi driver pay attention to when numbering the pages in the slides format? This makes a difference when using the dvi driver to select pages. If the driver numbers pages by the slide number, then it is easier to use the driver to print selected slides. However, this can be cumbersome when there are many pages of notes or overlays, especially if the driver cannot pick out the n^{th} occurence Slide output routines 15

of a page, because many pages will have the same page number. In this case, keeping track of physical page numbers may be preferred. We allow both options. By default, the dvi driver pays attention to the slide counter; i.e., this counter is assigned register 0

                                                                               310 \ifslides
                                                                               311 \let\c@page\c@slide
                                                                               312 \countdef\c@slide=0
                                                                               313 \c@slide=0
                                                                               314 \c@page=1
                                                                               315 \fi
                                                                        \truepagenumbers

This switches back to having the driver recognize physical page numbers.

                                                                               316 \ifslides
                                                                               317 \def\truepagenumbers{%
                                                                               318  \let\c@slide\c@page
                                                                               319  \countdef\c@page=0
                                                                               320  \c@page=1
                                                                               321  \c@slide=0
                                                                               322  \let\truepagenumbers\relax}
                                                                               323 \else
                                                                               324 \let\truepagenumbers\relax
                                                                               325 \fi
                                                                               326 \addto@preamblecmds{\truepagenumbers}

9 Slide output routines

                                                                        \process@slide, \overlay@loop, \layer@loop

\process@slide is the beginning of the “output” routine for slides. The main slide and then the overlays are successively copied to the box register \emb@slidebox, which is transformed, adorned and output by

                                                                        the \embellish@slide macro. The \make@overlay#1 macro should

set \emb@slidebox to the contents of \emb@slidebox, but with only the material for overlay #1 visible. See, for example, the definition of

                                                                        \make@overlay in semcolor.sty.
                                                                               327 \def\process@slide{%

328 \ifarticle
329  \@nameuse{rotb@\slide@rotation}\@slidebox
330 \else
331  \ifrotateheaders\else
332  \@nameuse{rotb@\slide@rotation}\@slidebox
333  \fi
334 \fi
335 \ifslides
336  \pagestyle{\slide@pagestyle}\def\thepage{\theslide}%
337 \fi
338 \def\slide@type{slide}%
339 \ifx\overlay@list\@empty
340  \setbox\emb@slidebox=\box\@slidebox
341  \finish@slide
342 \else
343  \make@overlay{0}%
344  \finish@slide
345  {\let\theoverlay\theslide\layer@loop{0}}%
346  \overlay@loop
347 \fi}
348 \def\overlay@loop{%
349 \begingroup
350  \slidetype@prep{overlay}%
351  \c@overlay=1
352  \@whilenum\c@overlay<10
353  \do{%
354  \test@member{\the\c@overlay}{\overlay@list}%
355  \if@test
356  \make@overlay{\the\c@overlay}%
357  \finish@slide
358  \fi
359  \layer@loop{\the\c@overlay}%
360  \advance\c@overlay by 1}%
361 \endgroup}
362 \def\layer@loop#1{%
363 \begingroup
364  \slidetype@prep{layer}%
365  \@for\n@layer:=\layer@list\do{%
366  \test@member{#1-\n@layer}{\overlay@list}%
367  \if@test
368  \make@overlay{#1-\n@layer}%
369  \finish@slide

Slide output routines 17

                                                                                370  \fi}%
                                                                                371 \endgroup}

                                                                         \slidetype@prep
                                                                                372 \def\slidetype@prep#1{%
                                                                                373 \ifslides
                                                                                374  \pagestyle{\@nameuse{#1@pagestyle}}%
                                                                                375  \def\thepage{\@nameuse{the#1}}%
                                                                                376 \fi
                                                                                377 \def\slide@type{#1}%
                                                                                378 \expandafter\the\@nameuse{#1@frameops}%
                                                                                379 \expandafter\ifx\csname #1@style\endcsname\@empty
                                                                                380  \else\edef\slide@style{\@nameuse{#1@style}}\fi
                                                                                381 \expandafter\ifx\csname #1@frame\endcsname\@empty
                                                                                382  \else\edef\slide@frame{\@nameuse{#1@frame}}\fi}

                                                                         \finish@slide
                                                                                383 \def\finish@slide{%
                                                                                384 \begingroup
                                                                                385  \@nameuse{sf@\slide@frame}%
                                                                                386  \@nameuse{ss@\slide@style}%
                                                                                387  \output@slide
                                                                                388 \endgroup}

                                                                         \output@slide

In the slides format, the finished slides are simply centered on the page, and then passed to L^{A}TEX’s \@outputpage macro. The completed page is then rotated if \ifrotateheaders is true, and finally it is shipped out. It is important that the slide be added to the page (\box255) since otherwise \special’s in the preamble will not be shipped out with the first slide. There is also a preference for not

                                                                         redefining \@outputpage.
                                                                                389 \ifslides
                                                                                390 \def\output@slide{%
                                                                                391  \begingroup
                                                                                392  \ifrotateheaders
                                                                                393  \let\@outputpage\output@@slide
                                                                                394  \fi

395  \let\@themargin\oddsidemargin
396  \def\@thehead{\slideheadfont\@oddhead}%
397  \def\@thefoot{\slidefootfont\@oddfoot}%
398  \@specialpagefalse
399  \@twosidefalse
400  \vbox to \textheight{\vss
401  \hbox to \textwidth{\hss\box\emb@slidebox\hss}\vss}%
402  \newpage
403  \endgroup}
404 \def\output@@slide{\begingroup
405  \@nameuse{rotm@\slide@rotation}
406  \catcode`\ =10
407  \let\-\@dischyph \let\'\@acci \let\`\@accii \let\=\@acciii
408  \setbox\emb@slidebox=\vbox{%
409  \normalsize \baselineskip\z@ \lineskip\z@
410  \let\par\@@par
411  \vskip\topmargin \moveright\@themargin
412  \vbox{\setbox\@tempboxa=\vbox to\headheight{%
413  \vfil \hbox to\textwidth{\let\label\@gobble
414  \let\index\@gobble \@thehead}}%
415  \dp\@tempboxa\z@
416  \box\@tempboxa
417  \vskip \headsep
418  \vbox to \textheight{\vss
419  \hbox to \textwidth{\hss\box\@outputbox\hss}\vss}%
420  \vbox to \z@{\vbox{\baselineskip\footskip
421  \hbox to\textwidth{\let\label\@gobble
422  \let\index\@gobble \@thefoot}\vss}}}}
423  \@nameuse{rotb@\slide@rotation}\emb@slidebox
424  \shipout\box\emb@slidebox
425  \endgroup
426  \global\@colht\textheight
427  \stepcounter{page}\stepcounter{note}\let\firstmark\botmark}
428 \fi

In the article format with the slidesonly selection, the slides are centered on each line and enclosed in stretchable glue. We have to make sure the glue does not get separated at page breaks, and so \nobreak’s and \hrule’s are added. A more elegant way to output the slides is to accumulate them in a special box rather than adding them to the current page, but this again would mean that \special’s in the preamble might not be shipped out with the first page, and any text

                                                                         The \init@slide and \@slideboxrestore macros  19

that is included around the slides, such as a title or a list of slides, would be accumulated until there is a full page or the document ends.

                                                                                429 \newdimen\slidesep \slidesep .2in
                                                                                430 \ifarticle
                                                                                431 \def\output@slide{%
                                                                                432  \hrule height\z@\nobreak\vfill\nobreak\vskip.5\slidesep
                                                                                433  \nobreak\centerline{\box\emb@slidebox}%
                                                                                434  \nobreak\vskip.5\slidesep\nobreak\vfill
                                                                                435  \nobreak\hrule height\z@\allowbreak}
                                                                                436 \fi

In the article format and the notes selection, the slides are floated. First we define the float fslide. Hopefully, setting the type number to 32 will avoid conflicts. The \@dblfloat command is used, so that this works with the twocolumn option.

                                                                                437 \ifarticle
                                                                                438 \ifnotes
                                                                                439  \def\fps@fslide{htbp}
                                                                                440  \def\ftype@fslide{32}
                                                                                441  \def\fslide{\@dblfloat{fslide}}
                                                                                442  \let\endfslide\end@dblfloat
                                                                                443  \def\output@slide{%
                                                                                444  \begin{fslide}\centerline{\box\emb@slidebox}\end{fslide}}
                                                                                445 \fi
                                                                                446 \fi

                                                             10 The \init@slide and \@slideboxrestore macros

                                                                         \init@slide

\init@slide sets up a few things at the beginning of every slide, landscape or portrait, which can or must go before the beginning of the minipage. \thepage is set to \theslide so that page references refer to the slide. \fix@floats and \fix@whatsits are defined below.

                                                                                447 \def\init@slide{%
                                                                                448 \refstepcounter{slide}%
                                                                                449 \def\thepage{\theslide}%
                                                                                450 \let\thispagestyle\slidepagestyle
                                                                                451 \fix@floats
                                                                                452 \fix@whatsits

453 \global\def\overlay@list{}%
454 \setcounter{overlay}{0}}
\fix@floats

Floats are neutralized, but the captions work as usual. This makes it easier to just transfer a float from some other document to a slide. This only works if end of floating environment is \defined to be \end@float, rather than \let to be \end@float.

455 \def\fix@floats{%
456 \def\@xfloat##1[##2]{\def\@captype{##1}\par\medskip\vbox\bgroup
457  \hsize\columnwidth\ignorespaces}%
458 \def\end@float{\par\vskip\z@\egroup\medskip}%
459 \let\@dblfloat\@float\let\end@dblfloat\end@float
460 \def\endfigure{\end@float}\def\endtable{\end@float}}
\fix@whatsits

The whatsits \write, \openout and \closeout are problematic in slides for two reasons:

1. First, an otherwise empty vertical list with a whatsit is not empty. Thus, if a slide begins with a \write command, followed by a line a text, \parskip is inserted before the text. This can be quite noticable in a slide environment, since by default \parskip is about 2.5% of the height of a slide. This problem is likely to arise because it is convenient to put a slide’s \label command first.

2. Second, the slides are omitted in the notesonly selection, but we want to preserve cross-referencing. It is not possible to \shipout a \@slidebox without affecting output in some circumstance, but without shipping out the \@slidebox, the writes that are needed for cross-referencing are not carried out.

We solve these two problems by making the three whatsits mentioned above \immediate within the slide environments. This might cause unforeseen problems for some macros. It also introduces a known problem: when notes are printed with the slides as floats, page references for the slides may not be accurate. This does not seem grave enough to warrant fixing.

461 \let\normal@write\write

The \init@slide and \@slideboxrestore macros  21
462 \let\normal@read\read
463 \let\normal@openout\openout
464 \let\normal@closeout\closeout
465 \def\fix@whatsits{%
466 \def\write{\immediate\normal@write}%
467 \def\read{\immediate\normal@read}%
468 \def\openout{\immediate\normal@openout}%
469 \def\closeout{\immediate\normal@closeout}}
\slidebox@restore

\slidebox@restore sets up the spacing parameters at the beginning of every slide. The component commands are defined following this macro.

470 \def\slidebox@restore{%
471 \slide@spacing
472 \slide@displayskips
473 \slide@listparameters
474 \slide@fontsizes}
\slidefonts, \ifslidefonts

\slidefonts should set up any special fonts for the slides. It is given a null default definition here. \ifslidefonts determines whether it is invoked at the beginning of the document (the default in the slides format), rather than at the beginning of every slide (the default in the article format).

475 \def\slidefonts{}
476 \newif\ifslidefonts
477 \addto@hook\before@document{%
478 \ifslidefonts\slidefonts\let\slidefonts\relax\fi}
479 \ifslides\slidefontstrue\fi
480 \addto@preamblecmds{\slidefontstrue\do\slidefontsfalse}
\slidefontsizes, \slide@fontsizes

\slide@fontsizes should define the font declarations for slides. Its default is set by the style options 11pt or 12pt, or lack thereof (i.e., \@ptsize is set in article.sty, which has already been input). \slidefontsizes resets its definition. Valid arguments are 8, 9, 10, 11 and 12.

481 \edef\slide@fontsizes{\noexpand\ptsize{1\@ptsize}}

482 \def\slidefontsizes#1{\def\slide@fontsizes{\ptsize{#1}}}

 \slide@spacing

\slide@spacing sets some spacing parameters.

483 \def\slide@spacing{%
484 \raggedright
485 \lineskip 1pt \normallineskip 1pt
486 \parskip .5em plus .2em minus .1em
487 \footnotesep 7pt
488 \def\arraystretch{1.2}\def\baselinestretch{1.18}}%

 \slide@displayskips

\slide@displayskips sets the displays skips to smaller values than they would usually have in the article document style. These skips are usually set by the font size declarations, but in order to streamline the \n@ptsize commands, these skips are set here, independently of the font size declarations but using the relative unit ex.

489 \def\slide@displayskips{%
490 \abovedisplayskip 1.5ex plus .5ex minus 1ex
491 \belowdisplayskip \abovedisplayskip
492 \abovedisplayshortskip \z@ plus.5ex
493 \belowdisplayshortskip 1ex plus.5ex minus .5ex}

 \slide@listparameters

The list parameters are generally tightened up, compared to the usual spacing in article.sty, to compensate for the large \parskip and \baselinestretch. These parameters need some adjustment.

494 \def\slide@listparameters{%
495 \leftmargini 1.8em \leftmarginii 1.6em \leftmarginiii 1em
496 \leftmarginiv 1em \leftmarginv 1em \leftmarginvi 1em
497 \leftmargin\leftmargini
498 \labelsep .45em
499 \labelwidth\leftmargini\advance\labelwidth-\labelsep
500 \partopsep .2em plus .1em minus .1em
501 \def\@listi{\leftmargin\leftmargini
502  \topsep .5em plus .2em minus .1em
503  \parsep .5em plus .2em minus .1em
504  \itemsep .25em plus .1em minus .05em}%

Slide frames 23

                                                                                505 \def\@listii{\leftmargin\leftmarginii
                                                                                506  \labelwidth\leftmarginii\advance\labelwidth-\labelsep
                                                                                507  \topsep \z@ \parsep \z@
                                                                                508  \itemsep .25em plus .1em minus .05em}%
                                                                                509 \def\@listiii{\leftmargin\leftmarginiii
                                                                                510  \labelwidth\leftmarginiii\advance\labelwidth-\labelsep}%
                                                                                511 \def\@listiv{\leftmargin\leftmarginiv
                                                                                512  \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}%
                                                                                513 \def\@listv{\leftmargin\leftmarginv
                                                                                514  \labelwidth\leftmarginv\advance\labelwidth-\labelsep}%
                                                                                515 \def\@listvi{\leftmargin\leftmarginvi
                                                                                516  \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}%
                                                                                517 \@listi}

                                                                         \slide@hook, \everyslide

\slide@hook and \everyslide are hooks for modifying the slide environments. Style designers should use \slide@hook, which is a token registers. Commands can be added to it without destroying previously added commands using the \addto@hook command. \everyslide is an ordinary command sequence to be used by users for the same purpose. For example

                                                                             \renewcommand{\everyslide}{\parindent 6pt}

In this case, any previous definition of \everyslide is lost.

                                                                                518 \newtoks\slide@hook
                                                                                519 \slide@hook{}
                                                                                520 \def\everyslide{}

11 Slide frames

                                                                         \slideframewidth, \slideframesep
                                                                                521 \newdimen\slideframewidth \slideframewidth 4pt
                                                                                522 \newdimen\slideframesep \slideframesep .3in
                                                                                523 \addto@hook\slide@parameters{%
                                                                                524 \noexpand\setslidelength{\noexpand\slideframewidth}%
                                                                                525  {\number\slideframewidth sp}%
                                                                                526 \noexpand\setslidelength{\noexpand\slideframesep}%
                                                                                527  {\number\slideframesep sp}}

 \slideframe, \overlayframe, \layerframe

The use of token registers to pop the optional argument of these macros with \slide@parameters seems like a waste, but there doesn’t seem to be any other way.

528 \def\@ifgoodsf#1{\@ifundefined{sf@#1}%
529 {\@seminarerr{Slide frame `#1' undefined}\@eha}}
530 \newtoks\overlay@frameops
531 \newtoks\layer@frameops
532 \def\slideframe#1{\@ifgoodsf{#1}{\edef\slide@frame{#1}}}
533 \def\overlayframe{%
534 \@ifnextchar[{\@overlayframe}{\@overlayframe[]}}
535 \def\@overlayframe[#1]#2{\@ifgoodsf{#2}%
536 {\edef\overlay@frame{#2}\overlay@frameops{#1}}}
537 \def\layerframe{%
538 \@ifnextchar[{\@layerframe}{\@layerframe[]}}
539 \def\@layerframe[#1]#2{\@ifgoodsf{#2}%
540 {\edef\layer@frame{#2}\layer@frameops{#1}}}
541 \addto@hook\slide@parameters{%
542 \noexpand\def\noexpand\slide@frame{\slide@frame}%
543 \noexpand\def\noexpand\overlay@frame{\overlay@frame}%
544 \noexpand\def\noexpand\layer@frame{\layer@frame}%
545 \noexpand\overlay@frameops{\the\overlay@frameops}%
546 \noexpand\layer@frameops{\the\layer@frameops}}%

 \sf@none, \sf@plain

\sf@frame should be a macro that puts a frame around \emb@slidebox, setting \emb@slidebox to the resulting box.

547 \def\sf@none{}
548 \def\sf@{}
549 \def\sf@plain{%
550 \setbox\emb@slidebox=\hbox{%
551  \fboxrule=\slideframewidth
552  \fboxsep=\slideframesep
553  \fbox{\copy\emb@slidebox}}}
554 \slideframe{plain}
555 \overlayframe{}
556 \layerframe{}

Slide styles 25

12 Slide styles

                                                                         \slidestyle, \overlaystyle, \layerstyle

These save the specified slide and overlay styles, to be invoked when processing the slides. The argument can be empty.

                                                                                557 \def\@ifgoodss#1{\@ifundefined{ss@#1}%
                                                                                558  {\@seminarerr{Slide style `#1' undefined}\@eha}}%
                                                                                559 \def\slidestyle#1{\@ifgoodss{#1}{\edef\slide@style{#1}}}
                                                                                560 \def\overlaystyle#1{\@ifgoodss{#1}{\edef\overlay@style{#1}}}
                                                                                561 \def\layerstyle#1{\@ifgoodss{#1}{\edef\layer@style{#1}}}
                                                                                562 \addto@hook\slide@parameters{%
                                                                                563 \noexpand\def\noexpand\slide@style{\slide@style}%
                                                                                564 \noexpand\def\noexpand\overlay@style{\overlay@style}%
                                                                                565 \noexpand\def\noexpand\layer@style{\layer@style}}

                                                                         \ss@empty, \ss@plain, \ss@plainbottom

The plain slide style places the slide label on the left side of the framed slide, centered vertically. The caption is set in a box with zero width so that it does not affect the centering of the slide on the page. In the plainbottom style, the label is centered at the bottom of the slide.

                                                                                566 \def\ss@empty{}
                                                                                567 \def\ss@{}
                                                                                568 \def\ss@plain{%
                                                                                569 \setbox\emb@slidebox=\hbox{%
                                                                                570  \vbox to \ht\emb@slidebox{\vss
                                                                                571  \hbox to 0pt{\bf\hss\@nameuse{sl@\slide@type}\hskip 15pt}%
                                                                                572  \vss}\box\emb@slidebox}}
                                                                                573 \def\ss@plainbottom{%
                                                                                574 \setbox\emb@slidebox=\vbox{\copy\emb@slidebox\vskip 9pt
                                                                                575  \hbox to\wd\emb@slidebox{%
                                                                                576  \bf\hss\@nameuse{sl@\slide@type}\hss}}}%
                                                                                577 \ifslides
                                                                                578 \slidestyle{empty}%
                                                                                579 \else
                                                                                580 \slidestyle{plain}
                                                                                581 \fi
                                                                                582 \overlaystyle{}
                                                                                583 \layerstyle{}

 \sl@slide, \sl@overlay, \sl@layer
584 \def\sl@slide{Slide \theslide}
585 \def\sl@overlay{Overlay \theoverlay}
586 \def\sl@layer{Layer \thelayer}

13 Page styles

 \newpagestyle, \renewpagestyle

The next two commands allow one to define new pages styles in the preamble of a document without playing around with the catcode of @.

587 \def\newpagestyle#1#2#3{%
588 \expandafter\newcommand\csname ps@#1\endcsname{%
589  \def\@oddhead{#2}\let\@evenhead\@oddhead
590  \def\@oddfoot{#3}\let\@evenfoot\@oddfoot}}
591 \def\renewpagestyle#1#2#3{%
592 \expandafter\renewcommand\csname ps@#1\endcsname{%
593  \def\@oddhead{#2}\let\@evenhead\@oddhead
594  \def\@oddfoot{#3}\let\@evenfoot\@oddfoot}}
 \slidepagestyle, \overlaypagestyle

The next commands set the page style for slides, overlays and layers, although this information is only used in the slides format. The argument can be empty, in which case no special page style is used.

595 \def\@ifgoodps#1{\@ifundefined{ps@#1}%
596  {\@seminarerr{Page style `#1' undefined}\@eha}}
597 \def\slidepagestyle#1{%
598 \@ifgoodps{#1}{\edef\slide@pagestyle{#1}}}
599 \def\overlaypagestyle#1{%
600 \@ifgoodps{#1}{\edef\overlay@pagestyle{#1}}}
601 \def\layerpagestyle#1{%
602 \@ifgoodps{#1}{\edef\layer@pagestyle{#1}}}
603 \addto@hook\slide@parameters{%
604 \noexpand\def\noexpand\slide@pagestyle{\slide@pagestyle}%
605 \noexpand\def\noexpand\overlay@pagestyle{\overlay@pagestyle}%
606 \noexpand\def\noexpand\layer@pagestyle{\layer@pagestyle}}
607 \def\ps@{}
608 \slidepagestyle{}
609 \overlaypagestyle{}
610 \layerpagestyle{}

Magnification 27

                                                                         \ps@align
                                                                                611 \ifslides
                                                                                612 \def\ps@align{%
                                                                                613  \def\@oddhead{\thepage\hfil+}\let\@evenhead\@oddhead
                                                                                614  \def\@oddfoot{+\hfil+}\let\@evenfoot\@oddfoot}
                                                                                615 \else
                                                                                616 \def\ps@align{}
                                                                                617 \fi
                                                                         \slideheadfont, \slidefootfont

Because it is likely that one wants to change the headers and footers to have a different font size that the slides, we included \slideheadfont and \slidefootfont in the headers and footers for the slides format. This is not robust.

                                                                                618 \def\slideheadfont{\scriptsize}
                                                                                619 \def\slidefootfont{\scriptsize}
                                                                                620 \ifslides
                                                                                621 \def\@thehead{\slideheadfont\@oddhead}%
                                                                                622 \def\@thefoot{\slidefootfont\@oddfoot}%
                                                                                623 \fi

14 Magnification

                                                                         \magstep, \magstepminus

We extend the definition of \magstepn to n = 0, …, 9, and define an analogous macro for reduction. The argument of \@magstep must be a count register.

                                                                                624 \def\magstep#1{\ifcase#1 \@m\or 1200\or 1440\or 1728\or
                                                                                625 2074\or 2488\or 2986\or 3583\or 4300\or 5160\fi\relax}
                                                                                626 \def\magstepminus#1{%
                                                                                627 \ifcase#1 \@m\or 833\or 694\or 579\or 482\or 401\fi\relax}
                                                                                628 \def\@magstep#1{%
                                                                                629 \ifnum#1<0#1=-#1magstepminus#1\else\magstep#1\fi}
                                                                         \invert@mag

If \cs is a command sequence (not a count register) that expands to an integer n > 0, then \invert@mag\cs sets \cs to 1000n^{−1}. E.g., after the commands

\def\mymag{\magstep2} \invert@mag\mymag

the meaning of \mymag is .694444. We use dimension registers to access TEX’s internal arithmetic routines.

630 {\catcode`\p=12\catcode`\t=12
631 \gdef\@@inv@@mag#1pt#2{\def#2{#1}}}
632 \def\invert@mag#1{\@tempdima=1000pt
633 \divide\@tempdima by #1\relax
634 \expandafter\@@inv@@mag\the\@tempdima#1}

\@slidesmag, \@articlemag
\@slidesmag and \@articlemag define \inverseslidesmag and
\inverseartmag for use by \setslidelength, etc., using the

\invert@mag routine defined above. They also set the magnification of the document in the slides or article format. Their arguments can be any magnification.

635 \def\@slidesmag#1{%
636 \@tempcnta=#1\relax%
637 \ifnum\@tempcnta>0
638  \edef\inverseslidesmag{\the\@tempcnta}%
639  \invert@mag\inverseslidesmag
640  \ifslides\mag\@tempcnta\fi
641 \else
642  \@seminarerr{\string\@slidesmag\space argument must be an
643  integer equal to 1000 times the magnification}\@eha
644 \fi}
645 \def\@articlemag#1{%
646 \@tempcnta=#1\relax%
647 \ifnum\@tempcnta>0
648  \edef\inverseartmag{\the\@tempcnta}%
649  \invert@mag\inverseartmag
650  \ifarticle\mag\@tempcnta\fi
651 \else
652  \@seminarerr{\@string\articlemag\space argument must be an
653  integer equal to 1000 times the magnification}\@eha
654 \fi}
655 \addto@preamblecmds{\@slidesmag\do\@articlemag}

\slidesmag, \articlemag

Magnification 29

 \slidesmag and \articlemag provide an interface for \@slidesmag

and \@articlemag that allows only \magstep type magnifications.

656 \def\@semmagerr#1{%
657 \@seminarerr{\string#1 argument must be an integer
658  between -5 and 9}\@eha}
659 \def\slidesmag#1{%
660 \@tempcnta=#1\relax
661 \ifnum\@tempcnta>-6
662  \ifnum\@tempcnta<10
663  \edef\the@slidesmag{\the\@tempcnta}%
664  \@slidesmag{\magstep\@tempcnta}%
665  \else
666  \@semmagerr\slidesmag
667  \fi
668 \else
669  \@semmagerr\slidesmag
670 \fi}
671 \def\articlemag#1{%
672 \@tempcnta=#1\relax
673 \ifnum\@tempcnta>-6
674  \ifnum\@tempcnta<10
675  \edef\the@articlemag{\the\@tempcnta}%
676  \@articlemag{\magstep\@tempcnta}%
677  \else
678  \@semmagerr\articlemag
679  \fi
680 \else
681  \@semmagerr\articlemag
682 \fi}
683 \addto@preamblecmds{\slidesmag\do\articlemag}

Now the default magnifications are set:

684 \slidesmag{4}
685 \articlemag{0}
 \setslidelength, \addtoslidelength, \setartlength,
 \addtoartlength
686 \def\setslidelength#1#2{#1=#2\relax#1=\inverseslidesmag#1}%
687 \def\addtoslidelength#1#2{\dimen@=#2\relax
688 \advance#1 by \inverseslidesmag\dimen@}
689 \def\setartlength#1#2{#1=#2\relax#1=\inverseartmag#1}

690 \def\addtoslidelength#1#2{\dimen@=#2\relax
691 \advance#1 by \inverseartmag\dimen@}

15 Page parameters

When the the document begins, the page parameters are scaled depending on the format and the magnification for that format, so that it is as if the parameters were set with true dimensions. This allows a user to change the magnification in the preamble without having to go back and rescale the page parameters.

\do@pageparameters
First, we define \do@pageparameters like \do@specials, but with all

the page parameters listed on page 163 of Lamport’s L^{A}TEX User’s Guide and Reference Manual. Parameters can be added the same way commands are added to \@preamblecmds.

692 \def\do@pageparameters{%
693 \do\oddsidemargin
694 \do\evensidemargin
695 \do\marginparwidth
696 \do\marginparsep
697 \do\topmargin
698 \do\headheight
699 \do\headsep
700 \do\textheight
701 \do\textwidth
702 \do\topskip
703 \do\footskip
704 \do\footheight}

\scale@pageparameters

Now we define \scale@pageparameters, which is invoked at the beginning of the document, to scale the page parameters.

705 \ifslides
706 \def\scale@pageparameters{%
707  \begingroup
708  \def\do##1{\global##1=\inverseslidesmag##1\relax}%
709  \do@pageparameters
710  \endgroup}

Page parameters 31

711 \else
712 \def\scale@pageparameters{%
713  \begingroup
714  \def\do##1{\global##1=\inverseartmag##1\relax}%
715  \do@pageparameters
716  \endgroup}
717 \fi
718 \addto@hook\before@document{\scale@pageparameters}
719 \addto@preamblecmds{\scale@pageparameters\do\do@pageparameters}

In the slides format, the margins are the same on all sides (1 inch), and the footers and headers are placed out of the way (1/2 inch from the top and bottom of the document).

720 \newdimen\paperwidth
721 \newdimen\paperheight
722 \paperwidth 8.5in
723 \paperheight 11in
724 \ifslides
725 \oddsidemargin 0pt
726 \evensidemargin 0pt
727 \marginparwidth 0pt
728 \marginparsep 0pt
729 \textwidth \paperheight
730 \advance\textwidth by -2in
731 \topmargin -1in
732 \headheight .5in
733 \headsep .5in
734 \textheight \paperwidth
735 \advance\textheight by -2in
736 \footskip .75in
737 \footheight .25in
738 \fi

In the article format, we set the margins a little smaller compared to the L^{A}TEX article style.

739 \ifarticle
740 \topmargin -15pt
741 \headheight 15pt
742 \headsep 25pt
743 \textheight 615pt
744 \footskip 33pt
745 \footheight 15pt

746 \advance\oddsidemargin by -20pt
747 \advance\evensidemargin by -20pt
748 \advance\textwidth by 40pt
749 \fi

16 Titles

The \date, \author and \title commands are redefined so that they save their information in accessible command sequences, \thedate,

 \theauthor and \thetitle.
750 \def\date#1{\gdef\@date{#1}\gdef\thedate{#1}}
751 \def\author#1{\gdef\@author{#1}\gdef\theauthor{#1}}
752 \def\title#1{\gdef\@title{#1}\gdef\thetitle{#1}}
753 \date{\today}

 \maketitle

The \maketitle command is modified so that it can be used in a slide environment. In particular, it does not undefine itself at the end.

754 \def\maketitle{\par
755 \begingroup
756 \def\thefootnote{\fnsymbol{footnote}}%
757 \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}%
758 \if@slide
759  \@maketitle
760 \else
761  \if@twocolumn
762  \twocolumn[\@maketitle]
763  \else
764  \newpage\global\@topnum\z@\@maketitle
765  \fi
766  \thispagestyle{plain}%
767 \fi
768 \@thanks
769 \endgroup
770 \setcounter{footnote}{0}%
771 \let\@thanks\relax}

 \@maketitle

Omitting and including notes 33

The \@maketitle command generates a smaller title than in L^{A}TEX’s

                                                                         article style.
                                                                                772 \def\@maketitle{%
                                                                                773 \null
                                                                                774 \begin{center}
                                                                                775  \def\baselinestretch{1}\large\normalsize
                                                                                776  {\Large\bf \thetitle \par}%
                                                                                777  \vskip 1.2em
                                                                                778  {\bf \lineskip .5em
                                                                                779  \begin{tabular}[t]{c}\theauthor\end{tabular}\par}%
                                                                                780  \vskip .8em
                                                                                781  {\large \thedate}%
                                                                                782 \end{center}%
                                                                                783 \par\vskip .5em}

17 Omitting and including notes

                                                                         \allversions, \endallversions, \allversions*,
                                                                         \endallversions*

The allversions environments are processed in any version.

                                                                                784 \def\allversions{}
                                                                                785 \let\endallversions\relax
                                                                                786 \@namedef{allversions*}{\@bsphack\globaldefs=1}
                                                                                787 \@namedef{endallversions*}{\@esphack}
                                                                         \slide@list, \addtoslidelist

\slide@list stores the list of environments that are to be included with the slidesonly selection. Environments are added to it using

                                                                         the \addtoslidelist command.
                                                                                788 \def\slide@list{slide,slide*,allversions,allversions*}
                                                                                789 \def\addtoslidelist#1{\xdef\slide@list{\slide@list,#1}}
                                                                                790 \addto@preamblecmds{\addtoslidelist}
                                                                         \xcomment@hook

The macro \@xcomment, defined in xcomment.sty, does the actual omitting of notes in the slidesonly format. Only environments in \slide@list are processed.

                                                                                791 \ifslidesonly

792 \def\xcomment@hook{\@xcomment{@@@}{\slide@list}}
793 \fi

\fewnotes

The \fewnotes command just neuralizes the omission of notes.

794 \def\fewnotes{\let\xcomment@hook\relax}

18 Omitting and including slides

\onlyslides, \notslides

\onlyslides and \notslides store their arguments, which should expand to a comma separated list of numbers and ranges, in the command sequence \os@list. It is not immediately expanded, because the argument may contain references that are not yet defined; recall that the .aux file is processed at the beginning of the document.

795 \def\os@list{}
796 \newif\if@os
797 \def\onlyslides#1{\def\os@list{#1}\@ostrue
798 \def\os@warning{\@warning{\string\onlyslides\space argument
799  contains undefined references}}}
800 \def\notslides#1{\def\os@list{#1}\@osfalse
801 \def\os@warning{\@warning{\string\notslides\space argument
802  contains undefined references}}}
803 \addto@preamblecmds{\onlyslides\do\notslides}

\os@expandlist

\os@expandlist is invoked at the beginning of the document, after the .aux files has been processed.

804 \addto@hook\after@document{%
805 \ifx\os@list\@empty\else\os@expandlist\fi}

\os@expandlist first expands the list, and then processes each commaseparated entry with \os@expandrange.

806 \def\os@expandlist{%
807 \let\os@@warning\relax
808 \begingroup
809  \def\ref##1{\@ifundefined{r@##1}{?}%

Omitting and including slides 35

810  {\noexpand\@car\@nameuse{r@##1}\noexpand\@nil}}%
811  \edef\@tempd{\os@list}%
812  \xdef\os@list{}%
813  \@for\@tempc:=\@tempd
814  \do{\expandafter\os@expandrange\@tempc-:-:\@nil}%
815  \os@@warning
816 \endgroup
817 \let\os@expandrange\relax
818 \let\os@checknum\relax
819 \let\os@expandlist\relax}

 \os@expandrange

\os@expandrange expands entries of the form m-n to (m − 1)+(n + 1), which will simplify checking slide numbers against the list (+ is used as a separator instead of - to allow for negative numbers). Entries that consist of a single number n are treated like a range n-n.

820 \def\os@expandrange#1-#2-#3\@nil{%
821 \def\@tempa{?}\def\@tempb{#1}%
822 \ifx\@tempa\@tempb
823  \let\os@@warning\os@warning
824 \else
825  \@tempcnta=#1\relax
826  \def\@tempb{#2}%
827  \ifx\@tempa\@tempb
828  \let\os@@warning\os@warning
829  \else
830  \def\@tempa{:}%
831  \ifx\@tempa\@tempb
832  \@tempcntb=\@tempcnta
833  \else
834  \@tempcntb=#2\relax
835  \fi
836  \advance\@tempcnta by -1
837  \advance\@tempcntb by 1
838  \ifx\os@list\@empty
839  \xdef\os@list{\the\@tempcnta+\the\@tempcntb}%
840  \else
841  \xdef\os@list{\os@list,\the\@tempcnta+\the\@tempcntb}%
842  \fi
843  \fi
844 \fi}

\os@test

\os@test checks whether a slide should be processed. For each entry m-n in the list \os@list, if the slide number is greater than m and less than n, \if@test is set to \if@os. Recall that \if@os is \iftrue is \os@list is a list of slides to be included, and is \iffalse if \os@list is a list of slides to be excluded.

845 \def\os@test{%
846 \ifx\os@list\@empty
847  \@testtrue
848 \else
849  \if@os\@testfalse\else\@testtrue\fi
850  \@for\@tempa:=\os@list
851  \do{\expandafter\os@testrange\@tempa\@nil}%
852 \fi}
853 \def\os@testrange#1+#2\@nil{%
854 \ifnum\c@slide>#1
855  \ifnum\c@slide<#2
856  \if@os\@testtrue\else\@testfalse\fi
857  \fi
858 \fi}

19 Font size declarations

\ptsize

The \ptsize{n} command invokes a macro so that the font size declarations are defined as in artn.sty, except that the font size declarations only affect the sizes of fonts, and not the list or display parameters. These parameters are set at the beginning of each slide environment. \ptsize should only be used in slide environments.

859 \def\ptsize#1{\@nameuse{#1@ptsize}}

The actual commands defining L^{A}TEX’s font size declarations are simply copied from art*.sty, except that the commands no longer affect the value of spacing parameters like \abovedisplayskip.

\8@ptsize

From the art8.sty. Author unknown.

860 \@namedef{8@ptsize}{%

Font size declarations 37

861 \def\@normalsize{\@setsize\normalsize{9.5pt}\viiipt\@viiipt}%
862 \def\small{\@setsize\small{8pt}\viipt\@viipt}%
863 \def\footnotesize{\@setsize\footnotesize{8pt}\vipt\@vipt}%
864 \def\scriptsize{\@setsize\scriptsize{7pt}\vipt\@vipt}%
865 \def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}%
866 \def\large{\@setsize\large{12pt}\xpt\@xpt}%
867 \def\Large{\@setsize\Large{14pt}\xiipt\@xiipt}%
868 \def\LARGE{\@setsize\LARGE{17pt}\xivpt\@xivpt}%
869 \def\huge{\@setsize\huge{20pt}\xviipt\@xviipt}%
870 \def\Huge{\@setsize\Huge{25pt}\xxpt\@xxpt}%
871 \large\normalsize}

 \9@ptsize

From art9.sty. Author unknown.

872 \@namedef{9@ptsize}{%
873 \def\@normalsize{\@setsize\normalsize{11pt}\ixpt\@ixpt}%
874 \def\small{\@setsize\small{9.5pt}\viiipt\@viiipt}%
875 \def\footnotesize{\@setsize\footnotesize{8pt}\viipt\@viipt}%
876 \def\scriptsize{\@setsize\scriptsize{7pt}\vipt\@vipt}%
877 \def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}%
878 \def\large{\@setsize\large{12pt}\xpt\@xpt}%
879 \def\Large{\@setsize\Large{14pt}\xiipt\@xiipt}%
880 \def\LARGE{\@setsize\LARGE{17pt}\xivpt\@xivpt}%
881 \def\huge{\@setsize\huge{20pt}\xviipt\@xviipt}%
882 \def\Huge{\@setsize\Huge{25pt}\xxpt\@xxpt}%
883 \large\normalsize}

 \10@ptsize

From Lamport’s art10.sty.

884 \@namedef{10@ptsize}{%
885 \def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt}%
886 \def\small{\@setsize\small{11pt}\ixpt\@ixpt}%
887 \def\footnotesize{%
888  \@setsize\footnotesize{9.5pt}\viiipt\@viiipt}%
889 \def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}%
890 \def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}%
891 \def\large{\@setsize\large{14pt}\xiipt\@xiipt}%
892 \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}%
893 \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}%
894 \def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}%

895 \def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}%
896 \large\normalsize}
\11@ptsize

From Lamport’s art11.sty.

897 \@namedef{11@ptsize}{%
898 \def\@normalsize{\@setsize\normalsize{13.6pt}\xipt\@xipt}%
899 \def\small{\@setsize\small{12pt}\xpt\@xpt}%
900 \def\footnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt}%
901 \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}%
902 \def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}%
903 \def\large{\@setsize\large{14pt}\xiipt\@xiipt}%
904 \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}%
905 \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}%
906 \def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}%
907 \def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}%
908 \large\normalsize}
\12@ptsize

From Lamport’s art12.sty.

909 \@namedef{12@ptsize}{%
910 \def\@normalsize{\@setsize\normalsize{14.5pt}\xiipt\@xiipt}%
911 \def\small{\@setsize\small{13.6pt}\xipt\@xipt}%
912 \def\footnotesize{\@setsize\footnotesize{12pt}\xpt\@xpt}%
913 \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}%
914 \def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}%
915 \def\large{\@setsize\large{18pt}\xivpt\@xivpt}%
916 \def\Large{\@setsize\Large{22pt}\xviipt\@xviipt}%
917 \def\LARGE{\@setsize\LARGE{25pt}\xxpt\@xxpt}%
918 \def\huge{\@setsize\huge{30pt}\xxvpt\@xxvpt}%
919 \let\Huge=\huge
920 \large\normalsize}

20 The \twoup macro

\twoup

See 2up.sty for details.

921 \def\twoup{\@ifnextchar[{\@twoup}{\@twoup[0]}}

The \twoup macro 39

922 \ifslides
923 \def\@twoup[#1]{%
924  \@tempcnta=\the@slidesmag\relax
925  \@tempcntb=\@tempcnta
926  \advance\@tempcntb by #1\relax
927  \advance\@tempcntb by -3\relax
928  \ifnum\@tempcntb>-6\relax
929  \input{2up.tex}%
930  \source{\@magstep\@tempcnta}{\paperheight}{\paperwidth}%
931  \target{\@magstep\@tempcntb}{\paperwidth}{\paperheight}%
932  \targetlayout{topbottom}%
933  \landscapefalse
934  \else
935  \@seminarerr{Slides magnification is too low for
936  \string\twoup\space to handle}\@eha
937  \fi}
938 \fi

939 \ifarticle
940 \def\@twoup[#1]{%
941  \@tempcnta=\the@articlemag\relax
942  \@tempcntb=\@tempcnta
943  \advance\@tempcntb by #1\relax
944  \advance\@tempcntb by -1\relax
945  \ifnum\@tempcntb>-6\relax
946  \input{2up.tex}%
947  \source{\@magstep\@tempcnta}{\paperwidth}{\paperheight}%
948  \advance\@tempcnta by -1\relax
949  \target{\@magstep\@tempcntb}{\paperheight}{\paperwidth}%
950  \if@twoside
951  \targetlayout{twosidebyside}%
952  \fi
953  \landscapetrue
954  \else
955  \@seminarerr{Article magnification is too low for
956  \string\twoup\space to handle}\@eha
957  \fi}
958 \fi
959 \addto@preamblecmds{\twoup\do\@twoup}

21 No notes

\nonotes

There used to be a command \nonotes that got rid of some of the baggage associated with the omission of notes and globally executed some of the commands that begin each slide. This command had to be included by the user in the preamble, and but now it is the default.

960 \ifslidesonly\else\ifnotes\else\ifnotesonly\else
961 \slidebox@restore\let\slidebox@restore\relax
962 \fi\fi\fi

22 Configuration file

963 \openin1 seminar.con
964 \ifeof1\else\closein1 \relax\@@input seminar.con\fi

INDEX 41

Index

The bold numbers denote the pages where the entries are defined, and all other numbers indicate the lines of code where the entries are used.

Symbols

\@articlemag . . . . . . . . . . . . . 16

\@landscapeonly . . . . . . . . . . . 4

\@maketitle . . . . . . . . . . . . . . 18 \@overlay . . . . . . . . . . . . . . . . 8 \@seminarerr . . . . . . . . . . . . . . 2 \@slidebox . . . . . . . . . . . . . . . 4 \@slideheight . . . . . . . . . . . . . 4 \@slidesmag . . . . . . . . . . . . . . 16 \@slidewidth . . . . . . . . . . . . . . 4 \10@ptsize . . . . . . . . . . . . . . 20 \11@ptsize . . . . . . . . . . . . . . 21 \12@ptsize . . . . . . . . . . . . . . 21 \8@ptsize . . . . . . . . . . . . . . . 20 \9@ptsize . . . . . . . . . . . . . . . 20

A

\addto@hook . . . . . . . . . . . . . . . 2

\addto@preamblecmds . . . . . . . . 3
\addtoartlength . . . . . . . . . . 16
\addtoslidelength . . . . . . . . 16
\addtoslidelist . . . . . . . . . . 18

\after@slide . . . . . . . . . . . . . . 5 \allversions . . . . . . . . . . . . . 18 \allversions* . . . . . . . . . . . . 18 \articlemag . . . . . . . . . . . . . . 16

B

\before@slide . . . . . . . . . . . . . 5

\begin@slidebox . . . . . . . . . . . 5

C

\c@note . . . . . . . . . . . . . . . . . . 9 \colorlayers . . . . . . . . . . . . . . 8

D

\do@pageparameters . . . . . . . . 17

\document . . . . . . . . . . . . . . . . 3

E \end@slidebox . . . . . . . . . . . . . 5

                                  \endallversions . . . . . . . . . . 18
                                  \endallversions* . . . . . . . . . 18

\enddocument . . . . . . . . . . . . . . 4 \endslide . . . . . . . . . . . . . . . . 6 \endslide* . . . . . . . . . . . . . . . 6 \everyslide . . . . . . . . . . . . . . 13

F \fewnotes . . . . . . . . . . . . . . . 19 \finish@slide . . . . . . . . . . . . 10 \fix@floats . . . . . . . . . . . . . . 12 \fix@whatsits . . . . . . . . . . . . 12

I \if@landscape . . . . . . . . . . . . . 4 \if@slide . . . . . . . . . . . . . . . . 4 \iflandscape . . . . . . . . . . . . . . 4 \iflayers . . . . . . . . . . . . . . . . 8 \ifoverlays . . . . . . . . . . . . . . . 8

                                  \ifrotateheaders . . . . . . . . . . 7

\ifslidefonts . . . . . . . . . . . . 12 \init@slide . . . . . . . . . . . . . . 11 \invert@mag . . . . . . . . . . . . . . 15

L \l@rotation . . . . . . . . . . . . . . . 6 \landscape . . . . . . . . . . . . . . . 4

                                  \landscapeonly . . . . . . . . . . . . 4

\layer@loop . . . . . . . . . . . . . . . 9 \layerframe . . . . . . . . . . . . . . 14 \layerstyle . . . . . . . . . . . . . . 14

M \magstep . . . . . . . . . . . . . . . . 15 \magstepminus . . . . . . . . . . . . 15 \make@overlay . . . . . . . . . . . . . 8 \maketitle . . . . . . . . . . . . . . 18

N

\NestedSlide@Error . . . . . . . . . 4

\newpagestyle . . . . . . . . . . . . 15 \nonotes . . . . . . . . . . . . . . . . 22 \notslides . . . . . . . . . . . . . . 19

O

\onlyslides . . . . . . . . . . . . . . 19

\os@expandlist . . . . . . . . . . . 19
\os@expandrange . . . . . . . . . . 19

\os@test . . . . . . . . . . . . . . . . 20 \output@slide . . . . . . . . . . . . 10 \overlay . . . . . . . . . . . . . . . . . 8 \overlay@loop . . . . . . . . . . . . . 9 \overlayframe . . . . . . . . . . . . 14

\overlaypagestyle . . . . . . . . 15

\overlaystyle . . . . . . . . . . . . 14

P

\p@rotation . . . . . . . . . . . . . . . 6 \portraitonly . . . . . . . . . . . . . 4

\process@slide . . . . . . . . . . . . 9

\ps@align . . . . . . . . . . . . . . . 15 \ptsize . . . . . . . . . . . . . . . . . 20

R

\renewpagestyle . . . . . . . . . . 15

\rotb@none . . . . . . . . . . . . . . . 6 \rotm@down . . . . . . . . . . . . . . . 7 \rotm@left . . . . . . . . . . . . . . . 7 \rotm@none . . . . . . . . . . . . . . . 7 \rotm@right . . . . . . . . . . . . . . . 7

S

\scale@pageparameters . . . . . 17

\setartlength . . . . . . . . . . . . 16

\setslidelength . . . . . . . . . . 16

\sf@none . . . . . . . . . . . . . . . . 14 \sf@plain . . . . . . . . . . . . . . . 14 \sl@layer . . . . . . . . . . . . . . . 15 \sl@overlay . . . . . . . . . . . . . . 15 \sl@slide . . . . . . . . . . . . . . . 15 \slide . . . . . . . . . . . . . . . . . . . 6 \slide* . . . . . . . . . . . . . . . . . . 6

\slide@displayskips . . . . . . . 13
\slide@fontsizes . . . . . . . . . 12

\slide@hook . . . . . . . . . . . . . . 13 \slide@list . . . . . . . . . . . . . . 18

\slide@listparameters . . . . . 13
\slide@parameters . . . . . . . . . 5
\slide@rotation . . . . . . . . . . . 6
\slide@spacing . . . . . . . . . . . 13
\slidebox@restore . . . . . . . . 12

\slidefonts . . . . . . . . . . . . . . 12

\slidefontsizes . . . . . . . . . . 12
\slidefootfont . . . . . . . . . . . 15

\slideframe . . . . . . . . . . . . . . 14

\slideframesep . . . . . . . . . . . 13
\slideframewidth . . . . . . . . . 13
\slideheadfont . . . . . . . . . . . 15

\slideheight . . . . . . . . . . . . . . 4

\slidepagestyle . . . . . . . . . . 15
\sliderotation . . . . . . . . . . . . 6

\slidesmag . . . . . . . . . . . . . . 16 \slidestyle . . . . . . . . . . . . . . 14

\slidetype@prep . . . . . . . . . . 10

\slidewidth . . . . . . . . . . . . . . . 4 \ss@empty . . . . . . . . . . . . . . . 14 \ss@plain . . . . . . . . . . . . . . . 14

\ss@plainbottom . . . . . . . . . . 14

T

\test@member . . . . . . . . . . . . . . 2 \thelayer . . . . . . . . . . . . . . . . 8 \theoverlay . . . . . . . . . . . . . . . 8 \theslide . . . . . . . . . . . . . . . . 4

\truepagenumbers . . . . . . . . . . 9

\twoup . . . . . . . . . . . . . . . . . . 21

X

\xcomment@hook . . . . . . . . . . . 18