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

612133 views
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
%%
3
%% This file was modified by Marc Roeder ([email protected])
4
%% The \printref command now prints a label like pkgname:labelname
5
%% just as the online manual and the html manual do.
6
%%
7
%% This choice was made to have clickable function names in the html
8
%% version of the documentation of RDS.
9
%%
10
%% Galway, 7th January 2008.
11
%%
12
13
14
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
%%
16
%A gapmacro.tex GAP manual Frank Celler
17
%A Heiko Theissen
18
%A Alexander Hulpke
19
%%
20
%% @(#)$Id: gapmacro.tex,v 4.64.4.1 2005/08/26 08:59:57 gap Exp $
21
%%
22
%% DO NOT RELY ON MACRO DEFINITIONS IN THIS FILE!
23
%% The official definition of the manual style is to be found in the file
24
%% `ext:document.tex'.
25
%%
26
%% The following macros are defined in this file.
27
%%
28
%% `text' set text in typewriter style (use `\<' instead of `<')
29
%% <text> set text in italics (use $\<$ instead of $<$ for less than)
30
%% *text* set text in emphasized style (i.e. slanted)
31
%% $a.b$ same as $a \cdot b$ (use $\.$ instead of $.$ for full stop)
32
%% "ref" refer to a label (like "function!for category")
33
%% \pif sets a single '
34
%% \cite{.} make a citation
35
%% \index{.} \indextt{.} make index entry (\indextt in typewriter style)
36
%%
37
%% \beginitems produce itemized texts with 3pc hanging indentation
38
%% item & text
39
%%
40
%% item & text ...
41
%% \enditems
42
%%
43
%% \begintt verbatim text in typewriter style
44
%% verbatim material
45
%% \endtt
46
%% \beginexample verbatim text in typewriter style
47
%% verbatim material
48
%% \endexample
49
%%
50
%% \Input{file} includes file `file.tex'
51
%% \Chapter{title} followed by a blank line
52
%% \Section{title} followed by a blank line
53
%% make chapter or section title. Automatically generates table of
54
%% contents. \null after \Section{...} inhibits indexing.
55
%% \>function( arguments )!{ index subentry }
56
%% \>`a binop b'{binary operation}!{ index subentry }
57
%% make a heading for a subsection explaining a function or a binary
58
%% operation. This automatically generates a label and an index entry
59
%% (with optional subentry).
60
%% \){\fmark ...}
61
%% the same without label and index entry
62
%%
63
%% \URL{url}
64
%% \Mailto{}
65
%%
66
%% \BeginningOfBook
67
%% \FrontMatter, \Chapters, \Appendices, \EndMatter parts of the book
68
%% \Bibliography, \Index, \TableOfContents make these chapters (w/o head)
69
%% \EndOfBook
70
%%
71
72
\input amssym.tex
73
74
% Page dimensions and double column output.
75
\hsize 39pc
76
\vsize 52pc
77
78
% do we run pdftex?
79
\expandafter\ifx\csname pdfdest\endcsname\relax
80
\immediate\write16{Running TeX}
81
% no: define dummy bookmarking functions
82
\global\def\bookmarkdestin#1{}
83
\global\def\setbookmarkind#1#2{}
84
\global\def\setbookmark#1#2{}
85
\global\def\indexbookmark#1#2{}
86
\else
87
\immediate\write16{Running PDFTeX}
88
% yes: define macros to do pdf stuff and set some parameters
89
\global\def\bookmarkdestin#1{\pdfdest name {#1} xyz}
90
\global\def\setbookmarkind#1#2{%
91
\setindent{\chapterlen{\the\chapno}}
92
\pdfoutline goto name {#1} count -\indentno {#2}}
93
\global\def\setbookmark#1#2{%
94
\setindent{\chapterlen{\the\chapno}}
95
\pdfoutline goto name {#1} count 0 {#2}}
96
% special treatment for the index to get proper indention
97
\global\def\indexbookmark#1#2{%
98
\pdfoutline goto name {#1} count -27 {#2}}
99
\pdfinfo{
100
/Subject (GAP Manual)
101
/Author (The GAP Group)
102
}
103
\pdfcatalog{
104
/URI (http://www.gap-system.org)
105
/PageMode /UseOutlines}
106
\pdfcompresslevel 9
107
\fi
108
109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110
%
111
% Generic double column output.
112
%
113
% Modified from a routine written by Donald Knuth (The TeXBook, App. E)
114
%
115
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116
%
117
% The user may modify the following to his tastes:
118
%
119
% \pagewidth vertical length of page.
120
% \pageheight horizontal width of page.
121
% \colwidth column width
122
% \separator macro to generate column separator. Default is nothing.
123
% \rulesep sets it to \vrule. \norulesep doesn't.
124
% \makepage default is what is contained in plain.
125
\catcode`@=11 % from plain.tex
126
% Create and initialize new dimensions.
127
\newdimen\pagewidth \newdimen\pageheight \newdimen\colwidth
128
\pagewidth=\hsize \pageheight=\vsize \colwidth=3.2truein
129
130
\def\draft{\hsize 42pc\vsize 63pc\pagewidth=\hsize \pageheight=\vsize}
131
132
\def\pif{\char39}
133
134
% This routine is used by \output ; this is different from
135
% the one found in App. E.
136
\def\onepageout#1{{\setbox255=\vbox{#1}
137
\hsize=\pagewidth \vsize=\pageheight \plainoutput}}
138
\def\normaloutput{\onepageout{\unvbox255}}
139
\maxdeadcycles=100 % \output is called quite often
140
141
\output={\normaloutput}
142
\newbox\partialpage \newdimen\origvsize \newif\ifrigid
143
\def\begindoublecolumns{\global\origvsize=\vsize \begingroup
144
\output={\global\setbox\partialpage=\vbox{\unvbox255\kern0pt}}\eject
145
\output={\doublecolumnout} \hsize=\colwidth \dimen@=\pageheight
146
\advance\dimen@ by-\ht\partialpage \multiply\dimen@ by2
147
\ifdim\dimen@<2\baselineskip \dimen@=2\baselineskip\fi
148
\vsize=\dimen@}
149
\def\enddoublecolumns{\output={\balancecolumns}\eject
150
\endgroup \global\vsize=\origvsize \pagegoal=\vsize}
151
\def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
152
\setbox0=\vsplit255 to.46\vsize \setbox2=\vsplit255 to.46\vsize
153
%\setbox0=\vbox{A\unvbox0B\vfill}\setbox2=\vbox{C\unvbox2D\vfill}%
154
\onepageout\pagesofar \global\vsize=2\pageheight
155
\unvbox255 \penalty\outputpenalty}
156
\def\pagesofar{\unvbox\partialpage
157
\wd0=\hsize \wd2=\hsize
158
%\hbox to\pagewidth{\box0\hfil\separator\hfil\box2}}
159
\hbox to\pagewidth{\valign{##\vfill\cr%
160
\vbox{\unvbox0}\cr\noalign{\hfil\separator\hfil}\vbox{\unvbox2}\cr}}}
161
\def\norulesep{\let\separator=\relax}
162
\def\rulesep{\let\separator=\vrule}
163
\let\separator=\relax
164
\def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0
165
\advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
166
\divide\dimen@ by2 \splittopskip=\topskip
167
{\vbadness=10000 \loop \global\setbox3=\copy0
168
\global\setbox1=\vsplit3 to\dimen@
169
\ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
170
\ifrigid
171
\setbox0=\vtop{\unvbox1}
172
\setbox2=\vtop{\unvbox3}
173
\else
174
\setbox0=\vbox to\dimen@{\unvbox1}
175
\setbox2=\vbox to\dimen@{\dimen2=\dp3 \unvbox3\kern-\dimen2 \vfil}
176
\fi
177
\global\vsize=\origvsize \pagesofar}
178
\catcode`@=12
179
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180
181
\colwidth 19pc
182
\newdimen\manindent \manindent 3pc
183
\newdimen\smallmanindent \smallmanindent 1pc
184
\parskip 1ex plus 0.5ex minus 0.5ex
185
\parindent 0pt
186
187
% Additional fonts.
188
\font\inchhigh=cminch
189
\font\titlefont=cmssdc10 at 40pt
190
\font\subtitlefont=cmssdc10 at 24pt
191
\font\secfont=cmssdc10 at 14pt
192
\font\sf=cmss10
193
\font\bsf=cmssdc10
194
\font\smallrom=cmr8
195
\font\sevenit=cmti10 at 7pt \scriptfont\itfam=\sevenit
196
\font\fiveit=cmti10 at 5pt \scriptscriptfont\itfam=\fiveit
197
198
% If you don't have `msb' fonts, replace the next 4 lines by `\let\Bbb=\bf'.
199
\newfam\msbfam \def\Bbb{\fam\msbfam}
200
\font\tenmsb=msbm10 \textfont\msbfam=\tenmsb
201
\font\sevenmsb=msbm7 \scriptfont\msbfam=\sevenmsb
202
\font\fivemsb=msbm5 \scriptscriptfont\msbfam=\fivemsb
203
\font\sevenmsa=msam7
204
205
% the dark triangle
206
\def\darktriangleright{\raise.4ex\hbox{\sevenmsa\char"49}}
207
208
% Math mode should use text italic.
209
{\count0=\itfam \advance\count0 by-1 \multiply\count0 by"100
210
\count1=`A
211
\loop \count2=\mathcode\count1 \advance\count2 by\count0
212
\global\mathcode\count1=\count2
213
{\advance\count1 by'040
214
\count2=\mathcode\count1 \advance\count2 by\count0
215
\global\mathcode\count1=\count2}
216
\ifnum\count1<`Z \advance\count1 by1\repeat}
217
218
% macros for verbatim scanning (almost copied from `The TeXbook')
219
\chardef\other=12
220
\def\undocatcodespecials{\catcode`\\=\other \catcode`\{=\other
221
\catcode`\}=\other \catcode`\<=\other \catcode`\$=\other
222
\catcode`\%=\other \catcode`\~=\other \catcode`\^=\other
223
\catcode`\_=\other \catcode`\*=\other \catcode`\`=\other
224
\catcode`\!=\other \catcode`\"=\other \catcode`\&=\other
225
\catcode`\#=\other \catcode`\|=\other}
226
\def\ttindent{5mm} % indentation amount of verbatim examples
227
\def\kernttindent{\hskip\ttindent\relax} % for use in %\begintt
228
{\obeyspaces\global\let =\ }
229
{\obeylines\gdef\obeylines{\catcode`^^M=\active}\gdef^^M{\par}%
230
\catcode`#=\active \catcode`&=6 \gdef#{\char35}%
231
%\catcode`#=\active \catcode`&=6 \gdef#&1^^M{\hbox{\char35 &1}^^M}%
232
\gdef\ttverbatim{\begingroup\undocatcodespecials \catcode`\#=\active%
233
\parindent 0pt \def\_^^M{\allowbreak}\def\${$}\def\`{`}%
234
\def\par{\ifvmode\allowbreak\vskip 1pc plus 1pt\else\endgraf\penalty100\relax\fi}%
235
\obeyspaces \obeylines \tt}}
236
\outer\def\begintt{\par
237
\begingroup\advance\leftskip by \ttindent
238
\ttverbatim \parskip=0pt \catcode`\|=0 \rightskip-5pc \ttfinish}
239
{\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
240
|obeylines % end of line is active
241
|gdef||{|char124} %
242
|gdef|ttfinish#1^^M#2\endtt{#1|medskip{#2}|endgroup %
243
|endgroup%
244
|vskip-|parskip|medskip|noindent|ignorespaces}}
245
\def\unstableoutput{}
246
\outer\def\beginexample{\par
247
\begingroup\advance\leftskip by \ttindent
248
\ttverbatim \parskip=0pt \catcode`\|=0 \rightskip-5pc \examplefinish}
249
{\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
250
|obeylines % end of line is active
251
|gdef||{|char124} %
252
|gdef|examplefinish#1^^M#2\endexample{#1|medskip{#2}|endgroup %
253
|endgroup%
254
|vskip-|parskip|medskip|noindent|ignorespaces}}
255
256
% Input/output streams. Chapter and section counters.
257
\newwrite\labelout \newwrite\indexout \newwrite\secindout
258
\newwrite\tocout \newwrite\citeout \newwrite\ans
259
\newread \labelin \newread \indexin \newread \tocin \newread \citein
260
\countdef\chapno=1 \newcount\secno \newcount\subsecno \newcount\exno
261
\newcount\indentno
262
\newcount\chapnum %GG \chapnum is a numerical \chapno for the .six file
263
\def\chapterno{{\edef\tempa{\thechapter}\tempa}}
264
%\def\folio{\ifnum\pageno<0 \romannumeral-\pageno \else
265
% \chapterno\ifx\thechapter\emptychapter\else--\fi \number\pageno\fi}
266
%\def\doindex#1#2#3{\write\indexout{\noexpand\indexentry{#1#2#3}%
267
% {\ifnum\pageno<0 \romannumeral-\pageno \else
268
% \thechapter\ifx\thechapter\emptychapter\else--\fi \number\pageno\fi}}%
269
% \ifvmode\nobreak\fi}
270
271
%AH
272
\def\folio{\ifnum\pageno<0 \romannumeral-\pageno \else
273
\number\pageno\fi}
274
275
%\def\doindex#1#2#3{\protectedwrite\indexout{\noexpand\indexentry{#1#2#3}%
276
% {\ifnum\pageno<0\romannumeral-\pageno\else%
277
% \number\pageno\fi}}%
278
% \ifvmode\nobreak\else\unskip\fi}
279
{\catcode`@=11
280
\catcode`<=\active \catcode`_=\active \catcode`!=\active \catcode`*=\active
281
\catcode``=\active
282
283
\global\let\n@exp\noexpand
284
285
\gdef\doindex#1#2#3{\begingroup
286
%\let_\underscore\let`\lq\let<\<\let!\excl
287
\def\noexpand{}% this kills noexpands from some index entries
288
\def\protect{\n@exp\n@exp\n@exp}%
289
\def_{\protect_}\def*{\protect*}\def`{\protect `}\def<{\protect <}\def!{\protect!}%
290
\edef\tmp{\n@exp\n@exp\n@exp\indexentry{#1#2#3}}%
291
\expandafter\write\expandafter\indexout\expandafter{\tmp{\folio}}%
292
%{\scrollmode\errorcontextlines 1\show\tmp\errorstopmode}%
293
\ifvmode\nobreak\else\unskip\fi\endgroup}%
294
}
295
296
% Additional active characters and their default meanings.
297
\mathcode`.="2201 \mathchardef\.="702E
298
\def\undoquotes{\catcode`'=12 \catcode``=12 \def\"##1{{\accent127 ##1}}}
299
\def\excl{!} \chardef\lqq=`\\ \let\underscore=\_
300
\chardef\<=`<
301
\catcode`!=\active \let!=\excl
302
\catcode`^=\active \def^{\ifmmode\sp\else{\char`\^}\fi}
303
\catcode`_=\active \def\activeusc{\ifmmode\sb\else\_\fi}
304
\let_=\activeusc \let\_=\underscore
305
\catcode`*=\active \def*{\ifmmode\let\next=\*\else\let\next=\bold\fi\next}
306
\def\bold#1*{{\bf #1\/}} \chardef\*=`*
307
\catcode`<=\active \def<#1>{{\chardef*=`*\let_=\_\it#1\/}}
308
309
\catcode`"=\active \def"{\begingroup\undoquotes\doref} \chardef\"=`"
310
\chardef\\=`\\
311
312
{\catcode`|=0 \catcode`\\=12 |gdef|bs{\}}
313
% Labels (which are automatically generated by ``\Section'' and ``\>'').
314
%\newif\iflabmultdef
315
\newif\iflabundef
316
\newif\iflabchanged
317
\def\doref#1"{\bookref#1:"}
318
\def\bookref#1:#2"{\def\tempa{#2}\ifx\tempa\empty\printref{\book:#1}\else
319
\printbookref#1:#2"\fi}
320
\def\printbookref#1:#2:"{\printref{#1:#2}}
321
322
% Macros which write labels, citations and index entries on auxiliary files.
323
%
324
% 1. Some code was moved around so that all the labels and indexing stuff
325
% would be together.
326
% 2. Modified \makelabel, \printref and \label to be more like the LaTeX
327
% commands \newlabel, \ref and \label, respectively. The commands:
328
% \@xp, \@firstoftwo, \@secondoftwo, \namedef, \@ifundefined
329
% \protectedwrite are adapted pieces of LaTeX code (\@xp is actually
330
% AmSLaTeX's abbreviation of \expandafter).
331
% 3. The upshot of 2. is that now underscore is allowed in labels and
332
% index-entries and that the \makelabel commands written to the
333
% manual.lab files have arguments that are no longer put in lowercase.
334
% The labels formed inside TeX from the \makelabel commands maps
335
% underscores to | (needed to be a non-active character) and then
336
% converts to lowercase.
337
% 4. Since GapDoc uses < and > in some of its labels a temporary re-defintion
338
% of <#1> was necessary, inside \@xplowr.
339
% - GG 2001/06/11, 2001/09/02
340
\catcode`@=11
341
\let\@xp\expandafter
342
\long\def\@firstoftwo#1#2{#1}
343
\long\def\@secondoftwo#1#2{#2}
344
\def\namedef#1{\expandafter\def\csname #1\endcsname}
345
\def\@ifundefined#1{\@xplowr{#1}%
346
\@xp\ifx\csname \xpandlowr\endcsname\relax%
347
\@xp\@firstoftwo%
348
\else%
349
\@xp\@secondoftwo%
350
\fi}
351
\def\protectedwrite#1#2{\begingroup\let_\relax\immediate\write#1{#2}\endgroup}
352
\def\@xplowr#1{\begingroup\def_{|}\def<##1>{|##1|}\let\next=\relax%
353
\expandafter\edef\next{\gdef\noexpand\xpandlowr{#1}}%
354
\lowercase\expandafter{\next}\endgroup}
355
\def\makelabel#1#2{\@xplowr{r@#1}%
356
\@ifundefined{\xpandlowr}%
357
\relax%
358
{\let_\activeusc}%\protectedwrite{16}{Label `#1' multiply defined.}}%
359
\let_\activeusc%\protectedwrite{16}{Defined label `#1'.}%
360
\begingroup\edef_{|}\global\namedef{\xpandlowr}{#2}\endgroup}
361
362
%%%%%%%%%% Changed the following paragraph:
363
%\gdef\printref#1{\@xplowr{#1}%
364
% \@xp\ifx\csname r@\xpandlowr\endcsname\relax\lqq\xpandlowr''%
365
% \protectedwrite{16}{Label `#1' undefined.}\global\labundeftrue%
366
% \else\csname r@\xpandlowr\endcsname\fi\endgroup\let_\activeusc}
367
%% to:
368
\gdef\printref#1{\@xplowr{#1}%
369
\@xp\ifx\csname r@\xpandlowr\endcsname\relax\lqq\xpandlowr''%
370
\protectedwrite{16}{Label `#1' undefined.}\global\labundeftrue%
371
\else {\tt#1}\fi\endgroup\let_\activeusc}
372
%%%%%%%%%%
373
%% End of changes.
374
375
376
% Macros which write labels, citations and index entries on auxiliary files.
377
\gdef\label#1{\@xplowr{#1}
378
\ifnum\secno=0 \edef\@currentlabel{\thechapter}\else
379
\ifnum\subsecno=0 \edef\@currentlabel{\thechapter.\the\secno}\else
380
\edef\@currentlabel{\thechapter.\the\secno.\the\subsecno}\fi\fi
381
\@xp\ifx\csname r@\book:\xpandlowr\endcsname\@currentlabel\else%
382
%\immediate\write16{Label `\book:#1' has changed.}
383
\global\labchangedtrue\fi
384
\protectedwrite\labelout{\string\makelabel{\book:#1}{\@currentlabel}}%
385
\let_\activeusc}
386
387
\gdef\sigel#1{[\expandafter\ifx\csname c@#1\endcsname\relax
388
\immediate\write16{Reference `#1' undefined.}\global\labundeftrue
389
#1\else \csname c@#1\endcsname\fi]}
390
\gdef\bibitem[#1]#2{\expandafter\gdef\csname c@#2\endcsname{#1}%
391
\item{\sigel{#2}}%
392
\immediate\write\labelout{\noexpand\setcitlab{#2}\noexpand{#1}}}
393
\gdef\setcitlab#1#2{\expandafter\gdef\csname c@#1\endcsname{#2}}
394
\catcode`@=12%
395
396
\def\cite#1{\write\citeout{\bs citation{#1}}\sigel{#1}}
397
\def\dosecindex#1#2#3{\ifchapter{\let\ =\space%
398
\protectedwrite\secindout{#1 \the\chapno.\the\secno. #2#3}}\fi}
399
\def\bothindex#1#2#3#4{\doindex{#2}{#3}{#4}\dosecindex{#1}{#2}{#4}}
400
\def\index#1{\bothindex I{#1}{}{}}
401
\def\atindex#1#2{\doindex{\scrubafterexcl#1!\end}{#2}{}\dosecindex I{#1}{}}
402
\def\indextt#1{\doindex{\scrubafterexcl#1!\end}%
403
{@`\scrubafterexcl#1!\end'\scrubbeforeexcl#1!\end}{}\dosecindex I{#1}{}}
404
%\def\indextt#1{\atindex{#1}{@`#1'}}
405
\def\indexit#1{{\it #1}}
406
407
% Macros for generating the table of contents.
408
\newif\iffirstsec \firstsectrue
409
\def\dotsfill{\leaders\hbox to12pt{\hss.\hss}\hfill}
410
411
\def\appcontents#1#2#3{}
412
413
\def\chapcontents#1#2#3{%
414
%\iffirstsec\firstsecfalse\else\line{}\fi% empty line
415
\par\penalty-5\medskip
416
\line{\bf\kern\manindent\vbox{\advance\hsize by-\manindent
417
\advance\hsize by-1.5em
418
\rightskip 0pt plus1fil \emergencystretch 3em
419
\noindent\llap{\hbox to\manindent{\hss #1\kern\smallmanindent}}\strut
420
#2~\hfill \strut\rlap{\hbox to1.5em{\hss #3}}}\hfil}}
421
422
\def\seccontents#1#2#3{
423
\par\penalty-5\medskip
424
\setchapterlen#1.
425
\line{\kern\manindent\vbox{\advance\hsize by-\manindent
426
\advance\hsize by-1.5em
427
\rightskip 0pt plus1fil \emergencystretch 3em
428
\noindent\llap{\hbox to\manindent{\hss #1\kern\smallmanindent}}\strut
429
#2~\dotsfill \strut\rlap{\hbox to1.5em{\hss #3}}}\hfil}}
430
431
% GG ... the idea of \ors is to put the right no. of \or s in the \appno
432
% macro so that for an appendix:
433
% 1. \the\chapno gives the number needed in the .six file, and
434
% 2. \appno\chapno gives the right letter A, B, ... for the .lab file
435
\newtoks\ortoks
436
\long\def\addor{\begingroup\ortoks\expandafter{\ors\or}
437
\xdef\ors{\the\ortoks}\endgroup}
438
\def\setors{{\xdef\ors{} \count0=\chapno
439
\loop\ifnum\count0>0 \addor \advance\count0 by -1\repeat}}
440
\def\appno#1{\expandafter\ifcase\expandafter#1\ors\or A\or B\or C\or D\or E\or
441
F\or G\or H\or I\or J\or K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or
442
U\or V\or W\or X\or Y\or Z\else\immediate\write16{Counter too large} \fi}
443
444
% Macros for chapter and section headings.
445
\def\filename{appendix}
446
\def\tocstrut{{\setbox0=\hbox{1}\vrule width 0pt height\ht0}}
447
\outer\def\Input#1{\def\filename{#1.tex}\input #1}
448
\def\emptychapter{\noexpand\tocstrut}
449
\def\normalchapter{\the\chapno}
450
% GG
451
\def\appendixchapter{\appno\chapno} % \appno behaves like LaTeX's \Alph
452
\newif\ifchapter % set to true when \thechapter = \normalchapter
453
% ... or ... when \thechapter = \appendixchapter
454
455
{\catcode`@=11%
456
%
457
\gdef\setchapterlen#1.#2.{\expandafter\gdef\csname ch@#1\endcsname{#2}}
458
\gdef\chapterlen#1{%
459
\ifchapter
460
\expandafter\ifx\csname ch@#1\endcsname\relax%
461
0%
462
\else\csname ch@#1\endcsname\fi
463
\else 0\fi}%
464
}
465
\def\setindent#1{\indentno=#1}
466
467
468
\def\Chapter#1 \par{\vfill\supereject \headlinefalse
469
% \ifodd\pageno\else\null\vfill\eject\headlinefalse\fi
470
\advance\chapno by1 \secno=0\subsecno=0\exno=0%\ifnum\pageno>0 \pageno=1 \fi
471
\bookmarkdestin{#1}
472
\def\chapname{#1} \label{#1}
473
\immediate\write16{Chapter `#1' .}%
474
\write\tocout{\noexpand\chapcontents{\thechapter}{#1}{\the\pageno}}
475
\ifchapter
476
\immediate\write\secindout{C \filename\space\the\chapno. \chapname}\fi
477
\setbookmarkind{#1}{#1}
478
\setbox0=\hbox{\inchhigh\kern-.075em \chapterno}
479
\setbox1=\vbox{\titlefont \advance\hsize by-\wd0 \advance\hsize by-1em
480
% \hyphenpenalty=10000 \linepenalty=10000
481
\leftskip 0pt plus\hsize \parfillskip 0pt \baselineskip 44pt\relax #1}
482
\line{\box0\hfil\box1}\nobreak \mark{}\vskip 40pt}
483
484
% start hack added by TB
485
\def\PreliminaryChapter#1 \par{\vfill\supereject \headlinefalse
486
% \ifodd\pageno\else\null\vfill\eject\headlinefalse\fi
487
\advance\chapno by1 \secno=0\subsecno=0\exno=0%\ifnum\pageno>0 \pageno=1 \fi
488
\bookmarkdestin{#1}
489
\def\chapname{#1 (preliminary)} \label{#1}
490
\write\tocout{\noexpand\chapcontents{\thechapter}{#1 (preliminary)}{\the\pageno}}
491
\ifchapter
492
\immediate\write\secindout{C \filename\space\the\chapno. \chapname}\fi
493
\setbookmarkind{#1}{#1}
494
\setbox0=\hbox{\inchhigh\kern-.075em \chapterno}
495
\setbox1=\vbox{\titlefont \advance\hsize by-\wd0 \advance\hsize by-1em
496
% \hyphenpenalty=10000 \linepenalty=10000
497
\leftskip 0pt plus\hsize \parfillskip 0pt \baselineskip 44pt\relax #1 (preliminary)}
498
\line{\box0\hfil\box1}\nobreak \mark{}\vskip 40pt}
499
% end hack added by TB
500
501
\outer\def\Section#1#2\par{\bigbreak \advance\secno by1
502
\subsecno=0
503
\ifx\thechapter\emptychapter
504
\edef\tempa{\the\secno}
505
\else
506
\edef\tempa{\thechapter.\the\secno}%
507
\fi%
508
\bookmarkdestin{\tempa}
509
\setbookmark{\tempa}{#1}
510
\expandafter\writesecline\tempa\\{#1}
511
\dosecindex S{#1}{}
512
\ifx#2\nolabel\else{\let\ =\space\label{#1}}\fi
513
\ifx#2\null\else \edef\tempb{{#1@#1}}
514
\expandafter\doindex\tempb{|indexit}{}\fi
515
\noindent{\baselineskip 18pt\let!=\space \mark{Section \the\secno. #1}%
516
\secfont \tempa \enspace #1}\par\nobreak\medskip}
517
518
\def\writesecline#1\\#2{\write\tocout{\noexpand\seccontents{#1}{#2}
519
{\the\pageno}}}
520
\def\letter#1{\medskip{\secfont #1}\endgraf\nobreak%
521
\edef\tempa{LeTtEr#1}%
522
\bookmarkdestin{\tempa}%
523
\setbookmark{\tempa}{#1}%
524
}
525
526
% Macros for generating paragraph headings (e.g., function descriptions).
527
\def\fmark{\noindent\llap{\darktriangleright\rm\enspace}}
528
\def\moveup#1{\leavevmode \raise.16ex\hbox{\rm #1}}
529
\def\fpar{\endgraf\endgroup\nobreak\smallskip\noindent\ignorespaces}
530
\def\>{\begingroup\undoquotes\obeylines\angle}
531
\def\){\begingroup\obeylines\cloparen}
532
{\obeylines
533
\gdef\angle#1
534
{\endgroup \ifx\par\fpar \global\def\susemarker{\fmark}\else%
535
\global\advance\subsecno by1%
536
\global\def\susemarker{\noindent\llap{\smallrom\the\subsecno\kern.5ex%
537
\darktriangleright\rm\enspace}}%
538
\ifvmode \vskip -\lastskip \fi \medskip%
539
\begingroup\let\par=\fpar \parskip 0pt \fi%
540
\endgraf\nobreak\oporfunc#1\end}%
541
\gdef\cloparen#1
542
{\endgroup \ifx\par\fpar \else%
543
\ifvmode \vskip -\lastskip \fi \medskip%
544
\begingroup\let\par=\fpar \parskip 0pt \fi%
545
\endgraf{\def\[{\moveup\lbrack}\def\]{\moveup\rbrack}\def\|{\vrule\relax}%
546
\noindent\typewriter#1'}}%
547
\gdef\scanparen#1(#2\end{\def\tempa{#2}\ifx\tempa\empty%
548
\def\next{\begingroup\cloparen\susemarker#1
549
\label{#1}\bothindex F{#1}{@`#1'}{}}%
550
\else\def\next{\delparen#1(#2\end}\fi \next}}
551
\def\delparen#1(\end{\function#1}
552
\def\oporfunc#1#2\end{\ifx#1`\def\next{\oporvalue#1#2}\else
553
\def\next{\scanparen#1#2(\end}\fi \next}
554
\long\def\oporvalue`#1'#2{\ifx#2V\def\next{\operation`#1'{#1}@{`#1'} V}\else
555
\def\next{\operation`#1'{#2}}\fi \next}
556
\long\def\operation`#1'#2#3{{\def\[{\moveup\lbrack}\def\]{\moveup\rbrack}%
557
\def\|{\vrule\relax}}
558
\susemarker\typewriter#1'%
559
\ifx#3!\def\next{\suboperation{#2}}
560
\else\ifx#3@\def\next{\subatoperation{#2}}
561
\else\endheaderline \label{#2}%
562
\bothindex F{#2}{}{}\let\next=#3\fi\fi\next}
563
\long\def\function#1(#2)#3{{\def\[{\moveup\lbrack}\def\]{\moveup\rbrack}%
564
\def\|{\vrule\relax}
565
\susemarker\typewriter#1(#2)'}%
566
\ifx#3!\def\next{\subfunction{#1}}\else
567
\endheaderline\label{#1}\bothindex F{#1}{@`#1'}{}%
568
\let\next=#3\fi\next}
569
\def\subfunction#1#2{\endheaderline\label{#1!#2}%
570
\bothindex F{#1}{@`#1'}{!#2}}
571
\def\suboperation#1#2{\endheaderline\label{#1!#2}%
572
\bothindex F{#1}{}{!#2}}
573
\def\subatoperation#1#2{\endheaderline\label{#1}%
574
\doindex{\scrubafterexcl#1!\end}{@#2}{}
575
\dosecindex F{#1}{}}
576
\def\scrubafterexcl#1!#2\end{#1}
577
\def\scrubbeforeexcl#1!#2\end{\if\relax#2\else!\removeendexcl#2\fi}
578
\def\removeendexcl#1!{#1}
579
580
\def\endheaderline{\hskip 0pt plus 1filll}
581
582
% Macro for item lists.
583
\catcode`&=\active
584
\def\beginitems{%
585
\smallskip
586
\begingroup
587
\def&{\par \nobreak \hangindent\manindent \hangafter 0
588
{\parskip 0pt\noindent}\ignorespaces}
589
\parindent 0pt
590
\catcode`&=\active
591
}
592
\def\enditems{\par \endgroup \smallskip \noindent \ignorespaces}
593
594
% Macro for item lists.
595
\def\beginlist{%
596
\smallskip
597
\begingroup
598
\parindent=2em
599
}
600
\def\endlist{\par \endgroup \smallskip \noindent \ignorespaces}
601
\catcode`&=4
602
603
% Macros for exercises.
604
\outer\def\exercise{\advance\exno by1\begingroup
605
\def\par{\endgraf\endgroup\medskip\noindent}
606
\medskip\noindent{\bf Exercise \chapterno.\the\exno.}\quad}
607
\outer\def\answer{\immediate\write\ans{}%
608
\immediate\write\ans{\noexpand\answerto{\thechapter.\the\exno.}}%
609
\copytoblankline}
610
\def\answerto#1{{\noindent\bf #1}}
611
\def\copytoblankline{\begingroup\setupcopy\copyans}
612
{\undoquotes
613
\gdef\setupcopy{\undocatcodespecials \obeylines \obeyspaces}
614
\obeylines \gdef\copyans#1
615
{\def\next{#1}%
616
\ifx\next\empty\let\next=\endgroup %
617
\else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
618
619
% Macros for the active backquote character (`).
620
{\catcode`.=\active \gdef.{\char'056 \penalty0}}
621
\def\writetyper{\catcode`.=\active \chardef\{ =`{ \chardef\}=`}
622
\chardef*=`* \chardef"=`" \chardef~=`~}
623
\catcode``=\active
624
\def`{\futurelet\next\backquote}
625
\def\typewriter#1'{\leavevmode{\writetyper \chardef`=96 \tt #1}}
626
\def\backquote{\ifx\next`\let\next=\doublebackquote
627
\else\let\next=\typewriter \fi \next}
628
\def\doublebackquote`{\lqq}
629
630
% The \Package command for argument <pkg> defines a macro \<pkg> that
631
% sets the text <pkg> in sans-serif i.e. a share package author should
632
% put a \Package{<pkg>} in their manual.tex file and then use {\<pkg>}
633
% when they refer to package <pkg>.
634
635
\def\Package#1{\namedef{#1}{{\sf #1}}}
636
\Package{GAP}
637
\Package{MOC}
638
\Package{ATLAS}
639
640
% For one-off references to a share package there is the following:
641
642
\def\package#1{{\sf #1}}
643
644
% The day
645
646
\def\Day{\number\day}
647
648
% The month in words
649
650
\def\Month{\ifcase\month\or January\or February\or March\or April\or May\or
651
June\or July\or August\or September\or October\or November\or December\fi}
652
653
% The year
654
655
\def\Year{\number\year}
656
657
% The date
658
659
\def\Today{{\Day} {\Month} {\Year}}
660
661
% Miscellaneous macros.
662
\def\N{{\Bbb N}} \def\Z{{\Bbb Z}} \def\Q{{\Bbb Q}} \def\R{{\Bbb R}}
663
\def\C{{\Bbb C}} \def\F{{\Bbb F}} \def\calR{{\cal R}}
664
665
%T do we want these
666
%\def\stars{\bigskip\centerline{\*\qquad\*\qquad\*}\bigskip}
667
668
% Page numbers and running heads.
669
\newif\ifheadline
670
\nopagenumbers
671
\def\makeheadline{\vbox to0pt{\vskip-22.5pt\hbox to\pagewidth{\vbox to8.5pt
672
{}\the\headline}\vss}\nointerlineskip}
673
\headline={\ifheadline\ifodd\pageno \righthead\hfil{\rm\folio}\else
674
{\rm\folio}\hfil\lefthead \fi
675
\else\global\headlinetrue \hfil\fi}
676
677
% Macro for inputting an auxiliary file.
678
\def\inputaux#1#2#3{\immediate\openin#1=#2\jobname.#3
679
\ifeof#1\immediate\write16{No file #2\jobname.#3.}\else
680
\immediate\closein#1 \input#2\jobname.#3 \fi}
681
682
% Macros for the parts of the manual.
683
\outer\def\FrontMatter{%
684
\let\thechapter=\emptychapter
685
\def\lefthead{\it\chapname} \let\righthead=\lefthead
686
687
\begingroup
688
\undoquotes
689
\inputaux\labelin{}{lab}
690
%\setbox0=\vbox{\Bibliography}
691
\endgroup
692
\labchangedfalse
693
694
% Open the auxiliary files for output.
695
\immediate\openout\tocout =\jobname.toc
696
\immediate\openout\labelout =\jobname.lab
697
\immediate\openout\indexout =\jobname.idx
698
\immediate\openout\secindout=\jobname.six
699
\immediate\openout\citeout =\jobname.aux
700
% \immediate\openout\ans=answers
701
\immediate\write\citeout{\bs bibstyle{alpha}}
702
703
\ifodd\pageno\else\headlinefalse\null\vfill\eject\fi
704
% \pageno=1
705
}
706
707
\outer\def\Chapters{\vfill\eject
708
\chapno=0 \let\thechapter=\normalchapter \chaptertrue
709
\def\lefthead{{\it Chapter \the\chapno. \chapname}}
710
\def\righthead{\ifx\botmark\empty\lefthead\else{\it \botmark}\fi}}
711
712
% GG
713
% Rather than reset \chapno in \Appendices, for the .six file (which GAP's
714
% help uses), we number appendices as if they were chapters (via \the\chapno)
715
% i.e. if the last chapter was numbered 7 then for the .six file the first
716
% appendix would be numbered 8.
717
% The \setors macro puts (\number\chapno - 1) \or s in the \ors macro so that
718
% \appno\chapno (= \appendixchapter) numbers the appendices sequentially from A
719
% for the .lab file (which TeX uses).
720
\outer\def\Appendices{\vfill\eject
721
\setors \let\thechapter=\appendixchapter \chaptertrue
722
\def\lefthead{{\it Appendix \thechapter. \chapname}}
723
\def\righthead{\ifx\botmark\empty\lefthead\else{\it \botmark}\fi}}
724
725
\def\EndMatter{\vfill\eject
726
\def\thechapter{} \chapterfalse
727
\def\lefthead{{\it \chapname}}
728
\let\righthead=\lefthead
729
\hbadness=5000\relax
730
\gdef\EndMatter{}}
731
732
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
733
%%
734
%F \BeginningOfBook . . . . . . . . . . . . . . . . . . . . start the book
735
%%
736
\def\BeginningOfBook#1{%
737
\def\book{#1}%
738
\pageno=-1%
739
\pageno=1%
740
\headlinefalse%
741
\let\thechapter=\emptychapter%
742
\def\lefthead{\it\chapname}%
743
\let\righthead=\lefthead%
744
}
745
%
746
%
747
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
748
%%
749
%F \UseReferences{<book-path>} . . . use references from book in <book-path>
750
%%
751
\def\UseReferences#1{{\undoquotes
752
\inputaux\labelin{#1/}{lab}}
753
}
754
\let\UseGapDocReferences\UseReferences %needed so that the HTML converter
755
%can tell the difference
756
%
757
%
758
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
759
%%
760
%F \EndOfBook . . . . . . . . . . . . . . . . . . . . . . . . end the book
761
%%
762
\def\EndOfBook{\vfill\supereject
763
\immediate\write16{##}
764
\immediate\closeout\citeout
765
\immediate\write16{## Citations for BibTeX written on \jobname.aux.}
766
\immediate\closeout\indexout
767
\immediate\write16{## Index entries for makeindex written on \jobname.idx.}
768
\immediate\closeout\secindout
769
\immediate\write16{## Section index entries written on \jobname.six.}
770
\immediate\closeout\labelout
771
\immediate\write16{## Label definitions written on \jobname.lab.}
772
\immediate\closeout\tocout
773
\immediate\write16{## Table of contents written on \jobname.toc.}
774
%\iflabmultdef\immediate\write16{## There were multiply-defined labels.}\fi
775
\iflabundef\immediate\write16{## There were undefined labels or
776
references.}\fi
777
\iflabchanged\immediate\write16{## Labels have changed, run again. (Or
778
they were multiply defined.)}\fi
779
\immediate\write16{##}
780
\end
781
}
782
%
783
%
784
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
785
%%
786
%F \TableOfContents . . . . . . . . . . . . . . produce a table of contents
787
%%
788
% name of the chapter containing the table of contents
789
\def\TOCHeader{Contents}
790
791
% explanation at the beginning of the table of contents
792
\def\TOCMatter{%
793
}
794
795
% macros for generating the table of contents
796
%\newif\iffirstsec\firstsectrue
797
\def\dotsfill{\leaders\hbox to12pt{\hss.\hss}\hfill}
798
799
% produce the chapter "Contents"
800
\outer\def\TableOfContents{\Chapter{\TOCHeader}
801
802
\TOCMatter
803
\vskip 20pt
804
\begingroup
805
\rigidfalse
806
\let!=\space
807
\begindoublecolumns
808
\inputaux\tocin{}{toc}\vfill\eject
809
\enddoublecolumns
810
\endgroup
811
}
812
813
% a one column version of \TableOfContents for short manuals
814
\outer\def\OneColumnTableOfContents{\Chapter{\TOCHeader}
815
816
\TOCMatter
817
\vskip 20pt
818
\begingroup
819
\rigidfalse
820
\let!=\space
821
\inputaux\tocin{}{toc}\vfill\eject
822
\endgroup
823
}
824
825
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
826
%%
827
%F \TitlePage{<text>} . . . . . . . . . . . . . . . . generate a title page
828
%%
829
\long\def\TitlePage#1{%
830
\null\vfill#1\null\vfill\eject
831
}
832
833
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
834
%%
835
%F \Colophon{<text>} . . . . . . . . . . . . . . generate a colophon page
836
%%
837
\long\def\Colophon#1{\Chapter{}
838
839
#1\null\vfill\eject
840
}
841
842
843
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
844
%%
845
%F \Answers . . . . . . . . . . . . . produce the answers to the exercises
846
%%
847
% header for the answers
848
\def\AnswersHeader{Answers to the Exercises}
849
%
850
% produce the chapter "Answers"
851
\def\Answers{\Chapter{\AnswersHeader}
852
853
\parindent\manindent
854
\parskip 1ex plus 0.5ex minus 0.5ex
855
\immediate\closeout\ans
856
\input answers
857
}
858
859
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860
%%
861
%F \Bibliography . . . . . . . . . . . . produce the chapter "Bibliography"
862
%%
863
% header for the bibliography
864
\def\BibHeader{Bibliography}
865
866
% produce the chapter bibliography
867
\def\Bibliography{\EndMatter\Chapter{\BibHeader}
868
869
\begingroup\undoquotes\frenchspacing
870
\parindent\manindent
871
\pretolerance=5000 %badness allowed for hypenation
872
\tolerance=5000 %badness allowed before overfull boxes appear
873
\parskip 1ex plus 0.5ex minus 0.5ex
874
\def\begin##1##2{} \def\end##1{}
875
\let\newblock=\relax \let\em=\sl
876
\inputaux\citein{}{bbl}
877
\endgroup
878
}
879
880
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
881
%%
882
%F \Index . . . . . . . . . . . . . . . . . . produce the chapter "Index"
883
%%
884
% header for the index
885
\def\IndexHeader{Index}
886
887
% explanation at the beginning of the index
888
\def\IndexMatter{%
889
This index covers only this manual.
890
A page number in {\it italics} refers to a whole section which is devoted to
891
the indexed subject. Keywords are sorted with case and spaces ignored,
892
e.g., ```PermutationCharacter''' comes before ``permutation group''.%
893
}
894
895
% kerning in full index after letter
896
\def\idxkern{\kern.3em}
897
898
% produce the chapter index
899
\def\Index{\EndMatter%
900
% get the proper bookmarking function
901
\global\let\setbookmarkind=\indexbookmark%
902
\Chapter{\IndexHeader}
903
904
\IndexMatter
905
\bigskip
906
\begindoublecolumns
907
\pretolerance=5000 %badness allowed for hypenation
908
\tolerance=5000 %badness allowed before overfull boxes appear
909
\parindent 0pt \parskip 0pt \rightskip 0pt plus2em \emergencystretch 2em
910
\everypar{\hangindent\smallmanindent}
911
\def\par{\endgraf\leftskip 0pt}
912
\def\sub{\advance\leftskip by\smallmanindent}
913
\def\subsub{\advance\leftskip by2\smallmanindent}
914
\obeylines
915
\inputaux\indexin{}{ind}
916
\enddoublecolumns
917
}
918
919
% pseudo chapters used for authors, preface, copyright &c.
920
\def\PseudoInput#1#2#3{%
921
\vfill\eject% to ensure the pseudo-chapter no. doesn't get into headline
922
\advance\chapno by1\secno=0\subsecno=0
923
\immediate\write\secindout{C #1.tex \thechapter. #2}
924
\label{#2}\label{#3}} % we do this for the benefit of the HTML manuals
925
926
% some often-used LaTeX functions
927
\def\frac#1#2{{{#1}\over{#2}}}
928
929
% as the etalchar gets written out in manual.lab, better make it nonfancy
930
% (otherwise something breaks).
931
\def\etalchar#1{$^{#1}$}
932
\def\etalchar#1{#1}
933
934
% nasty trick to cope with the `newcommand' created by bibtex
935
\def\newcommand#1#2#3#4#5{}
936
937
% URL stuff
938
\def\URL#1{\par\kernttindent\hbox{`#1'}\ifx\EndMatter\empty\else\qquad\fi}
939
\def\Mailto#1{\penalty-1000\hskip 0pt plus10cm\hbox{`#1'}}
940
941
% ragged bottom will avoid large blank spaces
942
\raggedbottom
943
\frenchspacing
944
\vfuzz=2pt
945
946