summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/seminar/latex/seminar.bg2
blob: 4fdb7059334ca806e11032e9494b456469498b29 (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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% seminar.bg2 --- Corrections for compatibility problems and new bugs
%%                 found in the Seminar package, and few new additions
%%                 to help overlays management for PDF output files.
%%                 (see also the seminar.bug file in Seminar distribution)
%%
%%                 Disclaimer: this file is mine and doesn't engage TVZ!
%%
%% Note: insert it after \usepackage{graphicx} if you use `graphicx'
%%       and after \usepackage{longtable} if you use `longtable'
%%
%% Author          : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%% Created the     : 1995
%% Last mod. by    : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%% Last mod. the   : Fri May 31 20:19:22 2002
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\FileVersion{2.3}
\def\FileDate{2014/05/12}
\typeout{seminar.bg2: various corrections for the Seminar document class^^J%
         added since seminar.bug and few add-ons for overlays^^J%
         (Version \FileVersion\space of <\FileDate> (DG, hv))}

\RequirePackage{pst-ovl}
\edef\TheAtCode{\the\catcode`\@}
\catcode`\@=11

% 1 - To correct a bug in the note environment
%     (reported by Denis Girou (CNRS/IDRIS) <Denis.Girou@idris.fr> - 1995)
\@savsf=1


% 2 - To correct several bugs to generate a list of slides with subsection
%     entries
%     (reported by Denis Girou (CNRS/IDRIS) <Denis.Girou@idris.fr> - Jul. 18, 1995)
%   - To clear the subheading when a new heading is defined
%     (reported by Axel Thimm - <thimm@physik.fu-berlin.de> - June 5, 1997)
%   - To assure coherence between heading and subheading when used
%     in header/footer, for article mode
%     (reported by Axel Thimm - <thimm@physik.fu-berlin.de> - June 5, 1997)
%   - Improvements (\refstepcounter and \@addtoreset) by Jeremy Gibbons
%     <jgibbons@brookes.ac.uk> - Sep. 30, 1997

% Used by the \slide@subheading macro but undefined
\def\theslidesubsection{\theslidesection.\arabic{slidesubsection}}

%% Requires main pst-ovl
\ifx\PSTovlloaded\endinput\else\input pst-ovl \fi


\def\slide@heading[#1]#2{%
  \refstepcounter{slidesection}%
  \@addtoreset{slidesubsection}{slidesection}
  \addtocontents{los}{\protect\l@slide
    {\the\c@slidesection}{\ignorespaces#1}{\@SCTR}}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
    {\edef\@currentlabel{\csname p@slidesection\endcsname\theslidesection}%
      \makeslideheading{#2}}%
  \fi
  \gdef\theslideheading{#1}%
  \gdef\theslidesubheading{}%
}

\def\slide@subheading[#1]#2{%
  \refstepcounter{slidesubsection}%
  \addtocontents{los}{\protect\l@subslide
    {\the\c@slidesubsection}{\ignorespaces#1}{\@SCTR}}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
    {\edef\@currentlabel{\csname p@slidesubsection\endcsname
      \theslidesubsection}\makeslidesubheading{#2}}%
  \fi
  \gdef\theslidesubheading{#1}%
}
% 3 - To correct a bug in the \slidecontents macro
%     (reported by Denis Roegel (LORIA) <Denis.Roegel@loria.fr> - Sep. 22, 1996)

\long\def\@gobblethree #1#2#3{}

\def\slide@contents{%
  \def\l@slide##1##2##3{%
    \slide@cline{\slidenumberline{##1}{##2}}{##3}}%
  \let\l@subslide\@gobblethree
  \@startlos}

% 4 - To solve incompatibility between the `graphicx' package and Seminar.
%     The \espfslidesize Seminar macro work only with the old version of
%     the `epsfig' package, so with \includegraphics the PostScript files are
%     always scaled without the possibility to leave them to there natural
%     size. And also these files are not correctly scaled when we switch
%     from normal to article mode under Seminar. So, we must redefined the
%     \epsfslidesize macro of Seminar and modify few internal macros of
%     `graphicx'.
%     (Note: I consider only the `graphicX' package, not the 'graphicS' one)
%     (reported by Karl Tombre  (LORIA) <Karl.Tombre@loria.fr> and
%                  Denis Roegel (LORIA) <Denis.Roegel@loria.fr> - Jan. 16, 1997)

\def\GraphicsNotScaled{%
\ifx\Gin@viewport\undefined
\else                           % Graphicx package detected
\def\Gin@i{%
 \def\Gin@req@sizes{%
   \Gin@nat@height=\inverseslidesmag\Gin@nat@height
   \Gin@nat@width=\inverseslidesmag\Gin@nat@width
   \Gin@req@height\Gin@nat@height
   \Gin@req@width\Gin@nat@width}%
 \@ifnextchar[\Gin@ii{\Gin@ii[]}}
\define@key{Gin}{width}{%
\@tempdima=##1\@tempdima=\inverseslidesmag\@tempdima\def\Gin@ewidth{\@tempdima}}
\define@key{Gin}{height}{%
\@tempdima=##1\@tempdima=\inverseslidesmag\@tempdima\def\Gin@eheight{\@tempdima}}
\define@key{Gin}{totalheight}{%
\def\Gin@eresize{\totalheight}%
\@tempdima=##1\@tempdima=\inverseslidesmag\@tempdima\def\Gin@eheight{\@tempdima}}
\fi}

\def\epsfslidesize{%
\let\epsfsize\slide@epsfsize
\GraphicsNotScaled}

% 5 - To solve incompatibily between the LongTable package and Seminar
%     (reported by Bhaskar Manda (UIUC) <bhaskar@or4.me.uiuc.edu> - May 7, 1997)
%   - Problem in article format seen later
%     (reported by Axel Thimm <thimm@physik.fu-berlin.de> - June 5, 1997)

% From seminar.cls
\def\slide@outputLT{% (from \slide@output)
  \@makeslide
  \@testfalse
  \ifnotesonly\else
    \iflandscape
      \ifnum\@landscapeonly>-1 \os@test\fi
    \else
      \ifnum\@landscapeonly<1 \os@test\fi
    \fi
  \fi
  \if@test
    \reset@slideoutput
    \@@makeslideLT
    \process@slide
  \fi
  \refstepcounter{slide}}
\def\@@makeslideLT{% (from \@@makeslide)
  \overfullslide@warning
  \setbox\@slidebox\hbox{%
    \vfuzz=\slidefuzz\relax
    \vbox to\slide@vsize{%
    \box\@outputbox
    \ifcenterslides\vskip\z@ plus .0001fil \fi
    \unvbox\@slidebox
    \vskip\z@ plus .0001fil}%
    \the\after@slidepage}%
  \wd\@slidebox\textwidth}

% From LongTable
\def\LT@output{%
  \ifnum\outputpenalty <-\@Mi
    \ifnum\outputpenalty > -\LT@end@pen
      \LT@err{floats and marginpars not allowed in a longtable}\@ehc
    \else
      \setbox\z@\vbox{\unvbox\@cclv}%
      \ifdim \ht\LT@lastfoot>\ht\LT@foot
        \dimen@\pagegoal
        \advance\dimen@-\ht\LT@lastfoot
        \ifdim\dimen@<\ht\z@
          \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
          \@makecol
          \slide@outputLT
          \setbox\z@\vbox{\box\LT@head}%
        \fi
      \fi
      \global\@colroom\@colht
      \global\vsize\@colht
      \vbox
        {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
    \fi
  \else
    \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}%
    \@makecol
    \slide@outputLT
    \copy\LT@head
  \fi}

% We must adjust \textheight. Sometimes, you must increase it a little by
% something like \addtolength{\textheight}{5mm}
% But if you use slides like \begin{slide*}[15cm,10cm]
% you must define locally \textheight=15cm
\addtolength{\textheight}{-\headheight}


% 6 - To allow automatic changes of language dependent labels,
%     for instance by loading the `french' package after Seminar
%     (suggested by Bernard Gaulle (IDRIS) <gaulle@idris.fr> - Nov. 20, 1997)
% From seminar.cls
\def\slidename{Slide}
\def\slidelabel{\bf\slidename{} \theslide}
% From slidesec.sty
\def\listslidename{List of Slides}%
\def\listofslides{\section*{\listslidename%
\@mkboth{\expandafter\MakeUppercase\listslidename}%
        {\expandafter\MakeUppercase\listslidename}}%
  \def\l@slide##1##2##3{%
    \slide@undottedcline{\slidenumberline{##3}{##2}}{}}%
  \let\l@subslide\l@slide
  \@startlos}


% 7 - There were several problems when doing a global change of color
%     outside the "slide"environment (using the \color{ColorName} macro
%     of the `color' package) if this change was not done globally
%     (that is to say before the "\begin{document}") but inside the document,
%     for a part of the slides.
%     These problems can be seen specially for screen presentations,
%     when we want to use a dark background, so a light foreground color
%     for the text.
%     First, the header (defining for instance with the `fancyhdr' package)
%     changed of color one slide later and was restored one slide later too
%     if the change of the color was mas inside a group for some slides,
%     and second, the black color was forced by the footer.
%     We solve the first problem by usage of the same technique than the one
%     used by Seminar for global changes based on \special macros and made
%     before the "\begin{document}". We save the \specials in the
%     \saved@specials box and insert it at the beginning of the \@slidebox box
%     with the \insert@specials macro, as for the first slide.
%     And we solve the second problem by suppression of the command in the
%     hook which force the black color (defined in the `semcolor' package).
%     (reported by Denis Girou (CNRS/IDRIS) <Denis.Girou@idris.fr> - 1999-2002)

% Built from \save@srlidespecials (for all slides excepted the first one)
\def\save@slidespecials@ii{%
  \begingroup
    \output{%
      \global\setbox\saved@specials=\box\@cclv
      \global\wd\saved@specials=\z@
      \global\dp\saved@specials=\z@
      \global\ht\saved@specials=\z@}%
    \hbox{}\penalty-\@M
  \endgroup}%

% The first slide is already managed, so we will define \save@slidespecials@i
% started to the second one only...
\def\save@slidespecials@i{}%

\ifarticle\else
  \def\insert@specials{%
    \ifvoid\saved@specials\else
      \setbox\@slidebox\hbox{\box\saved@specials\box\@slidebox}%
    \fi
    \global\let\save@slidespecials@i\save@slidespecials@ii}
\fi

\addto@hook{\before@newslide}{\save@slidespecials@i}
\after@slidepage={}

% 7 - To vertically correctly center the footer, if defined
%     (this is mainly visible when using the `fancyhdr' package, and specially
%     when a footer rule line is defined)
%     (reported by Denis Girou (CNRS/IDRIS) - <Denis.Girou@idris.fr> - April 1998)

% 8 - Add-on to allow "full screen" backgrounds.
%     Seminar originally support only partial backgrounds, which doesn't cover
%     the full page but only the place of the text. It cannot be easily
%     modified, as there are dependancies between the header and the text.
%     So, we choose to define new macros \SeminarNewSlideFrameBackground
%     and \SeminarSlideFrameBackground to manage the full screen backgrounds,
%     designed on the model of the \newslideframe and \slideframe ones.
%     (added by Denis Girou (CNRS/IDRIS) <Denis.Girou@idris.fr> - Jun. 30, 1999)

\newbox\Seminar@SlideBoxBackground

\ifarticle
\else
  \def\output@slide{%
    \begingroup
      \hoffset=-\inverseslidesmag in
      \voffset=-\inverseslidesmag in
      \setslidelength\@tempdima{%
        \ifportrait\paperwidth\else\paperheight\fi}%
      \setslidelength\@tempdimb{%
        \ifportrait\paperheight\else\paperwidth\fi}%
      \ifrotateheaders
        \@ifrotateslide{%
          \dimen@=\@tempdima
          \@tempdima=\@tempdimb
          \@tempdimb=\dimen@}
      \fi
      % \oddsidemargin, \evensidemargin, \headheight, \footheight
      % used for scratch:
      % Some page styles like to know \textwidth:
      \setslidelength\headheight\slidetopmargin
      \setslidelength\footheight\slidebottommargin
      \ifautoslidemargins
        \textwidth=\wd\@slidebox
        \oddsidemargin=\@tempdima
        \advance\oddsidemargin-\textwidth
        \divide\oddsidemargin 2
      \else
        \setslidelength\oddsidemargin\slideleftmargin
        \setslidelength\evensidemargin\sliderightmargin
        \textwidth=\@tempdima
        \advance\textwidth-\oddsidemargin
        \advance\textwidth-\evensidemargin
      \fi
      \setbox\@slidebox=\hbox to \@tempdima{%
        \box\Seminar@SlideBoxBackground
        \kern\oddsidemargin
        \vbox to\@tempdimb{%
          \ifnum\fancyput@flag>-1
            \hbox{\kern-\oddsidemargin\do@fancyput}%
          \fi
          \let\label\@gobble
          \let\index\@gobble
          \let\glossary\@gobble
          \vbox to\headheight{%
            \vfill
            \hbox{%
              \slideheadfont\relax\strut
              \hbox to\textwidth{\@oddhead}}%
            \kern\z@}%
          \vfill
          \hbox to\textwidth{\hss\box\@slidebox\hss}%
          \vfill
          \vbox to\footheight{%
            \vfill
            \hbox{%
              \slidefootfont\relax\strut
              \hbox to\textwidth{\@oddfoot}}%
            \vfill}}%
        \hss}%
      \ifrotateheaders\@ifrotateslide\rotate@slide\fi
      \insert@specials
      \let\protect\noexpand
      \shipout\box\@slidebox
    \endgroup
    \let\firstmark\botmark}
  \@ifundefined{fancyput@flag}{\def\fancyput@flag{-1}}{}
\fi

\def\finish@slide{%
  \theSlideFrameBackground
  \theslideframe
  \add@slidelabel\slidelabel}


\def\SeminarNewSlideFrameBackground#1{%
  \@ifnextchar[{\@SeminarNewSlideFrameBackground{#1}}%
               {\@SeminarNewSlideFrameBackground{#1}[]}}
\def\@SeminarNewSlideFrameBackground#1[#2]{%
  \@namedef{semsfbops@#1}{#2}%
  \@namedef{semsfb@#1}##1}

\def\SeminarSlideFrameBackground{\Seminar@SlideFrameBackground{Slide}}
\def\Seminar@SlideFrameBackground#1{%
  \@ifstar{\@testtrue\Seminar@@SlideFrameBackground{#1}}%
          {\@testfalse\Seminar@@SlideFrameBackground{#1}}}
\def\Seminar@@SlideFrameBackground#1{%
  \@ifnextchar[{\Seminar@@@SlideFrameBackground{#1}}%
               {\Seminar@@@SlideFrameBackground{#1}[]}}
\def\Seminar@@@SlideFrameBackground#1[#2]#3{%
  \def\@tempa{none}%
  \def\@tempb{#3}%
  \ifx\@tempa\@tempb
    \@namedef{the#1FrameBackground}{\relax}%
  \else
    \ifx\@tempb\@empty
      \@namedef{the#1FrameBackground}{}%
    \else
      \@ifundefined{semsfb@#3}%
        {\@seminarerr{Background slide frame `#3' undefined}\@eha}%
        {\if@test
          \Seminar@@@@SlideFrameBackground{#1}[#2]{#3}%
        \else
          \@namedef{the#1FrameBackground}{%
            \setbox\Seminar@SlideBoxBackground=\hbox{{%
              \@nameuse{semsfbops@#3}#2%
                \@nameuse{semsfb@#3}{\box\Seminar@SlideBoxBackground}}}}%
        \fi}%
     \fi
   \fi}
\def\Seminar@@@@SlideFrameBackground#1[#2]#3{%
  \expandafter\let\expandafter\@tempa\csname the#1FrameBackground\endcsname
  \edef\next{%
    \noexpand\def\expandafter\noexpand\csname the#1FrameBackground\endcsname}%
  \expandafter\next\expandafter{\@tempa
    \setbox\Seminar@SlideBoxBackground=\hbox{{%
      \@nameuse{semsfbops@#3}%
      #2%
      \@nameuse{semsfb@#3}{\box\Seminar@SlideBoxBackground}}}}}%

\SeminarSlideFrameBackground{none}


% 9 - For screen presentations, and specially animated graphics,
%     we need more than 10 overlays. We increase the limit to 676 (26^2).
%     (added by Denis Girou (CNRS/IDRIS) <Denis.Girou@idris.fr> - Dec.  5, 2001)

\def\overlay#1{%
  \ifoverlays\ifx\@overlay\relax\nooverlays@err\fi\fi
  \ifslide
    \@tempcnta=#1
    \@testfalse
    \ifnum\@tempcnta>-2 \ifnum\@tempcnta<677 \@testtrue\fi\fi
    \if@test
      \c@overlay=\@tempcnta
      \ifnum\c@overlay=0
        \advance\c@slide by -1
        \refstepcounter{slide}%
      \else
        \advance\c@overlay by -1
        \refstepcounter{overlay}%
        \ifoverlays
          \xdef\overlay@list{\overlay@list,\the\c@overlay}%
        \fi
      \fi
      \ifoverlays
        \@overlay{\the\c@overlay}%
      \fi
    \else
      \@seminarerr{\string\overlay\space argument must be
        an integer between 0 and 676}\@eha
    \fi
  \else
    \@seminarerr{\string\overlay\space can only be used
      in slide environments}\@eha
  \fi
  \ignorespaces}

\def\overlay@loop{%
  \begingroup
    \overlay@prep
    \c@overlay=1
    \@whilenum\c@overlay<677
      \do{%
        \test@member{\the\c@overlay}{\overlay@list}%
        \if@test
          \make@overlay{\the\c@overlay}%
          \finish@slide
          \output@slide
        \fi
        \layer@loop{\the\c@overlay}%
        \advance\c@overlay by 1}%
  \endgroup}

\def\theoverlay{{%
\ifnum\c@overlay>26
  \@tempcnta=\c@overlay
  \advance\@tempcnta\m@ne
  \divide\@tempcnta by 26
  \multiply\@tempcnta by 26
  \@tempcntb=\c@overlay
  \advance\@tempcntb-\@tempcnta
  \@tempcnta=\c@overlay
  \advance\@tempcnta\m@ne
  \divide\@tempcnta by 26
  \theslide-\@alph{\@tempcnta}\@alph{\@tempcntb}%
\else
  \theslide-\alph{overlay}%
\fi}}


% 10 - Addition for management of cumulative and progressive overlays.
%      Due to PSTricks, Seminar had since the beginning the required
%      capabilities to manage overlays in various ways. The only thing
%      to do is to redefine the PSTricks \pst@initoverlay macro in the
%      relevant way.
%      (added by Denis Girou (CNRS/IDRIS) <Denis.Girou@idris.fr> - 1999-2001)

% From `semcolor'
\def\make@overlay#1{%
  \setbox\@slidebox=\hbox{%
    \pst@initoverlay{#1}%
    \pst@Verb{0 \tx@BOL }%
    \copy\@@slidebox
    \pst@Verb{-1 \tx@BOL }}}

\iffalse
% We must redefine too the /BeginOL macro form pstricks.pro, as "all" is now -1
% \def\pst@initoverlay#1{\pst@Verb{\tx@InitOL /TheOL (#1) def}}
\def\pst@initoverlay#1{%
\pst@Verb{
/BeginOL {
  dup -1 eq exch TheOL eq or
    {IfVisible not
      {Visible /IfVisible true def}
     if}
    {IfVisible
      {Invisible /IfVisible false def}
     if}
  ifelse} def
\tx@InitOL end 
/TheOL #1 def}}

\def\pst@overlay#1{%
\edef\curr@overlay{#1}%
\pst@Verb{#1 \tx@BOL }%
\aftergroup\pst@endoverlay}
\def\pst@endoverlay{%
\pst@Verb{\curr@overlay\space \tx@BOL }}
\fi

% Cumulative overlays
% ===================

% Cumulative overlays, to force to print all preceding ones
\def\SeminarCumulativeOverlays{%
\iffalse
\def\pst@initoverlay##1{%
\pst@Verb{
/BeginOL {
  dup -1 eq exch TheOL le or
    {IfVisible not
      {Visible /IfVisible true def}
     if}
    {IfVisible
      {Invisible /IfVisible false def}
     if}
  ifelse} def
\tx@InitOL end 
/TheOL ##1 def}}%
\fi
}

% Alternative method for same goal (needed when PSTricks nodes are used)
\def\SeminarAltCumulativeOverlays{%
\iffalse
\def\pst@initoverlay##1{%
\pst@Verb{
\tx@InitOL end 
/Visible {initclip} def
/Invisible {CP newpath OLUnit itransform moveto clip newpath moveto} def
/TheOL ##1 def}}
\fi
}

% Progressive overlays
% ===================

% Progressive overlays (at step i, only overlays 0 and i are shown)
\def\SeminarProgressiveOverlays{%
\def\pst@initoverlay##1{%
\pst@Verb{%
/BeginOL {%
  /NumOL ED
  NumOL -1 eq NumOL 0 eq NumOL TheOL eq or or
    {IfVisible not
      {Visible /IfVisible true def}
     if}
    {IfVisible
      {Invisible /IfVisible false def}
     if}
  ifelse} def
\tx@InitOL end 
/TheOL ##1 def}}}

% Alternative method for the same goal (needed when PSTricks nodes are used)
\def\SeminarAltProgressiveOverlays{%
\def\pst@initoverlay##1{%
\pst@Verb{%
/BeginOL {%
  /NumOL ED
  NumOL -1 eq NumOL 0 eq NumOL TheOL eq or or
    {IfVisible not
      {Visible /IfVisible true def}
     if}
    {IfVisible
      {Invisible /IfVisible false def}
     if}
  ifelse} def 
\tx@InitOL end 
/Visible {initclip} def
/Invisible {CP newpath OLUnit itransform moveto clip newpath moveto} def
/TheOL ##1 def}}}

% Generation of the next overlay (minor add-on)
% =============================================
% (it increment automatically the number of the current overlay)
\newcommand{\SeminarNextOverlay}[1]{%
\addtocounter{overlay}{1}%
\begin{overlay}{\the\c@overlay}#1\end{overlay}}

% To force all items in the various list environments to appear
% in their own overlay (minor add-on)
% =============================================================
\let\itemORIG\item

\def\SeminarItemInOverlay{%
\def\item{%
\addtocounter{overlay}{1}%
\overlay{\the\c@overlay}%
\itemORIG}}

\catcode`\@=\TheAtCode\relax
\endinput
%% END seminar.bg2