Debian Codegraph @

texmf-dist/source/latex/ppr-prv/ppr-prv.dtx

raw
1 % \iffalse
2 %<*never>
3 \documentclass{ltxdoc}
4
5 \usepackage[T1]{fontenc}
6 \usepackage[latin1]{inputenc}
7 \usepackage{xspace,url}
8 \usepackage[english]{babel}
9
10 \newcommand{\prosper}{\textsf{prosper}\xspace}
11 \newcommand{\pprprv}{\textsf{ppr-prv}\xspace}
12
13 \setlength{\parindent}{15pt}
14
15 \MakeShortVerb{\|}
16 \AtBeginDocument{\CodelineIndex\EnableCrossrefs}
17 \AtEndDocument{\PrintIndex}
18 \GetFileInfo{ppr-prv.cls}
19 \begin{document}
20 \def\fileversion{v 0.13c}
21 \def\filedate{2005/09/02}
22 \def\docdate{2004/03/21}
23
24 \DocInput{ppr-prv.dtx}
25 \end{document}
26 %</never>
27 % \fi
28 % \CheckSum{1289}
29 % \iffalse meta-comment
30 %
31 %========================================================================
32 % ppr-prv class: "Prosper Preview", a class to produce a printable
33 % version of prosper slides
34 % Copyright (C) 2003-2004 Mathieu Goutelle
35 % mgoutell[at]users[dot]sourceforge[dot]net
36 %
37 % This program may be distributed and/or modified under the
38 % conditions of the LaTeX Project Public License, either version 1.2
39 % of this license or (at your option) any later version.
40 % The latest version of this license is in
41 % http://www.latex-project.org/lppl.txt
42 % and version 1.2 or later is part of all distributions of LaTeX
43 % version 1999/12/01 or later.
44 % CVSId: $Id: ppr-prv.dtx,v 1.9 2005/09/04 19:10:39 mgoutell Exp $
45 %========================================================================
46 %
47 % \fi
48 %% \CharacterTable
49 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
50 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
51 %% Digits \0\1\2\3\4\5\6\7\8\9
52 %% Exclamation \! Double quote \" Hash (number) \#
53 %% Dollar \$ Percent \% Ampersand \&
54 %% Acute accent \' Left paren \( Right paren \)
55 %% Asterisk \* Plus \+ Comma \,
56 %% Minus \- Point \. Solidus \/
57 %% Colon \: Semicolon \; Less than \<
58 %% Equals \= Greater than \> Question mark \?
59 %% Commercial at \@ Left bracket \[ Backslash \\
60 %% Right bracket \] Circumflex \^ Underscore \_
61 %% Grave accent \` Left brace \{ Vertical bar \|
62 %% Right brace \} Tilde \~}
63 %
64 % \urlstyle{sf}
65 % \title{The \pprprv class: Prosper Preview}
66 % \author{Mathieu \textsc{Goutelle}}
67 % \date{\fileversion, \docdate}
68 % \maketitle
69 % \tableofcontents
70 %
71 % \section{Introduction}
72 %
73 % \subsection{Presentation}
74 % This class is used with LaTeX presentations using the \prosper class. \pprprv
75 % stands for "Prosper Preview". The aim of this class is to produce a printable
76 % version of the slides written with \prosper, with two slides per page.
77 %
78 % The result tries to be as accurate as possible. The major problem is the support
79 % of the starred version of the \{only,until,from\}Slide macros: the result is
80 % approximately what you can expect... It is far from perfect, just because the
81 % content of this macros are heaped over each other. But, it is difficult to
82 % handle these overlays on a sheet of paper!
83 %
84 % You can send comments, bugs report or proposed improvements to the author by
85 % email: \url{mgoutell[at]users[dot]sourceforge[dot]net}.
86 %
87 % \subsection{Use of \pprprv}
88 %
89 % The installation of ppr-prv files follows the same scheme as any other package
90 % installation on your distrib. You can consult this page from the UK TeX FAQ:
91 % \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages}.
92 %
93 % To use ppr-prv, you just have to change the |\documentclass| from |prosper| to
94 % |ppr-prv|. You don't need to change another thing to your \prosper document: all
95 % the macros and options of \prosper are normally fully supported by \pprprv. You
96 % can change the footer of each "slide" by changing |\slidename| and |\no|. By
97 % default, it is defined as: |\newcommand{\slidename}{slide}| and
98 % |\newcommand{\no}{\#}|. Since version 0.07, it uses Babel to support various
99 % languages (english, french, german and all their variants): if Babel is loaded,
100 % the footer is adapted to the chosen language. You can off course change it
101 % manually with |\renewcommand{\slidename}{...}| and |\renewcommand{\no}{...}| after
102 % |\begin{document}|.
103 %
104 % There is a new option for \pprprv since v0.11: |nopagebreak|. This can be used
105 % to let \LaTeX{} decide where to break the page instead of every two slides. It
106 % may be used for producing a more compact document. The macro |\NoPageBreak| has
107 % exactly the same meaning, except that it can be used at any time in the
108 % document. \pprprv also used since v0.11 the |geometry| package to define the
109 % layout of the page. You can change it by using |\geometry{...}| (see the
110 % documentation of this package for more details).
111 %
112 % If you use the patch for Prosper written by Hendri Adriaens
113 % (\url{http://stuwww.uvt.nl/~hendri/Downloads/haprosper.html}), you can use
114 % \pprprv as well since v. 0.09: features like toc, toc section and notes are
115 % fully supported. The use is exactly the same if you either load the patch or
116 % not. You just have to change your |documentclass| from |prosper| to |ppr-prv|
117 % and let the class do the work of redefining the macros for you. Since v. 0.09
118 % is the first release with a support for the patch, it may remain some bugs.
119 % Don't hesitate to report them to the author of \pprprv.
120 %
121 % I have tried not to depend on |pstricks| in \pprprv. It means that, if you don't
122 % use |pstricks| in your slide, you can use pdf\LaTeX{} to compile your \pprprv
123 % document, even if the compilation can lead to |Non-PDF special ignored!|
124 % warnings. Obviously, it doesn't work if you have some |pstricks| stuff in your
125 % slide contents or if you don't provide the figures in a format pdf\LaTeX{} can
126 % understand (PDF, PNG, JPG, MetaPost e.g.): in these cases, you still need to
127 % use \LaTeX{} to produce your document.
128 %
129 % A common mistake is to use floating environment in slides. It may work with
130 % regular \prosper document. But with \pprprv, it may leads to error message
131 % such as |Not in outer par mode| or |Float lost|. \pprprv tries to handle this
132 % issue by defining the floats as non-floating. But, if you specify some
133 % placement options (like [hbtp]), you will get these errors. By the way, you
134 % \textbf{really} don't need floats in slides!
135 %
136 % \StopEventually{}
137 %
138 % \section{Details of the code}
139 %
140 % \subsection{Preamble and options}
141 % We define first the version and all the stuff we need (or not) to begin
142 % \begin{macrocode}
143 %<*class>
144 \def\PPRPRV@Version{v. 0.13}
145 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
146 \ProvidesClass{ppr-prv}[2005/09/02, \PPRPRV@Version]
147 \typeout{(c) 2003-2005 Mathieu Goutelle}
148 %</class>
149 % \end{macrocode}
150 %
151 % Then we define the \prosper options to handle the one useful in our case
152 % (e.g. draft, footer) and ignore the others. There is also the declaration of
153 % the |nopagebreak| option specific to \pprprv.
154 % \begin{macrocode}
155 %<*class>
156 \newif\ifDVItoPS
157 \DeclareOption{ps}{\global\DVItoPStrue}
158 \DeclareOption{pdf}{\global\DVItoPSfalse}
159
160 \newif\ifisDraft
161 \DeclareOption{draft}{\global\isDrafttrue}
162 \DeclareOption{final}{\global\isDraftfalse}
163
164 \newif\ifinColor
165 \DeclareOption{slideColor}{}
166 \DeclareOption{slideBW}{}
167
168 \newif\ifallPages
169 \DeclareOption{total}{}
170 \DeclareOption{nototal}{}
171
172 \newif\ifcolorBG
173 \DeclareOption{nocolorBG}{}
174 \DeclareOption{colorBG}{}
175
176 \newif\ifAccumulate
177 \DeclareOption{accumulate}{}
178 \DeclareOption{noaccumulate}{}
179
180 \newif\ifnoFooter
181 \DeclareOption{noFooter}{\global\noFootertrue}
182 \noFooterfalse
183
184 \newif\if@distiller
185 \@distillerfalse
186 \DeclareOption{distiller}{\global\@distillertrue}
187
188 \newif\if@nopagebreak
189 \@nopagebreakfalse
190 \DeclareOption{nopagebreak}{\global\@nopagebreaktrue}
191
192 \DeclareOption{YandY}{\gdef\@pdf@driver{dvipsone}}
193 \DeclareOption{ps2pdf}{\gdef\@pdf@driver{ps2pdf}}
194 \DeclareOption{vtex}{\gdef\@pdf@driver{vtex}}
195
196 %% Default style file = default
197 \def\Style@chosen{default}
198 \DeclareOption*{\global\let\Style@chosen=\CurrentOption}
199 %</class>
200 % \end{macrocode}
201 %
202 % Here we pass all options a user want to add to specify the paper and font
203 % sizes to the article class and geometry package.
204 % \begin{macrocode}
205 %<*class>
206 \DeclareOption{a4paper}{%
207 \PassOptionsToClass{\CurrentOption}{article}%
208 \PassOptionsToPackage{\CurrentOption}{geometry}%
209 }
210 \DeclareOption{a5paper}{%
211 \PassOptionsToClass{\CurrentOption}{article}%
212 \PassOptionsToPackage{\CurrentOption}{geometry}%
213 }
214 \DeclareOption{b5paper}{%
215 \PassOptionsToClass{\CurrentOption}{article}%
216 \PassOptionsToPackage{\CurrentOption}{geometry}%
217 }
218 \DeclareOption{letterpaper}{%
219 \PassOptionsToClass{\CurrentOption}{article}%
220 \PassOptionsToPackage{\CurrentOption}{geometry}%
221 }
222 \DeclareOption{legalpaper}{%
223 \PassOptionsToClass{\CurrentOption}{article}%
224 \PassOptionsToPackage{\CurrentOption}{geometry}%
225 }
226 \DeclareOption{executivepaper}{%
227 \PassOptionsToClass{\CurrentOption}{article}%
228 \PassOptionsToPackage{\CurrentOption}{geometry}%
229 }
230 \DeclareOption{landscape}{%
231 \PassOptionsToClass{\CurrentOption}{article}%
232 \PassOptionsToPackage{\CurrentOption}{geometry}%
233 }
234
235 \PassOptionsToClass{10pt,11pt,12pt,oneside,twoside,final,draft,
236 leqno,fleqn,openbib}{article}
237 %</class>
238 % \end{macrocode}
239
240 % Then, we define a default behaviour, which is exactly the same as the \prosper
241 % one, except we add options for article (a4paper and 10pt).
242 % \begin{macrocode}
243 %<*class>
244 \ExecuteOptions{final,slideBW,total,nocolorBG,noaccumulate,ps,ps2pdf,a4paper,10pt}
245 \ProcessOptions\relax
246 %</class>
247 % \end{macrocode}
248 %
249 % \subsection{Main code}
250 % As a first action, we load the article class and save some macros for further use.
251 % \begin{macrocode}
252 %<*class>
253 %% Preliminary stuff
254 \LoadClass{article}
255
256 %% I save here the old value of the macros I need and which may be
257 %% modified by HA-prosper and define a test for detecting HA-prosper.
258 \newif\if@HAprosper\global\@HAprosperfalse
259 \let\old@section\section
260 \let\old@subsection\subsection
261 \let\old@itemize\itemize
262 \let\old@enditemize\enditemize
263 \let\old@enumerate\enumerate
264 \let\old@endenumerate\endenumerate
265 %</class>
266 % \end{macrocode}
267 %
268 % We then load |pstricks|, |graphicx| and |hyperref| to exactly mimic the
269 % \prosper environment and some others for internal use (|textcomp| and
270 % |geometry|). The |keyval| package is for HA-\prosper support.
271 % \begin{macrocode}
272 %<*class>
273 \RequirePackage{pstricks}
274 \RequirePackage{textcomp}
275 \RequirePackage{graphicx}
276 \RequirePackage[hmargin=2cm,vmargin=2cm,noheadfoot]{geometry}
277 \RequirePackage{keyval,ifpdf}
278 \ifpdf\gdef\@pdf@driver{pdftex}\fi
279 \RequirePackage[\@pdf@driver,plainpages=false,colorlinks=true]{hyperref}
280 %</class>
281 % \end{macrocode}
282 %
283 % Here we want to suppress the common error of using floats in slides: we
284 % redefine them as non-floats.
285 % \begin{macrocode}
286 %<*class>
287 \RequirePackage{float}
288 \newfloat{figure}{H}{lof}
289 \newfloat{table}{H}{lot}
290 %</class>
291 % \end{macrocode}
292 %
293 % \DescribeMacro{NoPageBreak}
294 % The |\NoPageBreak| macro has the same meaning has the |nopagebreak| option,
295 % except it can be used at any time in the document. To revert the effect of
296 % |\NoPageBreak|, the |\PageBreak| macro is defined. We define also the indent
297 % to 0pt and we don't want folio nor head/foot.
298 % \begin{macrocode}
299 %<*class>
300 \newcommand{\NoPageBreak}{\global\@nopagebreaktrue}
301 \newcommand{\PageBreak}{\global\@nopagebreakfalse}
302
303 \setlength{\parindent}{0pt}
304 \pagestyle{empty}
305 %</class>
306 % \end{macrocode}
307 %
308 % For the support for the HA-propser package, we need to define some \prosper
309 % internals to avoid the HA patch to complain about a missing length or macro.
310 % \begin{macrocode}
311 %<*class>
312 %% Support for the HA-propser package: we try here to mimic the prosper
313 %% class to avoid the HA patch to complain about a missing length or
314 %% macro.
315 \let\normal@write\write
316 \newlength{\slideWidth}
317 \setlength{\slideWidth}{\linewidth}
318 \newlength{\slidewidth}
319 \setlength{\slidewidth}{\linewidth}
320 \newlength{\slideheight}
321 \newcounter{trueSlideCounter}
322 \newcounter{overlaysCount}
323 \newcounter{item@step}
324 \newcommand{\slidetitle}[1]{}
325 \newcommand{\slideframe}[1]{}
326 \newcommand{\NewSlideStyle}[4][]{}
327 \newcommand{\newslideframe}[2]{}
328 \newcommand{\slidepagestyle}[1]{}
329 \def\@fontTextColor{}
330 \def\@fontTextBW{}
331 \def\@fontTitleColor{}
332 \def\@fontTitleBW{}
333 \def\@fontSubtitleColor{}
334 \def\@fontSubtitleBW{}
335 \def\ptsize#1{}
336 \newenvironment{slide@seminar}{}{}
337 \def\@DefMyItem{}
338 \def\@titleSpacing{\vspace*{10pt}}
339 \newif\ifInOverlays\InOverlaysfalse
340 \newcounter{limitOverlays}
341 \def\@cleanupOverlay{}
342 %</class>
343 % \end{macrocode}
344 %
345 % Here are some \textsf{seminar} internal we need also for HA-\prosper.
346 % \begin{macrocode}
347 %<*class>
348 %% Commands from Seminar
349 \newcounter{slide}
350 \newcommand{\renewpagestyle}[3]{}
351 \def\slidefonts{}
352 \newif\ifarticle\articletrue
353 %</class>
354 % \end{macrocode}
355 %
356 % This test will be used to decide if we need to insert a page break before
357 % printing the current slide.
358 % \begin{macrocode}
359 %<*class>
360 % Test to see if we need a pageskip
361 \newif\if@needsnewpage\global\@needsnewpagetrue
362 %</class>
363 % \end{macrocode}
364 %
365 % \DescribeMacro{part}
366 % We redefine the |\part| command first to suppress the optional transition
367 % argument and second to handle pagebreak and slides counter.
368 % \begin{macrocode}
369 %<*class>
370 %% Definition of the part command to suppress the optional transition argument
371 \let\part\relax
372 \newcommand{\part}[2][]{%
373 \if@needsnewpage
374 \if@nopagebreak\else\ifodd\theslideii\else\mbox{}\clearpage\fi\fi
375 \global\@needsnewpagefalse
376 \fi
377 \refstepcounter{slidei}%
378 \old@section*{#2}%
379 }
380 %</class>
381 % \end{macrocode}
382 %
383 % \DescribeMacro{maketitle}
384 % The |\maketitle| command is completely redefined since the |article| one isn't
385 % relevant: \prosper define some extra field we need to handle here.
386 % \begin{macrocode}
387 %<*class>
388 %% Handle all the maketitle stuff
389 \let\@cartouche\@empty
390 \newcommand{\slideCaption}[1]{\gdef\@cartouche{#1}}
391 \let\@Subtitle\@empty
392 \newcommand{\subtitle}[1]{\gdef\@Subtitle{#1}}
393 \let\old@Title\title
394 \renewcommand{\title}[1]{\gdef\@Title{#1}}
395
396 \let\@email\@empty
397 \newcommand{\email}[1]{\gdef\@email{#1}}
398 \let\@institution\@empty
399 \newcommand{\institution}[1]{\gdef\@institution{#1}}
400
401 \gdef\@Author{}
402 \renewcommand{\author}[1]{\gdef\@Author{#1}}
403
404 \renewcommand{\maketitle}{
405 \thispagestyle{empty}\setcounter{page}{0}%
406 \refstepcounter{slidei}%
407 \mbox{}\vfill
408 \begin{center}%
409 {\LARGE \@Title \par}%
410 \ifx\@Subtitle\@empty\else\vskip 2em{\large\@Subtitle\par}\fi
411 \vskip 6em%
412 {\large\@Author
413 \ifx\@email\@empty\else\vskip 1em\@email\fi
414 \ifx\@institution\@empty\else\vskip 1em\@institution\par\fi}%
415 \end{center}%
416 \vfill\mbox{}\clearpage
417 \global\@needsnewpagefalse
418 }
419 %</class>
420 % \end{macrocode}
421 %
422 % \DescribeEnv{Itemize}\DescribeEnv{itemstep}
423 % We redefine the |Itemize| and |itemstep|. They have the same behaviour as the
424 % original |itemize| of |article|. We have to ignore the optional argument of
425 % |itemstep|.
426 % \begin{macrocode}
427 %<*class>
428 %% Definition of the Itemize environment ;)
429 \let\Itemize\itemize
430 \let\endItemize\enditemize
431
432 %% Definition of the itemstep environment to gobble the optional argument.
433 \newenvironment{itemstep}[1][]%
434 {\itemize}
435 {\enditemize}
436 %</class>
437 % \end{macrocode}
438 %
439 % \DescribeEnv{slide}
440 % We define here the |slide| environment. We first define |prv@slide| because we
441 % will need it later on, for the support of HA-prosper.
442 %
443 % |\@size@overlay| will contain the height of the current slide and will be used
444 % to correctly draw the frame around slides. This height is computed as the
445 % maximum real height of the different overlays (espcially those defined with a
446 % Slide* macros) of the slide and is equal at least to 4cm, to avoid a really
447 % little frame when the user wants exactly two slides per page. The
448 % |\@slide@content| box contains the content of the slide. The first counter is
449 % for the number printed in footer, i.e. exactly the same as the one in
450 % \prosper. The second is used internally to print exactly two slides per page
451 % (without counting part for example).
452 % \begin{macrocode}
453 %<*class>
454 %% \@size@overlay contains the height of the current slide if we are using
455 %% overlays. It is equal at least to 4cm to try to avoid really little frame
456 %% when the user wants exactly two slides per page.
457 \newlength{\@size@tmp}
458 \global\@size@tmp\z@
459 \newlength{\@size@overlay}
460 %% Definition of the slide environment
461 \newsavebox{\@slide@content} % will contain the slide
462 %% Slide counter to be printed on the bottom of each slide
463 \newcounter{slidei}\setcounter{slidei}{0}
464 %% Slide counter to print just two slides per page (even when there is a
465 %% \part...)
466 \newcounter{slideii}\setcounter{slideii}{0}
467
468 \newenvironment{prv@slide}[1]{%
469 \if@needsnewpage
470 \if@nopagebreak\else\ifodd\theslideii\mbox{}\clearpage\fi\fi
471 \fi
472 \global\@needsnewpagetrue
473 \if@nopagebreak
474 \global\setlength{\@size@overlay}{\z@}%
475 \else
476 \global\setlength{\@size@overlay}{4cm}%
477 \fi
478 \begin{lrbox}{\@slide@content}\begin{minipage}{\linewidth}%
479 \old@subsection*{#1}%
480 }{%
481 \end{minipage}\end{lrbox}%
482 \settoheight{\@size@tmp}{\@slide@content}%
483 \begin{minipage}{\linewidth}
484 \fbox{%
485 \usebox{\@slide@content}%
486 \ifdim\@size@overlay>\@size@tmp
487 \addtolength{\@size@overlay}{\baselineskip}%
488 \rule[-\@size@overlay]{1pt}{0pt}%
489 \fi
490 }%
491 \ifnoFooter\else
492 \ifhmode\\\fi
493 \makebox[\linewidth][r]{%
494 \footnotesize
495 \ifx\@cartouche\@empty\else\@cartouche~---~\fi
496 \slidename~\no\theslidei}%
497 \fi
498 \end{minipage}
499 \par\if@nopagebreak\bigskip\else\vfill\fi
500 }
501 \newenvironment{slide}[2][]
502 {%
503 \refstepcounter{slidei}\stepcounter{slideii}%
504 \begin{prv@slide}{#2}%
505 }
506 {\end{prv@slide}}
507 %</class>
508 % \end{macrocode}
509 %
510 % At the end of the document, we print an invisible box to attach the |\vfill|
511 % and be sure the last slide doesn't flush to the bottom of the page.
512 % \begin{macrocode}
513 %<*class>
514 \AtEndDocument{\if@nopagebreak\else\ifodd\theslideii\vfill\mbox{}\else\fi\fi}
515 %</class>
516 % \end{macrocode}
517 %
518 % Here, we ignore a lot of \prosper macros.
519 % \begin{macrocode}
520 %<*class>
521 %% For the \Logo, don't do anything !
522 \newcommand{\Logo}{%
523 \@ifnextchar({\Logo@one}{\Logo@two}%
524 }
525 \def\Logo@one(#1)#2{}
526 \def\Logo@two#1{}
527
528 %% For the \Font*, don't do anything !
529 \newcommand{\FontTitle}[2]{}
530 \newcommand{\FontSubtitle}[2]{}
531 \newcommand{\FontText}[2]{}
532 %</class>
533 % \end{macrocode}
534 %
535 % In the following code, we handle the overlays. The tricky part is the
536 % definition of the starred version of \{only,until,from\}Slide macros. For
537 % these, we need to measure the content of the material before smashing it in a
538 % Opt height box. We put this height in the |\@size@overlay| length we use
539 % previously in |prv@slide| to draw a frame with the correct height.
540 % \begin{macrocode}
541 %<*class>
542 %% Definition of the whole overlay stuff: a bit annoying...
543 \newcommand{\overlays}[2]{#2} % We ignore overlays
544
545 \def\FromSlide#1{\relax}
546 \def\UntilSlide#1{\relax}
547 \def\OnlySlide#1{\relax}
548
549 \long\def\fromSlide@NE#1#2{#2}
550 \long\def\untilSlide@NE#1#2{#2}
551 \long\def\onlySlide@NE#1#2{#2}
552
553 \newbox\PRV@tempbox
554 \long\def\fromSlide@E#1#2{%
555 \sbox\PRV@tempbox{\begin{minipage}{\linewidth}#2\end{minipage}}%
556 \setlength{\@size@tmp}{\the\ht\PRV@tempbox}%
557 \addtolength{\@size@tmp}{\the\dp\PRV@tempbox}%
558 \ifdim\@size@tmp>\@size@overlay\global\@size@overlay\@size@tmp\fi
559 \vbox to 0pt\bgroup\usebox{\PRV@tempbox}\egroup
560 \vskip -\baselineskip\ignorespaces
561 }
562 \long\def\untilSlide@E#1#2{%
563 \sbox\PRV@tempbox{\begin{minipage}{\linewidth}#2\end{minipage}}%
564 \setlength{\@size@tmp}{\the\ht\PRV@tempbox}%
565 \addtolength{\@size@tmp}{\the\dp\PRV@tempbox}%
566 \ifdim\@size@tmp>\@size@overlay\global\@size@overlay\@size@tmp\fi
567 \vbox to 0pt\bgroup\usebox{\PRV@tempbox}\egroup
568 \vskip -\baselineskip\ignorespaces
569 }
570 \long\def\onlySlide@E#1#2{%
571 \sbox\PRV@tempbox{\begin{minipage}{\linewidth}#2\end{minipage}}%
572 \setlength{\@size@tmp}{\the\ht\PRV@tempbox}%
573 \addtolength{\@size@tmp}{\the\dp\PRV@tempbox}%
574 \ifdim\@size@tmp>\@size@overlay\global\@size@overlay\@size@tmp\fi
575 \vbox to 0pt\bgroup\usebox{\PRV@tempbox}\egroup
576 \vskip -\baselineskip\ignorespaces
577 }
578
579 \def\fromSlide{\@ifstar{\fromSlide@E}{\fromSlide@NE}}
580 \def\untilSlide{\@ifstar{\untilSlide@E}{\untilSlide@NE}}
581 \def\onlySlide{\@ifstar{\onlySlide@E}{\onlySlide@NE}}
582 %</class>
583 % \end{macrocode}
584 %
585 % We define some \prosper macros we don't really need in \pprprv. But we
586 % obviously need to define it...
587 % \begin{macrocode}
588 %<*class>
589 %% All the things I may have forgotten if I haven't read the docs
590 %% carefully enough
591 \newcommand{\PDFtransition}[1]{}
592 \newcommand{\DefaultTransition}[1]{}
593 \def\NoFrenchBabelItemize{\relax}
594 \newcommand{\ColorFoot}[1]{}
595 \newif\ifshowVersion
596 \showVersionfalse
597 \newcommand{\displayVersion}{\global\showVersiontrue}
598
599 \def\fontTitle#1{#1}
600 \def\fontText#1{#1}
601
602 \newcommand{\myitem}[2]{}
603
604 %% Stolen from the prosper.cls code
605 \newcommand{\PDForPS}{%
606 \ifDVItoPS
607 \let\prosper@next\@secondoftwo
608 \else
609 \let\prosper@next\@firstoftwo
610 \fi
611 \prosper@next}
612 %% #1 appears on the slide only on PS mode
613 \newcommand{\onlyInPS}{%
614 \ifDVItoPS
615 \let\prosper@next\@iden
616 \else
617 \let\prosper@next\@gobble
618 \fi
619 \prosper@next}
620 %% #1 appears on the slide only on PDF mode
621 \newcommand{\onlyInPDF}{%
622 \ifDVItoPS
623 \let\prosper@next\@gobble
624 \else
625 \let\prosper@next\@iden
626 \fi
627 \prosper@next}
628 %</class>
629 % \end{macrocode}
630 %
631 % \subsection{AtBeginDocument code}
632 % Finally, we add some |\AtBeginDocument| hackery. The purpose is first to
633 % support multi-language with Babel and we need to know if this package is
634 % loaded.
635 % \begin{macrocode}
636 %<*class>
637 \AtBeginDocument{% Multi-language support with Babel
638 %</class>
639 % \end{macrocode}
640 %
641 % If we detect Babel, we test the loaded language and define the footer macros
642 % according to this.
643 % \begin{macrocode}
644 %<*class>
645 \@ifpackageloaded{babel}{%
646 \def\@test{french}%
647 \ifx\languagename\@test
648 \newcommand{\slidename}{transparent}%
649 \providecommand{\no}{n\textdegree}%
650 \fi
651 \def\@test{english}%
652 \ifx\languagename\@test
653 \newcommand{\slidename}{slide}%
654 \providecommand{\no}{\#}%
655 \fi
656 \def\@test{british}%
657 \ifx\languagename\@test
658 \newcommand{\slidename}{slide}%
659 \providecommand{\no}{\#}%
660 \fi
661 \def\@test{canadian}%
662 \ifx\languagename\@test
663 \newcommand{\slidename}{slide}%
664 \providecommand{\no}{\#}%
665 \fi
666 \def\@test{USenglish}%
667 \ifx\languagename\@test
668 \newcommand{\slidename}{slide}%
669 \providecommand{\no}{\#}%
670 \fi
671 \def\@test{UKenglish}%
672 \ifx\languagename\@test
673 \newcommand{\slidename}{slide}%
674 \providecommand{\no}{\#}%
675 \fi
676 \def\@test{german}%
677 \ifx\languagename\@test
678 \newcommand{\slidename}{transparent}%
679 \providecommand{\no}{Nr.}%
680 \fi
681 \def\@test{germanb}%
682 \ifx\languagename\@test
683 \newcommand{\slidename}{transparent}%
684 \providecommand{\no}{Nr.}%
685 \fi
686 \def\@test{austrian}%
687 \ifx\languagename\@test
688 \newcommand{\slidename}{transparent}%
689 \providecommand{\no}{Nr.}%
690 \fi
691 \def\@test{ngerman}%
692 \ifx\languagename\@test
693 \newcommand{\slidename}{transparent}%
694 \providecommand{\no}{Nr.}%
695 \fi
696 \def\@test{naustrian}%
697 \ifx\languagename\@test
698 \newcommand{\slidename}{transparent}%
699 \providecommand{\no}{Nr.}%
700 \fi
701 }{}
702 \providecommand{\slidename}{slide}%
703 \providecommand{\no}{\#}%
704 }
705 %</class>
706 % \end{macrocode}
707 %
708 % \subsection{Support for HA-\protect\prosper}
709 % If we detect HA-\prosper, we need to redefine all the macros added by this
710 % patch. All this stuff goes into the \texttt{HAP-ppr-prv.def} file, which is
711 % loaded at the end of HA-\prosper if it detects \pprprv.
712 % \begin{macrocode}
713 %<*HAPdef>
714 %% Support for the HA-prosper package: redefinition of the
715 %% functionnalities added by this patch.
716 \@ifpackageloaded{HA-prosper}{%
717 \global\@HAprospertrue
718 % \def\HAP@ReqVersion{v3.9}
719 % \ifx\HAP@Version\undefined\else%
720 % \ifx\HAP@ReqVersion\HAP@Version\else%
721 % \ClassError{ppr-prv}{HA-prosper \HAP@Version\space and
722 % ppr-prv \PPRPRV@Version\space are incompatible}%
723 % {Read the documentation of HA-prosper.}%
724 % \fi%
725 % \fi
726
727 \renewenvironment{itemstep}[1][]{\old@itemize}{\old@enditemize}%
728 \renewenvironment{enumstep}[1][]{\old@enumerate}{\old@endenumerate}%
729
730 \define@key{PRV@keys@slide}{toc}{\def\@tockey{#1}}
731 \define@key{PRV@keys@slide}{bm}{}
732 \define@key{PRV@keys@slide}{trans}{}
733 \define@key{PRV@keys@slide}{sound}{}
734 \define@key{PRV@keys@slide}{template}{}
735 \def\xitem{\@ifnextchar<{\PRV@xitem}{\PRV@xitem<>}}
736 \def\PRV@xitem<#1>{\item}
737 \def\email#1{#1}
738 \def\institution#1{#1}
739
740 \renewcommand{\NewSlideStyle}[4][]{}
741 %</HAPdef>
742 % \end{macrocode}
743 %
744 % \DescribeEnv{slide}
745 % We first redefine the |slide| environment to first handle the optional keys
746 % for defining toc entries. But it is roughly |prv@slide|... The |wideslide|
747 % environment is set to |slide|.
748 %
749 % There is also some stuff here in case HA-prosper is loaded: since this package
750 % change |itemize|-like environments |AtBeginDocument|, we need to redefine it
751 % after... and after |AtBeginDocument| means just before printing the slides. We
752 % do this only in the first slide by testing the value of |\itemize|.
753 %
754 % \begin{macrocode}
755 %<*HAPdef>
756 \renewenvironment{slide}[2][]{%
757 \refstepcounter{slidei}\stepcounter{slideii}%
758 \setcounter{trueSlideCounter}{\theslidei}%
759 \let\@tockey\@undefined
760 \setkeys{PRV@keys@slide}{#1}%
761 \def\@tempa{#2}%
762 \ifx\@tempa\@empty
763 \ifx\@tockey\@undefined\else
764 \ifx\@tockey\@empty\else
765 \HAP@contentsline{0}{\@tockey}{\theslidei}{}%
766 \fi
767 \fi
768 \else
769 \ifx\@tockey\@undefined
770 \HAP@contentsline{0}{#2}{\theslidei}{}%
771 \else
772 \ifx\@tockey\@empty\else
773 \HAP@contentsline{0}{\@tockey}{\theslidei}{}%
774 \fi
775 \fi
776 \fi
777 \ifx\itemize\old@itemize\else
778 \global\let\itemize\old@itemize
779 \global\let\enditemize\old@enditemize
780 \global\let\enumerate\old@enumerate
781 \global\let\endenumerate\old@endenumerate
782 \fi
783 \begin{prv@slide}{#2}%
784 }
785 {%
786 \end{prv@slide}%
787 }
788
789 \renewenvironment{wideslide}[2][]{\begin{slide}[#1]{#2}}{\end{slide}}
790 %</HAPdef>
791 % \end{macrocode}
792 %
793 % \DescribeEnv{dualslide}
794 % The |dualslide| environment is a bit more complicated to redefine, just
795 % because we want to get rid of |pstricks|. So we do everything with \LaTeX{}
796 % boxes and some spaces adjustments.
797 % \begin{macrocode}
798 %<*HAPdef>
799 \newsavebox{\@slide@left}%
800 \newsavebox{\@slide@right}%
801 \newlength{\ht@slide}%
802
803 \def\dualslide{\@ifnextchar[\@dualslide{\@@@dualslide[][][]}}%
804 \def\@dualslide[#1]{%
805 \@ifnextchar[{\@@dualslide[#1]}{\@@@dualslide[#1][#1][#1]}}%
806 \def\@@dualslide[#1][#2]{%
807 \@ifnextchar[{\@@@dualslide[#1][#2]}{\@@@dualslide[#1][#2][#1]}}%
808 \long\def\@@@dualslide[#1][#2][#3]#4#5#6{%
809 \setlength{\HAP@colsep}{.04\linewidth}%
810 \setlength{\HAP@lcolwidth}{.47\linewidth}%
811 \setlength{\HAP@rcolwidth}{.47\linewidth}%
812 \setlength{\HAP@topsep}{0cm}%
813 \setlength{\HAP@bottomsep}{.3cm}%
814 \setlength{\HAP@indent}{0cm}%
815 \setkeys{HAP@keys@dual}{#4}%
816
817 \sbox{\@slide@left}{\begin{minipage}[t]{\HAP@lcolwidth}#5\end{minipage}}%
818 \sbox{\@slide@right}{\begin{minipage}[t]{\HAP@rcolwidth}#6\end{minipage}}%
819
820 \setlength{\ht@slide}{\the\ht\@slide@left}%
821 \addtolength{\ht@slide}{-0.5\baselineskip}%
822 \addtolength{\ht@slide}{\HAP@topsep}%
823 \leavevmode\null\kern\the\HAP@indent
824 \raisebox{-\ht@slide}{\usebox{\@slide@left}}%
825 \kern\the\HAP@colsep
826 \setlength{\ht@slide}{\the\ht\@slide@right}%
827 \addtolength{\ht@slide}{-0.5\baselineskip}%
828 \addtolength{\ht@slide}{\HAP@topsep}%
829 \raisebox{-\ht@slide}{\usebox{\@slide@right}}%
830 \par\vspace*{\HAP@bottomsep}%
831 }
832 %</HAPdef>
833 % \end{macrocode}
834 %
835 % We ignore again overlays...
836 % \begin{macrocode}
837 %<*HAPdef>
838 \renewcommand{\overlays}[2]{#2} % We ignore overlays (again...)
839 %</HAPdef>
840 % \end{macrocode}
841 %
842 % \DescribeMacro{maketitle}
843 % The redefinition of |\maketitle| is exactly the same as the previous one,
844 % except that we add the support for the optional toc entry definition.
845 % \begin{macrocode}
846 %<*HAPdef>
847 \renewcommand{\maketitle}[1][]{%
848 \refstepcounter{slidei}%
849 \setcounter{trueSlideCounter}{\theslidei}%
850 \let\@tockey\@undefined
851 \setkeys{PRV@keys@slide}{#1}%
852 \ifx\@tockey\@undefined
853 \else
854 \ifx\@tockey\@empty\else
855 \HAP@contentsline{0}{\@tockey}{\theslidei}{}%
856 \fi
857 \fi
858 \thispagestyle{empty}\setcounter{page}{0}%
859 \mbox{}\vfill
860 \begin{center}%
861 {\LARGE \@title \par}%
862 \ifx\@Subtitle\@empty\else\vskip 2em{\large\@Subtitle\par}\fi
863 \vskip 6em%
864 {\large\begin{tabular}[t]{c}\@author\end{tabular}\par}%
865 \end{center}%
866 \vfill\HAP@toc
867 \vfill\mbox{}\clearpage
868 \global\@needsnewpagefalse
869 }
870 %</HAPdef>
871 % \end{macrocode}
872 %
873 % \DescribeMacro{pcontentsline}
874 % Here is defined the |\pcontentsline| macro for defining the toc layout printed
875 % on the first page.
876 % \begin{macrocode}
877 %<*HAPdef>
878 \renewcommand{\fontToc}{}
879 \newlength{\PRV@indenttoc}
880 \setlength{\PRV@indenttoc}{0pt}
881 \renewcommand{\pcontentsline}[5]{%
882 \if1#1%
883 \setlength{\PRV@indenttoc}{0pt}%
884 \fi
885 \hspace*{\PRV@indenttoc}#2%
886 \if1#5\else\leaders\hbox{\hss.\ \hss}\hfill\slidename~\no#3\fi\\
887 \if1#1%
888 \setlength{\PRV@indenttoc}{10pt}%
889 \fi
890 }%
891 %</HAPdef>
892 % \end{macrocode}
893 %
894 % All the sectioning commands of HA-\prosper are redefined here. We only handle
895 % the toc entry, so it is much less complicated than in HA-\prosper!
896 % \begin{macrocode}
897 %<*HAPdef>
898 % Redefinition of tsection command to remove what is not needed
899 \newcounter{MG@tempTrueSlideCounter}
900 \renewcommand{\tsection}{%
901 \@ifstar
902 {\@ifnextchar[{\@tsection{0}{2}}{\@tsection{0}{2}[]}}%
903 {\@ifnextchar[{\@tsection{0}{1}}{\@tsection{0}{1}[]}}%
904 }%
905 \def\@tsection#1#2[#3]#4{%
906 \setcounter{MG@tempTrueSlideCounter}{\thetrueSlideCounter}%
907 \stepcounter{MG@tempTrueSlideCounter}%
908 \HAP@contentsline{1}{#4}{\theMG@tempTrueSlideCounter}{1}%
909 }%
910
911 % Redefinition of the part command to deal with the toc key
912 \renewcommand{\part}[2][]{%
913 \if@needsnewpage
914 \if@nopagebreak\else\ifodd\theslideii\else\mbox{}\clearpage\fi\fi
915 \global\@needsnewpagefalse
916 \fi
917 \refstepcounter{slidei}%
918 \setcounter{trueSlideCounter}{\theslidei}%
919 \let\@tockey\@undefined
920 \setkeys{PRV@keys@slide}{#1}%
921 \ifx\@tockey\@undefined
922 \HAP@contentsline{0}{#2}{\theslidei}{}%
923 \else
924 \ifx\@tockey\@empty\else
925 \HAP@contentsline{0}{\@tockey}{\theslidei}{}%
926 \fi
927 \fi
928 \old@section*{#2}%
929 }%
930 \renewcommand{\tsectionandpart}{\@ifstar{\tsectionandpart@E}{\tsectionandpart@NE}}
931 \newcommand{\tsectionandpart@E}[2][]{%
932 \let\@tockey\@undefined
933 \setkeys{PRV@keys@slide}{#1}%
934 \ifcase
935 \ifx\@tockey\@undefined\@ne\fi
936 \ifx\@tockey\@empty\@ne\fi
937 \z@
938 \tsection*{\@tockey}%
939 \else
940 \tsection*{#2}%
941 \fi
942 \part[toc={}]{#2}%
943 }
944 \newcommand{\tsectionandpart@NE}[2][]{%
945 \let\@tockey\@undefined
946 \setkeys{PRV@keys@slide}{#1}%
947 \ifcase
948 \ifx\@tockey\@undefined\@ne\fi
949 \ifx\@tockey\@empty\@ne\fi
950 \z@
951 \tsection{\@tockey}%
952 \else
953 \tsection{#2}%
954 \fi
955 \part[toc={}]{#2}%
956 }
957 %</HAPdef>
958 % \end{macrocode}
959 %
960 % Since HA-\prosper enhances the footer (left and right), we try to take
961 % advantages of this.
962 % \begin{macrocode}
963 %<*HAPdef>
964 \let\l@foot\@empty
965 \let\r@foot\@empty
966 \@ifundefined{HAP@leftfoot}{}{\gdef\l@foot{\HAP@leftfoot}}
967 \@ifundefined{HAP@rightfoot}{}{\gdef\r@foot{\HAP@rightfoot}}
968 \gdef\@cartouche{\l@foot\hfill\r@foot}
969 \renewcommand{\LeftFoot}[1]{%
970 \gdef\l@foot{#1}%
971 \gdef\@cartouche{\l@foot\hfill\r@foot}%
972 }%
973 \renewcommand{\RightFoot}[1]{%
974 \gdef\r@foot{#1}%
975 \gdef\@cartouche{\l@foot\hfill\r@foot}%
976 }%
977 %</HAPdef>
978 % \end{macrocode}
979 %
980 % \DescribeEnv{notes}
981 % Again, HA-\prosper adds a |notes| environment. We print it just between the
982 % slides, in a |quote| environment.
983 % \begin{macrocode}
984 %<*HAPdef>
985 \ifHAP@slidesonly\else
986 \renewenvironment{notes}[1]{%
987 \old@subsection*{#1}\bgroup\quote\footnotesize\sffamily
988 }{%
989 \endquote\egroup
990 \ifHAP@notesonly\else
991 \par
992 \if@nopagebreak
993 \bigskip
994 \else
995 \vfill
996 \ifodd\theslideii\else\mbox{}\clearpage\fi
997 \fi
998 \fi
999 \global\@needsnewpagefalse
1000 }%
1001 \fi
1002 %</HAPdef>
1003 % \end{macrocode}
1004 %
1005 % \DescribeMacro{OnSlide}\DescribeMacro{onSlide}
1006 % HA-\prosper adds also two extra macros for overlays: |\onSlide| and
1007 % |\OnSlide|. To handle it is relatively simple since we only have to
1008 % ``flatten'' overlays (see |\onlySlide| definition above).
1009 % \begin{macrocode}
1010 %<*HAPdef>
1011 \def\OnSlide#1{\relax}
1012 \long\def\onSlide@NE#1#2{#2}
1013 \long\def\onSlide@E#1#2{%
1014 \sbox\PRV@tempbox{\begin{minipage}{\linewidth}#2\end{minipage}}%
1015 \setlength{\@size@tmp}{\the\ht\PRV@tempbox}%
1016 \addtolength{\@size@tmp}{\the\dp\PRV@tempbox}%
1017 \ifdim\@size@tmp>\@size@overlay\global\@size@overlay\@size@tmp\fi
1018 \vbox to 0pt\bgroup\usebox{\PRV@tempbox}\egroup
1019 \vskip -\baselineskip\ignorespaces
1020 }
1021 \def\onSlide{\@ifstar\onSlide@E\onSlide@NE}
1022 }%
1023 {%
1024 \global\@HAprosperfalse%
1025 }
1026 %</HAPdef>
1027 % \end{macrocode}
1028 %
1029 % \setcounter{IndexColumns}{2}
1030 % \Finale
1031 %
1032 \endinput