Debian Codegraph @

texmf-dist/source/latex/revtex4/ltxdocext.dtx

raw
1 % \iffalse &pdflatex ltxdoc klootch
2 % ltxdocext.dtx: package to extend the ltxdoc class of standard LaTeX
3 % Copyright (c) 1999 Arthur Ogawa
4 %
5 % Disclaimer
6 % This file is distributed WITHOUT ANY WARRANTY;
7 % without even the implied warranty of
8 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 % ReadMe
10 % For the documentation and more detailed instructions for
11 % installation, typeset this document with \LaTeX.
12 % \fi
13 %% \CharacterTable
14 %% {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
15 %% 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
16 %% Digits \0\1\2\3\4\5\6\7\8\9
17 %% Exclamation \! Double quote \" Hash (number) \#
18 %% Dollar \$ Percent \% Ampersand \&
19 %% Acute accent \' Left paren \( Right paren \)
20 %% Asterisk \* Plus \+ Comma \,
21 %% Minus \- Point \. Solidus \/
22 %% Colon \: Semicolon \; Less than \<
23 %% Equals \= Greater than \> Question mark \?
24 %% Commercial at \@ Left bracket \[ Backslash \\
25 %% Right bracket \] Circumflex \^ Underscore \_
26 %% Grave accent \` Left brace \{ Vertical bar \|
27 %% Right brace \} Tilde \~}%
28 %
29 % \iffalse ltxdoc klootch
30 %%% @LaTeX-file{
31 %%% filename = "ltxdocext.dtx",
32 %%% version = "0.1",
33 %%% date = "2020/09/30",
34 %%% author = "Arthur Ogawa (mailto:[email protected])",
35 %%% copyright = "Copyright (C) 1999 Arthur Ogawa,
36 %%% all rights reserved. Copying of this file is
37 %%% authorized only if either:
38 %%% (1) you make absolutely no changes to your copy,
39 %%% including name; OR
40 %%% (2) if you do make changes, you first rename it
41 %%% to some other name.",
42 %%% address = "Arthur Ogawa,
43 %%% USA",
44 %%% telephone = "",
45 %%% FAX = "",
46 %%% email = "[email protected]",
47 %%% codetable = "ISO/ASCII",
48 %%% keywords = "latex, ltxdoc",
49 %%% supported = "yes",
50 %%% abstract = "extensions to the ltxdoc class",
51 %%% }
52 % \fi
53 %
54 % \iffalse ltxdoc klootch
55 % The following references the \file{00readme.txt} file,
56 % which contains basic information about this package.
57 % The contents of this file are generated when
58 % you typeset the programmer's documentation.
59 % Search on "{filecontents*}{00readme.txt}" to locate it.
60 % \fi\input{00readme.txt}%
61 %
62 % \subsection{Bill of Materials}
63 %
64 % Following is a list of the files in this distribution arranged
65 % according to provenance.
66 %
67 % \subsubsection{Primary Source}%
68 % One single file generates all.
69 %\begin{verbatim}
70 %ltxdocext.dtx
71 %\end{verbatim}
72 %
73 % \subsubsection{Generated by \texttt{latex ltxdocext.dtx}}%
74 % Typesetting the source file under \LaTeX\
75 % generates the readme and the installer.
76 %\begin{verbatim}
77 %00readme.txt ltxdocext.ins
78 %\end{verbatim}
79 %
80 % \subsubsection{Generated by \texttt{tex ltxdocext.ins}}%
81 % Typesetting the installer generates
82 % the package files.
83 %\begin{verbatim}
84 %ltxdocext.sty acrofont.sty
85 %\end{verbatim}
86 %
87 % \subsubsection{Documentation}%
88 % The following are the online documentation:
89 % \begin{verbatim}
90 %ltxdocext.pdf
91 % \end{verbatim}
92 %
93 % \subsubsection{Auxiliary}%
94 % The following are auxiliary files generated
95 % in the course of running \LaTeX:
96 % \begin{verbatim}
97 %ltxdocext.aux ltxdocext.idx ltxdocext.ind ltxdocext.log ltxdocext.toc
98 % \end{verbatim}
99 %
100 % \section{Code common to all modules}%
101 %
102 % The following may look a bit klootchy, but we
103 % want to require only one place in this file
104 % where the version number is stated,
105 % and we also want to ensure that the version
106 % number is embedded into every generated file.
107 %
108 % Now we declare that
109 % these files can only be used with \LaTeXe.
110 % An appropriate message is displayed if
111 % a different \TeX{} format is used.
112 % \begin{macrocode}
113 %<*doc|extensions|fonts>
114 \NeedsTeXFormat{LaTeX2e}[1995/12/01]%
115 %</doc|extensions|fonts>
116 % \end{macrocode}
117 % As desired, the following modules all
118 % take common version information:
119 % \begin{macrocode}
120 %<extensions>\ProvidesFile{ltxdocext.sty}%
121 %<fonts>\ProvidesFile{acrofont.sty}%
122 %<*doc>
123 \expandafter\ProvidesFile\expandafter{\jobname.dtx}%
124 %</doc>
125 % \end{macrocode}
126 %
127 % The following line contains, for once and for all,
128 % the version and date information.
129 % By various means, this information is reproduced
130 % consistently in all generated files and in the
131 % typeset documentation.
132 % \begin{macrocode}
133 [2020/09/30 0.1 ltxdoc extensions package]% \fileversion
134 % \end{macrocode}
135 %
136 %
137 % \section{The driver module \texttt{doc}}
138 %
139 % This module, consisting of the present section,
140 % typesets the programmer's documentation,
141 % generating the \file{.ins} installer and \file{00readme.txt} as required.
142 %
143 % Because the only uncommented-out lines of code at the beginning of
144 % this file constitute the \file{doc} module itself,
145 % we can simply typeset the \file{.dtx} file directly,
146 % and there is thus rarely any need to
147 % generate the ``doc'' {\sc docstrip} module.
148 % Module delimiters are nonetheless required so that
149 % this code does not find its way into the other modules.
150 %
151 % The \enve{document} command concludes the typesetting run.
152 %
153 % \begin{macrocode}
154 %<*doc>
155 % \end{macrocode}
156 %
157 % \subsection{Stubs for \file{ltxdocext.sty} and \file{acrofont.sty}}
158 %
159 % This \env{filecontents} environment generates stub files
160 % \file{ltxdocext.sty} and \file{acrofont.sty}.
161 % Stubs are needed because the documentation for this package
162 % requires them and they might not yet be present.
163 %
164 % A real version of these files will be generated
165 % when you typeset \file{ltxdocext.ins}, at which point
166 % the stub file will be overwritten (you will have to give {\sc docstrip}
167 % permission to do this).
168 % \begin{macrocode}
169 \begin{filecontents}{ltxdocext.sty}
170 % Stub version of ltxdocext.sty
171 \end{filecontents}
172 \begin{filecontents}[overwrite]{acrofont.sty}
173 % Stub version of acrofont.sty
174 \end{filecontents}
175 % \end{macrocode}
176 %
177 % \subsection{The Preamble}
178 % The programmers documentation is formatted
179 % with the \classname{ltxdoc} class with local customizations,
180 % and with the usual code line indexing.
181 % \begin{macrocode}
182 \documentclass[draft]{ltxdoc}
183 \RequirePackage{ltxdocext}%
184 \RequirePackage{acrofont}%
185 \CodelineIndex\EnableCrossrefs
186 % \end{macrocode}
187 %
188 % \subsubsection{Docstrip and info directives}
189 % We use so many {\sc docstrip} modules that we set the
190 % \texttt{StandardModuleDepth} counter to 1.
191 % \begin{macrocode}
192 \setcounter{StandardModuleDepth}{1}
193 % \end{macrocode}
194 % The following command retrieves the date and version information
195 % from this file.
196 % \begin{macrocode}
197 \expandafter\GetFileInfo\expandafter{\jobname.dtx}%
198 % \end{macrocode}
199 %
200 %
201 % \subsection{The installer file}
202 %
203 % The installer \file{ltxdocext.ins} appears here.
204 % If you have retrieved the standard distribution of this package,
205 % the installer file is already on your filesystem.
206 % If you are bootstrapping,
207 % the first typesetting of the \file{.dtx} file
208 % will cause the installer to be generated.
209 %
210 % The following modules are used to direct
211 % {\sc docstrip} in generating the external files:
212 % \begin{center}
213 % \begin{tabular}{lll}
214 % \textbf{Module}&\textbf{File}&\textbf{Description}\\
215 % doc &\file{ltxdocext.drv}&driver for programmer's documantation\\
216 % extensions&\file{ltxdocext.sty}&ltxdoc extensions package\\
217 % fonts &\file{acrofont.sty} &package to use only Acrobat fonts
218 % \end{tabular}
219 % \end{center}
220 %
221 % \begin{macrocode}
222 \begin{filecontents}{ltxdocext.ins}
223 %% This file will generate documentation and runtime files
224 %% from ltxdocext.dtx when run through LaTeX or TeX.
225 \input docstrip
226 \preamble
227
228 This is a generated file;
229 altering it directly is inadvisable;
230 instead, modify the original source file.
231 See the URL in the file 00readme.txt.
232
233 Copyright notice.
234
235 These files are distributed
236 WITHOUT ANY WARRANTY; without even the implied warranty of
237 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
238
239 \endpreamble
240 \keepsilent
241 \generate{%
242 \file{ltxdocext.drv}{\from{ltxdocext.dtx}{doc}}%
243 \file{ltxdocext.sty}{\from{ltxdocext.dtx}{extensions}}%
244 \file{acrofont.sty}{\from{ltxdocext.dtx}{fonts}}%
245 }%
246 \ifToplevel{
247 \Msg{***********************************************************}
248 \Msg{*}
249 \Msg{* To finish the installation, please move}
250 \Msg{* ltxdocext.sty}
251 \Msg{* into a directory searched by TeX.}
252 \Msg{*}
253 \Msg{* To produce the user documentation,
254 run ltxdocext.tex through LaTeX.}
255 \Msg{*}
256 \Msg{* To produce the programmer documentation,
257 run ltxdocext.dtx through LaTeX.}
258 \Msg{*}
259 \Msg{* Happy TeXing}
260 \Msg{***********************************************************}
261 }
262 \endbatchfile
263 \end{filecontents}
264 % \end{macrocode}
265 % Note that, because all of the files generated by the installer
266 % are part of the standard distribution, it will
267 % be necessary to run the installer only when bootstrapping
268 % (or, of course, during development).
269 % Note, too, that it is rare to generate the \file{doc}
270 % module because it suffices to simply typeset the \file{.dtx} file itself.
271 %
272 % \subsection{The ``Read Me'' File}
273 % As promised above, here is the contents of the
274 % ``Read Me'' file. That file serves a double purpose,
275 % since it also constitutes the beginining of the
276 % programmer's documentation. What better thing, after
277 % all, to have appear at the beginning of the
278 % typeset documentation?
279 %
280 % A good discussion of how to write a ReadMe file can be found in
281 % Engst, Tonya, ``Writing a ReadMe File? Read This''
282 % \emph{MacTech} October 1998, p. 58.
283 %
284 % Note the appearance of the
285 % \cmd\StopEventually\ command, which marks the
286 % dividing line between the user documentation
287 % and the programmer documentation.
288 %
289 % The usual user will not be asked to
290 % do a full build, not to speak
291 % of the bootstrap.
292 % Instructions for carrying these processes
293 % begin the programmer's manual.
294 %
295 % \begin{macrocode}
296 \begin{filecontents*}{00readme.txt}
297 \title{%
298 Extensions to the \classname{ltxdoc} class%
299 \thanks{%
300 This file has version number \fileversion,
301 last revised \filedate.%
302 % For version number and date, search on "\fileversion" in the .dtx file,
303 % or see the end of the 00readme.txt file.
304 }%
305 }%
306
307 \author{%
308 Arthur Ogawa (\texttt{mailto:[email protected]}),
309 \fileversion\\Copyright (C) 1999 Arthur Ogawa
310 }%
311 \maketitle
312
313 This file embodies the \classname{ltxdocext} package,
314 the implementation and its user documentation.
315
316 The distribution point for this work is
317 \url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxdocext...},
318 which contains fully unpacked, prebuilt runtime files and documentation.
319
320 To use this document class, you must have a working
321 \TeX\ installation equipped with \LaTeXe\
322 and possibly pdftex and Adobe Acrobat Reader or equivalent.
323
324 To install, retrieve the distribution,
325 unpack it into a directory on the target computer,
326 and move the files \file{ltxdocext.sty} and \file{acrofont.sty}
327 into a location in your filesystem where they will be found by \LaTeX.
328
329 If you will be using the \classname{acrofont} package, you must
330 also install the virtual fonts
331 \file{zpsynocmrv}, \file{zptmnocmr},
332 \file{zptmnocmrm}, and \file{zpzcnocmry}.
333 The corresponding \file{.tfm}, \file{.vf}, and \file{.vpl}
334 files are part of this distribution.
335
336 To use, read the user documentation \file{ltxdocext.pdf}.
337 The \file{.dtx} file, \file{ltxdocext.dtx}, constitutes
338 in itself an instance of use of the \classname{ltxdocext}
339 package and the \classname{acrofont} package.
340
341 \tableofcontents
342
343 \section{Processing Instructions}
344
345 The package files \file{ltxdocext.sty} and \file{acrofont.sty}
346 are generated from this file, \file{ltxdocext.dtx},
347 via the {\sc docstrip} facility of \LaTeX
348 via |tex ltxdocext.ins|.
349 The typeset documentation that you are now reading is generated from
350 the same file by typesetting it with \LaTeX\ or pdftex
351 via |latex ltxdocext.dtx| or |pdflatex ltxdocext.dtx|.
352
353 \subsection{Build Instructions}
354
355 You may bootstrap this suite of files solely from \file{ltxdocext.dtx}.
356 Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
357 then carry out the following steps:
358 \begin{enumerate}
359 \item
360 Within an otherwise empty directory,
361 typeset \file{ltxdocext.dtx} with \LaTeX\ or pdflatex;
362 you will obtain the typeset documentation you are now reading,
363 along with
364 the installer \file{ltxdocext.ins},
365 and the file \file{00readme.txt}.
366 \item
367 Now typeset \file{ltxdocext.ins},
368 thereby generating the package file \file{ltxdocext.sty},
369 and the package file \file{acrofont.sty}.
370 Make sure that {\sc docstrip} receives permission
371 to overwrite existing versions of these packages.
372 \item
373 Install \classname{ltxdocext.sty} and \classname{acrofont.sty}
374 by moving them to a location
375 in your filesystem where they will be found by \LaTeX.
376 \item
377 Now complete the typesetting of the documentation by
378 retypesetting \file{ltxdocext.dtx}.
379 Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
380 \LaTeX\ again in order to obtain a valid index and table of contents.
381 \end{enumerate}
382 \end{filecontents*}
383 % \end{macrocode}
384 %
385 % \subsection{The Document Body}
386 %
387 % Here is the document body, containing only a
388 % \cmd\DocInput\ directive---referring to this very file.
389 % This very cute self-reference is a common \classname{ltxdoc} idiom.
390 % \begin{macrocode}
391 \begin{document}%
392 \expandafter\DocInput\expandafter{\jobname.dtx}%
393 % ^^A\PrintChanges
394 \end{document}
395 % \end{macrocode}
396 %
397 % \begin{macrocode}
398 %</doc>
399 % \end{macrocode}
400 %
401 % \section{Using the \classname{ltxdoc} and \classname{acrofont} packages}%
402 % These packages are an adjunct to the
403 % standard \LaTeX\ \classname{ltxdoc} class and may be
404 % simply invoked as follows:
405 %\begin{verbatim}
406 %\documentclass[draft]{ltxdoc}
407 %\RequirePackage{ltxdocext}%
408 %\RequirePackage{acrofont}%
409 %\CodelineIndex\EnableCrossrefs
410 %\end{verbatim}
411 %
412 % Your document should simply cleave to the standards of the
413 % \classname{ltxdoc} class, with extensions and alterations as noted.
414 %
415 % \subsection{Extensions to the \classname{ltxdoc} class}%
416 %
417 % \subsubsection{Extensions to the \env{verbatim} environment and \cs{verb} command}%
418 %
419 % The delimiters \verb$<<$ and \verb$>>$ within the scope of the verbatim environment
420 % or within the argument of the \cmd\verb\ command produce
421 % italics surrounded by angle brackets.
422 % This typographic convention usually indicates
423 % \emph{metalanguage}, i.e., a placeholder.
424 %
425 % To obtain the angle bracket character per se,
426 % double the character, viz., ``\verb$the delimiter \verb+<<<<+$''.
427 %
428 % \subsubsection{The -\texttt{matter} Commands Work}
429 % The sectioning commands \cmd\frontmatter, \cmd\mainmatter, and \cmd\backmatter
430 % of the standard \LaTeX\ \classname{book} class are operative in the
431 % \classname{ltxdoc} class.
432 %
433 % \subsubsection{The \cs{GetFileInfo} command}\label{sec:GetFileInfo}
434 % You can use the \cmd\GetFileInfo\ command to extract
435 % the date, version, and file info of a file which has registered itself
436 % via the \cmd\ProvidesFile\ or \cmd\ProvidesClass\ command
437 % (employing the optional argument thereto).
438 %
439 % For instance, if your document contains the following:
440 %\begin{verbatim}
441 %\RequirePackage{ltxdocext}%
442 %\GetFileInfo{ltxdocext.sty}%
443 %\end{verbatim}
444 % then the following control sequence names will have
445 % a value corresponding to that package's \cmd\ProvidesFile\
446 % command:
447 % \cmd\filedate: the file's date,
448 % \cmd\fileversion: the file's version, and
449 % \cmd\fileinfo: the file's info.
450 %
451 % \subsubsection{Self-Indexing Commands}%
452 % Certain commands automatically produce an index entry
453 % (or several related entries) according to the meaning.
454 %
455 % \begin{unnumtable}
456 % \begin{tabular}{ll}
457 % meta-text &\cmd\m\arg{text}\\
458 % command &\cmd\cmd\cmd\csname\\
459 % environment name &\cmd\env\arg{name}\\
460 % \cmd\begin\verb`{foo}`&\cmd\envb\arg{foo}\\
461 % \cmd\end\verb`{foo}` &\cmd\enve\arg{foo}\\
462 % argument &\cmd\arg\arg{name}\\
463 % optional &\cmd\oarg\arg{name}\\
464 % filename &\cmd\file\arg{name}\\
465 % url &\cmd\url\arg{name}\\
466 % document class &\cmd\classname\arg{name}\\
467 % document substyle &\cmd\substyle\arg{name}\\
468 % class option &\cmd\classoption\arg{name}
469 % \end{tabular}
470 % \end{unnumtable}
471 %
472 % \subsubsection{Unnumbered Tables}%
473 %
474 % When your documentation requires the use of an unnumbered table,
475 % use the \env{unnumtable} environment:
476 % \begin{verbatim}
477 %\begin{unnumtable}
478 %\begin{tabular}{ll}
479 %<table rows>
480 %\end{tabular}
481 %\end{unnumtable}
482 % \end{verbatim}
483 %
484 % \subsubsection{Structuring Tables}%
485 % The commands \cmd\toprule, \cmd\colrule, and \cmd\botrule
486 % allow you to mark the beginning of the column heads
487 % the beginning of the table body, and the end of
488 % the table body, respectively.
489 % In context,
490 % \begin{verbatim}
491 %\begin{tabular}{ll}
492 %\toprule
493 %<table head rows>
494 %\colrule
495 %<table rows>
496 %\botrule
497 %\end{tabular}
498 % \end{verbatim}
499 %
500 % \subsubsection{A Sectioning Command Below \cs{subsection}}%
501 % The \cmd\subsubsection\ command is defined.
502 %
503 %
504 % \subsection{Alterations to the \classname{ltxdoc} class}%
505 % The following involve no new markup, but they
506 % do change the appearance of your formatted documentation:
507 % \begin{enumerate}
508 % \item
509 % Using the \classname{acrofont} package causes your
510 % document to be formatted using the standard
511 % Acrobat fonts to the greatest extent possible.
512 % This means that for most documents, Computer Modern
513 % is not used at all.
514 % Math that unavoidable must use CM still exists, however.
515 % \item
516 % An index will be produced at the end of the document
517 % without your needing to explicitly mark it up, and
518 % it will have an entry in the TOC.
519 % \item
520 % The \env{quote} environment has a slightly smaller left margin.
521 % \item
522 % Array columns are set tight by default.
523 % \item
524 % A host of \cmd\DoNotIndex\ directives are invoked.
525 % I intend this list to grow to encompass
526 % even more commands. Send me your suggestions.
527 % \end{enumerate}
528 %
529 %
530 %
531 %\StopEventually{}
532 %
533 % \section{Extensions to the ltxdoc class}
534 % The \file{extensions} {\sc docstrip} module comprises the
535 % package \classname{ltxdocext.sty}, which provides extensions
536 % to the standard \LaTeX\ \classname{ltxdoc} class.
537 %
538 % \subsection{Beginning of the \file{extensions} {\sc docstrip} module}
539 % \begin{macrocode}
540 %<*extensions>
541 \def\class@name{ltxdocext}%
542 \expandafter\PackageInfo\expandafter{\class@name}{%
543 An extension to the \protect\LaTeXe\space ltxdoc class
544 by A. Ogawa ([email protected])%
545 }%
546 % \end{macrocode}
547 %
548 % \subsection{Incorporate \classname{ltxguide.cls} extensions}
549 %
550 % Code extracted from \classname{ltxguide.cls}, by Alan Jeffrey.
551 % ``This code stolen from \classname{ltxguide.cls}:
552 % Some hacks with verbatim... NB: this would be better done with the
553 % verbatim package, but this document has to run on any \LaTeX
554 % installation.''
555 % \begin{macrocode}
556 \RequirePackage{verbatim}%
557 \let\o@verbatim\verbatim
558 \def\verbatim{%
559 \ifhmode\unskip\par\fi
560 % \nopagebreak % Overridden by list penalty
561 \ifx\@currsize\normalsize
562 \small
563 \fi
564 \o@verbatim
565 }%
566 % \end{macrocode}
567 %
568 % Here we extend the font-setting command to include making \texttt{<>} active
569 % (i.e., adjusting the input encoding).
570 % \begin{macrocode}
571 \renewcommand \verbatim@font {%
572 \normalfont \ttfamily
573 \catcode`\<=\active
574 \catcode`\>=\active
575 }%
576 % \end{macrocode}
577 %
578 % Make \verb$|...|$ a synonym for \cmd\verb\verb$|...|$.
579 % \begin{macrocode}
580 \RequirePackage{shortvrb}
581 \AtBeginDocument{%
582 \MakeShortVerb{\|}%
583 }%
584 % \end{macrocode}
585 %
586 % Make active bracket characters produce italics surrounded by angle brackets
587 % (used in \env{verbatim} and \cmd\verb).
588 % \verb|<<| produces a less-than, and \verb|>>| produces a greater-than.
589 % \begin{macrocode}
590 \begingroup
591 \catcode`\<=\active
592 \catcode`\>=\active
593 \gdef<{\@ifnextchar<\@lt\@meta}
594 \gdef>{\@ifnextchar>\@gt\@gtr@err}
595 \gdef\@meta#1>{\m{#1}}
596 \gdef\@lt<{\char`\<}
597 \gdef\@gt>{\char`\>}
598 \endgroup
599 \def\@gtr@err{%
600 \ClassError{ltxguide}{%
601 Isolated \protect>%
602 }{%
603 In this document class, \protect<...\protect>
604 is used to indicate a parameter.\MessageBreak
605 I've just found a \protect> on its own.
606 Perhaps you meant to type \protect>\protect>?
607 }%
608 }
609 \def\verbatim@nolig@list{\do\`\do\,\do\'\do\-}
610 % \end{macrocode}
611 % End of code stolen from \file{ltxguide.cls}. Thanks, Alan.
612 %
613 % Add functionality from doc.dtx:
614 % (code stolen from doc.dtx):
615 % \begin{macrocode}
616 \def\GetFileInfo#1{%
617 \def\filename{#1}%
618 \def\@tempb##1 ##2 ##3\relax##4\relax{%
619 \def\filedate{##1}%
620 \def\fileversion{##2}%
621 \def\fileinfo{##3}}%
622 \edef\@tempa{\csname ver@#1\endcsname}%
623 \expandafter\@tempb\@tempa\relax? ? \relax\relax}
624 % \end{macrocode}
625 % (end of code stolen from doc.dtx. Thanks FMi.)
626 %
627 % Various forms of self-indexing commands:
628 % \begin{macrocode}
629 \DeclareRobustCommand{\m}[1]{%
630 \meta{#1}%
631 \index{#1=\string\meta{#1} placeholder}\index{placeholder>#1=\string\meta{#1}}%
632 }%
633 \DeclareRobustCommand\meta[1]{%
634 \mbox{\LANGLE\itshape#1\/\RANGLE}%
635 }%
636 \def\LANGLE{$\langle$}%
637 \def\RANGLE{$\rangle$}%
638 \DeclareRobustCommand{\arg}[1]{%
639 {\ttfamily\string{}\meta{#1}{\ttfamily\string}}%
640 \index{#1=\string\ttt{#1}, argument}\index{argument>#1=\string\ttt{#1}}%
641 }%
642 \let\oarg\undefined
643 \DeclareRobustCommand{\oarg}[1]{%
644 {\ttfamily[%]
645 }\meta{#1}{\ttfamily%[
646 ]}%
647 \index{#1=\string\ttt{#1}, optional argument}%
648 \index{argument, optional>#1=\string\ttt{#1}}%
649 }%
650 \DeclareRobustCommand\cmd{\begingroup\makeatletter\@cmd}%
651 \def\@cmd#1{%
652 \endgroup
653 \cs{\expandafter\cmd@to@cs\string#1}%
654 \expandafter\cmd@to@index\string#1\@nil
655 }%
656 \def\cmd@to@cs#1#2{\char\number`#2\relax}%
657 \def\cmd@to@index#1#2\@nil{%
658 \index{#2=\string\cmd#1#2}%\index{command>#2=\string\cmd#1#2}%
659 }%
660 \DeclareRobustCommand\cs[1]{{\ttfamily\char`\\#1}}%
661 \def\scmd#1{%
662 \cs{\expandafter\cmd@to@cs\string#1}%
663 \expandafter\scmd@to@index\string#1\@nil
664 }%
665 \def\scmd@to@index#1#2\@nil#3{%
666 \index{\string$#3=\string\cmd#1#2---#3}%
667 %\index{command>\string$#3=\string\cmd#1#2---#3}%
668 }%
669 \DeclareRobustCommand\env{\name@idx{environment}}%
670 \DeclareRobustCommand\envb[1]{%
671 {\ttfamily\string\begin\string{}\env{#1}{\ttfamily\string}}%
672 }%
673 \DeclareRobustCommand\enve[1]{{\ttfamily\string\end\string{}\env{#1}{\ttfamily\string}}}%
674 \DeclareRobustCommand*{\file}[1]{%
675 {\ttfamily#1}%
676 \index{#1=\string\ttt{#1}}\index{file>#1=\string\ttt{#1}}%
677 }%
678 \DeclareRobustCommand\substyle{\name@idx{document substyle}}%
679 \DeclareRobustCommand\classoption{\name@idx{document class option}}%
680 \DeclareRobustCommand\classname{\name@idx{document class}}%
681 \def\name@idx#1#2{%
682 {\ttfamily#2}%
683 \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}%
684 }%
685 \DeclareRobustCommand\url@ltxdocext{\begingroup\catcode`\/\active\catcode`\.\active\catcode`\:\active\@url}%
686 \AtBeginDocument{%
687 \ifx\url\undefined\let\url\url@ltxdocext\fi
688 }%
689 \def\@url#1{%
690 \url@break{\ttfamily#1}%
691 \url@char\edef\@tempa{#1=\string\url{#1}}%
692 \expandafter\index\expandafter{\@tempa}%
693 \expandafter\index\expandafter{\expandafter u\expandafter r\expandafter l\expandafter >\@tempa}%
694 \endgroup
695 }%
696 {\catcode`\:\active\aftergroup\def\aftergroup:}{\active@colon}%
697 \def\colon@break{\colon@char\allowbreak}%
698 \def\colon@char{:}%
699 {\catcode`\/\active\aftergroup\def\aftergroup/}{\active@slash}%
700 \def\slash@break{\slash@char\allowbreak}%
701 \def\slash@char{/}%
702 {\catcode`\.\active\aftergroup\def\aftergroup.}{\active@dot}%
703 \def\dot@break{\dot@char\allowbreak}%
704 \def\dot@char{.}%
705 \def\url@break{\let\active@slash\slash@break\let\active@dot\dot@break\let\active@colon\colon@break}%
706 \def\url@char{\let\active@slash\slash@char\let\active@dot\dot@char\let\active@colon\colon@char}%
707 % \end{macrocode}
708 %
709 % \subsection{Changes to the base class of the ltxdoc class}
710 % Modify \env{theindex} environment so that it produces a TOC entry
711 % \begin{macrocode}
712 \renewenvironment{theindex}
713 {\if@twocolumn
714 \@restonecolfalse
715 \else
716 \@restonecoltrue
717 \fi
718 \columnseprule \z@
719 \columnsep 35\p@
720 \def\see##1##2{\textit{See} ##1}%
721 \def\seealso##1##2{\textit{See also} ##1}%
722 \def\cmd##1{\cs{\expandafter\cmd@to@cs\string##1}}%
723 \def\@url##1{\url@break\ttt{##1}\endgroup}%
724 \def\ttt##1{{\ttfamily##1}}%
725 \mathchardef\save@secnumdepth\c@secnumdepth
726 \c@secnumdepth\m@ne
727 \twocolumn[\section{\indexname}]%
728 % \@mkboth{\MakeUppercase\indexname}%
729 % {\MakeUppercase\indexname}%
730 \c@secnumdepth\save@secnumdepth
731 \thispagestyle{plain}\parindent\z@
732 \parskip\z@ \@plus .3\p@\relax
733 \let\item\@idxitem}
734 {\if@restonecol\onecolumn\else\clearpage\fi}
735 \renewenvironment{quote}
736 {\list{}{%
737 \leftmargin1em\relax
738 \rightmargin\leftmargin
739 }%
740 \item\relax}
741 {\endlist}
742 % \end{macrocode}
743 %
744 % \subsection{Extensions to the base class of \classname{ltxdoc.cls}}
745 %
746 % Matter commands from \classname{book.cls}
747 % \begin{macrocode}
748 \newif\if@mainmatter
749 \newif\if@openright
750 \@openrighttrue
751 \DeclareRobustCommand\frontmatter{%
752 \cleartorecto
753 \@mainmatterfalse
754 \pagenumbering{roman}%
755 }%
756 \DeclareRobustCommand\mainmatter{%
757 \cleartorecto
758 \@mainmattertrue
759 \pagenumbering{arabic}%
760 }%
761 \DeclareRobustCommand\backmatter{%
762 \if@openright
763 \cleartorecto
764 \else
765 \clearpage
766 \fi
767 \@mainmatterfalse
768 }%
769 \ifx\undefined\cleartorecto
770 \def\cleartorecto{\cleardoublepage}%
771 \fi
772 % \end{macrocode}
773 %
774 % Unnumbered tables
775 %
776 % \begin{environment}{unnumtable}
777 % An unnumbered table does not float.
778 % \begin{macrocode}
779 \def\@to{to}%
780 \newenvironment{unnumtable}{%
781 \par
782 \addpenalty\predisplaypenalty
783 \addvspace\abovedisplayskip
784 \hbox\@to\hsize\bgroup\hfil\ignorespaces
785 \let\@Hline\@empty
786 }{%
787 \unskip\hfil\egroup
788 \penalty\postdisplaypenalty
789 \vskip\belowdisplayskip
790 \aftergroup\ignorespaces
791 \@endpetrue
792 }%
793 % \end{macrocode}
794 % \end{environment}
795 %
796 % Emulate \cmd\toprule\ and friends
797 % \begin{macrocode}
798 \newcommand\toprule{\hline\hline}%
799 \newcommand\colrule{\\\hline}%
800 \newcommand\botrule{\\\hline\hline}%
801 % \end{macrocode}
802 %
803 % Define sectioning command below \cmd\subsubsection.
804 % \begin{macrocode}
805 \DeclareRobustCommand\subsubsubsection{%
806 \@startsection{subsubsection}{4}%
807 {\z@}{-15\p@\@plus-5\p@\@minus-2\p@}%
808 {5\p@}{\normalfont\normalsize\itshape}%
809 }%
810 % \end{macrocode}
811 %
812 % \subsection{In lieu of \file{ltxdoc.cfg}}
813 % We don't want everything to appear in the index
814 % \begin{macrocode}
815 \DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
816 \DoNotIndex{\@badmath,\@centercr,\@cite}
817 \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
818 \DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
819 \DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint}
820 \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
821 \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
822 \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
823 \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
824 \DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
825 \DoNotIndex{\bullet}
826 \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
827 \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
828 \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
829 \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
830 \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
831 \DoNotIndex{\fbox}
832 \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
833 \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
834 \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
835 \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
836 \DoNotIndex{\input}
837 \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
838 \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
839 \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
840 \DoNotIndex{\NeedsTeXFormat,\newdimen}
841 \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
842 \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
843 \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
844 \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
845 \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
846 \DoNotIndex{\refstepcounter,\relax,\renewcommand}
847 \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
848 \DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength}
849 \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
850 \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
851 \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
852 \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
853 \DoNotIndex{\wd,\xiipt,\year,\z@}
854 \DoNotIndex{\next}
855 % \end{macrocode}
856 %
857 % Direct \classname{ltxdoc} to produce an index.
858 % \begin{macrocode}
859 \AtEndDocument{\PrintIndex}%
860 % \end{macrocode}
861 %
862 % \subsection{Extension to \LaTeX's \env{filecontents} Environment}
863 % We want to
864 % coax the version number into \env{filecontents}-generated files.
865 % Note that we expect \cmd\fileversion\ and \cmd\filedate\ to
866 % hold the needed information. For this to be the case,
867 % your document should execute the \cmd\GetFileInfo\ command
868 % (as documented in section~\ref{sec:GetFileInfo}) before
869 % any instances of \env{filecontents}.
870 % \begin{macrocode}
871 \makeatletter
872 \def\endfilecontents{%
873 \immediate\write\reserved@c{%
874 \string\iffalse\space ltxdoc klootch^^J%
875 \ifx\undefined\fileversion\else
876 \ifx\undefined\filedate\else
877 This file has version number \fileversion, last revised \filedate.%
878 \fi\fi
879 \string\fi
880 }%
881 \immediate\closeout\reserved@c
882 \def\T##1##2##3{%
883 \ifx##1\@undefined\else
884 \@latex@warning@no@line{##2 has been converted to Blank ##3e}%
885 \fi
886 }%
887 \T\L{Form Feed}{Lin}%
888 \T\I{Tab}{Spac}%
889 \immediate\write\@unused{}%
890 }%
891 \expandafter\let\csname endfilecontents*\endcsname\endfilecontents
892 \makeatother
893 % \end{macrocode}
894 %
895 % Alter formatting in arrays; set them tight.
896 % \begin{macrocode}
897 \setlength\arraycolsep{0pt}%
898 % \end{macrocode}
899 %
900 % \subsection{End of the \file{extensions} {\sc docstrip} module}
901 % Here ends the module.
902 % \begin{macrocode}
903 %</extensions>
904 % \end{macrocode}
905 %
906 %
907 % \section{Font Package for Acrobat Compatability}%
908 % The package \classname{acrofont}
909 % substitutes Acrobat-standard fonts for Computer Modern where possible,
910 % even in math mode.
911 % Documents typeset with this package in effect will require as little
912 % downloaded font data as possible, but will not be exemplars of
913 % fine math typesetting.
914 %
915 % \subsection{Beginning of the \file{fonts} {\sc docstrip} module}
916 % The document class module comprises this and the next
917 % four sections.
918 % \begin{macro}{\class@base}
919 % We define in exactly one spot the base class.
920 % Typically that class will be one of \classname{book},
921 % \classname{article}, or \classname{report}.
922 % The base class effectively defines the use and the markup scheme
923 % of the class of documents to be handled by this class.
924 %
925 % This class is a variant of the standard \LaTeX\ book class:
926 % \url{ftp://ctan.tug.org/tex-archive/macros/latex/unpacked}.
927 % \begin{macrocode}
928 %<*fonts>
929 \def\class@name{ltxdocext}%
930 \expandafter\ClassInfo\expandafter{\class@name}{%
931 Written for \protect\LaTeXe\space
932 by A. Ogawa ([email protected])%
933 }%
934 % \end{macrocode}
935 % \end{macro}
936 %
937 % \subsection{Variants on psfonts packages}%
938 % The following uses \file{times.sty} from \url{/packages/psnfss/psfonts.dtx}
939 % \begin{macrocode}
940 \RequirePackage{times}%
941 % \end{macrocode}
942 %
943 % The following uses \file{mathptm.sty} from \url{/packages/psnfss/psfonts.dtx}
944 % \begin{macrocode}
945 \RequirePackage{mathptm}%
946 % \end{macrocode}
947 %
948 % The following is a customization of \file{ot1ptmcm.fd}.
949 % The virtual font referred to here \file{zptmnocmr} is
950 % a variant of Sebastian Rahtz's \file{zptmcmr}, but with
951 % even more glyphs moved from CM to Acrobat-standard fonts.
952 % \begin{macrocode}
953 \DeclareFontFamily{OT1}{ptmcm}{}
954 \DeclareFontShape{OT1}{ptmcm}{m}{n}{
955 <-> zptmnocmr
956 }{}
957 \DeclareFontShape{OT1}{ptmcm}{l}{n}{<->ssub * ptmnocm/m/n}{}
958 % \end{macrocode}
959 %
960 % The following is a customization of \file{omlptmcm.fd}
961 % The virtual font referred to here \file{zptmnocmrm} is
962 % a variant of Sebastian Rahtz's \file{zptmcmrm}, but with
963 % even more glyphs moved from CM to Acrobat-standard fonts.
964 % \begin{macrocode}
965 \DeclareFontFamily{OML}{ptmcm}{\skewchar \font =127}
966 \DeclareFontShape{OML}{ptmcm}{m}{it}{
967 <-> zptmnocmrm
968 }{}
969 \DeclareFontShape{OML}{ptmcm}{l}{it}{<->ssub * ptmcm/m/it}{}
970 \DeclareFontShape{OML}{ptmcm}{m}{sl}{<->ssub * ptmcm/m/it}{}
971 \DeclareFontShape{OML}{ptmcm}{l}{sl}{<->ssub * ptmcm/m/sl}{}
972 % \end{macrocode}
973 %
974 % The following is a customization of \file{omspzccm.fd}
975 % The virtual font referred to here \file{zpzcnocmry} is
976 % a variant of Sebastian Rahtz's \file{zpzccmry}, but with
977 % even more glyphs moved from CM to Acrobat-standard fonts.
978 % \begin{macrocode}
979 \DeclareFontFamily{OMS}{pzccm}{}
980 \DeclareFontShape{OMS}{pzccm}{m}{n}{
981 <-> zpzcnocmry
982 }{}% cmsy10 Symbol Zapf Chancery Medium-Italic Times-Roman
983 \DeclareFontShape{OMS}{pzccm}{l}{n}{<->ssub * pzccm/m/n}{}
984 % \end{macrocode}
985 %
986 % The following is a customization of \file{omxpsycm.fd}
987 % The virtual font referred to here \file{zpsynocmrv} is
988 % a variant of Sebastian Rahtz's \file{zpsycmrv}, but with
989 % even more glyphs moved from CM to Acrobat-standard fonts.
990 % \begin{macrocode}
991 \DeclareFontFamily{OMX}{psycm}{}
992 \DeclareFontShape{OMX}{psycm}{m}{n}{
993 <-> zpsynocmrv
994 }{}
995 \DeclareFontShape{OMX}{psycm}{l}{n}{<->ssub * psycm/m/n}{}
996 %
997 \DeclareFontEncoding{8r}{}{}% from file: 8renc.def
998 \DeclareFontFamily{8r}{cmr}{\hyphenchar\font45 }% from file: 8rcmr.fd
999 \DeclareFontShape{8r}{cmr}{m}{n}{
1000 <-> cmr10
1001 }{}
1002 % \end{macrocode}
1003 %
1004 % \subsection{Font definition files}%
1005 %
1006 % The following forces \LaTeX\ to do now what it would do anyway:
1007 % load the `font definition' information for the fonts that we
1008 % use. In this way, we prepare for faster processing through
1009 % the \cmd\dump\ of a preformatted macro package that will not
1010 % need to read in any packages or font definitions from disk.
1011 % \begin{macrocode}
1012 \input{8rphv.fd}%
1013 \input{8rptm.fd}%
1014 \input{ot1phv.fd}%
1015 \input{ot1ptm.fd}%
1016 \input{t1ptm.fd}%
1017 % \end{macrocode}
1018 %
1019 % \subsection{More math substitutions}%
1020 %
1021 % The following definitions arrange to get certain glyphs from the
1022 % text font instead of out of math pi fonts.
1023 % In particular, the copyright and registered symbols
1024 % are single glyphs instead of composites involving
1025 % the big circle from the \file{cmsy} font.
1026 % \begin{macrocode}
1027 \def\eightRChar#1{{\def\encodingdefault{8r}\fontencoding\encodingdefault\selectfont\char"#1}}%
1028 \def\LANGLE{$<$}%{\eightRChar{8B}}%
1029 \def\RANGLE{$>$}%{\eightRChar{9B}}%
1030 %\def\ASTER{\eightRChar{2A}}%
1031 %\def\DAGGER{\eightRChar{86}}%
1032 %\def\DDAGGER{\eightRChar{87}}%
1033 \def\BULLET{\eightRChar{95}}%
1034 %\def\SECTION{\eightRChar{A7}}%
1035 %\def\PARAGRAPH{\eightRChar{B6}}%
1036 \def\VERTBAR{\eightRChar{7C}}%
1037 \def\COPYRIGHT{\eightRChar{A9}}%
1038 \def\REGISTERED{\eightRChar{AE}}%
1039 % \end{macrocode}
1040 %
1041 % \begin{macrocode}
1042 \def\textbar{\VERTBAR}%
1043 \def\textbullet{\BULLET}%
1044 \def\textcopyright{\COPYRIGHT}%
1045 \def\textregistered{\REGISTERED}%
1046 % \end{macrocode}
1047 %
1048 % I have removed \cmd\ensuremath\ from the following definition, and
1049 % all commands like \cmd\mathsection have been converted to
1050 % e.g., \cmd\textsection.
1051 % \begin{macrocode}
1052 \def\@makefnmark{\@thefnmark}%
1053 \def\@fnsymbol#1{{\ifcase#1\or *\or \dagger\or \ddagger\or
1054 \textsection\or \textparagraph\or \|\or **\or \dagger\dagger
1055 \or \ddagger\ddagger \else\@ctrerr\fi}}
1056 % \end{macrocode}
1057 %
1058 % \subsection{End of the \file{fonts} {\sc docstrip} module}
1059 % Here ends the module.
1060 % \begin{macrocode}
1061 %</fonts>
1062 % \end{macrocode}
1063 %
1064 %
1065 % \section{Programming Conventions}%
1066 % In writing the above code, I cleave to certain conventions, noted
1067 % here.
1068 % My goal in explaining them is to encourage others maintaining this
1069 % body of code to consider following them as well.
1070 % The benefits are twofold:
1071 % Some of the coding conventions aim to avoid programming pitfalls;
1072 % following them reduces maintenance costs.
1073 % Others make the code easier to read; following these eases the
1074 % process of understanding how the code works.
1075 %
1076 % And, for my part, I prefer to read code of this type.
1077 %
1078 % \subsection{Whitespace Conventions}%
1079 % Exactly where code lines break and indent, and where additional
1080 % whitespace is inserted is explained here.
1081 % \begin{itemize}
1082 % \item
1083 % Each new macro definition or register assignment begins a new line.
1084 % Therefore, \cmd\def, \cmd\newcommand, and their ilk will start in column
1085 % 1.
1086 % \item
1087 % Code is indented one space for each level of nesting within braces
1088 % \verb|{}|.
1089 % \item
1090 % Likewise, if possible, for \cmd\if\dots and matching \cmd\fi.
1091 % \item
1092 % However, the closing brace or \cmd\fi\ is outdented by one so that it
1093 % falls
1094 % at the same level of indentation as its matching brace or \cmd\if,
1095 % and it appears alone on its line.
1096 % \item
1097 % Use of the |tab| character is deprecated
1098 % (tabs are not standardized across all applications and operating
1099 % systems).
1100 % \item
1101 % Lines of code are limited to 72 characters.
1102 % I follow this convention mostly to ease the transmission of files
1103 % via email (a deprecated practice) and to accomodate people with
1104 % small monitors.
1105 % But \classname{ltxdoc} output looks better with the shorter lines, too.
1106 % \item
1107 % Extraneous whitespace is avoided by using the comment character |%|.
1108 % In most cases, if falling at the end of a line of code,
1109 % a brace will be immediately followed by a comment character,
1110 % as will the macro parameter |#1| and any one-letter control sequence,
1111 % like |\\|.
1112 % \end{itemize}
1113 % These conventions taken together are illustrated by the following:
1114 % \begin{verbatim}
1115 %\def\prepdef#1#2{%
1116 % \@ifxundefined#1{\toks@{}}{\toks@\expandafter{#1}}%
1117 % \toks@ii{#2}%
1118 % \edef#1{\the\toks@ii\the\toks@}%
1119 %}%
1120 % \end{verbatim}
1121 % In the above, the definition of \cmd\prepdef\ would not fit on a single
1122 % line,
1123 % and required breaking. The first and last lines have matching braces,
1124 % and are a the same level of indentation, with the last line containing
1125 % a single brace.
1126 %
1127 % Each of the three intervening lines has balanced braces and is
1128 % indented by one space. Each line that would otherwise end in a single
1129 % brace character is terminated by a comment character.
1130 %
1131 % Some coders rely on the fact that a space character seen by \TeX's
1132 % scanner while in vertical mode is a no-op.
1133 % Be that as it may, I eliminate them unless actually intentional.
1134 %
1135 % \subsection{Conventions For Procedures}%
1136 % Here are some of my preferences when writing procedures:
1137 % \begin{itemize}
1138 %
1139 % \item
1140 % I dislike defining a macro within another macro, especially when the
1141 % pattern part is non-nil.
1142 % You know, you are not saving much space in |mem| when you do this,
1143 % right?
1144 % You do save space in the hash table and the string pool, though.
1145 % On the other hand, we are not dealing with small \TeX\ engines
1146 % anymore; Team \LaTeX\ has made sure of this.
1147 %
1148 % \item
1149 % If two or more macros have very similar replacement parts, consider
1150 % layering.
1151 %
1152 % \item
1153 % Macros may perform parsing, may maintain tokens or registers, or may
1154 % set type (produce marks). I try to avoid combining the three functions
1155 % in a single macro.
1156 %
1157 % \item
1158 % When a procedure both does assignments and sets type, I try to have a
1159 % clean separations between the two activities. Try to avoid:
1160 % \begin{verbatim}
1161 % \vskip10pt
1162 % \parindent=0pt
1163 % \leavevmode
1164 % \end{verbatim}
1165 %
1166 % \item
1167 % The Boolean calculus (cf. \cmd\@ifx)
1168 % is very useful and produces code that executes nicely.
1169 % Using it also helps avoid your having to debug problems where
1170 % \cmd\if\dots\ and \cmd\fi\ are not properly balanced
1171 % (a nightmare in case you didn't already experience it).
1172 %
1173 % \end{itemize}
1174 %
1175 % \subsection{Conventions For \LaTeX}%
1176 % Team \LaTeX\ make certain recommendations in \file{clsguide.tex}.
1177 % Ones that I particularly pay attention to are:
1178 % \begin{itemize}
1179 %
1180 % \item
1181 % For the sake of ``color safety'',
1182 % use \cmd\sbox\ rather than \cmd\setbox, \cmd\mbox\ rather than \cmd\hbox, and
1183 % \cmd\parbox\ or \env{minipage} rather than \cmd\vbox.
1184 %
1185 % \item
1186 % Use \cmd\newcommand\ and \cmd\newenvironment\ to declare user-level commands
1187 % and environments. Avoid the idiom \cmd\def\cmd\foo, \cmd\def\cmd\endfoo\ to define
1188 % an environment.
1189 % Ideally, all user-level markup could be extracted from the
1190 % document class by grepping on \cmd\newcommand\ and \cmd\newenvironment.
1191 %
1192 % \item
1193 % Prefer to use \cmd\setlength\ to assign registers.
1194 %
1195 % \end{itemize}
1196 % I cannot help but notice that much of the code of \LaTeX\ itself fails
1197 % to comply with many of the coding recommendations of Team \LaTeX.
1198 %
1199 %
1200 % \Finale
1201 % %Here ends the programmer's documentation.
1202 % \endinput
1203 %
1204 \endinput