summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/frankenstein/compsci.stq
blob: 8bc92c4561dd6956da092535d18ca77391c45b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
%%
%% This is file `compsci.stq',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% compsci.sty 
%% 
%%     This program is part of the Frankenstein bundle for LaTeX.
%% 
%%     Copyright (C) 1995-2001 Matthew Swift <swift@alum.mit.edu>
%% 
%%     This file may have one of TWO names, either
%%     compsci.sty or compsci.stq.  This
%%     LaTeX package will work ONLY if it is called compsci.sty
%%     and placed in a proper directory.  This file should have been
%%     distributed to you with a DIFFERENT file (also) called
%%     compsci.sty which functions identically to this one
%%     but contains documentation in comments.  This file works faster,
%%     but the other should be kept because it contains the documentation
%%     for this LaTeX package. Files called README and INSTALL should have
%%     also been distributed to you with this file; see them for more
%%     information.
%% 
%%     This program is free software; you may redistribute it and/or
%%     modify it under the conditions of the LaTeX Project Public
%%     License, either version 1.2 or (at your option) any later version.
%%     The latest version of this license is in
%%     http://www.latex-project.org/lppl.txt, and version 1.2 or later is
%%     part of all distributions of LaTeX version 1999/12/01 or later.
%% 
%%     This program is distributed in the hope that it will be useful,
%%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%%     LaTeX Project Public License for more details.
%% 
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
\def\fileinfo{macros for writing about macros (Frankenstein's conscience)}
\def\DoXPackageS {}
\def\fileversion{v1.2}
\def\filedate{2001/08/31}
\def\docdate{2001/08/31}
\edef\PPOptArg {%
  \filedate\space \fileversion\space \fileinfo
}
\makeatletter% A special comment to help create bst files.  Don't change!
\@ifundefined{JusTLoaDInformatioN} {%
  }{% ELSE (we know the compsci package is already loaded, too)
  \UndefineCS\JusTLoaDInformatioN
  \SaveDoXVarS
  \eExpand\csname DoXPackageS\endcsname\In {%use \csname in case it's undefined
    \usepackage{#1}%
  }%
  \RestoreDoXVarS
  \makeatother
  \endinput
}% A special comment to help create bst files.  Don't change!
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{compsci}[\PPOptArg]
%%
\RequirePackage{abbrevs,alltt,lips,moredefs,relsize,shortvrb,%
                slemph,titles,url,verbatim}
\DeclareOption{hyperlatex} {%
  \FrankenInfo{compsci}{hyperlatex}
  \UndefineCS\code
  \UndefineCS\file
  \AtEndOfPackage {
    \DeleteShortVerb{\|}
    \newlet\cs@url\url
    \renewcommand*\url [1][] {%
      \def\sc@t@a{#1}%
      \ifx\sc@t@a\ShortEmpty
        \let\sc@t@a\cs@url
      \else
        \defcommand\sc@t@a [1] {%
          #1\footnote{See \texttt{##1}.}%
        }%
      \fi
      \sc@t@a
    }
    \renewcommand*\email [1][] {%
      \def\sc@t@a{#1}%
      \ifx\sc@t@a\ShortEmpty
        \expandafter\cs@email
      \else
        #1 \expandafter\cs@email
      \fi
    }
  }
}
\ProcessOptions
%%
%%
\MakeShortVerb{\|}
\newcommand*\code {%
  \begingroup
    \urlstyle{ttnobreak}%
    \Url
}
\newcommand\url@ttnobreakstyle {%
  \def\UrlFont     {\ttfamily}%
  \def\UrlSpecials {\do\ {\ }}%
  \def\UrlOrds     {\do\*\do\-}%
}
\begingroup
  \catcode `|=0
  \catcode `[=1
  \catcode `]=2
  \catcode`\{=12
  \catcode`\}=12
  \catcode`\\=12
  |gdef|@xverbatim#1\end{codeexample}[#1|end[codeexample]]
  |gdef|@sxverbatim#1\end{codeexample*}[#1|end[codeexample*]]
|endgroup
\newcommand\codeexample {%
  \@beginparpenalty
  \predisplaypenalty
  \@docverbatim
  \MacroFont
  \frenchspacing
  \@vobeyspaces
  \@xverbatim
}
\NewName{codeexample*} {} {%
  \@beginparpenalty
  \predisplaypenalty
  \@docverbatim
  \MacroFont
  \@sxverbatim
}
\newcommand\@docverbatim {%
  \trivlist
  \item[]%
  \if@minipage\else
    \vskip\parskip
  \fi
  \leftskip\@totalleftmargin
  \rightskip\z@
  \parindent\z@
  \parfillskip\@flushglue
  \parskip\z@
  \@@par
  \@tempswafalse
  \def\par {%
    \if@tempswa
      \hbox{}%
    \fi
    \@tempswatrue
    \@@par
    \penalty\interlinepenalty
    \check@percent
  }%
  \obeylines
  \let\do\do@noligs
  \verbatim@nolig@list
  \let\do\@makeother
  \dospecials
}
\requirecommand*\MakePercentIgnore{\catcode`\%9\relax}
\requirecommand*\MakePercentComment{\catcode`\%14\relax}
\newenvironment{codeexamplex} {%
    \alltt
    \def\\{\char`\\}%
    \MakePercentIgnore\relax
  }{%
  \endalltt
}
\newenvironment{typesetexample} {%
    \quote
  }{%
  \endquote
}
\newwrite \verbatim@out
\DefName{end@cs@verbatim@write} {} {%
  \immediate\closeout\verbatim@out
  \@esphack
}
\defcommand\cs@verbatim@write [1] {%
  \@bsphack
  \immediate\openout \verbatim@out #1
  \let\do\@makeother\dospecials
  \catcode`\^^M\active \catcode`\^^I=12
  \def\verbatim@processline {%
    \if@cs@using@doc@
      \immediate\write\verbatim@out{\expandafter\GobbleM\the\verbatim@line}%
    \else
      \immediate\write\verbatim@out{\the\verbatim@line}%
    \fi
  }%
  \verbatim@start
}
\newboolean{verbtab@ok}
\newboolean{@cs@first@line@}
\ReserveCS\cs@verbatim@input
\@cs@first@line@true
{\catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N
  \lowercase{%
    \gdef\cs@verbatim@input #1{%
      \begingroup
        \@verbatim\frenchspacing\@vobeyspaces
        \def\verbatim@addtoline##1~{%
          \verbatim@line\expandafter{\the\verbatim@line##1}%
        }%
        \openin\verbatim@in@stream=#1
        \ifeof\verbatim@in@stream
          \FrankenError{compsci}
            {Can't find file #1!}\@eha
        \else
          \verbtab@oktrue
          \verbatim@line {}%
          \def\verbtab@prev@line{PREVINIT~}%
          \loop
            \read\verbatim@in@stream to \verbtab@line
            \ifeof\verbatim@in@stream
              \verbtab@okfalse
            \else
              \if@cs@first@line@
                \@cs@first@line@false
              \else
                \expandafter\verbatim@addtoline\verbtab@prev@line
                \the\verbatim@line
                \par
                \verbatim@line {}%
              \fi
              \let\verbtab@prev@line\verbtab@line
            \fi
          \ifverbtab@ok \repeat
          \closein\verbatim@in@stream
        \fi
        \endtrivlist
      \endgroup
      \@doendpe
    }%               \gdef
  }%                \lowercase
}%                  catcodes
\newboolean{@cs@using@doc@}
\newenvironment{bothexample} {%
    \@ifundefined{ver@doc.sty} {%
        \@cs@using@doc@false
      }{% ELSE
      \@cs@using@doc@true
    }
    \par
    \begingroup
     \cs@verbatim@write{\jobname.vrb}
  }{%
  \end@cs@verbatim@write
  \cs@verbatim@input{\jobname.vrb}%
  \endgroup
  \par\noindent{\sffamily\larger LOOKS LIKE:}%
  \par\smallskip
  \noindent\fbox{%
    \minipage{\textwidth}
      \MakePercentComment
      \input{\jobname.vrb}%
    \endminipage
  }%
  \par\medskip
}
\newenvironment{splitexample} [1] {%
  \cs@verbatim@write{\jobname.vrb}
    #1
  \end@cs@verbatim@write
  \codeexample
  }{%
  \endcodeexample
  \par\smallskip
  \noindent\fbox{%
    \minipage{\textwidth}
    \input{\jobname.vrb}%
    \endminipage
  }%
  \par\medskip
}
\newcommand\caveat [1] {%
  \cs@caveat
  #1%
  \endgroup
  \par
}
\newenvironment{warning} {%
    \cs@caveat
  }{%
  \endgroup
  \par
}
\newcommand\cs@caveat {%
  \par
  \begingroup
    \em {\bfseries Warning:}\space
}
\newcommand\todo [1] {%
  \cs@todo
    #1%
  \endgroup
  \par
}
\newenvironment{todoenv} {%
    \cs@todo
  }{%
  \endgroup
  \par
}
\newcommand\cs@todo {%
  \par
  \begingroup
    \em {\bfseries To do:}\space
}
\NewTextFontCommand \program \TMFontProgram % generic name of computer program
\NewTextFontCommand \bst     \ttfamily      % name of BibTeX bibliography style
\NewTextFontCommand \class   \slshape       % name of LaTeX class
\NewTextFontCommand \env     \ttfamily      % name of environment
\NewTextFontCommand \ext     \ttfamily      % name of file extension
\NewTextFontCommand \option  \ttfamily      % name of package or class option
\NewTextFontCommand \package \slshape       % name of LaTeX package
\NewTextFontCommand \cat     \sffamily      % name of a category
\newlet             \typeset \fbox          % text as it appears when typeset
\newlet             \file    \path          % name of disk file
\newcommand\cs@email {%
  \begingroup
    \def\UrlLeft{<}%
    \def\UrlRight{>}%
    \urlstyle{tt}%
    \Url
}
\newcommand\cs@email@nobrace {%
  \begingroup
    \urlstyle{tt}%
    \Url
}
\newcommand\email{\cs@email}
\begingroup
\obeyspaces%
\catcode`\^^M\active%
\gdef\meta{\begingroup\let\\\textbackslash\normalfont\obeyspaces\catcode`\^^M\active%
\let^^M\do@space\let \do@space%
\def\-{\egroup\discretionary{-}{}{}\hbox\bgroup\itshape}%
\m@ta}%
\endgroup
\defcommand\m@ta [1] {%
  \leavevmode
  \hbox\bgroup$\langle$\itshape#1\/$\rangle$\egroup
  \endgroup
}
\def\do@space {%
  \egroup
  \space
  \hbox\bgroup\itshape\futurelet\next\sp@ce
}
\def\sp@ce {%
  \ifx\next\do@space
    \expandafter\sp@@ce
  \fi
}
\defcommand\sp@@ce [1] {%
  \futurelet\next\sp@ce
}
\defcommand*\marg [1] {%
  \penalty 9999%
  {\ttfamily\char`\{\meta{#1}\char`\}}%
}
\defcommand*\oarg [1] {%
  \penalty 9999%
  {\ttfamily[\meta{#1}]}%
}
\NewRobustCommand*\cname [1] {%
  \expandafter\code\expandafter{\bslash#1}%
}
\DeclareRobustCommand*\cmd {%
  \leavevmode
  \@ifnextchar \bgroup
      \cs@cmd@grouped
    \cs@cmd@ungrouped
}
\newcommand\cs@cmd@grouped [1] {%
  \begingroup
    \maybe@ic
    \code{#1}%
    \aftergroup\maybe@ic
  \endgroup
}
\newcommand\cs@cmd@ungrouped [1] {%
  \begingroup
    \maybe@ic
    \code{#1}%
    \aftergroup\maybe@ic@space
  \endgroup
}
\let\cs\cmd
%%
\def\partname {%
  Part%
}
\newcommand*\ProcessDTXFile [1] {%
  \def\filename {#1}%
  \def\JusTLoaDInformatioN {}%
  \UndefineCS\initelyHavECitationS
  \input{#1}%
  \UndefineCS\JusTLoaDInformatioN % not necessary in my usage, but safe
}
\newcommand*\IfCitations [1] {%
  \@ifundefined{initelyHavECitationS} {%
    }{% ELSE
    #1\relax
  }%
}
\newcommand*\IfJustLoadInformation [1] {%
  \@ifundefined{JusTLoaDInformatioN} {%
    }{% ELSE
    #1\relax
  }%
}
\newcommand*\SaveDoXVarS {%
  \SaveCS\fileinfo \SaveCS\fileversion
  \SaveCS\filedate \SaveCS\docdate
  \SaveCS\DoXPackageS
  \def\RestorECitationS {%
    \UndefineCS\initelyHavECitationS
  }%
  \IfCitations {%
    \let\RestorECitationS\relax
  }%
}
\newcommand*\RestoreDoXVarS {%
  \RestoreCS\fileinfo \RestoreCS\fileversion
  \RestoreCS\filedate \RestoreCS\docdate
  \RestoreCS\DoXPackageS
  \RestorECitationS
}
\newcommand*\AddToCheckSum [1] {%
  \global\advance\check@sum #1%
}
\NewAbbrevCategory{Program}
\NewUserAbbrevDefiner{\newprogram}{Program}
\def\TMFontProgram {%
  \relsize{-1}\ttfamily
}
\providecommand\BibTeX {%
  {\rmfamily B\kern-.05em{\scshape i\kern-.025em b}\kern-.08em
    T\kern-.1667em\raisebox{-.7ex}{E}\kern-.125emX}%
}
\InputIfFileExists{compsci.cfg}{}{}
\endinput
%%
%% End of file `compsci.stq'.