summaryrefslogtreecommitdiff
path: root/web/glasgow/lit2x-0.16/literate/lit-style.tex
blob: 7ffd7603a0f29ea0599def320a0390fa34cb03a3 (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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
% THIS FILE IS AUTOMATICALLY INPUT INTO GLASGOW LITERATE DOCUMENTS
%
% support for "literate programming" with Haskell (and other things)
%  contact: Will Partain (partain@dcs.glasgow.ac.uk)
%
% most of it is copies of semi-std .sty files;
% done this way so we don't have to rely on others having them

\newcommand{\ToDo}[1]{$\spadesuit$~{\bf ToDo:} {\em #1} $\spadesuit$}
\newcommand{\srcloc}[1]{\marginpar{\footnotesize\tt #1}}
\newcommand{\smiley}{%
\hbox{$\bigcirc\mskip-13.3mu{}^{..}
\mskip-11mu\scriptscriptstyle\smile\ $}}

\makeatletter

%% basic format, for better or worse, is "Simon's format"
%% intended for 11pt work
%%
%===================================================================
%\input{a4wide.sty}
%NAME: a4wide.sty
% "moretext" document style option.
% Jean-Francois Lamy, July 86
%
% Redefines the margins so that they are more in line with 
% what we are used to see.
%

%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%\input a4.sty
%%
%% This file was generated with `docstrip.tex' version v1.0b <89/11/05>
%%
%% The original source file was `a4.doc'.
%%
%% IMPORTANT NOTICE:
%% You are not allowed to distribute this file.
%% For distribution of the original source see
%% the copyright notice in the file `a4.doc'.
%%
\def\fileversion{1.2}
\def\filedate{26 Feb 90}
\def\docdate {26 Feb 90}
%% \CheckSum{134}
%% \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         \~}
%%
%%\typeout{Style option `A4' \fileversion\space<\filedate> (NP and JLB)}
%%\typeout{English documentation\space\space\space<\docdate> (JLB)}
\topmargin 0pt
\ifcase \@ptsize
    \textheight 53\baselineskip
\or
    \textheight 46\baselineskip
\or
    \textheight 42\baselineskip
\fi
\advance\textheight by \topskip
\ifcase \@ptsize
    \textwidth      5.00in
    \marginparwidth 1.00in
  \if@twoside
    \oddsidemargin  0.55in
    \evensidemargin 0.75in
  \else
    \oddsidemargin  0.55in
    \evensidemargin 0.55in
  \fi
\or
    \textwidth      5.20in
    \marginparwidth 1.00in
  \if@twoside
    \oddsidemargin  0.45in
    \evensidemargin 0.65in
  \else
    \oddsidemargin  0.45in
    \evensidemargin 0.45in
  \fi
\or
    \textwidth      5.70in
    \marginparwidth 0.80in
  \if@twoside
    \oddsidemargin  0.20in
    \evensidemargin 0.40in
  \else
    \oddsidemargin  0.20in
    \evensidemargin 0.20in
  \fi
\fi
\def\WideMargins{%
  \newdimen\ExtraWidth
  \ifcase \@ptsize
    \ExtraWidth = 0.5in
    \@widemargins
  \or
    \ExtraWidth = 0.5in
    \@widemargins
  \or
    \ExtraWidth = 0.7in
    \@widemargins
  \fi\let\WideMargins\relax\let\@widemargins\relax}
{\def\do{\noexpand\do\noexpand}
 \xdef\@preamblecmds{\@preamblecmds \do\WideMargins}
}
\def\@widemargins{%
    \global\advance\textwidth by -\ExtraWidth
    \global\advance\marginparwidth by \ExtraWidth
    \if@twoside
      \tw@sidedwidemargins
    \else
      \@nesidedwidemargins
    \fi}
\def\tw@sidedwidemargins{%
    \if@reversemargin
      \@tempdima=\evensidemargin
      \advance\@tempdima by -\oddsidemargin
      \advance\oddsidemargin by \ExtraWidth
      \advance\oddsidemargin by \@tempdima
      \advance\evensidemargin by -\@tempdima
    \else
      \advance\evensidemargin by \ExtraWidth
    \fi}
\def\@nesidedwidemargins{%
    \if@reversemargin
      \advance\oddsidemargin by \ExtraWidth
      \advance\evensidemargin by \ExtraWidth
    \fi}
%\endinput
% end of a4.sty
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

\ifcase \@ptsize
    % mods for 10 pt
    \oddsidemargin  0.15 in     %   Left margin on odd-numbered pages.
    \evensidemargin 0.35 in     %   Left margin on even-numbered pages.
    \marginparwidth 1 in        %   Width of marginal notes.
    \oddsidemargin 0.25 in      %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0.25 in
    \marginparwidth 0.75 in
    \textwidth 5.875 in % Width of text line.
\or % mods for 11 pt
    \oddsidemargin 0.1 in      %   Left margin on odd-numbered pages.
    \evensidemargin 0.15 in    %   Left margin on even-numbered pages.
    \marginparwidth 1 in       %   Width of marginal notes.
    \oddsidemargin 0.125 in    %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0.125 in
    \marginparwidth 0.75 in
    \textwidth 6.125 in % Width of text line.
\or % mods for 12 pt
    \oddsidemargin -10 pt      %   Left margin on odd-numbered pages.
    \evensidemargin 10 pt      %   Left margin on even-numbered pages.
    \marginparwidth 1 in       %   Width of marginal notes.
    \oddsidemargin 0 in      %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0 in
    \marginparwidth 0.75 in
    \textwidth 6.375 true in % Width of text line.
\fi
% end of a4wide.sty
%===================================================================

% Block paragraphs
% NOTE: comment out these four lines if you want more
% standard LaTeX-looking paragraphs.
\setlength{\parskip}{0.25cm}
% partain: save the parindent value, for indenting code
\newlength{\litcodeindent}
\setlength{\litcodeindent}{\z@}
%\setlength{\litcodeindent}{\parindent}
% comment out this one line if you want std para indentation:
\setlength{\parindent}{0cm}
%\renewcommand{\textfraction}{0.2}
%\renewcommand{\floatpagefraction}{0.7}

% display environment: same as "quotation"
\def\display{\list{}{\listparindent \z@
    \itemindent\listparindent
    \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
\let\enddisplay=\endlist

% flushdisplay environment: same as "display" but without indent
\def\flushdisplay{\list{}{\listparindent \z@
    \itemindent\listparindent
    \leftmargin\z@ \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
\let\endflushdisplay=\endlist

% unflushverbatim environment: "verbatim" is naturally "flush"
% so this simply arranges "unflushness".  It presumes things are written as...
% \begin{unflushverbatim}
% \begin{verbatim}
% <stuff>
% \end{verbatim}
% \end{unflushverbatim}
%
\def\unflushverbatim{\list{}{\listparindent \z@
    \itemindent\listparindent
    \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
\let\endunflushverbatim=\endlist

%\newcommand{\BeginLitCode}{\par\noindent\begin{tabular}{@{\hspace*{1.2em}}l@{}}}
%\newcommand{\BeginLitCodeNoIndent}{\par\noindent\begin{tabular}{@{}l@{}}}
%\newcommand{\EndLitCode}{\end{tabular}}

% same, for now
%\newcommand{\BeginLitVerb}{\par\noindent\begin{tabular}{@{\hspace*{1.2em}}l@{}}}
%\newcommand{\BeginLitVerbNoIndent}{\par\noindent\begin{tabular}{@{}l@{}}}
%\newcommand{\EndLitVerb}{\end{tabular}}

% and some internal variants that set the page numbers differently
\newcommand{\indexttit}[1]{\index{#1@{\tt #1}|itindexpage}}
\newcommand{\itindexpage}[1]{{\it #1}}
%\newcommand{\indexPageUL}[1]{\index{#1|underline}}
\newcommand{\ttize}[1]{{\tt #1}}
\newcommand{\ttunderline}[1]{\underline{\tt #1}}

\newcommand{\heading}[1]{\par\vspace{2\baselineskip}\noindent #1\par}

\newcommand{\Haskell}{Haskell}

% slightly hacked...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File "comment.sty" (by Tom Hofmann, E-mail: wtho@cgch.UUCP)
% 1989-10-30
% 
% This File contains the definition of a LaTeX environment "comment"
% which allows to alternatively print or suppress parts of the document.
%
%
% Usage:
%
%    - Declare "comment" as documentstyle option or include this file
%      by "\input{comment.sty}"
%    - Embed comments in "\begin{comment}" and "\end{comment}"
%    - To print the document including the comments write "\printcomments"
%      before the first comment. Alternatively, write "\suppresscomments"
%      to print without comments.
%    - The default setting is "\printcomments".
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% (1) Definition of the environment "comment" when notes are
%     to be printed.

% hack here
% orig: \def\printcomments{\def\comment{}}	% "\endcomment" can be missing

\def\printcomments{\def\comment{\par \small {\em Comment:}}}	% "\endcomment" can be missing

% (2) Definition of the environment "comment" when notes are not
%     to be printed.

%     Make '{' and '}' "other characters" and make '(' and ')'
%     "begingroup" and "endgroup" resp.  Thus make it possible
%     to have "\end{comment}" as part of a macro definition.

\begingroup\makeatletter		% since the catcodes of '{' and '}'
\catcode`{=12\relax\catcode`}=12\relax	% will change, use \begingroup and
\catcode`(=1\relax \catcode`)=2\relax	% \endgroup instead.

\gdef\suppresscomments(%

%     Make '{' and '}' searchable when expanding the macro by giving them
%     the same catcode in the subsequent text as in the macro definition.

	  \gdef\comment(\catcode`{=12\relax\catcode`}=12\relax\@NOTE)

%     Skip text between "\begin{comment}" and "\end{comment}"
%     (inclusive), but return an "\end{comment}" command to LaTeX for
%     the correct environment handling (see below).

	  \long\gdef\@NOTE##1\end{comment}(\@ENDNOTE))


\endgroup				% End of the enchantment.

%     Generate an environment-end command conformable to LaTeX.

{\makeatletter\gdef\@ENDNOTE{\end{comment}}}

\printcomments				% This is the default setting.

%========================================================================
% saves having to put this in all the time
%\input{makeidx.sty}
% makeidx.sty 20-Jan-87

\def\see#1#2{{\em see\/} #1}
\def\printindex{\@input{\jobname.ind}}
% end of makeidx.sty
\makeatother
%========================================================================

%========================================================================
\makeatletter
% file tgrind.sty
% NB: nuke line numbering
%%%%%%%%%%%
%NAME: tgrind.sty
% LaTeX tgrind environment

% Based on Van Jacobson's ``tgrindmac'', a macro package for TeX grinding
% Our job here is to simplify it quite a bit and make it conform to LaTeX

\newif\ifcomment\newif\ifstring
\newcount\linecount\newcount\linenext
\newbox\linesofar
\newdimen\TBwid
\newdimen\ts
\newbox\tbox

\def\tgrind{%
% Stuff we ignore for right now.
\let\Head=\@gobble
\def\File##1,##2,##3{}
\let\Proc=\@gobble
\let\ProcCont=\@gobble
%
% Each formfeed in the input is replaced by a "\NewPage" macro.  If
% you really want a page break here, define this as "\vfill\eject".
\def\NewPage{\filbreak\bigskip}
%
% Each line of the program text is enclosed by a "\L{...}".  We turn
% each line into an hbox of size hsize.  If we saw a procedure name somewhere
% in the line (i.e., "procbox" is not null), we right justify "procbox"
% on the line.  Every 10 lines we output a small, right justified line number.
\def\L##1{\par\hbox to\hsize{\CF\strut\global\advance\linecount by1
##1\hss\linebox}}
%
\linecount=0
\linenext=9
\def\linebox{\ifnum\linecount>\linenext\global\advance\linenext by10
% partain: \hbox{\sevrm\the\linecount}\fi}
% partain2: \hbox{\rm\tiny\the\linecount}\fi}
\hbox{}\fi}
%
% The following weirdness is to deal with tabs.  "Pieces" of a line
% between tabs are output as "\LB{...}".  E.g., a line with a tab at
% column 16 would be output as "\LB{xxx}\Tab{16}\LB{yyy}".  (Actually, to
% reduce the number of characters in the .tex file the \Tab macro
% supplies the 2nd & subsequent \LB's.) We accumulate the LB stuff in an
% hbox.  When we see a Tab, we grab this hbox (using "\lastbox") and turn
% it into a box that extends to the tab position.  We stash this box in
% "\linesofar" & use "\everyhbox" to get \linesofar concatenated onto the
% front of the next piece of the line.  (There must be a better way of
% doing tabs [cf., the Plain.tex tab macros] but I'm not not enough of a
% TeX wizard to come up with it.  Suggestions would be appreciated.)
\def\LB{\CF\hbox}
\setbox\linesofar=\null
\everyhbox={\box\linesofar}
\def\Tab##1{\setbox\tbox=\lastbox\TBwid=1\wd\tbox\advance\TBwid by 1\ts
\ifdim\TBwid>##1\ts
\setbox\linesofar=\hbox{\box\tbox\space}\else
\setbox\linesofar=\hbox to ##1\ts{\box\tbox\hfil}\fi\LB}
%
% A normal space is too thin for code listings.  We make spaces & tabs
% be in "\ts" units (which are the width of a "0" in the current font).
\setbox\tbox=\hbox{0} \ts=1\wd\tbox \setbox\tbox=\hbox{\hskip 1\ts}
\def\space{\hskip 1\ts\relax}
%
% Font changing stuff for keywords, comments & strings.  We put keywords
% in boldface, comments in text-italic & strings in typewriter.  Since
% we're usually changing the font inside of a \LB macro, we remember the
% current font in \CF & stick a \CF at the start of each new box.
% Also, the characters " and ' behave differently in comments than in
% code, and others behave differently in strings than in code.
\let\CF=\rm
\def\K##1{{\bf ##1}}	% Keyword
\def\C{\it\global\let\CF=\it\global\commenttrue\relax}	% Comment Start
\def\CE{\rm\global\let\CF=\rm\global\commentfalse\relax}% Comment End
\def\S{\tt\global\let\CF=\tt\global\stringtrue\relax}	% String Start
\def\SE{\rm\global\let\CF=\rm\global\stringfalse\relax}	% String End
%
% Special characters.
\def\{{\ifmmode\lbrace\else\ifstring{\char'173}\else$\lbrace$\fi\fi}
\def\}{\ifmmode\rbrace\else\ifstring{\char'175}\else$\rbrace$\fi\fi}
\def\!{\ifmmode\backslash\else\ifstring{\char'134}\else$\backslash$\fi\fi}
\def\|{\ifmmode|\else\ifstring{\char'174}\else$|$\fi\fi}
\def\<{\ifmmode<\else\ifstring<\else$<$\fi\fi}
\def\>{\ifmmode>\else\ifstring>\else$>$\fi\fi}
\def\/{\ifmmode/\else\ifstring/\else$/$\fi\fi}
\def\-{\ifmmode-\else\ifstring-\else$-$\fi\fi}
\def\_{\ifstring{\char'137}\else\underbar{\ }\fi}
\def\&{{\char'046}}
\def\#{{\char'043}}
\def\%{{\char'045}}
\def\~{{\char'176}}
\def\"{\ifcomment''\else{\tt\char'042}\fi}
\def\'{\ifcomment'\else{\tt\char'047}\fi}
\def\^{{\char'136}}
\def\${{\rm\char'044}}
%
\raggedright\obeyspaces%\let =\space%
}

% \tagrind*[FLOAT]{FILE}{CAPTION}{LABEL}
%    *		optional
%    FLOAT	float options
%    FILE	reads LaTeXgrind input in file FILE
%    CAPTION	for list of figures
%    LABEL	for \ref and \pageref
\def\tagrind{\@ifstar{\@stagrind}{\@tagrind}}

\def\@tagrind{\@ifnextchar[{\@@tagrind}{\@@tagrind[t]}}
\def\@stagrind{\@ifnextchar[{\@@stagrind}{\@@stagrind[t]}}

\def\@@tagrind[#1]#2#3#4{%
    \begin{figure}[#1]
	\hrule
	\vskip .5\baselineskip
	\begin{minipage}\columnwidth\small
	    \begin{tgrind}
		\input #2\relax
	    \end{tgrind}
	\end{minipage}
	\vskip .5\baselineskip plus .5\baselineskip
	\begingroup
	    \setbox\z@=\hbox{#4}%
	    \ifdim\wd\z@>\z@
		\caption{#3}%
		\label{#4}%
	    \else
		\captcont{#3}%
	    \fi
	\endgroup
	\vskip 2pt
	\hrule
    \end{figure}
}

\def\@@stagrind[#1]#2#3#4{%
    \begin{figure*}[#1]
	\hrule
	\vskip .5\baselineskip
	\begin{minipage}\textwidth\small
	    \begin{tgrind}
		\input #2\relax
	    \end{tgrind}
	\end{minipage}
	\vskip .5\baselineskip plus .5\baselineskip
	\begingroup
	    \setbox\z@=\hbox{#4}%
	    \ifdim\wd\z@>\z@
		\caption{#3}%
		\label{#4}%
	    \else
		\captcont{#3}%
	    \fi
	\endgroup
	\vskip 2pt
	\hrule
    \end{figure*}
}


\def\tgrindfile#1{%
    \par\addvspace{0.1in}
    \hrule
    \vskip .5\baselineskip
    \begin{footnotesize}
	\begin{tgrind}
	    \input #1\relax
	\end{tgrind}
    \end{footnotesize}
    \vskip .5\baselineskip
    \hrule
    \addvspace{0.1in}
}
% end of tgrind.sty
\makeatother
%========================================================================

%========================================================================
% changebar.sty
\makeatletter

%% This is file `changebar.sty' generated
%% on <1992/1/6> with the docstrip utility (v1.1k). 
%% 
%% The original source file was `changebar.doc'.
%% Included modules: `changebar'.
%% 
%% IMPORTANT NOTICE:
%% You are not allowed to distribute this file.
%% For distribution of the original source see 
%% the copyright notice in the file `changebar.doc'. 
%% 
\def\fileversion{v3.0-test}
\def\filedate{6 Nov 91}
\def\docdate{6 Nov 91}
%% \CheckSum{798}
%% \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         \~}
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\wlog{Document style option `changebar', \fileversion\space<\filedate>}
\chardef\atcatcode=\catcode`\@
\catcode`\@=11\relax
\def\cb@maxpoint{80}
\def\cb@minpoint{1}
\def\cb@nil{0}
\newcount\cb@nextpoint
\cb@nextpoint=\cb@minpoint
\newcount\cb@currentpoint
\newcount\cb@page
\newcount\cb@pagecount
\cb@pagecount=0
\newif\ifouterbars \outerbarsfalse
\newdimen\cb@odd
\newdimen\cb@even
\def\cb@positions{%
  \global\cb@odd =\hoffset
  \global\advance\cb@odd by \oddsidemargin
  \ifouterbars
    \global\advance\cb@odd by \textwidth
    \global\advance\cb@odd by \changebarsep
  \else
    \global\advance\cb@odd by -\changebarsep
  \fi
  \global\cb@even =\hoffset
  \global\advance\cb@even by \evensidemargin
  \if@twoside
    \ifouterbars
      \global\advance\cb@even by -\changebarsep
    \else
      \global\advance\cb@even by \textwidth
      \global\advance\cb@even by \changebarsep
    \fi
  \else
    \ifouterbars
      \global\advance\cb@even by \textwidth
      \global\advance\cb@even by \changebarsep
    \else
    \fi
      \global\advance\cb@even by -\changebarsep
  \fi}
{\catcode`\p=12\catcode`\t=12 \gdef\cb@removedim#1pt{#1}}
\def\driver#1{%
  \bgroup\edef\next{\def\noexpand\tempa{#1}}%
    \uppercase\expandafter{\next}%
    \def\LN{DVITOLN03}%
    \def\DVItoPS{DVITOPS}%
    \def\DVIPS{DVIPS}%
    \def\emTeX{EMTEX}%
    \global\chardef\cb@driver@setup=0
    \ifx\tempa\LN      \global\chardef\cb@driver@setup=0\fi
    \ifx\tempa\DVItoPS \global\chardef\cb@driver@setup=1\fi
    \ifx\tempa\DVIPS   \global\chardef\cb@driver@setup=2\fi
    \ifx\tempa\emTeX   \global\chardef\cb@driver@setup=3\fi
  \egroup}
{\def\do{\noexpand\do\noexpand}
 \xdef\@preamblecmds{\@preamblecmds \do\driver}
}
\def\cb@setup@specials{%
\ifcase\cb@driver@setup
  \def\cb@defpoint##1##2{\special{ln03:defpoint \the##1(\the##2,)}}
  \def\cb@connect##1##2##3{%
    \special{ln03:connect \the##1\space\space \the##2\space \the##3}}
  \def\cb@resetpoints{%
    \special{ln03:resetpoints \cb@minpoint \space\cb@maxpoint}}
\or
  \def\cb@defpoint##1##2{%
    \special{dvitops: inline
                \expandafter\cb@removedim\the##2\space 6.5536 mul\space
                /CBarX\the##1\space exch def currentpoint exch pop
                /CBarY\the##1\space exch def}}
  \def\cb@connect##1##2##3{%
    \special{dvitops: inline
                gsave \thechangebargrey\space 100 div setgray
                \expandafter\cb@removedim\the##3\space 6.5536 mul\space
                CBarX\the##1\space\space CBarY\the##1\space\space moveto
                CBarX\the##2\space\space CBarY\the##2\space\space lineto
                stroke grestore}}
  \let\cb@resetpoints\relax
\or
  \def\cb@defpoint##1##2{%
     \special{ps:
                \expandafter\cb@removedim\the##2\space 4.096 mul\space
                Resolution\space mul\space 300\space div\space
                /CBarX\the##1\space exch def currentpoint exch pop
                /CBarY\the##1\space exch def}}
    \def\cb@connect##1##2##3{%
      \special{ps:
                gsave \thechangebargrey\space 100 div setgray
                \expandafter\cb@removedim\the##3\space 4.096 mul\space
                Resolution\space mul\space 300\space div\space
                setlinewidth
                CBarX\the##1\space\space CBarY\the##1\space\space moveto
                CBarX\the##2\space\space CBarY\the##2\space\space lineto
                stroke grestore}}
    \let\cb@resetpoints\relax
\or
  \typeout{Changebar Warning: changebars only supported for v1.5+ of dvidrv}%
  \def\cb@defpoint##1##2{\special{em:point \the##1,\the##2}}
  \def\cb@connect##1##2##3{\special{em:line \the##1,\the##2,\the##3}}
  \let\cb@resetpoints\relax
\else
  \typeout{Changebar Warning: changebars not supported in unknown setup}
  \def\cb@defpoint##1##2{}
  \def\cb@connect##1##2##3{}
  \let\cb@resetpoints\relax
\fi
\global\let\cb@setup@specials\relax}
\def\cbstart{\@ifnextchar [{\cb@start}{\cb@start[\changebarwidth]}}
\def\cbend{\cb@end}
\def\cbdelete{\@ifnextchar [{\cb@delete}{\cb@delete[\deletebarwidth]}}
\def\cb@delete[#1]{\vbox to 0pt{\vss\cb@start[#1]\vskip #1\cb@end}}
\def\changebar{\@ifnextchar [{\cb@start}{\cb@start[\changebarwidth]}}%
\def\endchangebar{\cb@end}
\def\nochangebars{\def\cb@start[##1]{}%
                  \def\cb@delete[##1]{}%
                  \let\cb@end\relax}
\newlength{\changebarwidth}
\setlength{\changebarwidth}{2pt}
\newlength{\deletebarwidth}
\setlength{\deletebarwidth}{4pt}
\newlength{\changebarsep}
\setlength{\changebarsep}{30pt}
\newcounter{changebargrey}
\setcounter{changebargrey}{65}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\cb@start[#1]{\cb@currentpoint=\cb@nextpoint
        \@tempdima=#1\relax                             % for \cb@push
        \cb@push\cb@currentlist
        \ifvmode \cb@setBeginPoint\cb@currentpoint
        \else \vbox to 0pt{\vskip -\ht\strutbox         %jump up a line to
        \cb@setBeginPoint\cb@currentpoint               %set point
        \vskip \ht\strutbox}\fi
        \cb@writeAux\cb@advancePoint}
\def\cb@advancePoint{%
  \global\advance\cb@nextpoint by 2\relax
  \ifnum\cb@nextpoint>\cb@maxpoint
    \global\cb@nextpoint=\cb@minpoint\relax
  \fi}
\def\cb@end{%
  \cb@pop\cb@currentlist
  \ifnum\cb@currentpoint=\cb@nil
    \typeout{Changebar Warning: Badly nested changebars;
                                Expect erroneous results}%
  \else
    \cb@setEndPoint\cb@currentpoint
    \advance\cb@currentpoint by1\cb@writeAux
  \fi}
\def\cb@setBeginPoint#1{%
  \ifodd\cb@pagecount
    \cb@defpoint{#1}{\cb@even}%
  \else
    \cb@defpoint{#1}{\cb@odd}%
  \fi}
\def\cb@setEndPoint#1{%
  \@tempcnta=#1\advance\@tempcnta by1\relax
  \ifodd\cb@pagecount
    \cb@defpoint{\@tempcnta}{\cb@even}%
  \else
    \cb@defpoint{\@tempcnta}{\cb@odd}%
  \fi
  \cb@connect{#1}{\@tempcnta}{\@tempdima}}%
\def\cb@writeAux{%
  \if@filesw
    \begingroup
      \edef\point{\the\cb@currentpoint}%
      \edef\level{\the\@tempdima}%
      \let\the=0%
      \edef\cb@temp{\write\@auxout
          {\string\cb@barpoint{\point}{\the\cb@pagecount}{\level}}}%
      \cb@temp
    \endgroup
  \fi}
\let\cb@makecol=\@makecol
\def\@makecol{%
  \setbox\@cclv=\vbox{\cb@resetpoints\cb@beginSaves\unvbox\@cclv}%
  \gdef\cb@beginSaves{}
  \global\advance\cb@pagecount by 1%
  \cb@buildActive\cb@processActive
  \cb@makecol}
\def\cb@processActive{%
  \cb@pop\cb@spanlist
  \ifnum\cb@currentpoint=\cb@nil
  \else
    \setbox\@cclv=\vbox{\unvbox\@cclv\advance\cb@pagecount by -1%
                        \cb@setEndPoint\cb@currentpoint}%
    \cb@saveBeginPoint\cb@currentpoint
    \cb@push\cb@history
    \cb@processActive
  \fi}
\def\cb@saveBeginPoint#1{%
  \ifodd\cb@pagecount
    \xdef\cb@beginSaves{\cb@defpoint{#1}{\cb@even}\cb@beginSaves}%
  \else
    \xdef\cb@beginSaves{\cb@defpoint{#1}{\cb@odd}\cb@beginSaves}%
  \fi}
\def\cb@beginSaves{}                % initially empty
\def\cb@buildActive{\cb@initlist\cb@spanlist\cb@pushNextActive}
\def\cb@pushNextActive{%
  \cb@pop\cb@history
  \ifnum\cb@currentpoint=\cb@nil
  \else
    \ifnum\cb@page>\cb@pagecount
      \cb@push\cb@history
    \else
      \ifodd\cb@currentpoint
        \cb@push\cb@spanlist
      \else
        \cb@pop\cb@spanlist
      \fi
      \cb@pushNextActive
    \fi
  \fi}
\def\cb@initlist#1{\xdef#1{}}
\cb@initlist\cb@history % the history list; initially empty
\cb@initlist\cb@spanlist % list of bars spanning current page
\cb@initlist\cb@currentlist % used to implement nesting without using

\newwrite\cb@write % file for history list
\newread\cb@read
\immediate\openout\cb@write=\jobname.cb % open for building of history list
\def\cb@pop#1{%
  \ifx #1\cb@history
    \ifeof\cb@read
    \else
      {\endlinechar=-1\read\cb@read to\@temp
       \xdef\cb@history{\cb@history\@temp}%
      }%
    \fi
  \fi
  \ifx#1\@empty
    \cb@currentpoint=\cb@nil\cb@page=0%
  \else
    \expandafter\cb@carcdr#1e#1%
  \fi}
\def\cb@carcdr#1n#2p#3l#4e#5{%
  \cb@currentpoint=#1\cb@page=#2\@tempdima=#3\xdef#5{#4}}
\def\cb@push#1{%
  \xdef#1{\the\cb@currentpoint n\the\cb@page p\the\@tempdima l#1}}
\def\cb@barpoint#1#2#3{\immediate\write\cb@write{#1n#2p#3l}}
\let\cb@document=\document
\def\document{\cb@document
              \cb@setup@specials
              \cb@positions
              \immediate\closeout\cb@write
              \immediate\openin\cb@read=\jobname.cb}
\let\cb@enddocument\enddocument
\def\enddocument{\clearpage\cb@initlist\cb@history
   \immediate\closein\cb@read\immediate\openin\cb@read=\jobname.cb%
   \let\cb@barpoint=\cb@checkHistory\cb@enddocument}
\def\cb@checkHistory#1#2#3{\cb@pop\cb@history
        \ifnum #1=\cb@currentpoint
            \ifnum #2=\cb@page        % do nothing
            \else \cb@error           % page numbers mismatched
            \fi
        \else \cb@error               % point numbers mismatched
        \fi}
\def\cb@error{%
  \message{Changebar Warning: Changebar info has changed. %
                              Rerun to get right.}
  \gdef\cb@checkHistory##1##2##3{}%
  \let\cb@barpoint=\cb@checkHistory}
\let\cb@endfloat=\end@float
\def\end@float{%
  \cb@pop\cb@currentlist
  \ifnum\cb@currentpoint=\cb@nil
  \else
    \cb@push\cb@currentlist
    \global\@tempdima=\@tempdima
    \egroup
    \global\setbox\@currbox=%
        \vbox\bgroup\cb@start[\@tempdima]\unvbox\@currbox\cb@end
  \fi
  \cb@endfloat}
\let\endfigure=\end@float       % need to rebind these to new def
\let\endtable=\end@float
\let\cb@footnote=\@footnotetext
\long\def\@footnotetext#1{%
  \cb@pop\cb@currentlist
  \ifnum\cb@currentpoint=\cb@nil
    \cb@footnote{#1}
  \else
    \cb@push\cb@currentlist
    \edef\cb@temp{\the\@tempdima}%
    \cb@footnote{\cb@start[\cb@temp]#1\cb@end}%
  \fi}
\let\cb@mpfootnote=\@mpfootnotetext
\long\def\@mpfootnotetext#1{%
  \cb@pop\cb@currentlist
  \ifnum\cb@currentpoint=\cb@nil
    \cb@mpfootnote{#1}
  \else
    \cb@push\cb@currentlist
    \edef\cb@temp{\the\@tempdima}%
    \cb@mpfootnote{\cb@start[\cb@temp]#1\cb@end}%
  \fi}
\catcode`\@=\atcatcode \let\atcatcode\relax
%\endinput
%% 
%% End of file `changebar.sty'.
%
% end of changebar.sty; now we configure it:
%
% partain:
\driver{DVIPS}
% want black, thin lines
\setlength{\changebarwidth}{0.2pt}
\setcounter{changebargrey}{0}
%
\makeatother
%========================================================================

%========================================================================
\makeatletter

% Olin Shiver's code.sty
% partain: the stuff actually used is defined immediately afterwards
%--------
% code.sty: -*- latex -*-
% Latex macros for a "weak" verbatim mode.
% -- like verbatim, except \, {, and } have their usual meanings.

% Environments: code, tightcode,  codeaux, codebox, centercode
% Commands: \dcd, \cddollar, \cdmath, \cd, \codeallowbreaks, \codeskip, \^
% Already defined in LaTeX, but of some relevance: \#, \$, \%, \&, \_, \{, \}

% Changelog at the end of the file.

% These commands give you an environment, code, that is like verbatim
% except that you can still insert commands in the middle of the environment:
%     \begin{code}
%     for(x=1; x<loop_bound; x++)
%         y += x^3; /* {\em Add in {\tt x} cubed} */
%     \end{code}
%
% All characters are ordinary except \{}. To get \{} in your text, 
% you use the commands \\, \{, and \}.

% These macros mess with the definition of the special chars (e.g., ^_~%).
% The characters \{} are left alone, so you can still have embedded commands:
%	\begin{code} f(a,b,\ldots,y,z) \end{code}
% However, if your embedded commands use the formerly-special chars, as in
%    	\begin{code} x := x+1 /* \mbox{\em This is $y^3$} */ \end{code}
% then you lose. The $ and ^ chars are scanned in as non-specials,
% so they don't work. If the chars are scanned *outside* the code env,
% then you have no problem:
% 	\def\ycube{$y^3$}
% 	\begin{code} x := x+1 /* {\em This is \ycube} */ \end{code}
% If you must put special chars inside the code env, you do it by
% prefixing them with the special \dcd ("decode") command, that
% reverts the chars to back to special status:
%    	\begin{code} x := x+1 /* {\dcd\em This is $y^3$} */ \end{code}
% \dcd's scope is bounded by its enclosing braces. It is only defined within
% the code env. You can also turn on just $ with the \cddollar command;
% you can turn on just $^_ with the \cdmath command. See below.
%
% Alternatively, just use \(...\) for $...$, \sp for ^, and \sb for _.

% WARNING:
% Like \verb, you cannot put a \cd{...} inside an argument to a macro
% or a command. If you try, for example,
%     \mbox{\cd{$x^y$}}
% you will lose. That is because the text "\cd{$x^y$}" gets read in
% as \mbox's argument before the \cd executes. But the \cd has to
% have a chance to run before LaTeX ever reads the $x^y$ so it can
% turn off the specialness of $ and ^. So, \cd has to appear at
% top level, not inside an argument. Similarly, you can't have
% a \cd or a \code inside a macro (Although you could use \gdef to
% define a macro *inside* a \cd, which you could then use outside.
% Don't worry about this if you don't understand it.)

% BUG: In the codebox env, the effect of a \dcd, \cddollar, or \cdmath
%   command is reset at the end of each line. This can be hacked by
%   messing with the \halign's preamble, if you feel up to it.

% Useage note: the initial newline after the \begin{code} or 
%   \begin{codebox} is eaten, but the last newline is not.
%   So,
%     \begin{code}
%     foo
%     bar
%     \end{code}
%  leaves one more blank line after bar than does
%     \begin{code}
%     foo
%     bar\end{code}
%  Moral: get in the habit of terminating code envs without a newline
%  (as in the second example).
%

% All this stuff tweaks the meaning of space, tab, and newline.
%===============================================================================
% \cd@obeyspaces
% Turns all spaces into non-breakable spaces.
% Note: this is like \@vobeyspaces except without spurious space in defn.
% @xobeysp is basically a space; it's defined in latex.tex.
%
{\catcode`\ =\active\gdef\cd@obeyspaces{\catcode`\ =\active\let =\@xobeysp}}



% \cd@obeytabs
% Turns all tabs into 8 non-breakable spaces (which is bogus).
%
{\catcode`\^^I=\active %
  \gdef\cd@obeytabs{\catcode`\^^I=\active\let^^I=\cd@tab}}

\def\cd@tab{\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp}



% \cd@obeylines
% Turns all cr's into linebreaks. Pagebreaks are not permitted between lines.
% This is copied from lplain.tex's \obeylines, with the cr def'n changed.
%
{\catcode`\^^M=\active % these lines must end with %
  \gdef\cd@obeylines{\catcode`\^^M=\active\let^^M=\cd@cr}}

% What ^M turns into. This def'n keeps blank lines from being compressed out.
\def\cd@cr{\par\penalty10000\leavevmode} 	% TeX magicness
%\def\cd@cr{\par\penalty10000\mbox{}}		% LaTeX


% \codeallowbreaks
% Same as \cd@obeylines, except pagebreaks are allowed.
% Put this command inside a code env to allow pagebreaks.

{\catcode`\^^M=\active % these lines must end with %
  \gdef\codeallowbreaks{\catcode`\^^M\active\let^^M\cd@crbr}}

%\def\cd@crbr{\leavevmode\endgraf} % What ^M turns into.
%partain:
\def\cd@crbr{\par\leavevmode} % What ^M turns into.


% \cd@obeycrsp 
% Turns cr's into non-breakable spaces. Used by \cd.

{\catcode`\^^M=\active % these lines must end with %
  \gdef\cd@obeycrsp{\catcode`\^^M=\active\let^^M=\@xobeysp}}

% =============================================================================

% Set up code environment, in which most of the common special characters
% appearing in code are treated verbatim, namely: $&#^_~%
% \ { } are still enabled so that macros can be called in this
% environment.  Use \\, \{, and \} to use these characters verbatim
% in this environment.
% 
% Inside a group, you can make
% all the hacked chars	special with the	\dcd		command
% $			special with the 	\cddollar	command
% $^_			special with the	\cdmath		command.
% If you have a bunch of math $..$'s in your code env, then a global \cddollar
% or \cdmath at the beginning of the env can save a lot of trouble.
% When chars are special (e.g., after a \dcd), you can still get #$%&_{} with
% \#, \$, \%, \&, \_, \{, and \} -- this is standard LaTeX.
% Additionally, \\ gives \ inside the code env, and when \cdmath
% makes ^ special, it also defines \^ to give ^.

%The hacked characters can be made special again
% within a group by using the \dcd command.

% Note: this environment allows no breaking of lines whatsoever; not
% at spaces or hypens.  To arrange for a break use the standard \- command,
% or a \discretionary{}{}{} which breaks, but inserts nothing.  This is useful,
% for example for allowing hypenated identifiers to be broken, e.g.
% \def\={\discretionary{}{}{}} %optional break
% FOO-\=BAR.

\def\setupcode{\parsep=0pt\parindent=0pt%
  \tt\frenchspacing\catcode``=13\@noligs%
  \def\\{\char`\\}%
  \let\dcd=\cd@dcd\let\cddollar=\cd@dollarspecial\let\cdmath=\cd@mathspecial%
  \@makeother\$\@makeother\&\@makeother\#%
  \@makeother\^\@makeother\_\@makeother\~%
  \@makeother\%\cd@obeytabs\cd@obeyspaces}
% other: $&#^_~%
% left special: \{}
% unnecessary: @`'"


%% codebox, centercode
%%=============================================================================
%% The codebox env makes a box exactly as wide as it needs to be
%% (i.e., as wide as the longest line of code is). This is useful
%% if you want to center a chunk of code, or flush it right, or
%% something like that. The optional argument to the environment,
%% [t], [c], or [b], specifies how to vertically align the codebox,
%% just as with arrays or other boxes. Default is [c].

%% Must be a newline immediately after "\begin{codebox}[t]"!

{\catcode`\^^M=\active % these lines must end with %
  \gdef\cd@obeycr{\catcode`\^^M=\active\let^^M=\cr}}

% If there is a [<letter>] option, then the following newline will
% be read *after* ^M is bound to \cr, so we're cool. If there isn't
% an option given (i.e., default to [c]), then the @\ifnextchar will
% gobble up the newline as it gobbles whitespace. So we insert the
% \cr explicitly. Isn't TeX fun?
\def\codebox{\leavevmode\@ifnextchar[{\@codebox}{\@codebox[c]\cr}} %]

\def\@codebox[#1]%
  {\hbox\bgroup$\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi\bgroup%
   \tabskip\z@\setupcode\cd@obeycr% just before cd@obey
   \halign\bgroup##\hfil\span}

\def\endcodebox{\crcr\egroup\egroup\m@th$\egroup}

% Center the box on the page:
\newenvironment{centercode}%
  {\begin{center}\begin{codebox}[c]}%
  {\end{codebox}\end{center}}


%% code, codeaux, tightcode
%%=============================================================================
%% Code environment as described above. Lines are kept on one page.
%% This actually works by setting a huge penalty for breaking
%% between lines of code. Code is indented same as other displayed paras.
%% Note: to increase left margin, use \begin{codeaux}{\leftmargin=1in}.

% To allow pagebreaks, say \codeallowbreaks immediately inside the env.
% You can allow breaks at specific lines with a \pagebreak form.

%% N.B.: The \global\@ignoretrue command must be performed just inside
%% the *last* \end{...} before the following text. If not, you will
%% get an extra space on the following line. Blech.

%% This environment takes two arguments. 
%% The second, required argument is the \list parameters to override the
%%     \@listi... defaults.
%%     - Usefully set by clients: \topsep \leftmargin
%%     - Possible, but less useful: \partopsep
%% The first, optional argument is the extra \parskip glue that you get around
%%     \list environments. It defaults to the value of \parskip.
\def\codeaux{\@ifnextchar[{\@codeaux}{\@codeaux[\parskip]}} %]
\def\@codeaux[#1]#2{%
  \bgroup\parskip#1%
	 \begin{list}{}%
	       {\parsep\z@\rightskip\z@\listparindent\z@\itemindent\z@#2}%
	       \item[]\setupcode\cd@obeylines}%
\def\endcodeaux{\end{list}\leavevmode\egroup\ignorespaces\global\@ignoretrue}

%% Code env is codeaux with the default margin and spacing \list params:
\def\code{\codeaux{}} \let\endcode=\endcodeaux

%% Like code, but with no extra vertical space above and below.
\def\tightcode{\codeaux[=0pt]{\topsep\z@}}%
\let\endtightcode\endcodeaux
%  {\vspace{-1\parskip}\begin{codeaux}{\partopsep\z@\topsep\z@}}%
%  {\end{codeaux}\vspace{-1\parskip}}



% Reasonable separation between lines of code
\newcommand{\codeskip}{\penalty0\vspace{2ex}}


% \cd is used to build a code environment in the middle of text.
% Note: only difference from display code is that cr's are taken
% as unbreakable spaces instead of linebreaks.

\def\cd{\leavevmode\begingroup\ifmmode\let\startcode=\startmcode\else%
	\let\startcode\starttcode\fi%
	\setupcode\cd@obeycrsp\startcode}

\def\starttcode#1{#1\endgroup}
\def\startmcode#1{\hbox{#1}\endgroup}


% Restore $&#^_~% to their normal catcodes
% Define \^ to give the ^ char.
% \dcd points to this guy inside a code env.
\def\cd@dcd{\catcode`\$=3\catcode`\&=4\catcode`\#=6\catcode`\^=7%
	   \catcode`\_=8\catcode`\~=13\catcode`\%=14\def\^{\char`\^}}

% Selectively enable $, and $^_ as special.
% \cd@mathspecial also defines \^ give the ^ char.
% \cddollar and \cdmath point to these guys inside a code env.
\def\cd@dollarspecial{\catcode`\$=3}
\def\cd@mathspecial{\catcode`\$=3\catcode`\^=7\catcode`\_=8%
		    \def\^{\char`\^}}


% Change log:
% Started off as some macros found in C. Rich's library.
% Olin 1/90:
% Removed \makeatletter, \makeatother's -- they shouldn't be there,
%   because style option files are read with makeatletter. The terminal
%   makeatother screwed things up for the following style options.
% Olin 3/91:
% Rewritten. 
% - Changed things so blank lines don't get compressed out (the \leavevmove
%   in \cd@cr and \cd@crwb). 
% - Changed names to somewhat less horrible choices. 
% - Added lots of doc, so casual hackers can more easily mess with all this.
% - Removed `'"@ from the set of hacked chars, since they are already
%   non-special. 
% - Removed the bigcode env, which effect can be had with the \codeallowbreaks
%   command.
% - Removed the \@noligs command, since it's already defined in latex.tex.
% - Win big with the new \dcd, \cddollar, and \cdmath commands.
% - Now, *only* the chars \{} are special inside the code env. If you need
%   more, use the \dcd command inside a group.
% - \cd now works inside math mode. (But if you use it in a superscript,
%   it still comes out full size. You must explicitly put a \scriptsize\tt
%   inside the \cd: $x^{\cd{\scriptsize\tt...}}$. A \leavevmode was added
%   so that if you begin a paragraph with a \cd{...}, TeX realises you
%   are starting a paragraph.
% - Added the codebox env. Tricky bit involving the first line hacked
%   with help from David Long.

% end of code.sty
%
% partain: things actually used
%% verbcode env is like tightcode:
%\def\verbcode{\codeaux[=0pt]{\topsep\z@\parskip\z@\leftmargin\litcodeindent}} \let\endverbcode=\endcodeaux
%\def\verbcode{\codeaux{\leftmargin\litcodeindent\cbstart}}%
\def\verbcode{%
  \bgroup\parskip\parskip%
	 \begin{list}{}%
	       {\parsep\z@\rightskip\z@\listparindent\z@\itemindent\z@\leftmargin\litcodeindent}%
	       \item[]\setupcode\cd@obeylines\cbstart}%
\def\endverbcode{\cbend\end{list}\leavevmode\egroup\ignorespaces\global\@ignoretrue}
%
\def\verbtext{\codeaux{\leftmargin\litcodeindent}} \let\endverbtext=\endcodeaux
%
\makeatother
%========================================================================