Debian Codegraph @

texmf-dist/source/latex/leaflet/leaflet.dtx

raw
1 % \iffalse meta-comment
2 %
3 %
4 % (c) 1998 Jürgen Schlegelmilch <[email protected]>
5 % (c) 2000 Walter Schmidt <[email protected]>
6 % (c) 2002-2004 Rolf Niepraschk <[email protected]> and
7 % Hubert Gäßlein
8 % (c) 2012-2024 Rolf Niepraschk <[email protected]>
9 %
10 % This file may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in:
14 %
15 % http://www.latex-project.org/lppl.txt
16 %
17 % and version 1.3 or later is part of all distributions of LaTeX
18 % version 2003/12/01 or later.
19 %
20 % \fi
21 %
22 % \iffalse
23 %<class>\ProvidesClass{leaflet}
24 %<class> [2024/03/12 v2.1c LaTeX document class (JS,WaS,RN,HjG)]
25 %
26 %<*driver|manual>
27 %<driver>\def\filename{leaflet.dtx}
28 %<manual>\def\filename{leaflet-manual.tex}
29 \def\fileversion{v2.1c} % change this when leaflet-manual changed, too.
30 \def\filedate{2024/03/12}
31 \def\docdate {2024/03/12} % change this when leaflet-manual changed, too.
32 %</driver|manual>
33 %<*driver>
34 \listfiles
35 \errorcontextlines5
36 \documentclass[a4paper]{ltxdoc}
37 \IfFileExists{geometry.sty}{%
38 \usepackage[left=\marginparwidth,textwidth=1.15\textwidth,%
39 top=20mm,bottom=30mm]{geometry}}{}
40 \IfFileExists{url.sty}{\usepackage{url}}
41 {\newcommand\url[1]{\texttt{#1}}}
42 %\OnlyDescription
43 %\AlsoImplementation
44 \EnableCrossrefs
45 \CodelineIndex
46 \RecordChanges
47 \setlength\emergencystretch{3em}
48 \begin{document}
49 \DocInput{leaflet.dtx}
50 \end{document}
51 %</driver>
52 % \fi
53 %
54 % \CheckSum{1291}
55 %
56 % \CharacterTable
57 % {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
58 % 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
59 % Digits \0\1\2\3\4\5\6\7\8\9
60 % Exclamation \! Double quote \" Hash (number) \#
61 % Dollar \$ Percent \% Ampersand \&
62 % Acute accent \' Left paren \( Right paren \)
63 % Asterisk \* Plus \+ Comma \,
64 % Minus \- Point \. Solidus \/
65 % Colon \: Semicolon \; Less than \<
66 % Equals \= Greater than \> Question mark \?
67 % Commercial at \@ Left bracket \[ Backslash \\
68 % Right bracket \] Circumflex \^ Underscore \_
69 % Grave accent \` Left brace \{ Vertical bar \|
70 % Right brace \} Tilde \~}
71 %
72 % \changes{v0.8c}{2004/01/16}{Repacked as dtx file. (RN)}
73 % \changes{v0.9d}{2004/05/29}{M-x delete-trailing-whitespace (HjG)}
74 % \changes{v0.9d}{2004/05/29}{LPPL 1.3 (HjG)}
75 % \changes{v0.9d}{2004/05/29}{More code documentation; some caveats. (HjG)}
76 % \changes{v0.9e}{2004/06/11}{Add option `finish'. (RN/HjG)}
77 % \changes{v0.9f}{2004/06/25}{Merge v0.9d and v0.9e (hastily). (HjG)}
78 % \changes{v0.9g}{2004/06/25}{Rename option `finish' to `combine'. (RN/HjG)}
79 % \changes{v1.0pre1}{2004/06/26}{Redefinition of \cmd{\immediate},
80 % \cmd{\write}, \cmd{\openout} and \cmd{\closeout}. (RN)}
81 % \changes{v1.0pre2}{2004/06/26}{eTeX support. (RN)}
82 % \changes{v1.0pre3}{2004/07/07}{Options `landscape' and `portait'. (RN)}
83 % \changes{v1.0}{2004/08/06}{CTAN release. (RN/HjG)}
84 % \changes{v1.0a}{2004/08/08}{Option `debug'. (RN)}
85 % \changes{v1.0d}{2012/06/04}{Options `twopart/notwopart' suggested
86 % by Luis Rivera. No more `final' in \cmd{\ExecuteOptions} suggested
87 % by Axel Berger (RN)}
88 % \changes{v2.0d}{2020/10/25}{Using UTF8 in the preamble for author names
89 % to prevent unpacking issue. (RN)}
90 %
91 % \DoNotIndex{\newcommand,\renewcommand,\newenvironment,\renewenvironment}
92 % \DoNotIndex{\providecommand,\def,\edef,\let,\gdef,\xdef,\global,\newtoks}
93 % \DoNotIndex{\newif,\newsavebox}
94 % \DoNotIndex{\RequirePackage,\DeclareOption,\ProcessOptions,\ExecuteOptions}
95 % \DoNotIndex{\CurrentOption,\OptionNotUsed}
96 % \DoNotIndex{\LoadClass,\ClassError,\ClassInfo,\ClassWarningNoLine}
97 % \DoNotIndex{\documentclass,\usepackage,\document}
98 % \DoNotIndex{\input,\InputIfFileExists,\IfFileExists,\listfiles}
99 % \DoNotIndex{\@ifdefinable,\@ifundefined,\@percentchar,\@empty}
100 % \DoNotIndex{\AtBeginDocument,\AtEndDocument,\AtEndOfPackage}
101 % \DoNotIndex{\MessageBreak,\typeout,\begin,\end,\noindent}
102 % \DoNotIndex{\wd,\dp,\ht,\par,\@gobble,\g@addto@macro}
103 % \DoNotIndex{\z@,\z@skip,\p@,\@ne,\tw@,\thr@@,\@iv,\strip@pt,\@plus}
104 % ^^A ,\@cclv
105 % \DoNotIndex{\the,\if,\else,\or,\fi,\ifnum,\ifdim,\ifcase,\ifodd}
106 % \DoNotIndex{\advance,\multiply,\divide}
107 % \DoNotIndex{\addtolength,\setlength,\usebox,\setbox,\box,\hbox,\vbox,\hb@xt@}
108 % \DoNotIndex{\usecounter,\setcounter,\undefined,\@undefined,\loop,\repeat}
109 % \DoNotIndex{\vspace,\hspace,\vfill,\hfill,\put,\string}
110 % \DoNotIndex{\csname,\endcsname,\begingroup,\endgroup,\@nameuse}
111 % \DoNotIndex{\expandafter,\afterassignment,\aftergroup,\noexpand}
112 % \DoNotIndex{\@tempdima,\@tempdimb,\@tempdimc,\@tempcnta,\@tempcntb}
113 % \DoNotIndex{\@tempboxa,\@temptokena,\toks@,\mbox,\makebox}
114 % \DoNotIndex{\reserved@a,\relax,\protect,\space,\@spaces}
115 % \DoNotIndex{\romannumeral,\Roman,\section,\subsection,\tableofcontents}
116 % \DoNotIndex{\if@tempswa,\@tempswatrue,\@tempswafalse,\if,\ifx,\@ifstar}
117 % \DoNotIndex{\bfseries,\normalfont,\normalsize,\small,\large,\Huge}
118 % \DoNotIndex{\parindent,\parskip,\parsep,\clearpage,\newpage,\thanks,\title}
119 %
120 % \DoNotIndex{\TEXT,\author,\maketitle}
121 %
122 % \title{The \textsf{leaflet} document class}
123 %
124 % \author{\makebox[.25\textwidth][r]{J\"urgen Schlegelmilch} \and
125 % Hubert G\"a\ss{}lein \and
126 % \makebox[.25\textwidth][l]{Rolf Niepraschk} \and
127 % Walter Schmidt}
128 %
129 % \date{\filedate}
130 %
131 % \maketitle
132 %
133 % \tableofcontents
134 %
135 % \section{Usage}
136 % Process the file |leaflet-manual.tex| with \LaTeX\ to see
137 % details of usage and layout.
138 %
139 % \StopEventually{\PrintChanges\PrintIndex}
140 %
141 %
142 % \section{Implementation}
143 %
144 % \begin{macrocode}
145 %<*class>
146 % \end{macrocode}
147 %
148 % \subsection{Test whether the LaTeX format is new enough}
149 % We use the 'shipout/before' hook.
150 % \begin{macrocode}
151 \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
152 \IfFormatAtLeastTF{2020/10/01}{}{%
153 \ClassError{leaflet}{%
154 LaTeX version equal to or newer \MessageBreak
155 than '2020/10/01' is required%
156 }{%
157 Renew your TeX installation.%
158 }%
159 }
160 % \end{macrocode}
161 % \subsection{Saving some internal macros\dots}
162 %
163 % \begin{macrocode}
164 \let\LL@begindvi\@begindvi
165 % \end{macrocode}
166 % \subsection{Option processing}
167 %
168 % \changes{v1.0b}{2004/08/12}{New option
169 % \texttt{nospecialtricks} for testing purposes. (RN)}
170 % \changes{v2.0a}{2020/10/13}{The macro \cmd{\LenToUnit} is no longer
171 % required. (RN)}
172 % \begin{macrocode}
173 \@ifundefined{iflandscape}{\newif\iflandscape}{}%
174 \@ifundefined{iftumble}{\newif\iftumble}{}%
175 \@ifundefined{iftwopart}{\newif\iftwopart}{}%
176 \@ifundefined{iffoldcorr}{\newif\iffoldcorr}{}%
177 \newlength\LL@tempdima
178 \newcommand\LL@debug@info[1]{}%
179 \DeclareOption{dvips}{\PassOptionsToPackage{\CurrentOption}{graphics}}
180 \DeclareOption{pdftex}{\PassOptionsToPackage{\CurrentOption}{graphics}}
181 \DeclareOption{vtex}{\PassOptionsToPackage{\CurrentOption}{graphics}}
182 \DeclareOption{dvipdfm}{\PassOptionsToPackage{\CurrentOption}{graphics}}
183 \DeclareOption{twoside}{\OptionNotUsed}
184 \DeclareOption{twocolumn}{\OptionNotUsed}
185 \DeclareOption{landscape}{\landscapetrue}
186 \DeclareOption{portrait}{\landscapefalse}
187 \DeclareOption{debug}{\let\LL@debug@info\typeout}
188 \DeclareOption{twopart}{\twoparttrue}
189 \DeclareOption{notwopart}{\twopartfalse}
190 \DeclareOption{nospecialtricks}{%
191 \AtEndOfClass{%
192 \ifLL@combine
193 \let\immediate\@@@immediate\let\write\@@@write
194 \let\openout\@@@openout\let\closeout\@@@closeout
195 \let\special\@@@special\let\@@@exec@outs\relax
196 \fi}}
197 % \end{macrocode}
198 % \begin{macro}{\LL@setPaperSize}
199 % Some paper sizes are not supported by the article class.
200 % Hence this work-around.
201 % These page dimensions \emph{must} be given in landscape orientation!
202 % \begin{macrocode}
203 \newcommand*\LL@setPaperSize{}
204 \DeclareOption{a3paper}{\def\LL@setPaperSize{%
205 \paperwidth=420mm\paperheight=297mm\relax}}%
206 \@ifdefinable\ifLL@combine{\newif\ifLL@combine}
207 \DeclareOption{combine}{\LL@combinetrue}
208 \DeclareOption{nocombine}{\LL@combinefalse}
209 % \end{macrocode}
210 % \end{macro}
211 % \begin{macro}{\LL@selectOutput}
212 % \begin{macrocode}
213 \newcommand*\LL@selectOutput{}
214 \DeclareOption{frontside}{\def\LL@selectOutput#1#2{#1}}
215 \DeclareOption{backside}{\def\LL@selectOutput#1#2{#2}}
216 \DeclareOption{bothsides}{\def\LL@selectOutput#1#2{#1#2}}
217 % \end{macrocode}
218 % \end{macro}
219 % \begin{macrocode}
220 \DeclareOption{tumble}{\tumbletrue}
221 \DeclareOption{notumble}{\tumblefalse}
222 % \end{macrocode}
223 % \begin{macro}{\LL@foldmark}
224 % Drawing code for the fold mark.
225 % (Will be called within a |picture| environment.)
226 % \begin{macrocode}
227 \newcommand*\LL@foldmark{}
228 \DeclareOption{foldmark}{%
229 \def\LL@foldmark{%
230 \begingroup
231 \linethickness{\foldmarkrule}%
232 \@tempdima=\dimexpr\paperheight-\LL@tmargin
233 \put(0,\@tempdima){%
234 \line(0,-1){\foldmarklength}}%
235 \endgroup}%
236 }
237 % \end{macrocode}
238 % \changes{v1.0d}{2004/12/22}{Invalid code for option ``nofoldmark''
239 % changed. Thanks to Una Smith. (RN)}
240 % \begin{macrocode}
241 \DeclareOption{nofoldmark}{\def\LL@foldmark{}}%
242 % \end{macrocode}
243 % \end{macro}
244 % \changes{v1.1a}{2015/12/27}{New options `foldcorr/nofoldcorr' suggested by
245 % Walter Schmidt. (RN)}
246 % \begin{macrocode}
247 \DeclareOption{foldcorr}{\foldcorrtrue}
248 \DeclareOption{nofoldcorr}{\foldcorrfalse}
249 % \end{macrocode}
250 % \begin{macrocode}
251 \newcommand*\LL@toomanypages[2]{}
252 \DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{article}%
253 \AtEndOfClass{%
254 \def\LL@toomanypages#1#2{%
255 \ClassWarningNoLine{leaflet}{#1.\MessageBreak#2}}%
256 }%
257 }
258 \DeclareOption{final}{\PassOptionsToClass{\CurrentOption}{article}%
259 \AtEndOfClass{%
260 \ifLL@combine
261 \def\LL@toomanypages#1#2{%
262 \ClassError{leaflet}{#1}{#2.}}%
263 \else
264 \def\LL@toomanypages#1#2{%
265 \ClassWarningNoLine{leaflet}{#1.\MessageBreak#2}}%
266 \fi
267 }%
268 }
269 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
270 \PassOptionsToClass{landscape,a4paper}{article}
271 \ExecuteOptions{tumble,foldmark,bothsides,combine,landscape,notwopart}
272 \ProcessOptions\relax
273 \ifLL@combine
274 % \end{macrocode}
275 % \begin{macro}{\LL@rotate@I}
276 % \begin{macro}{\LL@rotate@II}
277 % Rotates the output pages.
278 % \begin{macrocode}
279 \newcommand*\LL@rotate@I{}\newcommand*\LL@rotate@II{}%
280 \iflandscape
281 \def\LL@rotate@I#1{#1}%
282 \iftumble
283 \def\LL@rotate@II#1{\rotatebox[origin=c]{180}{#1}}%
284 \else
285 \def\LL@rotate@II#1{#1}%
286 \fi
287 \else
288 \def\LL@rotate@I#1{\rotatebox[origin=c]{90}{#1}}%
289 \iftumble
290 \def\LL@rotate@II#1{\rotatebox[origin=c]{270}{#1}}%
291 \else
292 \def\LL@rotate@II#1{\rotatebox[origin=c]{90}{#1}}%
293 \fi
294 \fi
295 % \end{macrocode}
296 % \end{macro}
297 % \end{macro}
298 % \begin{macro}{\immediate}
299 % \begin{macro}{\write}
300 % \begin{macro}{\openout}
301 % \begin{macro}{\closeout}
302 % In the following we redefine the \TeX{} primitives \cmd{\immediate},
303 % \cmd{\write}, \cmd{\openout}, and \cmd{\closeout}. All of them not
304 % ``immediate'' executed statements are added to the macro
305 % \cmd{\@@@pending@outs} (comma list). So especially the \cmd{\write}
306 % statements independent of \TeX's \cmd{\shipout} run at a convenient time. For
307 % V\TeX\ we must keep in mind that \cmd{\immediate}\cmd{\special} exist.
308 % \changes{v1.0b}{2004/08/12}{\cmd{\special} must be processed similar
309 % to e.\,g. \cmd{\write} (V\TeX). (RN)}
310 % \begin{macrocode}
311 \def\@@@pending@outs{}\let\@@@immediate\immediate
312 \let\@@@write\write \let\@@@special\special
313 \let\@@@openout\openout \let\@@@closeout\closeout
314 \def\immediate{%
315 \let\write\immediate@write%
316 \let\openout\immediate@openout%
317 \let\closeout\immediate@closeout%
318 \let\special\immediate@special}%
319 \def\reset@immediate{%
320 \let\write\pending@write%
321 \let\openout\pending@openout%
322 \let\closeout\pending@closeout%
323 \let\special\@@@special}%
324 \long\def\pending@write#1#{\pending@@write{#1}}
325 \def\immediate@write{%
326 \reset@immediate\@@@immediate\@@@write}%
327 \def\immediate@openout{%
328 \reset@immediate\@@@immediate\@@@openout}%
329 \def\immediate@closeout{%
330 \reset@immediate\@@@immediate\@@@closeout}%
331 \def\immediate@special{%
332 \reset@immediate\@@@immediate\@@@special}%
333 \let\write\pending@write
334 \let\openout\pending@openout
335 \let\closeout\pending@closeout
336 % \end{macrocode}
337 % \begin{macro}{\@dummy@whatsit}
338 % Makes our redefined primitives more like ``whatsits'' (???).
339 % `\cmd{\special}|{}|' is also possible for pdf\TeX\ but we get a lot of
340 % strange warnings (``|Non-PDF special ignored!|'') in this case.
341 % \begin{macrocode}
342 \def\@dummy@whatsit{\special{}}
343 \begingroup\@ifundefined{pdfoutput}%
344 {\endgroup}
345 {\endgroup
346 \ifnum\pdfoutput>\z@\def\@dummy@whatsit{\pdfliteral{}}\fi}
347 % \end{macrocode}
348 % \end{macro}
349 % \begin{macrocode}
350 \begingroup\expandafter\expandafter\expandafter\endgroup
351 \expandafter\ifx\csname eTeXversion\endcsname\relax
352 %%% Test is from Markus Kohm (d.c.t.t, 29 Jun 2004)
353 \ClassWarningNoLine{leaflet}{%
354 *************************************\MessageBreak
355 * It's very recommended to use eTeX \MessageBreak
356 * with this package! \MessageBreak
357 *************************************}%
358 % \end{macrocode}
359 % \begin{macro}{\pending@@write}
360 % Doesn't work correctly without any \cmd{\mark} or \cmd{\special}
361 % or \cmd{\pdfliteral} command inside.
362 % \begin{macrocode}
363 \long\def\pending@@write#1#2{%
364 \@dummy@whatsit
365 \g@addto@macro\@@@pending@outs{\@@@immediate\@@@write\number#1{#2},}}%
366 % \end{macrocode}
367 % \end{macro}
368 % \begin{macro}{\pending@openout}
369 % \begin{macrocode}
370 \def\pending@openout#1 {%
371 \@dummy@whatsit
372 \g@addto@macro\@@@pending@outs{\@@@immediate\@@@openout\number#1,}}%
373 % \end{macrocode}
374 % \end{macro}
375 % \begin{macro}{\pending@closeout}
376 % \begin{macrocode}
377 \def\pending@closeout#1{%
378 \@dummy@whatsit
379 \g@addto@macro\@@@pending@outs{\@@@immediate\@@@closeout\number#1,}}%
380 % \end{macrocode}
381 % \end{macro}
382 % \begin{macro}{\@@@exec@outs}
383 % Note to this implementation: The out commands and the page breaks are not
384 % allways in sync, which means possible wrong page references.
385 % \begin{macrocode}
386 \newcommand*\@@@exec@outs{%
387 \@@@pending@outs\gdef\@@@pending@outs{}%
388 \LL@debug@info{%
389 >>> execute the output commands of the current page <<<}}%
390 % \end{macrocode}
391 % \end{macro}
392 % \begin{macrocode}
393 \else
394 \RequirePackage{etex}
395 % \end{macrocode}
396 % Allocation of a new mark class.
397 % \begin{macrocode}
398 \globmarks\@@@out@mark
399 \newcounter{@@total@outs}\setcounter{@@total@outs}{0}
400 \newcounter{@@last@exec}\setcounter{@@last@exec}{0}
401 % \end{macrocode}
402 % \begin{macro}{\pending@@write}
403 % Doesn't work correctly without any \cmd{\mark} or \cmd{\special}
404 % or \cmd{\pdfliteral} command inside.
405 % \begin{macrocode}
406 \long\def\pending@@write#1#2{%
407 \global\advance\c@@@total@outs\@ne%
408 \marks\@@@out@mark{\the\c@@@total@outs}%
409 \g@addto@macro\@@@pending@outs{\@@@immediate\@@@write\number#1{#2},}}%
410 % \end{macrocode}
411 % \end{macro}
412 % \begin{macro}{\pending@openout}
413 % \begin{macro}{\pending@@openout}
414 % \begin{macro}{\pending@@@openout}
415 % \begin{macro}{\@ifequalsign}
416 % \begin{macrocode}
417 \def\pending@openout#1 {%
418 \global\advance\c@@@total@outs\@ne%
419 \marks\@@@out@mark{\the\c@@@total@outs}%
420 \g@addto@macro\@@@pending@outs{\@@@immediate\@@@openout\number#1,}}%
421 % \end{macrocode}
422 % \end{macro}
423 % \end{macro}
424 % \end{macro}
425 % \end{macro}
426 % \begin{macro}{\pending@closeout}
427 % \begin{macrocode}
428 \def\pending@closeout#1{%
429 \global\advance\c@@@total@outs\@ne%
430 \marks\@@@out@mark{\the\c@@@total@outs}%
431 \g@addto@macro\@@@pending@outs{\@@@immediate\@@@closeout\number#1,}}%
432 % \end{macrocode}
433 % \end{macro}
434 % \begin{macro}{\@@@exec@outs}
435 % With the call of \cmd{\@@@exec@outs} we simulate \TeX's
436 % execution of non-immediate output commands. The number of pending
437 % commands which can be executed must be decremented by
438 % $\cmd{\value}|{@@total@outs}| - \cmd{\botmarks}\cmd{\@@@out@mark}$. The
439 % remaining commands must still wait until the next output page is
440 % ready. It works only for output commands in the main text which moved to
441 % the next page but not for floating output commands.
442 % \changes{v2.0c}{2020/10/14}{Missing \cmd{\set@display@protect} (RN)}
443 % \begin{macrocode}
444 \newcommand*\@@@exec@outs{%
445 \begingroup
446 % \end{macrocode}
447 % Pending io's $=\cmd{\@tempcntb} = \mbox{TOTAL-OUTS}\,-\,\mbox{LAST-EXEC}$
448 % \begin{macrocode}
449 \@tempcntb\c@@@total@outs\advance\@tempcntb-\c@@@last@exec%
450 \edef\reserved@a{\botmarks\@@@out@mark}%
451 \ifx\reserved@a\@empty\@tempcnta\z@\else\@tempcnta\reserved@a\fi%
452 \LL@debug@info{PENDING-OUTS:\the\@tempcntb\space\space
453 TOTAL-OUTS:\the\c@@@total@outs\space\space
454 LAST-EXEC:\the\c@@@last@exec\space\space
455 TOPMARK:\topmarks\@@@out@mark\space\space
456 FIRSTMARK:\firstmarks\@@@out@mark\space\space
457 BOTMARK:\botmarks\@@@out@mark}%
458 % \end{macrocode}
459 % Last valid pending entry $ = \cmd{\@tempcntb} =
460 % \mbox{PENDING-OUTS}\,-\,\mbox{TOTAL-OUTS}\,+\,\mbox{BOTMARK} $
461 % \par\noindent
462 % Number of invalid (moved) out's $ = \cmd{\@tempcnta} =
463 % \mbox{TOTAL-OUTS}\,-\,\mbox{BOTMARK} $
464 % \begin{macrocode}
465 \advance\@tempcnta-\c@@@total@outs \advance\@tempcntb\@tempcnta
466 \@tempcnta-\@tempcnta%
467 \ifnum\@tempcnta>\z@
468 \LL@debug@info{%
469 >>> resave \the\@tempcnta\space output command(s).
470 Too early to execute! <<<}%
471 \fi
472 \@tempcnta\z@ \def\reserved@b{}%
473 \set@display@protect
474 \@for\reserved@a :=\@@@pending@outs\do{%
475 \ifx\reserved@a\@empty\else
476 \ifnum\@tempcnta<\@tempcntb%
477 \reserved@a% execute output's related to the current page box.
478 \global\advance\c@@@last@exec\@ne
479 \LL@debug@info{>>> execute output command number
480 \the\c@@@last@exec\space<<<}%
481 \else
482 % \end{macrocode}
483 % Other output's must be resaved and still pending.
484 % \begin{macrocode}
485 \expandafter\g@addto@macro\expandafter\reserved@b\expandafter{%
486 \reserved@a,}%
487 \fi
488 \advance\@tempcnta\@ne%
489 \fi}%
490 \expandafter\@temptokena\expandafter{\reserved@b}%
491 \xdef\@@@pending@outs{\the\@temptokena}%
492 \endgroup}%
493 % \end{macrocode}
494 % \end{macro}
495 % \begin{macrocode}
496 \fi% end of eTeX test.
497 % \end{macrocode}
498 % \end{macro}
499 % \end{macro}
500 % \end{macro}
501 % \end{macro}
502 % \begin{macro}{\protected@write}
503 % Because our redefined \cmd{\write} is expandable we must protect
504 % it inside of \LaTeX's \cmd{\protected@write}.
505 % \begin{macrocode}
506 \long\def\protected@write#1#2#3{%
507 \begingroup
508 \let\thepage\relax
509 #2%
510 \let\protect\@unexpandable@protect
511 \edef\reserved@a{\noexpand\write#1{#3}}%
512 \reserved@a%
513 \endgroup
514 \if@nobreak\ifvmode\nobreak\fi\fi}%
515 % \end{macrocode}
516 % \end{macro}
517 % \begin{macro}{\@begindvi}
518 % Delay \cmd{\@begindvi} to be executed until the real page output.
519 % \begin{macrocode}
520 \let\@begindvi\@empty
521 \fi% end of \ifLL@combine
522 % \end{macrocode}
523 % \end{macro}
524 % \begin{macro}{\LL@toomanypages}
525 % Now elsewhere \dots
526 % \end{macro}
527 % \changes{v1.1a}{2015/12/27}{Using \cmd{\dimexpr} instead of
528 % package `calc'.(RN)}
529 % \begin{macrocode}
530 \LoadClass{article}
531 \RequirePackage{graphicx}
532 % \end{macrocode}
533 % \begin{macro}{\LL@pagesize@specials}
534 % Now the graphics driver is known.
535 % We will check the graphics driver and set special code for page
536 % dimensions and other.
537 % \changes{v1.0e}{2013/11/06}{Patch from Toby Thurston for XeLaTeX. (RN)}
538 % \changes{v1.1b}{2017/03/17}{Adding code for LuaTeX \textgreater 0.85.
539 % Thanks to Knut Lickert for his bug report. (RN)}
540 % \begin{macrocode}
541 \newcommand*\LL@pagesize@specials[2]{}
542 \@ifundefined{Gin@driver}{}{%
543 \ifx\Gin@driver\@empty\else%
544 \filename@parse{\Gin@driver}\@tempswafalse%
545 \def\reserved@a{dvips}%
546 \ifx\filename@base\reserved@a\@tempswatrue\fi%
547 \def\reserved@a{dvipdfm}%
548 \ifx\filename@base\reserved@a\@tempswatrue\fi%
549 \if@tempswa
550 \ClassInfo{leaflet}{Generating code for dvips}%
551 \def\LL@pagesize@specials#1#2{%
552 \@tempdima=#1\@tempdimb=#2 %
553 \AtBeginDvi{\special{papersize=\the\@tempdima,\the\@tempdimb}}}%
554 \fi
555 \def\reserved@a{pdftex}%
556 \ifx\filename@base\reserved@a
557 \ClassInfo{leaflet}{Generating code for pdfTeX}%
558 \def\LL@pagesize@specials#1#2{%
559 \@tempdima=#1\@tempdimb=#2 %
560 \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}%
561 \fi
562 \def\reserved@a{luatex}%
563 \ifx\filename@base\reserved@a
564 \ClassInfo{leaflet}{Generating code for LuaTeX}%
565 \ifx\pdfpagewidth\@undefined
566 \def\LL@pagesize@specials#1#2{%
567 \@tempdima=#1\@tempdimb=#2 %
568 \pagewidth\@tempdima\pageheight\@tempdimb}%
569 \else
570 \def\LL@pagesize@specials#1#2{%
571 \@tempdima=#1\@tempdimb=#2 %
572 \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}%
573 \fi
574 \fi
575 \def\reserved@a{xetex}%
576 \ifx\filename@base\reserved@a
577 \ClassInfo{leaflet}{Generating code for XeTeX}%
578 \def\LL@pagesize@specials#1#2{%
579 \@tempdima=#1\@tempdimb=#2%
580 \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}%
581 \fi
582 \def\reserved@a{vtex}%
583 \ifx\filename@base\reserved@a
584 \ClassInfo{leaflet}{Generating code for VTeX}%
585 \def\LL@pagesize@specials#1#2{%
586 \@tempdima=#1\@tempdimb=#2%
587 \mediawidth\@tempdima\mediaheight\@tempdimb}%
588 \fi
589 \fi
590 }
591 % \end{macrocode}
592 % \end{macro}
593 %
594 % \begin{macro}{\LL@CmdIgnored}
595 % \begin{macrocode}
596 \newcommand*\LL@CmdIgnored[1]{%
597 \ClassWarning{leaflet}{%
598 `\string#1' ignored}}
599 % \end{macrocode}
600 % \end{macro}
601 % \subsection{Changing the class properties}
602 % \begin{macrocode}
603 \setlength{\parskip}{1ex plus 2pt}
604 \@listi%
605 \setlength{\labelwidth}{\leftmargin}
606 \addtolength{\labelwidth}{-\labelsep}
607 \pagestyle{empty}
608 \AddToHook{cmd/maketitle/after}{\thispagestyle{empty}}%
609 \headheight\z@
610 \headsep\z@
611 \footskip\z@
612 \marginparwidth\z@
613 \marginparsep\z@
614 \sloppy
615 \setcounter{secnumdepth}{0}
616 %\renewcommand\marginpar[2][]{\LL@CmdIgnored{\marginpar}}
617 \renewcommand\twocolumn[1][]{\LL@CmdIgnored{\twocolumn}}
618 \renewcommand\onecolumn{\LL@CmdIgnored{\onecolumn}}
619 \renewcommand\topfraction{0.7}
620 \renewcommand\bottomfraction{0.7}
621 \setlength{\textfloatsep}{10pt plus 4pt minus 3pt}
622 \setlength{\parindent}{\z@}
623 \setlength{\leftmargini}{1.5em}
624 \setlength{\leftmarginii}{1.5em}
625 \setlength{\leftmarginiii}{1.5em}
626 \setlength{\leftmarginiv}{1.5em}
627 \setlength{\leftmarginv}{1.5em}
628 \setlength{\leftmarginvi}{1.5em}
629 \setlength{\labelsep}{.5em}
630 \setlength \labelwidth{\leftmargini}
631 \addtolength\labelwidth{-\labelsep}
632 % \end{macrocode}
633 % \begin{macro}{\noparskip}
634 % \begin{macrocode}
635 \def\noparskip{\par\vspace{-\parskip}}
636 % \end{macrocode}
637 % \end{macro}
638 % Modification of list and section parameters for a more compact layout.
639 % \begin{macrocode}
640 \let\old@small\small
641 \renewcommand{\small}{\old@small\let\@listi\@listI}
642 \let\old@footnotesize\footnotesize
643 \renewcommand{\footnotesize}{\old@footnotesize\let\@listi\@listI}
644 % \end{macrocode}
645 % \begin{macro}{\sectfont}
646 % User macro for changing the font of the typesetted parameter of
647 % the \cmd{\?section} commands.
648 % \begin{macrocode}
649 \newcommand{\sectfont}{\bfseries}
650 % \end{macrocode}
651 % \end{macro}
652 % \begin{macrocode}
653 \renewcommand\section{\@startsection{section}{1}{\z@}%
654 {-3.5ex \@plus -.75ex}%
655 {1ex} %{1.5ex}%
656 {\normalfont\large\sectfont}}
657 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
658 {-2.5ex plus -.5ex}%
659 {1\p@} %{1ex}%
660 {\normalfont\normalsize\sectfont}}
661 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
662 {-2.5ex plus -.5ex}%
663 {-1em}%
664 {\normalfont\normalsize\sectfont}}
665 \def\part{\LL@CmdIgnored{\part}\secdef\@part\@spart}
666 \def\@part[#1]#2{}
667 \def\@spart#1{}
668
669 \renewcommand*\descriptionlabel[1]{%
670 \hspace\labelsep\normalfont\descfont #1}
671 % \end{macrocode}
672 % \begin{macro}{\descfont}
673 % User macro for changing the font of the description label.
674 % \begin{macrocode}
675 \newcommand*\descfont{\bfseries}
676 % \end{macrocode}
677 % \end{macro}
678 % \begin{macrocode}
679 \iffalse
680 % Doesn't work!
681 \g@addto@macro\enumerate{\parsep2\p@\@plus2\p@\@minus\z@}
682 \g@addto@macro\itemize{\parsep2\p@\@plus2\p@\@minus\z@}
683 \g@addto@macro\description{\parsep2\p@\@plus2\p@\@minus\z@}
684 \else
685 \newcommand*\LL@listsetup{%
686 % \parsep.445ex\@plus.445ex\@minus.2225ex%
687 % \parsep.5ex\@plus.5ex\@minus.25ex%
688 \parsep1ex\@plus.5ex\@minus.25ex%
689 \LL@debug@info{***parsep=\the\parsep}%
690 % \itemsep.25\parsep
691 \itemsep\z@
692 \LL@debug@info{***itemsep=\the\itemsep}%
693 \topsep\z@
694 \LL@debug@info{***topsep=\the\topsep}%
695 % \partopsep\z@
696 \LL@debug@info{***partopsep=\the\partopsep}%
697 }
698 \def\enumerate{%
699 \ifnum \@enumdepth >\thr@@\@toodeep\else
700 \advance\@enumdepth\@ne
701 \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
702 \expandafter
703 \list
704 \csname label\@enumctr\endcsname
705 {\usecounter\@enumctr
706 \def\makelabel##1{\hss\llap{##1}}%
707 %\def\makelabel##1{##1\hfill}%
708 %\def\makelabel##1{\hss##1}%
709 \LL@listsetup
710 }%
711 \fi}
712 \def\itemize{%
713 \ifnum \@itemdepth >\thr@@\@toodeep\else
714 \advance\@itemdepth\@ne
715 \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
716 \expandafter
717 \list
718 \csname\@itemitem\endcsname
719 {%
720 \def\makelabel##1{\hss\llap{##1}}%
721 %\def\makelabel##1{##1\hfill}%
722 %\def\makelabel##1{\hss##1}%
723 \LL@listsetup
724 }%
725 \fi}
726 \renewenvironment{description}
727 {\list{}{\labelwidth\z@ \itemindent-\leftmargin
728 \let\makelabel\descriptionlabel
729 \LL@listsetup}}
730 {\endlist}
731 \fi
732 % \end{macrocode}
733 %
734 % \subsection{Changing the page dimensions}
735 %
736 % \begin{macro}{\setmargins}
737 % User command to specify the margins. (o, u, l, r)
738 %
739 % |\setmargins|\marg{top}\marg{bottom}\marg{left}\marg{right}
740 %
741 % The new user interface!
742 % By default, the \textsf{leaflet} class does not use headings,
743 % footings and marginal notes.
744 % If the user desires, these can be restored by setting the respective
745 % lengths \emph{before} calling |\setmargins|.
746 % Setting the margins should \emph{always} be done using |\setmargins|;
747 % if the user assigns to any of the length registers |\topmargin|,
748 % |\evensidemargin|, |\oddsidemargin| using |\setlength|, chaos will
749 % happen.
750 %
751 % \begin{macrocode}
752 \newcommand*\setmargins[4]{%
753 % \end{macrocode}
754 % temp. top!
755 % \begin{macrocode}
756 \setlength\topmargin{#1}%
757 \edef\LL@tmargin{\the\topmargin}%
758 % \end{macrocode}
759 % temp. bottom!
760 % \begin{macrocode}
761 \setlength\evensidemargin{#2}%
762 \textheight=\dimexpr\paperheight
763 -\topmargin-\evensidemargin-\headheight-\headsep-\footskip
764 % \end{macrocode}
765 % temp. left!
766 % \begin{macrocode}
767 \setlength\oddsidemargin{#3}%
768 % \end{macrocode}
769 % temp. right!
770 % \begin{macrocode}
771 \setlength\evensidemargin{#4}%
772 \textwidth=\dimexpr\paperwidth
773 -\oddsidemargin-\evensidemargin-\marginparwidth-\marginparsep
774 % \end{macrocode}
775 % real top!
776 % \begin{macrocode}
777 \addtolength\topmargin{-1in}%
778 % \end{macrocode}
779 % real left!
780 % \begin{macrocode}
781 \addtolength\oddsidemargin{-1in}%
782 % \end{macrocode}
783 % probably not necessary
784 % \begin{macrocode}
785 \evensidemargin\oddsidemargin
786 }
787 % \end{macrocode}
788 % \end{macro}
789 % The dimensions of a single small page.
790 % \begin{macrocode}
791 \LL@setPaperSize
792 \paperwidth=0.333333334\paperwidth
793 \setmargins{11mm}{11mm}{8mm}{8mm}
794 % \end{macrocode}
795 %
796 % \subsection{Additional user macros}
797 %
798 % \begin{macro}{\foldmarkrule}
799 % \begin{macro}{\foldmarklength}
800 % The dimension of the foldmark between page~2 and page~3.
801 % \begin{macrocode}
802 \newcommand*\foldmarkrule{0.4pt}
803 \newcommand*\foldmarklength{2mm}
804 % \end{macrocode}
805 % \end{macro}
806 % \end{macro}
807 % \begin{macro}{\AddToBackground}
808 % \begin{macro}{\AddToBackground*}
809 % Adds the given parameter~|#2| (some picture commands) to a
810 % macro which will be used inside a zero-dimensional picture environment
811 % located at the lower left corner of a page. Parameter~|#1|
812 % selects the page number. The star version adds the picture commands to the
813 % background of one of the combined large pages instead of one of the small
814 % pages.
815 % \begin{macrocode}
816 \newcommand\AddToBackground{%
817 \@ifstar{\@tempswatrue\LL@AddToBackground}
818 {\@tempswafalse\LL@AddToBackground}}
819 \@onlypreamble\AddToBackground
820 \newcommand\LL@AddToBackground[2]{%
821 \if@tempswa\def\@tempa{LL@largePic}\else\def\@tempa{LL@smallPic}\fi
822 \expandafter\providecommand\csname\@tempa\@Roman{#1}\endcsname{}%
823 \expandafter\g@addto@macro\csname\@tempa\@Roman{#1}\endcsname{#2}}
824 % \end{macrocode}
825 % \end{macro}
826 % \end{macro}
827 % \begin{macro}{\CutLine}
828 % \changes{v2.1a}{2020/11/06}{Optional parameter for line type}
829 % \begin{macro}{\CutLine*}
830 % \begin{macro}{\Scissors}
831 % Adds a line with two scissors on the left side of the page given as
832 % parameter |#1|. The starred version draws only the line.
833 % \begin{macrocode}
834 \newcommand*\CutLine{%
835 \@ifstar{\@tempswafalse\LL@CutLine}{\@tempswatrue\LL@CutLine}}
836 \@onlypreamble\CutLine
837 \newcommand*\LL@CutLine[2][.]{%
838 \ifLL@combine
839 \ifx\Scissors\@empty\@tempswafalse\fi
840 \if .#1%
841 \def\@tempa{\dotfill}%
842 \else\if -#1%
843 \def\@tempa{\hrulefill}%
844 \fi\fi
845 \edef\@tempb{%
846 \noexpand\AddToBackground{#2}{%
847 \noexpand\put(0,0){%
848 \noexpand\rotatebox{90}{\noexpand\makebox(\paperheight,0){%
849 \noexpand\normalsize\@tempa\if@tempswa\noexpand\Scissors%
850 \@tempa\@tempa\noexpand\Scissors\@tempa\fi}}}}%
851 }%
852 \@tempb
853 \fi}
854 \IfFileExists{pifont.sty}
855 {\RequirePackage{pifont}%
856 \newcommand*\Scissors{\raisebox{-0.85ex}{\large\ding{34}}}}%
857 {\newcommand*\Scissors{}}
858 % \end{macrocode}
859 % \end{macro}
860 % \end{macro}
861 % \end{macro}
862 % Adds the fold mark code between page~2 and page~3.
863 % \begin{macrocode}
864 \AddToBackground{3}{\LL@foldmark}
865 % \end{macrocode}
866 %
867 % \subsection{Page construction and output}
868 %
869 % \subsubsection{Intercepting the small pages}
870 %
871 % \begin{macro}{\vb@xt@}
872 % Similar to \cmd{\hb@xt@} (should be part of the \LaTeX\ kernel).
873 % \begin{macrocode}
874 \providecommand*\vb@xt@{\vbox to}
875 % \end{macrocode}
876 % \end{macro}
877 % We use our own page saving macro instead of real \LaTeX\ output.
878 % \begin{macrocode}
879 \AtBeginDocument{\AddToHook{shipout/before}{\LL@processPage}}
880 % \end{macrocode}
881 % \begin{macro}{LL@page}
882 % A counter for the small pages (absolute counting).
883 % \begin{macrocode}
884 \newcounter{LL@page}\setcounter{LL@page}{1}
885 \newcommand\LL@tempa{}
886 % \end{macrocode}
887 % \end{macro}
888 % \begin{macro}{\LL@processPage}
889 % With ``combine'' option the six small pages will be saved in box registers
890 % (\cmd{\LL@boxI}\dots \cmd{\LL@boxVI}).
891 % The \cmd{\ShipoutBox} with the page content must be a bit moved to get a
892 % ``normal-sized'' box. In ``nocombine'' mode only put the background picture.
893 % \changes{v1.1a}{2015/12/27}{Additions for new option `foldcorr'. (RN)}
894 % \changes{v2.0a}{2020/10/13}{Do not call \cmd{\@@@exec@outs} temporarily. (RN)}
895 % \changes{v2.0a}{2020/10/13}{Using \LaTeX's new 'shipout/before' hook. (RN)}
896 % \changes{v2.0b}{2020/10/14}{Renamed \cmd{\LL@savePage} to
897 % \cmd{\LL@processPage}. (RN)}
898 % \changes{v2.0c}{2020/10/14}{Activated \cmd{\@@@exec@outs} again. (RN)}
899 % \begin{macrocode}
900 \newcommand*\LL@processPage{%
901 \ifLL@combine\DiscardShipoutBox\fi
902 \ifnum\c@LL@page<7\relax
903 \LL@tempdima=\paperwidth
904 \ifLL@combine
905 \iffoldcorr
906 \@tempswafalse
907 \ifnum\c@LL@page=4\relax
908 \@tempswatrue
909 \else
910 \ifnum\c@LL@page=5\relax
911 \@tempswatrue
912 \fi
913 \fi
914 \if@tempswa\LL@tempdima=0.9797979798\paperwidth
915 \else\LL@tempdima=1.0101010101\paperwidth \fi
916 \fi
917 \@@@exec@outs
918 \expandafter\newsavebox\csname LL@box\Roman{LL@page}\endcsname%
919 \setbox\ShipoutBox=\vbox{\vskip1in\unvbox\ShipoutBox}%
920 \setbox\ShipoutBox=\vbox{\moveright1in\box\ShipoutBox}%
921 \setbox\ShipoutBox=\hb@xt@\paperwidth{\box\ShipoutBox\hss}%
922 \iffoldcorr
923 \setbox\ShipoutBox=\hb@xt@\LL@tempdima{\hss\box\ShipoutBox\hss}\fi
924 % \end{macrocode}
925 % Add a background picture to a single small page (`combine').
926 % \begin{macrocode}
927 \setbox\ShipoutBox=\vb@xt@\paperheight{%
928 \vbox{%
929 \pictur@(0,0)(0,\paperheight)%
930 \begingroup
931 \set@typeset@protect
932 \paperwidth=\LL@tempdima
933 \@nameuse{LL@smallPic\Roman{LL@page}}%
934 \endgroup
935 \endpicture
936 }%
937 \nointerlineskip\box\ShipoutBox\vss
938 }%
939 \global\expandafter\setbox
940 \csname LL@box\Roman{LL@page}\endcsname=\box\ShipoutBox
941 \typeout{\@spaces[\the\c@LL@page] ==> [\Roman{LL@page}]}%
942 \else
943 % \end{macrocode}
944 % Add a background picture to a single small page (`nocombine').
945 % \begin{macrocode}
946 \setbox\ShipoutBox\vbox{%
947 \vbox{\@tempdima=1in\relax
948 \@tempdimb=\paperheight\advance\@tempdimb-\@tempdima
949 \pictur@(0,0)(\@tempdima,\@tempdimb)%
950 \begingroup
951 \set@typeset@protect
952 \@nameuse{LL@smallPic\Roman{LL@page}}%
953 \endgroup
954 \endpicture
955 }%
956 \nointerlineskip\box\ShipoutBox
957 }%
958 \fi
959 \fi
960 \ifnum\c@LL@page=7\relax
961 % \end{macrocode}
962 % Make this an error or warning message, depending on class option.
963 % (|-->| warning in all cases?)
964 % \begin{macrocode}
965 \begingroup
966 \set@typeset@protect
967 \LL@toomanypages{%
968 The text you supplied fills more than six pages\MessageBreak
969 and will therefore not fit onto a single flyer}{%
970 Try using smaller fonts or reducing vertical space}%
971 \endgroup
972 \fi
973 \stepcounter{LL@page}}
974 % \end{macrocode}
975 % \end{macro}
976 %
977 % \noindent NOTE TO OURSELVES:
978 % All the following must be done if the document code is already
979 % processed.
980 %
981 % \changes{v2.0b}{2020/10/14}{Using hooks instead of redefinition
982 % of \cmd{\@@end}. (RN)}
983 % \begin{macro}{\LL@add@empty@pages}
984 % Generating missing small pages
985 % \begin{macrocode}
986 \newcommand*\LL@add@empty@pages{%
987 \clearpage\pagestyle{empty}%
988 \loop\ifnum\c@LL@page<7\relax
989 \ClassInfo{leaflet}{Generating empty page \the\c@page}%
990 \null\newpage
991 \repeat
992 }
993 % \end{macrocode}
994 % \end{macro}
995 % \begin{macro}{\LL@shipout@combined@pages}
996 % \begin{macrocode}
997 \newcommand*\LL@shipout@combined@pages{%
998 % \end{macrocode}
999 %
1000 % \subsubsection{Reassembling the small pages}
1001 %
1002 % Suppresses all shipout hook's clients (removing other kinds of
1003 % background pictures). Our page saving macro is still needed for
1004 % the next step and must be set again.
1005 % \changes{v2.0b}{2020/10/14}{Suppress other background images. (RN)}
1006 % \begin{macrocode}
1007 \RemoveFromHook{shipout/foreground}[*]
1008 \RemoveFromHook{shipout/background}[*]
1009 \RemoveFromHook{shipout/lastpage}[*]
1010 \RemoveFromHook{shipout/before}[*]
1011 \AddToHook{shipout/before}{\LL@processPage}
1012 % \end{macrocode}
1013 % Create empty pages if necessary.
1014 % \begin{macrocode}
1015 \LL@add@empty@pages
1016 % \end{macrocode}
1017 % Here begins the real output. LaTeX's \cmd{\shipout} will no more suppressed.
1018 % The begin dvi hook is reactivated. Final removing content from the hook.
1019 % \begin{macrocode}
1020 \RemoveFromHook{shipout/before}[*]
1021 \let\@begindvi\LL@begindvi
1022 \paperwidth=3\paperwidth
1023 \iflandscape
1024 \LL@pagesize@specials{\paperwidth}{\paperheight}%
1025 \else
1026 \LL@pagesize@specials{\paperheight}{\paperwidth}%
1027 \fi
1028 % \end{macrocode}
1029 % \begin{macro}{\LL@shipoutPage}
1030 % \changes{v1.0c}{2004/08/13}{Fix \cmd{\protect}-ion problems. (RN/HjG)}
1031 % This is similar to \LaTeX's \cmd{\@outputpage}, but without a group;
1032 % \cmd{\set@display@protect} seems to work as well.
1033 % \begin{macro}{\LL@preparePages}
1034 % \begin{macro}{\LL@preparePage}
1035 % Helper macros for page output: reassemble the small pages.
1036 %
1037 % \begin{macrocode}
1038 \newcommand*\LL@shipoutPage[1]{%
1039 % \set@display@protect
1040 \let \protect \noexpand
1041 \shipout\vb@xt@\paperheight{%
1042 \set@typeset@protect
1043 \vskip-1in%
1044 \@begindvi\hb@xt@\paperwidth{\hskip-1in##1\hss}\vss}}%
1045 \newcommand*\LL@preparePages[3]{%
1046 \typeout{[\@Roman{##1}\space\@Roman{##2}\space\@Roman{##3}] ==>}%
1047 % \end{macrocode}
1048 % Add a background picture to a large page.
1049 % \begin{macrocode}
1050 \pictur@(0,0)\@nameuse{LL@largePic\Roman{page}}\endpicture%
1051 \LL@preparePage{##1}\LL@preparePage{##2}\LL@preparePage{##3}}%
1052 \newcommand*\LL@preparePage[1]{%
1053 \expandafter\box\csname LL@box\@Roman{##1}\endcsname}%
1054 % \end{macrocode}
1055 % \end{macro}
1056 % \end{macro}
1057 % \end{macro}
1058 % Combine and output the frontside and the backside.
1059 % The option two part arranges the pages in a different than the ``natural''
1060 % order, to allow the typesetting of a 4 page leaflet and a detachable 2 page
1061 % form, for summaries, fill-in forms, applications, questionnaires, etc.
1062 % \begin{macrocode}
1063 \LL@selectOutput
1064 \iftwopart
1065 {\setcounter{page}{1}%
1066 \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{6}{4}{1}}}}%
1067 {\setcounter{page}{2}%
1068 \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{5}}}}%
1069 \else
1070 {\setcounter{page}{1}%
1071 \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{5}{6}{1}}}}%
1072 {\setcounter{page}{2}%
1073 \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{4}}}}%
1074 \fi
1075 }%
1076 % \end{macrocode}
1077 % \end{macro}
1078 % \begin{macrocode}
1079 \ifLL@combine
1080 \AddToHook{enddocument/end}{\LL@shipout@combined@pages}
1081 \else
1082 % \end{macrocode}
1083 % Create empty pages if necessary and then call the normal \LaTeX\ end.
1084 % \begin{macrocode}
1085 \LL@pagesize@specials{\paperwidth}{\paperheight}%
1086 \AtEndDocument{%
1087 \LL@add@empty@pages
1088 }
1089 \fi
1090 %</class>
1091 % \end{macrocode}
1092 % Done. Phew! (Did you hear that deep-drawn sigh?)
1093 %
1094 % \Finale
1095 %\endinput
1096 %
1097 % And here comes the user manual ...
1098 %<*manual>
1099 \listfiles
1100 \errorcontextlines=99
1101 \documentclass[
1102 %%notumble,
1103 %%nofoldmark,
1104 %%dvipdfm,
1105 %%portrait,
1106 %%titlepage,
1107 %%nocombine,
1108 %%a3paper,
1109 %%debug,
1110 %%nospecialtricks,
1111 %%draft,
1112 ]{leaflet}
1113
1114 %\setcounter{secnumdepth}{1}
1115
1116 \renewcommand*\foldmarkrule{.3mm}
1117 \renewcommand*\foldmarklength{5mm}
1118 %\setmargins{11mm}{3in}{8mm}{20mm}
1119 %
1120 %\pagestyle{plain}
1121
1122 \usepackage[T1]{fontenc}
1123 \usepackage{textcomp}
1124 \usepackage{mathptmx}
1125 \usepackage[scaled=0.9]{helvet}
1126 % the TeX and LaTeX logos for use with Times
1127 \makeatletter
1128 \def\ptmTeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.075emX\@}
1129 \DeclareRobustCommand{\ptmLaTeX}{L\kern-.3em
1130 {\setbox0\hbox{T}%
1131 %\vb@xt@ % :-)
1132 \vbox to\ht0{\hbox{%
1133 \csname S@\f@size\endcsname
1134 \fontsize\sf@size\z@
1135 \math@fontsfalse\selectfont
1136 A}%
1137 \vss}%
1138 }%
1139 \kern-.12em
1140 \ptmTeX}
1141 \makeatother
1142 \let\TeX=\ptmTeX
1143 \let\LaTeX=\ptmLaTeX
1144 \usepackage{shortvrb}
1145 \MakeShortVerb{\|}
1146 \usepackage{url}
1147 \usepackage{graphicx}
1148 \usepackage[svgnames]{xcolor}
1149
1150 %%%%\renewcommand{\descfont}{\normalfont}
1151 \newcommand\Lpack[1]{\textsf{#1}}
1152 \newcommand\Lclass[1]{\textsf{#1}}
1153 \newcommand\Lopt[1]{\texttt{#1}}
1154 \newcommand\Lprog[1]{\textit{#1}}
1155
1156 \newcommand*\defaultmarker{\textsuperscript\textasteriskcentered}
1157
1158 \title{The document class \Lclass{leaflet}}
1159 \author{%
1160 Rolf Niepraschk\\
1161 Walter Schmidt\\
1162 Hubert G\"a\ss lein}
1163 \date{Last updated~\docdate\\printed \today}
1164
1165 \CutLine*{1}% Dotted line without scissors (same as \CutLine*[.]{1})
1166 \CutLine[-]{6}% Solid line with scissors
1167
1168 \AddToBackground{5}{% Background of a small page
1169 \put(0,0){\textcolor{LightSkyBlue}{\rule{\paperwidth}{\paperheight}}}}
1170
1171 \AddToBackground*{2}{% Background of a large page
1172 \put(.5\paperwidth,.5\paperheight){%
1173 \makebox(0,0)[c]{%
1174 \resizebox{.9\paperwidth}{!}{\rotatebox{35.26}{%
1175 \textsf{\textbf{\textcolor{LightGray}{BACKGROUND}}}}}}}}
1176
1177 \begin{document}
1178
1179 \maketitle
1180
1181 %%\LARGE
1182
1183 %%\tableofcontents
1184
1185
1186 \section{Overview}
1187
1188 The document class \Lclass{leaflet} creates a document of (up to) six
1189 small pages in portrait orientation, arranged physically on two
1190 ``normal-size'' pages. The target page sizes supported by the standard
1191 \LaTeX{} \Lclass{article} are available, plus |a3paper|. Printing these
1192 to both sides of a sheet and folding appropriately will yield a six-page
1193 leaflet.
1194
1195 %% TEST: These commands are no longer disabled!
1196 \iffalse
1197 \reversemarginpar
1198 \marginpar[XXX]{YYY}
1199 \fi
1200 %% TEST: These commands are disabled!
1201 \onecolumn
1202 \twocolumn[WWW]
1203 %% end of TEST
1204
1205 \section{Requirements}
1206
1207 Using the \Lclass{leaflet} class requires that the final
1208 document is created in PostScript or PDF format, using
1209 \begin{itemize}
1210 \item \TeX{} and \Lprog{dvips}, or
1211 \item pdf\TeX{}, or
1212 \item V\TeX{} in PS or PDF mode.
1213 \end{itemize}
1214 (Some other drivers supported by standard \LaTeX{} work as well.)
1215
1216 \section{Features}
1217
1218 Basically the \Lclass{leaflet} class provides the same features as the
1219 standard \Lclass{article} class. There are, however, a number of
1220 differences and restrictions, as well as some additional facilities and
1221 peculiarities:
1222
1223 \begin{itemize}
1224
1225 \item
1226 The sectioning level |\part| is not available.
1227 The other sectioning levels are not numbered by default.
1228
1229 \item
1230 References to the page where floating objects are located may come out
1231 wrong (this includes |\pageref| as well as |\listof...| commends).
1232
1233 \item
1234 Section headers are typeset in a smaller font size than in the
1235 standard classes.
1236
1237 \item
1238 You may use list-like environments just as in the standard classes.
1239 The left margins have been adjusted to work well with the
1240 \Lopt{a4paper} and \Lopt{letterpaper} class options.
1241 With other target page sizes, you'll have to adjust them.
1242
1243 Here's a small demo:
1244 \begin{description}
1245 \item[Uncle Meat] First entry in a description environment.
1246 \item[King Kong] Second entry.
1247 \begin{itemize}
1248 \item First entry in an itemize environment.
1249 \begin{enumerate}
1250 \item First entry in an enumerate environment.
1251 \item Second entry.
1252 \begin{enumerate}
1253 \item First entry in an enumerate environment.
1254 \begin{enumerate}
1255 \item First entry in an enumerate environment.
1256 \item Second entry.
1257 \end{enumerate}
1258 \item Second entry.
1259 \begin{itemize}
1260 \item First entry in an itemize environment.
1261 \item Second entry.
1262 \end{itemize}
1263 \item Another entry.
1264 \end{enumerate}
1265 \item Another entry.
1266 \end{enumerate}
1267 \item Second entry.
1268 \item Another entry.
1269 \end{itemize}
1270 \item[Frunobulax] Another entry.
1271 \end{description}
1272
1273 \item
1274 Marginal notes are pointless on the given page size and
1275 are disabled.
1276
1277 \item
1278 Two-column typesetting is not supported for the same reason.
1279
1280 \item
1281 By default, there are no page headers, page footers or page numbers,
1282 nor is there any space reserved for these.
1283
1284 However, you can restore them, if you like.
1285 To do so, use |\pagestyle| as with the standard classes,
1286 and |\setlength| to adjust the corresponding parameters (like
1287 |\headheight|).
1288 At last, you have to call the new macro \par
1289 | \setmargins{top}{bottom}{left}{right}|.
1290
1291 \item
1292 Paragraphs are separated by vertical space; the first line
1293 of a paragraph is not indented by default.
1294
1295 \item
1296 By default, all paragraphs are typeset as if you had
1297 specified |\sloppy| in the document preamble.
1298
1299 \item
1300 A small folding mark is created between the second and the
1301 third page.
1302
1303 \item
1304 The macro |\CutLine| draws a vertical dotted line with
1305 scissor symbols between the page indicated by its argument and the
1306 preceding one. The optional parameter |[-]| changes the dotted line to a
1307 solid one. The starred version omits the scissors symbols.
1308
1309 \item
1310 In case the text does not fit on six pages, a warning (or error,
1311 depending on some class option, see below) will be issued.
1312
1313 \item
1314 To add some background picture to individual pages, you can use
1315 |\AddToBackground| commands. Its first argument specifies the page,
1316 the second one the picture commands.
1317 The starred version puts the picture on the combined pages.
1318
1319 \end{itemize}
1320
1321
1322 \section{Customization}
1323
1324 The typeface to be used for the section headings is given by the macro
1325 |\sectfont|, and the typeface to be used for the labels of the
1326 |description| environment is given by |\descfont|.
1327 Both macros default to |\bfseries| and can be changed using
1328 |\renewcommand*|.
1329
1330 The horizontal and vertical margins of the (small) pages
1331 have the standard sizes 8 mm and 11 mm, respectively, and can be changed
1332 using |\setmargins|, as explained above.
1333 This may be useful, if the printing engine exhibits larger unprintable
1334 margins.
1335
1336 The macros |\foldmarkrule| and |\foldmarklength| determine the stroke
1337 width and the length of the fold mark, which is printed between the
1338 second and the third page.
1339 They default to 0.4\,pt and 2\,mm, respectively, and can be changed
1340 using |\renewcommand*| (\emph{not} |\setlength|!).
1341 See also the class options \Lopt{foldmark} and \Lopt{nofoldmark}.
1342
1343
1344 \section{Class options}
1345
1346 Default options are marked with an asterisk:
1347 \begin{description}
1348 \item[\Lopt{tumble}{\defaultmarker}, \Lopt{notumble}]
1349 By default, the contents of the back side of the final sheet is
1350 printed upside down.
1351 The option \Lopt{notumble} suppresses that.
1352 Doing so may be necessary to suit the behavior of certain printing
1353 engines.
1354 Specifying \Lopt[notumble] may also be useful during the writing of
1355 a document, to enable proof-reading on the screen.
1356 \item[\Lopt{frontside}, \Lopt{backside}, \Lopt{bothsides}{\defaultmarker}]
1357 These options control whether only the front page, the back page or
1358 both pages of the final sheet are to be be created.
1359 Thus, you can create separate files for the front an back side of
1360 the sheet.
1361 \item[\Lopt{foldmark}{\defaultmarker}, \Lopt{nofoldmark}]
1362 These options specifiy whether or not a fold mark is to be printed.
1363 \item[\Lopt{combine}{\defaultmarker}, \Lopt{nocombine}]
1364 These options specify whether the (small) pages should be output
1365 combined on a (large) target page (\Lopt{combine}) or as individual
1366 pages (\Lopt{nocombine}).
1367
1368 At the same time, the determine behaviour in case the text does not
1369 fit on six (small) pages.
1370 By default (\Lopt{combine}), an error is raised---and the surplus pages
1371 will be gobbled.
1372 Otherwise (\Lopt{nocombine}), just a warning will be issued;
1373 shortening the text appropriately is left to the user.
1374 \item[\Lopt{twopart}, \Lopt{notwopart}{\defaultmarker}]
1375 Allows the typesetting of a four page leaflet (first part) and a two page
1376 detachable form (second part), for fill-in forms, questionnaires, applications,
1377 etc.
1378 \item[\Lopt{foldcorr}, \Lopt{nofoldcorr}{\defaultmarker}]
1379 Decreases the width of pages 4 and 5 by 2\,\% (A4 paper: 2\,mm) and
1380 increases the other pages by 1\,\% (A4 paper: 1\,mm) for easier
1381 folding in combine mode.
1382 \end{description}
1383
1384 Other options are passed to the \Lclass{article} class.
1385
1386
1387 \section{Changes over version 0.3}
1388
1389 The present release of the \Lclass{leaflet} class differs basically
1390 from its predecessor, version~0.3, which had been developed originally
1391 by J\"urgen Schlegelmilch.
1392
1393 The main change is, that no more post-processing is required to
1394 arrange the pages on the sheet.
1395 Furthermore, the overall layout has been changed slightly to suit the
1396 small page size better.
1397 In general, documents that were written for version~0.3 will exhibit
1398 different line and page breaks when typeset using the new version of
1399 this document class.
1400
1401 \begin{thebibliography}{000}
1402 \bibitem{cit:latex-man}
1403 \textsc{L.\,Lamport}: \LaTeX. A Document Preparation System.
1404 \textit{User's Guide And Reference Manual.} Second Edition. 1994.
1405 \end{thebibliography}
1406
1407 \loggingall
1408 \end{document}
1409 %</manual>
1410 \endinput
1411