CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

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

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