source: Backup NB/Talks/MEMPHYSetal/LAGUNA/EU I3/PhysicsLatex/revtex4/revtex4/src/ltxdocext.dtx @ 416

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