The compsci LaTeX package

macros for writing about macros (Frankenstein’s conscience)

          Matt Swift <swift@alum.mit.edu>

Version: 1.1 Date: 1999/03/08

Documentation revision: 1999/03/08

Abstract

Compsci is useful whenever writing about programming, but especially when writing about TEX and especially when used as a supplement to the ltxdoc class to document L^{A}TEX macros in a literate programming style with dtx files.

Contents

I Discussion 2

1 Textual elements 2 2 Referring to commands 4 3 Miscellaneous 5

II Implementation 6

4 Version control 6 5 Requirements and context 6 6 Textual elements 7 7 Referring to commands 12 8 Miscellaneous 14

III Configuration 16

Part I

Discussion

1 Textual elements

\env \env {⟨environment name⟩} typesets the name of a L^{A}TEX environment. For ex-

ample, the enumerate environment.

To do: Add \bib how about?

\bst \bst{⟨bibstyle name⟩} typesets the name of a BibTEX bibliography style. For

example, the achicago bibstyle.

\package \package {⟨package name⟩} typesets the name of a L^{A}TEX package. For ex-

ample, the compsci package. \class \class {⟨class name⟩} typesets the name of a L^{A}TEX class. For example, the

letter class. \file \file {⟨file name⟩} typesets the name of a disk file. For example, the file

Makefile.in.

To do: Should I use url.sty’s \path command for this?

\ext \ext {⟨extension⟩} typesets the name of a disk file extension. For example, the extension dvi. The argument should not include the dot that separates the root name from the extension. The dot can be inserted by the macro if you want it.

\caveat \caveat {⟨warning text⟩} typesets warning paragraphs. You can also enclose warning the ⟨warning text⟩ in a warning environment. Using the warning environment is

necessary if the ⟨warning text⟩ is to include |...|s, a codeexample environment or other “verbatim” constructs.

Warning: This is an example \caveat or warning environment.

\todo The \todo {⟨text⟩} command and the todoenv environment are analogous to todoenv \caveat and warning, but they typeset paragraphs of a task “to do”.

To do: This is an example \todo or todoenv environment.

\code \code {⟨verbatim text⟩} and |⟨verbatim text⟩| typeset short pieces of code

\code*
|...|

