Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

561421 views
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
%%
3
%A gapmacro.tex GAP manual Frank Celler
4
%A Heiko Theissen
5
%A Alexander Hulpke
6
%%
7
%% @(#)$Id: gapmacro.tex,v 1.1 1999/11/26 02:10:01 gap Exp $
8
%%
9
%% DO NOT RELY ON MACRO DEFINITIONS IN THIS FILE!
10
%% The official definition of the manual style is to be found in the file
11
%% `ext:document.tex'.
12
%%
13
%% The following macros are defined in this file.
14
%%
15
%% `text' set text in typewriter style (use `\<' instead of `<')
16
%% <text> set text in italics (use $\<$ instead of $<$ for less than)
17
%% *text* set text in emphasized style (i.e. slanted)
18
%% $a.b$ same as $a \cdot b$ (use $\.$ instead of $.$ for full stop)
19
%% "ref" refer to a label (like "function!for category")
20
%% \pif sets a single '
21
%% \cite{.} make a citation
22
%% \index{.} \indextt{.} make index entry (\indextt in typewriter style)
23
%%
24
%% \beginitems produce itemized texts with 3pc hanging indentation
25
%% item & text
26
%%
27
%% item & text ...
28
%% \enditems
29
%%
30
%% \begintt verbatim text in typewriter style
31
%% verbatim material
32
%% \endtt
33
%% \beginexample verbatim text in typewriter style
34
%% verbatim material
35
%% \endexample
36
%%
37
%% \Input{file} includes file `file.tex' (not recommended for appendices)
38
%% \Chapter title \par
39
%% \Section{title} \par
40
%% make chapter or section title. Automatically generates table of
41
%% contents. \null after \Section{...} inhibits indexing.
42
%% \>function( arguments )!{ index subentry }
43
%% \>`a binop b'{binary operation}!{ index subentry }
44
%% make a heading for a subsection explaining a function or a binary
45
%% operation. This automatically generates a label and an index entry
46
%% (with optional subentry).
47
%% \){\fmark ...}
48
%% the same without label and index entry
49
%%
50
%% \BeginningOfBook
51
%% \FrontMatter, \Chapters, \Appendices parts of the book
52
%% \Bibliography, \Index, \TableOfContents make these chapters (w/o head)
53
%% \EndOfBook
54
%%
55
56
\input amssym.tex
57
58
% Page dimensions and double column output.
59
\hsize 39pc
60
\vsize 52pc
61
62
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63
%
64
% Generic double column output.
65
%
66
% Modified from a routine written by Donald Knuth (The TeXBook, App. E)
67
%
68
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69
%
70
% The user may modify the following to his tastes:
71
%
72
% \pagewidth vertical length of page.
73
% \pageheight horizontal width of page.
74
% \colwidth column width
75
% \separator macro to generate column separator. Default is nothing.
76
% \rulesep sets it to \vrule. \norulesep doesn't.
77
% \makepage default is what is contained in plain.
78
\catcode`@=11 % from plain.tex
79
% Create and initialize new dimensions.
80
\newdimen\pagewidth \newdimen\pageheight \newdimen\colwidth
81
\pagewidth=\hsize \pageheight=\vsize \colwidth=3.2truein
82
83
\def\draft{\hsize 42pc\vsize 63pc\pagewidth=\hsize \pageheight=\vsize}
84
85
\def\pif{\char39}
86
87
% This routine is used by \output ; this is different from
88
% the one found in App. E.
89
\def\onepageout#1{{\setbox255=\vbox{#1}
90
\hsize=\pagewidth \vsize=\pageheight \plainoutput}}
91
\def\normaloutput{\onepageout{\unvbox255}}
92
\maxdeadcycles=100 % \output is called quite often
93
94
\output={\normaloutput}
95
\newbox\partialpage \newdimen\origvsize \newif\ifrigid
96
\def\begindoublecolumns{\global\origvsize=\vsize \begingroup
97
\output={\global\setbox\partialpage=\vbox{\unvbox255\kern0pt}}\eject
98
\output={\doublecolumnout} \hsize=\colwidth \dimen@=\pageheight
99
\advance\dimen@ by-\ht\partialpage \multiply\dimen@ by2
100
\ifdim\dimen@<2\baselineskip \dimen@=2\baselineskip\fi
101
\vsize=\dimen@}
102
\def\enddoublecolumns{\output={\balancecolumns}\eject
103
\endgroup \global\vsize=\origvsize \pagegoal=\vsize}
104
\def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
105
\setbox0=\vsplit255 to.5\vsize \setbox2=\vsplit255 to.5\vsize
106
%\setbox0=\vbox{A\unvbox0B\vfill}\setbox2=\vbox{C\unvbox2D\vfill}%
107
\onepageout\pagesofar \global\vsize=2\pageheight
108
\unvbox255 \penalty\outputpenalty}
109
\def\pagesofar{\unvbox\partialpage
110
\wd0=\hsize \wd2=\hsize
111
%\hbox to\pagewidth{\box0\hfil\separator\hfil\box2}}
112
\hbox to\pagewidth{\valign{##\vfill\cr%
113
\vbox{\unvbox0}\cr\noalign{\hfil\separator\hfil}\vbox{\unvbox2}\cr}}}
114
\def\norulesep{\let\separator=\relax}
115
\def\rulesep{\let\separator=\vrule}
116
\let\separator=\relax
117
\def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0
118
\advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
119
\divide\dimen@ by2 \splittopskip=\topskip
120
{\vbadness=10000 \loop \global\setbox3=\copy0
121
\global\setbox1=\vsplit3 to\dimen@
122
\ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
123
\ifrigid
124
\setbox0=\vtop{\unvbox1}
125
\setbox2=\vtop{\unvbox3}
126
\else
127
\setbox0=\vbox to\dimen@{\unvbox1}
128
\setbox2=\vbox to\dimen@{\dimen2=\dp3 \unvbox3\kern-\dimen2 \vfil}
129
\fi
130
\global\vsize=\origvsize \pagesofar}
131
\catcode`@=12
132
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133
134
\colwidth 19pc
135
\newdimen\manindent \manindent 3pc
136
\newdimen\smallmanindent \smallmanindent 1pc
137
\parskip 1ex plus 0.5ex minus 0.5ex
138
\parindent 0pt
139
140
% Additional fonts.
141
\font\inchhigh=cminch
142
\font\titlefont=cmssdc10 at 40pt
143
\font\secfont=cmssdc10 at 14pt
144
\font\sf=cmss10
145
\font\bsf=cmssdc10
146
\font\smallrom=cmr8
147
\font\sevenit=cmti10 at 7pt \scriptfont\itfam=\sevenit
148
\font\fiveit=cmti10 at 5pt \scriptscriptfont\itfam=\fiveit
149
150
% If you don't have `msb' fonts, replace the next 4 lines by `\let\Bbb=\bf'.
151
\newfam\msbfam \def\Bbb{\fam\msbfam}
152
\font\tenmsb=msbm10 \textfont\msbfam=\tenmsb
153
\font\sevenmsb=msbm7 \scriptfont\msbfam=\sevenmsb
154
\font\fivemsb=msbm5 \scriptscriptfont\msbfam=\fivemsb
155
\font\sevenmsa=msam7
156
157
% the dark triangle
158
\def\darktriangleright{\raise.4ex\hbox{\sevenmsa\char"49}}
159
160
% Math mode should use text italic.
161
{\count0=\itfam \advance\count0 by-1 \multiply\count0 by"100
162
\count1=`A
163
\loop \count2=\mathcode\count1 \advance\count2 by\count0
164
\global\mathcode\count1=\count2
165
{\advance\count1 by'040
166
\count2=\mathcode\count1 \advance\count2 by\count0
167
\global\mathcode\count1=\count2}
168
\ifnum\count1<`Z \advance\count1 by1\repeat}
169
170
% macros for verbatim scanning (almost copied from `The TeXbook')
171
\chardef\other=12
172
\def\undocatcodespecials{\catcode`\\=\other \catcode`\{=\other
173
\catcode`\}=\other \catcode`\<=\other \catcode`\$=\other
174
\catcode`\%=\other \catcode`\~=\other \catcode`\^=\other
175
\catcode`\_=\other \catcode`\*=\other \catcode`\`=\other
176
\catcode`\!=\other \catcode`\"=\other \catcode`\&=\other
177
\catcode`\#=\other \catcode`\|=\other}
178
\def\ttindent{5mm} % indentation amount of verbatim examples
179
{\obeyspaces\global\let =\ }
180
{\obeylines\gdef\obeylines{\catcode`^^M=\active}\gdef^^M{\par}%
181
\catcode`#=\active \catcode`&=6 \gdef#{\char35}%
182
%\catcode`#=\active \catcode`&=6 \gdef#&1^^M{\hbox{\char35 &1}^^M}%
183
\gdef\ttverbatim{\begingroup\undocatcodespecials \catcode`\#=\active%
184
\parindent 0pt \def\_^^M{\allowbreak}\def\${$}\def\`{`}%
185
\def\par{\ifvmode\allowbreak\vskip 1pc plus 1pt\else\endgraf\penalty100\relax\fi}%
186
\obeyspaces \obeylines \tt}}
187
\outer\def\begintt{\par
188
\begingroup\advance\leftskip by \ttindent
189
\ttverbatim \parskip=0pt \catcode`\|=0 \rightskip-5pc \ttfinish}
190
{\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
191
|obeylines % end of line is active
192
|gdef||{|char124} %
193
|gdef|ttfinish#1^^M#2\endtt{#1|medskip{#2}|endgroup %
194
|endgroup%
195
|vskip-|parskip|medskip|noindent|ignorespaces}}
196
\outer\def\beginexample{\par
197
\begingroup\advance\leftskip by \ttindent
198
\ttverbatim \parskip=0pt \catcode`\|=0 \rightskip-5pc \examplefinish}
199
{\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
200
|obeylines % end of line is active
201
|gdef||{|char124} %
202
|gdef|examplefinish#1^^M#2\endexample{#1|medskip{#2}|endgroup %
203
|endgroup%
204
|vskip-|parskip|medskip|noindent|ignorespaces}}
205
206
% Input/output streams. Chapter and section counters.
207
\newwrite\labelout \newwrite\indexout \newwrite\secindout
208
\newwrite\tocout \newwrite\citeout \newwrite\ans
209
\newread \labelin \newread \indexin \newread \tocin \newread \citein
210
\countdef\chapno=1 \newcount\secno \newcount\subsecno \newcount\exno
211
\def\chapterno{{\edef\tempa{\thechapter}\tempa}}
212
%\def\folio{\ifnum\pageno<0 \romannumeral-\pageno \else
213
% \chapterno\ifx\thechapter\emptychapter\else--\fi \number\pageno\fi}
214
%\def\doindex#1#2#3{\write\indexout{\noexpand\indexentry{#1#2#3}%
215
% {\ifnum\pageno<0 \romannumeral-\pageno \else
216
% \thechapter\ifx\thechapter\emptychapter\else--\fi \number\pageno\fi}}%
217
% \ifvmode\nobreak\fi}
218
219
%AH
220
\def\folio{\ifnum\pageno<0 \romannumeral-\pageno \else
221
\number\pageno\fi}
222
\def\doindex#1#2#3{\write\indexout{\noexpand\indexentry{#1#2#3}%
223
{\ifnum\pageno<0 \romannumeral-\pageno \else
224
\number\pageno\fi}}%
225
\ifvmode\nobreak\fi}
226
227
% Additional active characters and their default meanings.
228
\mathcode`.="2201 \mathchardef\.="702E
229
\def\undoquotes{\catcode`'=12 \catcode``=12 \def\"##1{{\accent127 ##1}}}
230
\def\excl{!} \chardef\lqq=`\\ \let\underscore=\_
231
\catcode`!=\active \let!=\excl
232
\catcode`^=\active \def^{\ifmmode\sp\else{\char`\^}\fi}
233
\catcode`_=\active \def_{\ifmmode\sb\else\_\fi} \let\_=\underscore
234
\catcode`*=\active \def*{\ifmmode\let\next=\*\else\let\next=\bold\fi\next}
235
\def\bold#1*{{\bf #1\/}} \chardef\*=`*
236
\catcode`<=\active \def<#1>{{\chardef*=`*\let_=\_\it#1\/}}
237
\chardef\<=`<
238
\catcode`"=\active \def"{\begingroup\undoquotes\doref} \chardef\"=`"
239
\chardef\\=`\\
240
241
% Labels (which are automatically generated by ``\Section'' and ``\>'').
242
\newif\iflabundef
243
\def\doref#1"{\bookref#1:"}
244
\def\bookref#1:#2"{\def\tempa{#2}\ifx\tempa\empty\printref{\book:#1}\else
245
\printbookref#1:#2"\fi}
246
\def\printbookref#1:#2:"{\printref{#1:#2}}
247
248
249
{\catcode`@=11%
250
%
251
\gdef\makelabel#1#2{\expandafter\gdef\csname r@#1\endcsname{#2}}
252
\gdef\printref#1{%
253
\let\next=\relax%
254
\expandafter\edef\next{\def\noexpand\xpandlowr{#1}}%
255
\lowercase\expandafter{\next}%
256
\expandafter\ifx\csname r@\xpandlowr\endcsname\relax\lqq\xpandlowr''%
257
\immediate\write16{Label `#1' undefined.}\global\labundeftrue%
258
\else \csname r@\xpandlowr\endcsname \fi\endgroup}
259
}
260
261
% Macros for generating the table of contents.
262
\newif\iffirstsec \firstsectrue
263
\def\dotsfill{\leaders\hbox to12pt{\hss.\hss}\hfill}
264
265
\def\appcontents#1#2#3{}
266
267
\def\chapcontents#1#2#3{%
268
%\iffirstsec\firstsecfalse\else\line{}\fi% empty line
269
\par\penalty-5\medskip
270
\line{\bf\kern\manindent\vbox{\advance\hsize by-\manindent
271
\advance\hsize by-1.5em
272
\rightskip 0pt plus1fil \emergencystretch 3em
273
\noindent\llap{\hbox to\manindent{\hss #1\kern\smallmanindent}}\strut
274
#2~\hfill \strut\rlap{\hbox to1.5em{\hss #3}}}\hfil}}
275
276
\def\seccontents#1#2#3{
277
\line{\kern\manindent\vbox{\advance\hsize by-\manindent
278
\advance\hsize by-1.5em
279
\rightskip 0pt plus1fil \emergencystretch 3em
280
\noindent\llap{\hbox to\manindent{\hss #1\kern\smallmanindent}}\strut
281
#2~\dotsfill \strut\rlap{\hbox to1.5em{\hss #3}}}\hfil}}
282
283
\def\appno#1{{\count0=#1\advance\count0 by64 \char\count0}}
284
285
% Macros which write labels, citations and index entries on auxiliary files.
286
\newif\iflabchanged
287
{\catcode`|=0 \catcode`\\=12 |gdef|bs{\}}
288
{\catcode`@=11
289
\gdef\label#1{{\catcode`_=11\def_{X}
290
{\let\next=\relax
291
\expandafter\edef\next{\def\noexpand\xpandlowr{#1}}
292
\lowercase\expandafter{\next}
293
\ifnum\secno=0 \edef\next{\the\chapno}\else
294
\ifnum\subsecno=0 \edef\next{\the\chapno.\the\secno}\else
295
\edef\next{\the\chapno.\the\secno.\the\subsecno}\fi
296
\expandafter\ifx\csname r@\book:\xpandlowr\endcsname\next\else
297
%\immediate\write16{Label `\book:#1' has changed.}
298
\global\labchangedtrue\fi\fi
299
\immediate\write\labelout{\noexpand\makelabel{\book:\xpandlowr}{\next}}}}}
300
301
302
\gdef\sigel#1{[\expandafter\ifx\csname c@#1\endcsname\relax
303
\immediate\write16{Reference `#1' undefined.}\global\labundeftrue
304
#1\else \csname c@#1\endcsname\fi]}
305
\gdef\bibitem[#1]#2{\expandafter\gdef\csname c@#2\endcsname{#1}%
306
\item{\sigel{#2}}}}
307
\def\cite#1{\write\citeout{\bs citation{#1}}\sigel{#1}}
308
\def\dosecindex#1#2#3{\ifx\thechapter\normalchapter{\let\ =\space
309
\immediate\write\secindout{#1 \thechapter.\the\secno. #2#3}}\fi}
310
\def\bothindex#1#2#3#4{\doindex{#2}{#3}{#4}\dosecindex{#1}{#2}{#4}}
311
\def\index#1{\bothindex I{#1}{}{}}
312
\def\atindex#1#2{\bothindex I{#1}{#2}{}}
313
\def\indextt#1{\atindex{#1}{@`#1'}}
314
\def\indexit#1{{\it #1}}
315
316
% Macros for chapter and section headings.
317
\def\filename{appendix}
318
\def\tocstrut{{\setbox0=\hbox{1}\vrule width 0pt height\ht0}}
319
\outer\def\Input#1{\def\filename{#1.tex}\input #1}
320
\def\emptychapter{\noexpand\tocstrut}
321
\def\normalchapter{\the\chapno}
322
323
\def\Chapter#1 \par{\vfill\supereject \headlinefalse
324
% \ifodd\pageno\else\null\vfill\eject\headlinefalse\fi
325
\advance\chapno by1 \secno=0\subsecno=0\exno=0%\ifnum\pageno>0 \pageno=1 \fi
326
\def\chapname{#1} \label{#1}
327
\write\tocout{\noexpand\chapcontents{\thechapter}{#1}{\the\pageno}}
328
\ifx\thechapter\normalchapter
329
\immediate\write\secindout{C \filename\space\thechapter. \chapname}
330
\fi
331
\setbox0=\hbox{\inchhigh\kern-.075em \chapterno}
332
\setbox1=\vbox{\titlefont \advance\hsize by-\wd0 \advance\hsize by-1em
333
% \hyphenpenalty=10000 \linepenalty=10000
334
\leftskip 0pt plus\hsize \parfillskip 0pt \baselineskip 44pt\relax #1}
335
\line{\box0\hfil\box1}\nobreak \vskip 40pt}
336
337
% start hack added by TB
338
\def\PreliminaryChapter#1 \par{\vfill\supereject \headlinefalse
339
% \ifodd\pageno\else\null\vfill\eject\headlinefalse\fi
340
\advance\chapno by1 \secno=0\subsecno=0\exno=0%\ifnum\pageno>0 \pageno=1 \fi
341
\def\chapname{#1 (preliminary)} \label{#1}
342
\write\tocout{\noexpand\chapcontents{\thechapter}{#1 (preliminary)}{\the\pageno}}
343
\ifx\thechapter\normalchapter
344
\immediate\write\secindout{C \filename\space\thechapter. \chapname}\fi
345
\setbox0=\hbox{\inchhigh\kern-.075em \chapterno}
346
\setbox1=\vbox{\titlefont \advance\hsize by-\wd0 \advance\hsize by-1em
347
% \hyphenpenalty=10000 \linepenalty=10000
348
\leftskip 0pt plus\hsize \parfillskip 0pt \baselineskip 44pt\relax #1 (preliminary)}
349
\line{\box0\hfil\box1}\nobreak \vskip 40pt}
350
% end hack added by TB
351
352
\outer\def\Section#1#2\par{\bigbreak \advance\secno by1
353
\subsecno=0
354
\ifx\thechapter\emptychapter
355
\edef\tempa{\the\secno}
356
\else
357
\edef\tempa{\thechapter.\the\secno}%
358
\fi%
359
\expandafter\writesecline\tempa\\{#1}
360
\dosecindex S{#1}{}{\let\ =\space\label{#1}}
361
\ifx#2\null\else \edef\tempb{{#1@#1}}
362
\expandafter\doindex\tempb{|indexit}{}\fi
363
\noindent{\baselineskip 18pt\let!=\space \mark{Section \the\secno. #1}%
364
\secfont \tempa \enspace #1}\par\nobreak\medskip}
365
366
\def\writesecline#1\\#2{\write\tocout{\noexpand\seccontents{#1}{#2}
367
{\the\pageno}}}
368
\def\letter#1{\medskip{\secfont #1}\endgraf\nobreak}
369
370
% Macros for generating paragraph headings (e.g., function descriptions).
371
\def\fmark{\noindent\llap{\darktriangleright\rm\enspace}}
372
\def\moveup#1{\leavevmode \raise.16ex\hbox{\rm #1}}
373
\def\fpar{\endgraf\endgroup\nobreak\smallskip\noindent\ignorespaces}
374
\def\>{\begingroup\undoquotes\obeylines\angle}
375
\def\){\begingroup\obeylines\cloparen}
376
{\obeylines
377
\gdef\angle#1
378
{\endgroup \ifx\par\fpar \global\def\susemarker{\fmark}\else%
379
\global\advance\subsecno by1%
380
\global\def\susemarker{\noindent\llap{\smallrom\the\subsecno\kern.5ex%
381
\darktriangleright\rm\enspace}}%
382
\ifvmode \vskip -\lastskip \fi \medskip%
383
\begingroup\let\par=\fpar \parskip 0pt \fi%
384
\endgraf\nobreak\oporfunc#1\end}%
385
\gdef\cloparen#1
386
{\endgroup \ifx\par\fpar \else%
387
\ifvmode \vskip -\lastskip \fi \medskip%
388
\begingroup\let\par=\fpar \parskip 0pt \fi%
389
\endgraf{\def\[{\moveup\lbrack}\def\]{\moveup\rbrack}\def\|{\vrule\relax}%
390
\noindent\typewriter#1'}}%
391
\gdef\scanparen#1(#2\end{\def\tempa{#2}\ifx\tempa\empty%
392
\def\next{\begingroup\cloparen\susemarker#1
393
\label{#1}\bothindex F{#1}{@`#1'}{}}%
394
\else\def\next{\delparen#1(#2\end}\fi \next}}
395
\def\delparen#1(\end{\function#1}
396
\def\oporfunc#1#2\end{\ifx#1`\def\next{\operation#1#2}\else
397
\def\next{\scanparen#1#2(\end}\fi \next}
398
\long\def\operation`#1'#2#3{{\def\[{\moveup\lbrack}\def\]{\moveup\rbrack}%
399
\def\|{\vrule\relax}}
400
\susemarker\typewriter#1'%
401
\ifx#3!\def\next{\suboperation{#2}}
402
\else\ifx#3@\def\next{\subatoperation{#2}}
403
\else\endheaderline \label{#2}%
404
\bothindex F{#2}{}{}\let\next=#3\fi\fi\next}
405
\long\def\function#1(#2)#3{{\def\[{\moveup\lbrack}\def\]{\moveup\rbrack}%
406
\def\|{\vrule\relax}
407
\susemarker\typewriter#1(#2)'}%
408
\ifx#3!\def\next{\subfunction{#1}}\else
409
\endheaderline\label{#1}\bothindex F{#1}{@`#1'}{}%
410
\let\next=#3\fi\next}
411
\def\subfunction#1#2{\endheaderline\label{#1!#2}%
412
\bothindex F{#1}{@`#1'}{!#2}}
413
\def\suboperation#1#2{\endheaderline\label{#1!#2}%
414
\bothindex F{#1}{}{!#2}}
415
\def\subatoperation#1#2{\endheaderline\label{#1}%
416
\bothindex F{#1}{@#2}{}}
417
418
\def\endheaderline{\hskip 0pt plus 1filll}
419
420
% Macro for item lists.
421
\catcode`&=\active
422
\def\beginitems{%
423
\smallskip
424
\begingroup
425
\def&{\par \nobreak \hangindent\manindent \hangafter 0
426
{\parskip 0pt\noindent}\ignorespaces}
427
\parindent 0pt
428
\catcode`&=\active
429
}
430
\def\enditems{\par \endgroup \smallskip \noindent \ignorespaces}
431
432
% Macro for item lists.
433
\def\beginlist{%
434
\smallskip
435
\begingroup
436
\parindent=2em
437
}
438
\def\endlist{\par \endgroup \smallskip \noindent \ignorespaces}
439
\catcode`&=4
440
441
% Macros for exercises.
442
\outer\def\exercise{\advance\exno by1\begingroup
443
\def\par{\endgraf\endgroup\medskip\noindent}
444
\medskip\noindent{\bf Exercise \chapterno.\the\exno.}\quad}
445
\outer\def\answer{\immediate\write\ans{}%
446
\immediate\write\ans{\noexpand\answerto{\thechapter.\the\exno.}}%
447
\copytoblankline}
448
\def\answerto#1{{\noindent\bf #1}}
449
\def\copytoblankline{\begingroup\setupcopy\copyans}
450
{\undoquotes
451
\gdef\setupcopy{\undocatcodespecials \obeylines \obeyspaces}
452
\obeylines \gdef\copyans#1
453
{\def\next{#1}%
454
\ifx\next\empty\let\next=\endgroup %
455
\else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
456
457
% Macros for the active backquote character (`).
458
{\catcode`.=\active \gdef.{\char'056 \penalty0}}
459
\def\writetyper{\catcode`.=\active \chardef\{ =`{ \chardef\}=`}
460
\chardef*=`* \chardef"=`" \chardef~=`~}
461
\catcode``=\active
462
\def`{\futurelet\next\backquote}
463
\def\typewriter#1'{\leavevmode{\writetyper \chardef`=96 \tt #1}}
464
\def\backquote{\ifx\next`\let\next=\doublebackquote
465
\else\let\next=\typewriter \fi \next}
466
\def\doublebackquote`{\lqq}
467
468
% Miscellaneous macros.
469
\def\GAP{{\sf GAP}}
470
\def\MOC{{\sf MOC}}
471
\def\ATLAS{{\sf ATLAS}}
472
\def\N{{\Bbb N}} \def\Z{{\Bbb Z}} \def\Q{{\Bbb Q}} \def\R{{\Bbb R}}
473
\def\C{{\Bbb C}} \def\F{{\Bbb F}}
474
475
%T do we want these
476
%\def\stars{\bigskip\centerline{\*\qquad\*\qquad\*}\bigskip}
477
478
% Page numbers and running heads.
479
\newif\ifheadline
480
\nopagenumbers
481
\def\makeheadline{\vbox to0pt{\vskip-22.5pt\hbox to\pagewidth{\vbox to8.5pt
482
{}\the\headline}\vss}\nointerlineskip}
483
\headline={\ifheadline\ifodd\pageno \righthead\hfil{\rm\folio}\else
484
{\rm\folio}\hfil\lefthead \fi
485
\else\global\headlinetrue \hfil\fi}
486
487
% Macro for inputting an auxiliary file.
488
\def\inputaux#1#2#3{\immediate\openin#1=#2\jobname.#3
489
\ifeof#1\immediate\write16{No file #2\jobname.#3.}\else
490
\immediate\closein#1 \input#2\jobname.#3 \fi}
491
492
% Macros for the parts of the manual.
493
\outer\def\FrontMatter{%
494
\let\thechapter=\emptychapter
495
\def\lefthead{\it\chapname} \let\righthead=\lefthead
496
497
\begingroup
498
\undoquotes
499
\inputaux\labelin{}{lab}
500
\setbox0=\vbox{\Bibliography}
501
\endgroup
502
\labchangedfalse
503
504
% Open the auxiliary files for output.
505
\immediate\openout\tocout =\jobname.toc
506
\immediate\openout\labelout =\jobname.lab
507
\immediate\openout\indexout =\jobname.idx
508
\immediate\openout\secindout=\jobname.six
509
\immediate\openout\citeout =\jobname.aux
510
% \immediate\openout\ans=answers
511
\immediate\write\citeout{\bs bibstyle{alpha}}
512
513
\ifodd\pageno\else\headlinefalse\null\vfill\eject\fi
514
% \pageno=1
515
}
516
517
\outer\def\Chapters{\vfill\eject
518
\chapno=0 \let\thechapter=\normalchapter
519
\def\lefthead{{\it Chapter \the\chapno. \chapname}}
520
\def\righthead{\ifx\botmark\empty\lefthead\else{\it \botmark}\fi}}
521
522
\outer\def\Appendices{\vfill\eject
523
\def\filename{appendix}
524
\chapno=0 \def\thechapter{}% was: {\noexpand\appno{\the\chapno}}
525
%\def\lefthead{{\it Appendix \appno{\the\chapno}. \chapname}}
526
\def\lefthead{{\it \chapname}}
527
\let\righthead=\lefthead}
528
529
530
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
531
%%
532
%F \BeginningOfBook . . . . . . . . . . . . . . . . . . . . start the book
533
%%
534
\def\BeginningOfBook#1{%
535
\def\book{#1}%
536
\pageno=-1%
537
\pageno=1%
538
\headlinefalse%
539
\let\thechapter=\emptychapter%
540
\def\lefthead{\it\chapname}%
541
\let\righthead=\lefthead%
542
}
543
%
544
%
545
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
546
%%
547
%F \UseReferences{<book-path>} . . . use references from book in <book-path>
548
%%
549
\def\UseReferences#1{{\undoquotes
550
\inputaux\labelin{#1/}{lab}}
551
}
552
%
553
%
554
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
555
%%
556
%F \EndOfBook . . . . . . . . . . . . . . . . . . . . . . . . end the book
557
%%
558
\def\EndOfBook{\vfill\supereject
559
\immediate\write16{##}
560
\immediate\closeout\citeout
561
\immediate\write16{## Citations for BibTeX written on \jobname.aux.}
562
\immediate\closeout\indexout
563
\immediate\write16{## Index entries for makeindex written on \jobname.idx.}
564
\immediate\closeout\secindout
565
\immediate\write16{## Section index entries written on \jobname.six.}
566
\immediate\closeout\labelout
567
\immediate\write16{## Label definitions written on \jobname.lab.}
568
\immediate\closeout\tocout
569
\immediate\write16{## Table of contents written on \jobname.toc.}
570
\iflabundef\immediate\write16{## There were undefined labels or
571
references.}\fi
572
\iflabchanged\immediate\write16{## Labels have changed, run again. (Or
573
they were multiply defined.)}\fi
574
\immediate\write16{##}
575
\end
576
}
577
%
578
%
579
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
580
%%
581
%F \TableOfContents . . . . . . . . . . . . . . produce a table of contents
582
%%
583
% name of the chapter containing the table of contents
584
\def\TOCHeader{Contents}
585
586
% explanation at the beginning of the table of contents
587
\def\TOCMatter{%
588
}
589
590
% macros for generating the table of contents
591
%\newif\iffirstsec\firstsectrue
592
\def\dotsfill{\leaders\hbox to12pt{\hss.\hss}\hfill}
593
594
% produce the chapter "Contents"
595
\outer\def\TableOfContents{\Chapter{\TOCHeader}
596
597
\TOCMatter
598
\vskip 20pt
599
\begingroup
600
\rigidfalse
601
\let!=\space
602
%\begindoublecolumns
603
\inputaux\tocin{}{toc}\vfill\eject
604
%\enddoublecolumns
605
\endgroup
606
}
607
608
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
609
%%
610
%F \TitlePage{<text>} . . . . . . . . . . . . . . . . generate a title page
611
%%
612
\long\def\TitlePage#1{%
613
\null\vfill#1\null\vfill\eject
614
}
615
616
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
617
%%
618
%F \Colophon{<text>} . . . . . . . . . . . . . . generate a colophon page
619
%%
620
\long\def\Colophon#1{\Chapter{}
621
622
#1\null\vfill\eject
623
}
624
625
626
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
627
%%
628
%F \Answers . . . . . . . . . . . . . produce the answers to the exercises
629
%%
630
% header for the answers
631
\def\AnswersHeader{Answers to the Exercises}
632
%
633
% produce the chapter "Answers"
634
\def\Answers{\Chapter{\AnswersHeader}
635
636
\parindent\manindent
637
\parskip 1ex plus 0.5ex minus 0.5ex
638
\immediate\closeout\ans
639
\input answers
640
}
641
642
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
643
%%
644
%F \Bibliography . . . . . . . . . . . . produce the chapter "Bibliography"
645
%%
646
% header for the bibliography
647
\def\BibHeader{Bibliography}
648
649
% produce the chapter bibliography
650
\def\Bibliography{\Chapter{\BibHeader}
651
652
\begingroup\undoquotes\frenchspacing
653
\parindent\manindent
654
\parskip 1ex plus 0.5ex minus 0.5ex
655
\def\begin##1##2{} \def\end##1{}
656
\let\newblock=\relax \let\em=\sl
657
\inputaux\citein{}{bbl}
658
\endgroup
659
}
660
661
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
662
%%
663
%F \Index . . . . . . . . . . . . . . . . . . produce the chapter "Index"
664
%%
665
% header for the index
666
\def\IndexHeader{Index}
667
668
% explanation at the beginning of the index
669
\def\IndexMatter{%
670
This index covers only this manual.
671
A page number in {\it italics} refers to a whole section which is devoted to
672
the indexed subject. Keywords are sorted with case and spaces ignored,
673
e.g., ```PermutationCharacter''' comes before ``permutation group''.%
674
}
675
676
% kerning in full index after letter
677
\def\idxkern{\kern.3em}
678
679
% produce the chapter index
680
\def\Index{\Chapter{\IndexHeader}
681
682
\IndexMatter
683
\bigskip
684
\begindoublecolumns
685
\parindent 0pt \parskip 0pt \rightskip 0pt plus2em \emergencystretch 2em
686
\everypar{\hangindent\smallmanindent}
687
\def\par{\endgraf\leftskip 0pt}
688
\def\sub{\advance\leftskip by\smallmanindent}
689
\def\subsub{\advance\leftskip by2\smallmanindent}
690
\obeylines
691
\inputaux\indexin{}{ind}
692
\enddoublecolumns
693
}
694
695
% pseudo chapters used for authors, preface, copyright &c.
696
\def\PseudoInput#1#2{%
697
\advance\chapno by1\secno=0\subsecno=0
698
\immediate\write\secindout{C #1.tex \thechapter. #2}}
699
700
% some often-used LaTeX functions
701
\def\frac#1#2{{{#1}\over{#2}}}
702
\def\etalchar#1{$^{#1}$}
703
704
% nasty trick to cope with the `newcommand' created by bibtex
705
\def\newcommand#1#2#3#4#5{}
706
707
% ragged bottom will avoid large blank spaces
708
\raggedbottom
709
\frenchspacing
710
\vfuzz=2pt
711
712