summaryrefslogtreecommitdiff
path: root/usergrps/uktug/baskervi/4_1/goossens.tex
blob: bc195fd3e64b7db65e4066f4dd45b4830d3276d0 (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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
\def\Lit#1{\texttt{#1}}
\newcommand{\Cmd}[1]{{\ttfamily\upshape\char'134#1}}
\def\SEM{\texttt{seminar}}
\def\PS{\textsc{PostScript}}
\newenvironment{coldinglist}[2]%
{\begin{list}{\textcolour{#2}{\ding{#1}}}{}}%
{\end{list}}%

\title{Colour slides with \LaTeX\ and \SEM{}}
\author[Michel Goossens and Sebastian Rahtz]{Michel
  Goossens (CERN)\\Sebastian Rahtz (ArchaeoInformatica)}
\begin{Article} 
\section{Slides and \LaTeX}
Many \LaTeX\ users want to take advantage of \TeX's high-quality
typesetting when they produce overhead slides for a
presentation. This facility was originally provided by a separate
package, \SLiTeX, but that had a number of disadvantages:

\begin{itemize}
\item it was limited to a set of specially-scaled Computer Modern
      fonts and it was not easy to adapt to other fonts;
\item the user was required to have two separate files, one for
      control information and the other for the actual slides;
\item the control of colour and overlays was limited and crude;
\item There was only one `style' for slides, and writing a different
      layout (to, say, put a logo on each slide) was not documented.
\end{itemize}

\LaTeX{} users now have a variety of fonts, and vast numbers of
styles, to choose from, but \SLiTeX\ has lagged behind.  When
\LaTeXe{} was released at the end of 1993, this included a simple
\LaTeX\ document class (already available in the New Font Selection
Scheme, version 2) to emulate \SLiTeX\ without the overhead of a
separate macro package.  However, there is a much better \LaTeX\ 
package which has been available for some time now---\SEM; if used in
conjunction with a PostScript printer, and a set of useful macros
called PSTricks,\footnote{The \SEM\ package and PSTricks are the work
  of Timothy van Zandt ({\ttfamily tvz@princeton.edu}).} this offers
almost every imaginable facility, including:
\begin{dinglist}{43} 
 \item Fancy frames, headers and footers; 
 \item Landscape and portrait slides in the same document; 
 \item Coloured text and tables; 
 \item Interleaving of annotations and slides; 
 \item Slide `chapters' and list of slides; 
 \item Overlays.  
\end{dinglist}

\SEM\ is a normal \LaTeX\ package which can be used with almost all
other \LaTeX\ packages (such as those to change font, include
graphics etc). Its main job is to produce transparencies, but it can
also make accompanying notes from the same file. It is compatible with
$\mathcal{AMS}$-\LaTeX\ and \LaTeXe.

\section{Using the \SEM{} style}

Usage is simple; begin your document in the normal way\footnote{We are
  assuming \LaTeXe\ here, just to remind you to upgrade.} with
\begin{verbatim}
  \documentclass{seminar}
\end{verbatim}
\noindent The slide environments are
\begin{verbatim}
  \begin{slide}   
     ...    
  \end{slide}

  \begin{slide*}
     ...    
  \end{slide*}
\end{verbatim}

Where \verb|slide| is for landscape slides and \verb|slide*| is for
portrait slides.  By default, the document is typeset in {\em
landscape} mode, but if you include the \verb|portrait| package
option, the document is typeset in portrait mode.  \emph{Typesetting}
the document in landscape mode is different from \emph{printing} it in
landscape mode; you have to worry about the orientation of the page
when printing, but with \verb|dvips| this is simple, and taken care of
in the local control file described below.

So the default output\footnote{We have added a package
                     ``\Lit{times}'' so that the output will reduce 
                     properly to thumbnails for this article.}
from this input:

\begin{verbatim}
\documentclass{seminar}
\usepackage{times}
\begin{document}
\begin{slide}
My talk is about:
\begin{description}
\item[Cats] Nice furry creatures
 which belong in every good home;
\item[Dogs] Nasty barking things 
 which bite you;
\item[Snakes] They come slithering 
 through the grass and \emph{have 
 no feet}; this is  most disturbing;
\item[Rhinoceroses] {\bfseries Never}
 be rude to a rhino; they are bigger 
 than you, and meaner.
\end{description}
\end{slide}
\end{document}
\end{verbatim}

will look like: \parbox[c][\totalheight]{5.5cm}{\epsfig{figure=demo1.ps,width=5cm}}

Most slides will be no more
complicated than this, using standard \LaTeX\ 
environments like \texttt{itemize}, 
\texttt{enumerate} and \texttt{tabular}.

\section{Frame styles}
\def\Showslide#1{\parbox[c][\totalheight]{5cm}{\epsfig{figure=#1,width=5cm}}}
A variety of slide framing styles are available, set with the
\verb|\framestyle| command; the following are some of the predefined
ones (some assume you have a PostScript printer), using the
\verb|\slideframe| command:

\begin{tabular}{@{}m{12mm}l}
none   & \Showslide{demo2.ps}
\end{tabular}

\begin{tabular}{@{}m{12mm}l}
shadow & \Showslide{demo3.ps}
\end{tabular}

\begin{tabular}{@{}m{12mm}l}
double & \Showslide{demo4.ps}
\end{tabular}

\begin{tabular}{@{}m{12mm}l}
oval   & \Showslide{demo5.ps}
\end{tabular}

Similarly, a variety of page styles (the headers and footers) are
available with the \verb|\pagestyle| command, such as:

\begin{tabular}{@{}m{12mm}l}
empty  & \Showslide{demo6.ps}
\end{tabular}

\begin{tabular}{@{}m{12mm}l}
plain  & \Showslide{demo7.ps}
\end{tabular}

\begin{tabular}{@{}m{12mm}l}
align  & \Showslide{demo8.ps}
\end{tabular}

Both slide frames and page styles can be customized; for instance, the
examples in this paper (\eg\ Figure \ref{seminarcolour}) are suitable
for use at CERN.

\section{Interleaving notes, and selecting subsets}
It is easy to intersperse your slides with notes to yourself; these
can be simply placed between the \texttt{slide} environments or enclosed
in a specific \texttt{note} environment. You can use any \LaTeX\ commands
in these notes, and include your whole article here if desired. When
you want to print the slides, a variety of package options can be used:

\begin{description}
\item[slidesonly]  Only the slides are printed;
\item[notesonly]  Only the slides are printed;
\item[notes]  The slides are interleaved with the notes;
\item[article] The document notes are typeset like a normal \LaTeX\ paper,
              and the slides are placed as figures (reduced to half size).
\end{description}
The \Cmd{slideplacement} command can be used to affect how slides
are placed in the \texttt{article} format; the possible parameters are:

\begin{description}
\item[float]  (default) Slides are floated
\item[float*]  Slides are floated, but if two column format is chosen
               they will span both columns
\item[here] Slides are placed where they occur in the notes
\end{description}

Further detailed control of the interaction between slides and notes
is given in the \emph{User's Manual}.

Selected slides can be included or excluded with the
\verb|\onlyslides| or \verb|\noteslides| commands which a parameter of
a comma-separated list of slides; this can be numbers, ranges (\eg\
5--10) or \LaTeX\ \verb|\ref| commands referring to \verb|\label|
commands in the slides.

%\begin{figure*}
%\begin{tabular}{@{}cc@{}}
%  \framebox{{\epsfig{figure=over1,height=.45\textheight}}} &
%  \framebox{{\epsfig{figure=over2,height=.45\textheight}}} \\ 
%  \framebox{{\epsfig{figure=over3,height=.45\textheight}}} &
%  \framebox{{\epsfig{figure=over4,height=.45\textheight}}} \\ 
%\end{tabular}
%\caption{Slide overlays}
%\label{overlays} 
%\end{figure*} 

\begin{figure*}
\begin{tabular}{@{}p{.49\textwidth}p{.49\textwidth}@{}}
\epsfig{figure=sem1.ps,width=.45\textwidth} &
\epsfig{figure=sem2.ps,width=.45\textwidth} \\
\verb|\SlideColours{Red}{Yellow}| &
\verb|\SlideColours{Black}{White}|\\
\epsfig{figure=sem3.ps,width=.45\textwidth} &
\epsfig{figure=sem4.ps,width=.45\textwidth} \\
\verb|\SlideColours{White}{Blue} | &
Red on gradient White/JungleGreen\\ 
\end{tabular} 
\caption{Colour in slide background and foreground: (simulated with grey levels)}
\label{seminarcolour} 
\end{figure*} 

\section{Control over slide size, fonts and magnification}
There are a great number of parameters by which the user can change
any of the following either on a slide-by-slide basis, or for the whole
document:
\begin{itemize}
\item Slide height and width;
\item Top, bottom, left and right margins; 
\item Text justification (it is ragged right by default);
\item Page breaking by varying tolerance of over-running material;
\item Inter-line spacing;
\item Point size, and choice of fonts.
\end{itemize}
How to change the default settings is explained in detail in the {\em
User's Guide}. 

Because \SEM\ works by magnifying pages, sophisticated users should
read the manual to see how to deal with setting and changing \TeX\
dimensions. Most users need not worry about this---in commands like
\verb|\epsfig| you should always express your `width' and `height'
requests in fractions of the line size anyway.

\section{Advanced use: customing the \SEM\ control file}

The \SEM\ package always starts by trying to find a file called
\Lit{seminar.con} on the \Lit{TEXINPUTS} path; this gives the user or
site an opportunity to conveniently customize the defaults.  The
\Lit{seminar.con} file can contain any \LaTeX\ commands, including
inputting style files.  Our figures were typeset using a
\Lit{seminar.con} set up for CERN; the contents of this are given
below, with explanation of what is being done. It also shows how
higher-level functions can be added which the average user would not
want to program for themselves.

First, we set up landscape macros  for the \verb|dvips| driver.
\begin{verbatim}
\newcommand{\printlandscape}{%
      \special{papersize=297mm,210mm}}
\end{verbatim}
We will assume PostScript printers, and  gain nice PostScript 
effects like rounded box corners; these will need some extra style files:
\begin{verbatim}
\input semcolor.sty
\input fancybox.sty
\end{verbatim}
For slide `sections', list of contents, we use another style file:
\begin{verbatim}
\input slidesec.sty
\end{verbatim}
This allows us to use various commands, some of which are
used below. We can also produce list of slides, in two layouts:

\vspace{3pt}

\noindent \begin{tabular}{@{}p{4cm}p{4cm}}
\hline
\Cmd{listofslides}  & \Cmd{Slidecontents} \\
\epsfig{figure=cont1.ps,width=4cm}&
\epsfig{figure=cont2.ps,width=4cm} \\
\hline
\end{tabular}

\vspace{3pt}

\noindent
For slide headings, there is a predefined \verb|\slideheading|
command; we will amend this so that it is typeset with a `shadow'. The
\verb|slidechapter| command is also defined (the code is not given
here) which allows the user to break the slides into groups; the slide
chapter title will be given in the bottom right corner with this CERN style.
\begin{verbatim}
\def\@empty{}
\renewcommand{\makeslideheading}[1]{%
  \gdef\theslideheading{#1}%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty\else
    \begin{Sbox}
      \begin{Bcenter}
        \large\bfseries#1
      \end{Bcenter}
    \end{Sbox}
    \centerline{\shadowbox{\TheSbox}}
  \vspace{1ex minus 1ex}
  \fi
}
\end{verbatim}
Now the CERN page and frame styles;
the plain `cern' style just places registration `+' marks,
and the date:
\begin{verbatim}
\newpagestyle{cern}%
 {{\color{Black}\small
   {\bfseries +} \hfil \today
   \hfil  {\bfseries+}}}%
 {{\color{Black}\small
   {\bfseries +} \hfil \thepage
   \hfil {\bfseries+}}}%
\end{verbatim}
Whereas the `cernsections' style has section headings and a logo:
\begin{verbatim}
\newpagestyle{cernsections}%
 {{\color{Black}\small
   \raisebox{-.5cm}[0cm][0cm]{%
    \epsfig{figure=cernlogo.ps,height=.8cm}}
    \hfil {\bfseries\theslideheading} \hfil 
           {\bfseries\thepage} }}%
 {{\small\color{Black}\today 
    \hfil \thechapterheading /\inchap }}%
\end{verbatim}

For the slide frames, we define a frame with the word ``CERN''
set in a coloured box on the lower left; this is done using the
PSTricks macros (which are automatically included by the `semcolor'
option above). The colour commands are those predefined in
\texttt{dvips}'s \texttt{color.pro} header file:
\begin{verbatim}
\newslideframe{cern}{{\SlideFront
 \boxput(-0.7,-1.11){\psframebox%
 [linecolor=black,fillcolor=ForestGreen,
 fillstyle=solid]{\hbox{{\normalsize
 \sffamily\color{Black}CERN}}}}{#1}%
 \color{Black}}}
\end{verbatim}

Finally we make sure that each slide starts with the current
foreground colour.
\begin{verbatim}
\def\everyslide{\SlideFront}
\def\theslideheading{}
\end{verbatim}

The user uses the command \verb|\SlideColours|, with two parameters,
which are colour names for foreground and background.  A synonym is
defined for black on white. We have to be a bit careful defining
the frame border, because by default it is coloured using the \PS\
`setgray' operator, and that might not work with the colour
separation, so  we define an explicit blue frame (for variety).
\begin{verbatim}
\newslideframe{blueframe}[%
 \psset{linecolor=NavyBlue,%
  linewidth=\slideframewidth,%
  framesep=\slideframesep,%
  cornersize=absolute,%
  linearc=.5cm%
 }]{\psframebox{#1}}
\def\SlideColours#1#2{%
 \gdef\SlideFront{\color{#1}}%
 \slideframe{\Framedefault}%
 \slideframe*[\psset{fillcolor=#2,%
 fillstyle=solid}]{blueframe}%
}
\def\SlideColours#1#2{%
  \gdef\SlideFront{\color{#1}}%
   \slideframe{\Framedefault}%
   \slideframe*%
    [\psset{linecolor=Black,%
fillcolor=#2,fillstyle=solid}]%
    {scplain}%
   }
\def\blackandwhite{\SlideColours{Black}{White}}
\end{verbatim}
The slide defaults will be for a detailed layout and CERN logo,
with yellow  writing on a blue background:
\begin{verbatim}
 \pagestyle{cernsections}
 \slideframe{cern}
 \def\Framedefault{cern}
 \SlideColours{Yellow}{RoyalBlue}
\end{verbatim}

\end{Article}
\endinput

%----------------------------------------------------------------------
\end{Article}
\endinput