verbatim. For example, |{{@#%$^\| looks like {{@#%$^\ .

Instead of matching curly braces, any two identical characters, even a space, may be used to contain the ⟨verbatim⟩ after the \code command.

To do: Implement \code*. Like \verb*, \code* marks spaces explicitly. This is not an example todo, this is a real one for the compsci package!

\typeset \typeset {⟨text⟩} typesets ⟨text⟩ in a normal way, but indicates by boxing that the contents are an example of how some piece of code actually appears. For example, this looks like this when typeset.

typesetexample These example environments may be used to present a piece of source code and what it looks like when typeset. The typesetexample environment typesets its contents like \typeset except they are set off in their own indented block element instead of being boxed.

This is an example of the typesetexample environment. codeexample The codeexample and codeexample* environments are similar analogs of

codeexample*
codeexamplex
codeexamplex*

\code and \code*. The codeexamplex environment is like the codeexample en-

vironment except that \, {, } have their usual meanings. Inside the argument, \\ produces a typeset backslash.

   This is a \env{codeexample} environment: \(\int e^x\,dx\)  {}{{{!#@$%^&\
   There is a percent sign in the source after the $.

␣␣␣This␣is␣a␣\env{codexample*}␣environment:␣\(\int␣e^x\,dx\)␣␣{}{{{!#@$%^&\
␣␣␣Someday␣I␣would␣like␣to␣get␣rid␣of␣the␣leading␣spaces␣in␣a␣line.
␣␣␣
   This is a codeexamplex environment: ∫ eˆ x dx !#@$^&\
   The earlier examples had three unmatched open-braces which had to be
   closed in this environment.  Also the backslash had to be doubled.
   Percent signs get ignored---a BUG.

Warning: The codeexamplex environment ideally should ignore %s in the first column and print all others. The best I can do for the moment is to ignore all %s.

bothexample The bothexample and bothexample* environments typeset their contents two bothexample* times, side by side. The left side is set like either a codeexample or codeexample*

environment, and the right side is set like a typesetexample environment.

I find setting a line width of 65 characters in your editor helps keep this kind of example from bleeding to the right.

     This is one part of a \env{bothexample} environment:
     \(\int e^x\,dx\)  \fbox{jub-jub} \par
     The contents must not contain any \LaTeX{} errors.
     There is an annoying \% plus three explicit spaces at the beginning of
     the first part.  They are a bug!  Also notice also the missing percent
     sign after the backslash after ``annoying''---another bug that affects
     the verbatim part only.

LOOKS LIKE:

This is one part of a bothexample environment: ∫ e^{x} dx jub-jub The contents must not contain any L^{A}TEX errors. There is an annoying % plus three explicit spaces at the beginning of the first part. They are a bug! Also notice also the missing percent sign after the backslash after “annoying”—another bug that affects the verbatim part only.

splitexample The splitexample environment takes an argument which is used on the right splitexample* side (the typeset side) of an element that looks like bothexample. The contents

of the environment are set on the left side. This is a way to cheat, making the right side something other than the strict tyepsetting of what’s on the left.

Warning: The splitexample and bothexample environments execute example code. The example code is executed in a group, but be careful with global assignments, and with assignments that might screw up the example environment itself before the group ends. Notice that \setcounter is global.

The bothexample and splitexample environments use an auxiliary file with extension vrb, but a second pass with L^{A}TEX is not necessary.

   To do: Implement splitexample and splitexample*.

To do: Get the bothexample sub-environments side by side! Right now they are sequential. I recommend keeping line length inside this environment less than 40, however, in case the side-by-side presentation is ever possible. I have not followed this advice myself.

To do: Implement codeexamplex*.

Warning: The bothexample environment is working nicely now, but I have not even touched the other complicated verbatim-like environments, so they might be broken.

\url The compsci package uses the url package by Donald Arseneau to handle the

\email
\path

typesetting of URLs, email addresses, and filesystem paths. See that package for details of how line breaks are handled within these elements.

\option \option {⟨option name⟩} typesets the name of a package or class option. For

example, the landscape option.

\program \program {⟨program name⟩} typesets the name of a computer program. For

example the xdvi program. See also \newprogram below. \lips The compsci package uses the lips package, so you can use the \lips command

for text ellipses. My love is like a red red rose. …

\booktitle The compsci package uses the titles package, so several commands like \booktitle are available.

2 Referring to commands

\cs \cs {⟨command sequence⟩} typesets a command sequence, such as the one that \cmd starts this sentence. \cmd does the same thing. For example, \cs\foo looks

like \foo . When writing, e.g., \cs\foo the following spacing is automatically handled. The result doesn’t look different from using the |...| or \code syntax, but the markup allows the parsing of the macro name itself for some future purpose such as indexing.

Warning: You cannot say \cs\foo@bar when @ is not a letter (category

code 11), you must say \cs{\foo@bar} or \cname{foo@bar} instead.

Nor can you say \cs\par. It trips on \text@command.

Nor can you say \cs\iffoo. Use \cname{iffoo} instead.

\cname \cname {⟨command name⟩} is like \cs but its argument is evaluated and prefixed with a backslash character. For example, writing \cname{@tfor} gives you

 \@tfor .

\marg \marg {⟨mandatory argument⟩} typesets a mandatory argument, and \oarg \oarg {⟨optional argument⟩} typesets an optional argument. For example, These macros

are defined with \meta, so you can use \\ for a typeset backslash.

     \cs\GobbleMOM\marg{first arg}\oarg{optional second arg}\marg{third arg}

LOOKS LIKE:

\GobbleMOM {⟨first arg⟩}[⟨optional second arg⟩]{⟨third arg⟩}

\meta \meta{⟨text⟩} refers to a syntactic placeholder. You would use this for example to talk about one of the arguments of a command you’ve introduced, like ⟨text⟩ above, which can contain normal text but is broken across lines only at spaces. Within the argument \\ is a typeset backslash.

3 Miscellaneous

\newprogram The compsci package uses the abbrevs package to define the Program category of abbreviation. Use \newprogram{⟨\csname⟩}{⟨initial expansion⟩}[⟨subsequent expansion⟩] to define a new abbreviation {⟨\csname⟩} for a program.

\ProcessDTXFile \ProcessDTXFile can be used by a documentation driver file of the kind you might be inclined to make using the doc package. Its purpose is to be able to load a package up to a certain point so that just descriptive information can be read without reading in the whole file. \ProcessDTXFile{⟨filename⟩} defines the variable \JusTLoaDInformatioN and inputs the file ⟨filename⟩. To be useful, the file must have a statement that branches on whether \JusTLoaDInformatioN is defined. For an example of its use, see the present package.

\MaybeBibliography

Sorry, you will need to look at the source below.

\AddToCheckSum \AddToCheckSum {⟨number⟩} simply adds ⟨number⟩ globally to the checksum counter implemented in the doc package. This macro finds applications when the sources of a package are spread over one or more files such as configuration files or files concatenated by a Make process. For an example of its use, see the present package.

\BibTeX The BibTEX logo is provided if it isn’t already defined.

Part II

Implementation

4 Version control

\fileinfo \DoXUsepackagE \HaveECitationS \fileversion \filedate \docdate \PPOptArg These definitions must be the first ones in the file.
 1 \def\fileinfo{macros for writing about macros (Frankenstein's conscience)}
 2 \def\DoXPackageS {}
 3 \def\fileversion{v1.1}
 4 \def\filedate{1999/03/08}
 5 \def\docdate{1999/03/08}
 6 \edef\PPOptArg {%
 7 \filedate\space \fileversion\space \fileinfo
 8 }

If we’re loading this file from a \ProcessDTXFile command (see the compsci package), then \JusTLoaDInformatioN will be defined; othewise we assume it is not (that’s why the FunkY NamE).

If we’re loading from \ProcessDTXFile, we want to load the packages listed in \DoXPackageS (needed to typeset the documentation for this file) and then bail out. Otherwise, we’re using this file in a normal way as a package, so do nothing. \DoXPackageS, if there are any, are declared in the dtx file, and, if you’re reading the typeset documentation of this package, would appear just above. (It’s OK to call \usepackage with an empty argument or \relax, by the way.)

 9 \makeatletter% A special comment to help create bst files.  Don't change!
10 \@ifundefined{JusTLoaDInformatioN} {%
11 }{% ELSE (we know the compsci package is already loaded, too)
12 \UndefineCS\JusTLoaDInformatioN
13 \SaveDoXVarS
14 \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined
15  \usepackage{#1}%
16 }%
17 \RestoreDoXVarS
18 \makeatother
19 \endinput
20 }% A special comment to help create bst files.  Don't change!

Now we check for L^{A}TEX2e and declare the LaTeX package.

21 \NeedsTeXFormat{LaTeX2e}
22 \ProvidesPackage{compsci}[\PPOptArg]

5 Requirements and context

23 \RequirePackage{abbrevs,alltt,lips,moredefs,relsize,shortvrb,%
24  slemph,titles,url,verbatim}

6 Textual elements

\code |...| \url@ttnobreakstyle We use the url package to implement \code and the shortvrb package to implement |...|. There are no linebreaks in either. See the respective packages for considerations of robustness.

To do: summarize robustness considerations here.

25 \MakeShortVerb{\|}
26 \newcommand\code {%
27 \begingroup
28 \urlstyle{ttnobreak}%
29 \Url

30 }

31 \newcommand\url@ttnobreakstyle {%
32 \def\UrlFont     {\ttfamily}%
33 \def\UrlSpecials {\do\ {\ }}%
34 \def\UrlOrds     {\do\*\do\-}%

35 }

codeexample codeexample* What I’m doing here is defining codeexample and codeexample* to be just like

the doc package’s verbatim and verbatim*. That is, they ignore % characters at the beginning of lines.

36 \begingroup
37 \catcode `|=0
38 \catcode `[=1
39 \catcode `]=2
40 \catcode`\{=12
41 \catcode`\}=12
42 \catcode`\\=12
43 |gdef|@xverbatim#1\end{codeexample}[#1|end[codeexample]]
44 |gdef|@sxverbatim#1\end{codeexample*}[#1|end[codeexample*]]
45 |endgroup
46 \newcommand\codeexample {%
47 \@beginparpenalty
48 \predisplaypenalty
49 \@docverbatim
50 \MacroFont
51 \frenchspacing
52 \@vobeyspaces
53 \@xverbatim

54 }

55 \NewName{codeexample*} {} {%
56 \@beginparpenalty
57 \predisplaypenalty
58 \@docverbatim
59 \MacroFont
60 \@sxverbatim

61 }

62 \newcommand\@docverbatim {%
63 \trivlist

64 \item[]%
65 \if@minipage\else
66  \vskip\parskip
67 \fi
68 \leftskip\@totalleftmargin
69 \rightskip\z@
70 \parindent\z@
71 \parfillskip\@flushglue
72 \parskip\z@
73 \@@par
74 \@tempswafalse
75 \def\par {%
76  \if@tempswa
77  \hbox{}%
78  \fi
79  \@tempswatrue
80  \@@par
81  \penalty\interlinepenalty
82  \check@percent
83 }%
84 \obeylines
85 \let\do\do@noligs
86 \verbatim@nolig@list
87 \let\do\@makeother
88 \dospecials

89 }

\MakePercentIgnore \MakePercentComment These are defined in the doc package, which may be loaded.

90 \requirecommand*\MakePercentIgnore{\catcode`\%9\relax}
91 \requirecommand*\MakePercentComment{\catcode`\%14\relax}

codeexamplex The codeexamplex environment ideally should ignore %s in the first column and

print all others. The best I can do for the moment is to ignore %s. To do: use verbatim-write trick

92 \newenvironment{codeexamplex} {%
93  \alltt
94  \def\\{\char`\\}%
95  \MakePercentIgnore\relax
96 }{%
97 \endalltt

98 }

typesetexample The typesetexample environment is simple, it’s just the quote environment.

99 \newenvironment{typesetexample} {%
100  \quote
101 }{%
102 \endquote

103 }

To implement the bothexample environments we write out the contents of the environment and read them in twice, typesetting them differently each time. The verbatimwrite environment comes from the moreverb package. Reading the text twice seems unavoidable because we want to read them with different catcodes each time.

To do: Figure whether the tab stuff here is going is a help or a hindrance.

\verbatim@out
\end@cs@verbatim@write
\cs@verbatim@write
\verbtab@oktrue
\verbtab@okfalse
\ifverbtab@ok
\if@cs@first@line@
\@cs@first@line@true
\@cs@first@line@false
\cs@verbatim@input

104 \newwrite \verbatim@out
105 \DefName{end@cs@verbatim@write} {} {%
106 \immediate\closeout\verbatim@out
107 \@esphack

108 }

109 \defcommand\cs@verbatim@write [1] {%
110 \@bsphack
111 \immediate\openout \verbatim@out #1
112 \let\do\@makeother\dospecials
113 \catcode`\^^M\active \catcode`\^^I=12
114 \def\verbatim@processline {%
115  \if@cs@using@doc@
116  \immediate\write\verbatim@out{\expandafter\GobbleM\the\verbatim@line}%
117  \else
118  \immediate\write\verbatim@out{\the\verbatim@line}%
119  \fi

120 }%

121 \verbatim@start

122 }

123 \newboolean{verbtab@ok}
124 \newboolean{@cs@first@line@}
125 \ReserveCS\cs@verbatim@input
126 \@cs@first@line@true
127 {\catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N
128 \lowercase{%
129  \gdef\cs@verbatim@input #1{%
130  \begingroup
131  \@verbatim\frenchspacing\@vobeyspaces
132  \def\verbatim@addtoline##1~{%
133  \verbatim@line\expandafter{\the\verbatim@line##1}%

134 }%

135  \openin\verbatim@in@stream=#1
136  \ifeof\verbatim@in@stream
137  \FrankenError{compsci}
138  {Can't find file #1!}\@eha
139  \else
140  \verbtab@oktrue
141  \verbatim@line {}%
142  \def\verbtab@prev@line{PREVINIT~}%
143  \loop
144  \read\verbatim@in@stream to \verbtab@line

145  \ifeof\verbatim@in@stream
146  \verbtab@okfalse
147  \else
148 %              \DTypeout{My line is: [\meaning\verbtab@line]}%
149  \if@cs@first@line@
150 %                \DTypeout{I'm avoiding printing: [\meaning\verbtab@prev@line]}%
151  \@cs@first@line@false
152  \else
153 %                \DTypeout{I'll print: [\meaning\verbtab@prev@line]}%
154  \expandafter\verbatim@addtoline\verbtab@prev@line
155  \the\verbatim@line
156  \par
157  \verbatim@line {}%
158  \fi
159  \let\verbtab@prev@line\verbtab@line
160  \fi
161  \ifverbtab@ok \repeat
162  \closein\verbatim@in@stream
163  \fi
164  \endtrivlist
165  \endgroup
166  \@doendpe
167  }%               \gdef
168 }%                \lowercase
169 }%                  catcodes

bothexample bothexample* The first \begingroup … \endgroup I think is necessary to contain the verbatim activity. The second is necessary so that activity in the example environment does not effect anything outside it. Of course global activity will, so be careful! The \minipage effects the second group. [Hmm, I don’t see a “second” group. …]

170 \newboolean{@cs@using@doc@}
171 \newenvironment{bothexample} {%
172  \@ifundefined{ver@doc.sty} {%
173  \@cs@using@doc@false
174  }{% ELSE
175  \@cs@using@doc@true

176 }

177  \par
178  \begingroup
179  \cs@verbatim@write{\jobname.vrb}
180 }{%
181 \end@cs@verbatim@write
182 \cs@verbatim@input{\jobname.vrb}%
183 \endgroup
184 \par\noindent{\sffamily\larger LOOKS LIKE:}%
185 \par\smallskip
186 \noindent\fbox{%
187  \minipage{\textwidth}
188  \MakePercentComment
189  \input{\jobname.vrb}%

190  \endminipage

191 }%

192 \par\medskip

193 }

splitexample splitexample* We can’t use #1 in the end-environment part, so we write it out. Again we have

the problem of %s. Warning: This is broken!

194 % \newenvironment{gogog}[1]
195 %   {\verbatimwrite{\jobname.vrb}#1}
196 %   {\endverbatimwrite}
197 \newenvironment{splitexample} [1] {%
198 \cs@verbatim@write{\jobname.vrb}

199 #1

200 \end@cs@verbatim@write
201 \codeexample
202 }{%
203 \endcodeexample
204 \par\smallskip
205 \noindent\fbox{%
206  \minipage{\textwidth}
207  \input{\jobname.vrb}%
208  \endminipage

209 }%

210 \par\medskip

211 }

\caveat
warning
\cs@caveat
\todo
todoenv
\cs@todo

212 \newcommand\caveat [1] {%
213 \cs@caveat
214 #1%
215 \endgroup
216 \par

217 }

218 \newenvironment{warning} {%
219  \cs@caveat
220 }{%
221 \endgroup
222 \par

223 }

224 \newcommand\cs@caveat {%
225 \par
226 \begingroup
227  \em {\bfseries Warning:}\space

228 }

229 \newcommand\todo [1] {%
230 \cs@todo
231  #1%
232 \endgroup

233 \par

234 }

235 \newenvironment{todoenv} {%
236  \cs@todo
237 }{%
238 \endgroup
239 \par

240 }

241 \newcommand\cs@todo {%
242 \par
243 \begingroup
244  \em {\bfseries To do:}\space

245 }

\program \bst \class \email \env \ext \file \option \package \cat \typeset Abstract markup of terms and objects.
246 \NewTextFontCommand \program \TMFontProgram % generic name of computer program
247 \NewTextFontCommand \bst     \ttfamily      % name of BibTeX bibliography style
248 \NewTextFontCommand \class   \slshape       % name of LaTeX class
249 \requirecommand     \email [1] {\url{<#1>}} % email address
250 \NewTextFontCommand \env     \ttfamily      % name of environment
251 \NewTextFontCommand \ext     \ttfamily      % name of file extension
252 \requirecommand     \file    {\url}         % name of disk file
253 \NewTextFontCommand \option  \ttfamily      % name of package or class option
254 \NewTextFontCommand \package \slshape       % name of LaTeX package
255 \NewTextFontCommand \cat     \sffamily      % name of a category
256 \newlet             \typeset \fbox          % text as it appears when typeset

7 Referring to commands

\meta \m@ta \do@space \sp@ce \sp@@ce Here I redefine \meta to include a \normalfont right at the beginning inside a

group, since the command was working strangely when \ttfamily was in effect. Also, I redefine \\ to be a typeset backslash.

257 \begingroup
258 \obeyspaces%
259 \catcode`\^^M\active%
260 \gdef\meta{\begingroup\let\\\textbackslash\normalfont\obeyspaces\catcode`\^^M\active%
261 \let^^M\do@space\let \do@space%
262 \def\-{\egroup\discretionary{-}{}{}\hbox\bgroup\itshape}%
263 \m@ta}%
264 \endgroup

These are simply from the doc package.

265 \defcommand\m@ta [1] {%
266 \leavevmode
267 \hbox\bgroup$\langle$\itshape#1\/$\rangle$\egroup
268 \endgroup

269 }

270 \def\do@space {%
271 \egroup

272 \space
273 \hbox\bgroup\itshape\futurelet\next\sp@ce

274 }

275 \def\sp@ce {%
276 \ifx\next\do@space
277  \expandafter\sp@@ce
278 \fi

279 }

280 \defcommand\sp@@ce [1] {%
281 \futurelet\next\sp@ce

282 }

\marg \oarg These use \meta and are therefore slightly different than their counterparts in ltxdoc. A tiny bit of breakability is added at the beginning.

283 \defcommand*\marg [1] {%
284 \penalty 9999%
285 {\ttfamily\char`\{\meta{#1}\char`\}}%

286 }

287 \defcommand*\oarg [1] {%
288 \penalty 9999%
289 {\ttfamily[\meta{#1}]}%

290 }

\cname \cmd \cs For referring to a L^{A}TEX macro. The code is a mix from the ltxdoc class and the abbrevs package. There is no need to check for \nocorr commands inside the argument so we skip \text@command. We might conceivably be in a typewriter slanted, so we do check for italic corrections. We don’t handle the case of calling this in math mode (see the definition of \DeclareTextFontCommand in the kernel).

We handle the cases of \cmd{\foo} and \foo differently. The latter needs logic to determine the following space, whereas the former does not. They both need italic corrections.

291 \NewRobustCommand*\cname [1] {%
292 \expandafter\code\expandafter{\bslash#1}%

293 }

294 \DeclareRobustCommand*\cmd {%
295 \leavevmode
296 \@ifnextchar \bgroup
297  \cs@cmd@grouped
298  \cs@cmd@ungrouped

299 }

300 \newcommand\cs@cmd@grouped [1] {%
301 \begingroup
302  \maybe@ic
303  \code{#1}%
304  \aftergroup\maybe@ic
305 \endgroup

306 }

307 \newcommand\cs@cmd@ungrouped [1] {%
308 \begingroup

309  \maybe@ic
310  \code{#1}%
311  \aftergroup\maybe@ic@space
312 \endgroup

313 }

314 \let\cs\cmd

8 Miscellaneous

\partname \ProcessDTXFile \IfJustLoadInformation \JusTLoaDInformatioN \IfCitations \initelyHavECitationS \SaveDoXVarS \RestoreDoXVarS \RestorECitationS \AddToCheckSum See the version control section above and all throughout the Frankenstein bundle

for examples of when you might want to use these commands.

315 \def\partname {%
316 Part%

317 }

We make sure it’s OK to use \def multiple times. You might need to call packages with options.

318 \newcommand*\ProcessDTXFile [1] {%
319 \def\filename {#1}%
320 \def\JusTLoaDInformatioN {}%
321 \UndefineCS\initelyHavECitationS
322 \input{#1}%
323 \UndefineCS\JusTLoaDInformatioN % not necessary in my usage, but safe

324 }

325 \newcommand*\IfCitations [1] {%
326 \@ifundefined{initelyHavECitationS} {%
327  }{% ELSE
328  #1\relax

329 }% 330 }

331 \newcommand*\IfJustLoadInformation [1] {%
332 \@ifundefined{JusTLoaDInformatioN} {%
333  }{% ELSE
334  #1\relax

335 }% 336 }

337 \newcommand*\SaveDoXVarS {%
338 \SaveCS\fileinfo \SaveCS\fileversion
339 \SaveCS\filedate \SaveCS\docdate
340 \SaveCS\DoXPackageS
341 \def\RestorECitationS {%
342  \UndefineCS\initelyHavECitationS

343 }%

344 \IfCitations {%
345  \let\RestorECitationS\relax

346 }% 347 }

348 \newcommand*\RestoreDoXVarS {%

349 \RestoreCS\fileinfo \RestoreCS\fileversion
350 \RestoreCS\filedate \RestoreCS\docdate
351 \RestoreCS\DoXPackageS
352 \RestorECitationS

353 }

354 \newcommand*\AddToCheckSum [1] {%
355 \global\advance\check@sum #1%

356 }

\newprogram \TMFontProgram \TMHookProgram \TMResetProgram Provide for program abbreviations.
357 \NewAbbrevCategory{Program}
358 \NewUserAbbrevDefiner{\newprogram}{Program}
359 \def\TMFontProgram {%
360 \relsize{-1}\ttfamily

361 }

\BibTeX The BibTEX logo.

362 \providecommand\BibTeX {%
363 {\rmfamily B\kern-.05em{\scshape i\kern-.025em b}\kern-.08em
364  T\kern-.1667em\raisebox{-.7ex}{E}\kern-.125emX}%

365 }

Part III

Configuration

Other things are deferred to a configuration file.

 1 \InputIfFileExists{compsci.cfg}{}{}

The contents of the distributed configuration file are below.

 2 \def\fileinfo{Compsci package configuration}
 3 \def\fileversion{v1.1}
 4 \def\filedate{1996/10/28}
 5 \def\docdate{1996/03/23}
 6 \ProvidesFile{compsci.cfg}
\ALaTeX \Frankenstein \monster \CTAN \kpse \gemacs \auctex \nts \MakeIndex \etex \LaTeXiii \idvi Various program names.
 7 \newprogram\Frankenstein{Frankenstein}
 8 \newlet\monster\Frankenstein
 9 \requirecommand\ALaTeX {%
10 A\LaTeX%

11 }

12 \newabbrev\ctan{CTAN}
13 \newprogram\kpse{kpathsea}
14 \newprogram\gemacs{\textrm{GNU} Emacs}
15 \newprogram\auctex{AUC-\TeX}
16 \newprogram\nts{$\cal NTS$}
17 \newprogram\MakeIndex{{\normalshape\em Makeindex\/}}
18 \newprogram\etex{e-\TeX}
19 \newprogram\LaTeXiii{\LaTeX~3}
20 \newprogram\idvi{IDVI}

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\% . . . . . . . . . . . . 90, 91 \* . . . . . . . . . . . . . . 34 \- . . . . . . . . . . . 34, 262 \/ . . . . . . . . . . . 17, 267 \@@par . . . . . . . . . 73, 80

\@beginparpenalty 47, 56

\@bsphack . . . . . . . . 110

\@cs@first@line@false

. . . . . . . . . . . \underline{104}

\@cs@first@line@true

. . . . . . . . . . . \underline{104}

\@cs@using@doc@false

. . . . . . . . . . . 173

\@cs@using@doc@true 175
\@docverbatim 49, 58, 62

\@doendpe . . . . . . . . 166 \@eha . . . . . . . . . . . . 138 \@esphack . . . . . . . . 107

\@flushglue . . . . . . . 71
\@ifnextchar . . . . . . 296
\@ifundefined . . . . .

. 10, 172, 326, 332

\@makeother . . . . 87, 112
\@sxverbatim . . . . . . 60
\@tempswafalse . . . . 74
\@tempswatrue . . . . . 79
\@totalleftmargin . 68
\@verbatim . . . . . . . 131
\@vobeyspaces . . 52, 131
\@xverbatim . . . . . . . 53

\\ . . . . . . . . 42, 94, 260 \{ . . . . . . . . . . . 40, 285 \} . . . . . . . . . . . 41, 285 \^… 113, 127, 259, 260 \| . . . . . . . . . . . . . . 25 \~ . . . . . . . . . . . . . . 127

\␣ . . . . . . . . . . . . . . 33

A

\active 113, 127, 259, 260

\AddToCheckSum . . 5, \underline{315}

\advance . . . . . . . . . 355

                          \aftergroup . . . 304, 311

\ALaTeX . . . . . . . . . . . \underline{7} \alltt . . . . . . . . . . . 93 \auctex . . . . . . . . . . . \underline{7}

B

                          \begingroup . . . . . . .

… 27, 36, 130, 178, 226, 243, 257, 260, 301, 308

\bfseries …. 227, 244 \bgroup 262, 267, 273, 296 \BibTeX . . . . . . . . 5, \underline{362}

                          \booktitle . . . . . . . . 4
                          bothexample (environ-

ment) …. 3, \underline{170}

                          bothexample* (environ-

ment) …. 3, \underline{170} \bslash . . . . . . . . . . 292 \bst . . . . . . . . . . . 2, \underline{246}

C \cal . . . . . . . . . . . . . 16 \cat . . . . . . . . . . . . . \underline{246} \catcode 37–42, 90, 91,

113, 127, 259, 260 \caveat . . . . . . . . 2, \underline{212} \char . . . . . . . . . 94, 285

                          \check@percent . . . . 82
                          \check@sum . . . . . . . 355

\class . . . . . . . . . 2, \underline{246} \closein . . . . . . . . . 162 \closeout . . . . . . . . 106 \cmd . . . . . . . . . . . 4, \underline{291} \cname . . . . . . . . . 4, \underline{291} \code 2, \underline{25}, 292, 303, 310 \code* . . . . . . . . . . . . 2

                          \codeexample . . . 46, 201
                          codeexample (environ-

ment) . . . . . 3, \underline{36}

                          codeexample* (environ-

ment) . . . . . 3, \underline{36}

                                                   codeexamplex (environ-

ment) . . . . . 3, \underline{92}

                                                   codeexamplex* (envi-

ronment) . . . . . 3 \cs . . . . . . . . . . . 4, \underline{291}

                                                   \cs@caveat . . . . . . . \underline{212}
                                                   \cs@cmd@grouped 297, 300
                                                   \cs@cmd@ungrouped .

. . . . . . . . 298, 307 \cs@todo . . . . . . . . . \underline{212}

                                                   \cs@verbatim@input .

. . . . . . . . \underline{104}, 182

                                                   \cs@verbatim@write .

…. \underline{104}, 179, 198 \csname . . . . . . . . . . 14 \CTAN . . . . . . . . . . . . . \underline{7} \ctan . . . . . . . . . . . . 12

D

                                                   \DeclareRobustCommand

. . . . . . . . . . . 294 \def . . . . . . 1–5, 32–

34, 75, 94, 114, 132, 142, 262, 270, 275, 315, 319, 320, 341, 359

                                                   \defcommand . . . 109,

265, 280, 283, 287 \DefName . . . . . . . . . 105

                                                   \discretionary . . . . 262

\do . . 33, 34, 85, 87, 112

                                                   \do@noligs . . . . . . . 85

\do@space . . . . . . . . \underline{257} \docdate . \underline{1}, 5, 339, 350

                                                   \dospecials . . . . 88, 112
                                                   \DoXPackageS 2, 340, 351
                                                   \DoXUsepackagE . . . . . \underline{1}

\DTypeout . 148, 150, 153

E \edef . . . . . . . . . . . . . 6 \eExpand . . . . . . . . . 14 \egroup … 262, 267, 271 \else . . . . . . . . . 65,

117, 139, 147, 152 \em . . . . . . 17, 227, 244 \email . . . . . . . . . 4, \underline{246} \end . . . . . . . . . . . 43, 44

\end@cs@verbatim@write

…. \underline{104}, 181, 200 \endalltt . . . . . . . . 97

\endcodeexample . . . 203
\endcsname . . . . . . . 14
\endgroup . . . . . . . .

. 165, 183, 215, 221, 232, 238, 264, 268, 305, 312

\endinput . . . . . . . . 19

\endminipage . . 190, 208

\endquote . . . . . . . . 102

\endtrivlist . . . . . . 164
\endverbatimwrite . 196

\env . . . . . . . . . . . 2, \underline{246} environments:

bothexample* . . 3, \underline{10}
bothexample . . . 3, \underline{10}
codeexample* . . 3, \underline{7}
codeexamplex* . . . 3
codeexamplex . . 3, \underline{8}
codeexample . . . 3, \underline{7}
splitexample* . 3, \underline{11}
splitexample . . 3, \underline{11}

todoenv . . . . . . 2, \underline{11}

typesetexample 2, \underline{8}

warning . . . . . . 2, \underline{11} \etex . . . . . . . . . . . . . \underline{7}

\expandafter . . 116,

133, 154, 277, 292 \ext . . . . . . . . . . . 2, \underline{246}

F

\fbox . . . . . 186, 205, 256 \fi …. 67, 78, 119,

158, 160, 163, 278 \file . . . . . . . . . . 2, \underline{246} \filedate \underline{1}, 4, 339, 350 \fileinfo \underline{1}, 2, 338, 349 \filename . . . . . . . . 319

\fileversion . . . . . .

…. \underline{1}, 3, 338, 349

\FrankenError . . . . . 137
\Frankenstein . . . . . . \underline{7}
\frenchspacing . 51, 131

\futurelet . . . 273, 281

G

\gdef . . . . . 129, 167, 260 \gemacs . . . . . . . . . . . \underline{7} \global . . . . . . . . . . 355 \GobbleM . . . . . . . . . 116

H

\HaveECitationS . . . . \underline{1}

\hbox . . 77, 262, 267, 273

I

\idvi . . . . . . . . . . . . . \underline{7}

\if@cs@first@line@ . \underline{104}
\if@cs@using@doc@ . 115
\if@minipage . . . . . . 65
\if@tempswa . . . . . . . 76
\IfCitations . . . . . . \underline{315}

\ifeof . . . . . . . 136, 145

\IfJustLoadInformation

. . . . . . . . . . . \underline{315}

\ifverbtab@ok . . . . . \underline{104}

\ifx . . . . . . . . . . . . . 276

\immediate . . . . . . .

. 106, 111, 116, 118 \In . . . . . . . . . . . . . 14

\initelyHavECitationS

. . . . . . . . . . . \underline{315}

\input …. 189, 207, 322

\InputIfFileExists . . 1
\interlinepenalty . 81

\item . . . . . . . . . . . . 64 \itshape . . 262, 267, 273

J

\jobname . . 179, 182,

189, 195, 198, 207

\JusTLoaDInformatioN

. . . . . . . . 12, \underline{315}

K

\kern . . . . . . . . 363, 364 \kpse . . . . . . . . . . . . . \underline{7}

L

\langle . . . . . . . . . . 267 \larger . . . . . . . . . . 184 \LaTeX . . . . . . . . . 10, 19 \LaTeXiii . . . . . . . . . \underline{7} \lccode . . . . . . . . . . 127

\leavevmode . . . 266, 295

\leftskip . . . . . . . . 68 \let . 85, 87, 112, 159,

260, 261, 314, 345 \lips . . . . . . . . . . . . . 4 \loop . . . . . . . . . . . . 143

\lowercase . . . 128, 168

M

\m@ta . . . . . . . . . . . . \underline{257}

\MacroFont . . . . . 50, 59
\makeatletter . . . . . . 9
\makeatother . . . . . . 18
\MakeIndex . . . . . . . . \underline{7}
\MakePercentComment

. . . . . . . . \underline{90}, 188

\MakePercentIgnore .

. . . . . . . . . \underline{90}, 95

\MakeShortVerb . . . . 25

\marg . . . . . . . . . . 4, \underline{283} \maybe@ic . 302, 304, 309

\maybe@ic@space . . . 311
\MaybeBibliography . . 5

\meaning . . 148, 150, 153 \medskip . . . . . 192, 210 \meta … 5, \underline{257}, 285, 289 \minipage …. 187, 206 \monster . . . . . . . . . . \underline{7}

N

\N . . . . . . . . . . . . . . 127

\NeedsTeXFormat . . . 21
\newabbrev . . . . . . . 12
\NewAbbrevCategory . 357
\newboolean 123, 124, 170
\newcommand . . 26, 31,

46, 62, 212, 224, 229, 241, 300, 307, 318, 325, 331, 337, 348, 354

\newenvironment . . .

… 92, 99, 171, 194, 197, 218, 235

\newlet . . . . . . . . 8, 256 \NewName . . . . . . . . . 55

\newprogram . . . . . . .

. . 5, 7, 13–20, \underline{357}

\NewRobustCommand . 291

\NewTextFontCommand

. . . . . 246–248, 250, 251, 253–255

\NewUserAbbrevDefiner

. . . . . . . . . . . 358 \newwrite . . . . . . . . 104 \next . . . . . 273, 276, 281 \noindent . 184, 186, 205

\normalfont . . . . . . . 260
\normalshape . . . . . . 17

\nts . . . . . . . . . . . . . . \underline{7}

O

\oarg . . . . . . . . . . 4, \underline{283}

\obeylines . . . . . . . 84
\obeyspaces . . . 258, 260

\openin . . . . . . . . . . 135 \openout . . . . . . . . . 111 \option . . . . . . . . 4, \underline{246}

P

\package . . . . . . . 2, \underline{246} \par 75, 156, 177, 184,

185, 192, 204, 210, 216, 222, 225, 233, 239, 242

\parfillskip . . . . . . 71
\parindent . . . . . . . 70

\parskip . . . . . . . 66, 72 \partname . . . . . . . . \underline{315} \path . . . . . . . . . . . . . 4 \penalty . . 81, 284, 288 \PPOptArg . . . . . . . \underline{1}, 22

\predisplaypenalty .

. . . . . . . . . 48, 57

\ProcessDTXFile . 5, \underline{315}

\program . . . . . . . 4, \underline{246}

\providecommand . . . 362
\ProvidesFile . . . . . . 6
\ProvidesPackage . . 22

Q

\quote . . . . . . . . . . . 100

R

\raisebox . . . . . . . . 364 \rangle . . . . . . . . . . 267 \read . . . . . . . . . . . . 144 \relax . . . . . . . . 90,

91, 95, 328, 334, 345 \relsize . . . . . . . . . 360 \repeat . . . . . . . . . . 161

\requirecommand . . .

9, 90, 91, 249, 252

\RequirePackage . . . 23
\ReserveCS . . . . . . . 125
\RestorECitationS . \underline{315}
\RestoreCS . . . 349–351
\RestoreDoXVarS 17, \underline{315}
\rightskip . . . . . . . 69

\rmfamily . . . . . . . . 363

S

\SaveCS . . . . . . 338–340

\SaveDoXVarS . . . 13, \underline{315}

\scshape . . . . . . . . . 363 \sffamily …. 184, 255 \slshape . . . . . 248, 254

\smallskip . . . 185, 204

\sp@@ce . . . . . . . . . . \underline{257} \sp@ce . . . . . . . . . . . \underline{257} \space . . 7, 227, 244, 272

splitexample (environ-

ment) …. 3, \underline{194}

splitexample* (envi-

ronment) . 3, \underline{194}

T

\TeX . . . . . . . . . . . 15, 18

\textbackslash . . . . 260

\textrm . . . . . . . . . . 14

\textwidth . . . 187, 206

\the . . 116, 118, 133, 155

\TMFontProgram 246, \underline{357}
\TMHookProgram . . . . \underline{357}
\TMResetProgram . . . \underline{357}

\todo . . . . . . . . . . 2, \underline{212} todoenv (environment)

. . . . . . . . . 2, \underline{212} \trivlist . . . . . . . . 63

\ttfamily . . . . . 32,

247, 250, 251, 253, 285, 289, 360 \typeset . . . . . . . 2, \underline{246}

                          typesetexample (envi-

ronment) . . 2, \underline{99}

U

                          \UndefineCS . . . . . . .

. 12, 321, 323, 342 \Url . . . . . . . . . . . . . 29 \url . . . . . . . 4, 249, 252

                          \url@ttnobreakstyle   \underline{25}

\UrlFont . . . . . . . . . 32 \UrlOrds . . . . . . . . . 34

                          \UrlSpecials . . . . . . 33

\urlstyle . . . . . . . . 28

                          \usepackage . . . . . . . 15

V

                          \verbatim@addtoline

. . . . . . . . 132, 154

                          \verbatim@in@stream

. . . . . . . . 135, 136, 144, 145, 162

                          \verbatim@line . . . .

…. 116, 118, 133, 141, 155, 157

                          \verbatim@nolig@list 86
                          \verbatim@out . . . . . \underline{104}
                          \verbatim@processline

. . . . . . . . . . . 114

                          \verbatim@start . . . 121
                          \verbatimwrite . . . . 195
                          \verbtab@line . . . . .

…. 144, 148, 159

                          \verbtab@okfalse . . \underline{104}
                          \verbtab@oktrue . . . \underline{104}
                          \verbtab@prev@line .

. . . . . . . . 142, 150, 153, 154, 159

\vskip . . . . . . . . . . . 66

W warning (environment)

. . . . . . . . . 2, \underline{212} \write . . . . . . . 116, 118

Z \z@ . . . . . . . . 69, 70, 72