forked from gap-system/gap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgapmacrodoc.tex
1889 lines (1555 loc) · 74.9 KB
/
gapmacrodoc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%W gapmacrodoc.tex GAP documentation Thomas Breuer
%W & Frank Celler
%W & Martin Schoenert
%W & Heiko Theissen
%W & Burkhard Höfling
%%
%%
%Y Copyright 1997, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany
%%
%% self-contained document with the former chapter
%% ``The gapmacro.tex Manual Format'' of ``Extending GAP''
%%
\input gapmacro
\BeginningOfBook{gapmacro}
\UseReferences{ref}
\TitlePage{
\centerline{\titlefont GAP}\bigskip
\centerline{\secfont Release 4.5}\medskip
\centerline{\secfont October 2011}\vfill
\centerline{\titlefont The gapmacro.tex}\bigskip\bigskip
\centerline{\titlefont Manual Format}\vfill
\centerline{\secfont The GAP Group}\bigskip
\centerline{\secfont https://www.gap-system.org}
}
\OneColumnTableOfContents
\FrontMatter
\Chapters
\Chapter{The gapmacro.tex Manual Format}
This document describes a restricted {\TeX} format,
which is defined by the of macros in the file
\){\kernttindent GAPPATH/doc/gapmacro.tex}
and how to create the final documents (which can be printed or used by
{\GAP}'s online help) from it.
Some {\GAP}~4 package documentation is written in this format.
Up to version 4.4, the same was true for the main {\GAP} manuals.
See "TeX Macros" and "Examples, Lists, and Verbatim" for details on the
restricted set of available {\TeX} commands.
The first sections "The main file" and
"gapmacro:Structuring the text: Chapters and Sections" describe
the general layout of the files in case you need to write your own
package documentation.
If you are planning to write new documentation for a {\GAP} package,
one alternative to using the format described in this document
is to use the \package{GAPDoc} package,
see Chapter ``Introduction and Example''
in the \package{GAPDoc} manual,
for example type
\testexamplefalse
\beginexample
gap> ?GAPDoc:chapters
\endexample
in {\GAP}'s online help for a table of contents, or (if it is not
available in your installation) see:
\URL{http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc/}
If you want to use yet another document format you must provide certain
information to the interface of {\GAP}'s online help. This is described
in Chapter ``Interface to the GAP Help System'' of the
{\GAP} Reference Manual.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{The Main File}
\indextt{gapmacro.tex}\indextt{\\BeginningOfBook}\indextt{\\UseReferences}
\indextt{\\UseGapDocReferences}
\indextt{\\TitlePage}\indextt{\\Colophon}\indextt{\\TableOfContents}
\indextt{\\OneColumnTableOfContents}
\indextt{\\FrontMatter}\indextt{\\Chapters}\indextt{\\Appendices}
\indextt{\\Bibliography}\indextt{\\Index}\indextt{\\EndOfBook}
\indextt{\\Package}\indextt{\\package}
The main {\TeX} file is called `manual.tex'.
This file should contain the following commands:
%\begintt
\){\kernttindent\\input ../gapmacro}
\){\kernttindent\ ... (gapmacro.tex options, see "Additional Typesetting Options" below)}
\){\kernttindent\\Package\{<package-name>\}}
\){\kernttindent\\BeginningOfBook\{<name-of-book>\}}
\){\kernttindent\ \ \\UseReferences\{<book1>\}}
\){\kernttindent\ \ ...}
\){\kernttindent\ \ \\UseReferences\{<bookn>\}}
\){\kernttindent\ \ \\TitlePage\{<title>\}}
\){\kernttindent\ \ \\Colophon\{<text>\}}
\){\kernttindent\ \ \\TableOfContents}
\){\kernttindent\ \ \\FrontMatter}
\){\kernttindent\ \ \ \ \\immediate\\write\\citeout\{\\bs bibdata\{<mybibliography>\}\}}
\){\kernttindent\ \ \ \ \\Input\{<file1>\}}
\){\kernttindent\ \ \ \ ...}
\){\kernttindent\ \ \ \ \\Input\{<filen>\}}
\){\kernttindent\ \ \\Chapters}
\){\kernttindent\ \ \ \ \\Input\{<file1>\}}
\){\kernttindent\ \ \ \ ...}
\){\kernttindent\ \ \ \ \\Input\{<filen>\}}
\){\kernttindent\ \ \\Appendices}
\){\kernttindent\ \ \ \ \\Input\{<file1>\}}
\){\kernttindent\ \ \ \ ...}
\){\kernttindent\ \ \ \ \\Input\{<filen>\}}
\){\kernttindent\ \ \ \ \\Bibliography}
\){\kernttindent\ \ \ \ \\Index}
\){\kernttindent\\EndOfBook}
%\endtt
Now we describe what these commands do:
\beginitems
`\\input <path>/gapmacro.tex'&
inputs the {\GAP} ``style'' and macros file `gapmacro.tex'. If you are
writing a {\GAP} package either copy this file or use a relative path.
The former method will always work but requires you to keep the file
consistent with the system while the latter forces users to change the
`manual.tex' file if they are installing a package in a private location.
See also Section ``GAP Root Directory'' in the {\GAP} Reference Manual.
\index{typesetting options}
\index{options!for gapmacro.tex}
\indextt{\\Package}
`\\Package\{<package-name>\}'&
defines a macro `\\<package-name>' so that when you type
`\{\\<package-name>\}' (please include the curly braces) the text
<package-name> is typeset in the right way for {\GAP} packages, e.g.~if
you are writing a package \package{MyPackage} then you should include the
line
\){\kernttindent\\Package\{MyPackage\}}
&
in your `manual.tex' file and then in your chapter files use
`\{\\MyPackage\}' when you refer to \package{MyPackage} by name. There is
also the command `\\package\{<pkg>\}' when you wish to refer to other
{\GAP} packages; don't confuse the two i.e.~`\\Package\{<package-name>\}'
defines a macro `\\<package-name>' but produces no text, and
`\\package\{<pkg>\}' produces <pkg> set in the font that is right for
{\GAP} packages.
\indextt{\\BeginningOfBook}
`\\BeginningOfBook\{<name-of-book>\}'&
starts the book <name-of-book>. It is used for cross-references, see
"Labels and References". If you are writing a {\GAP} package use the name
of your package here.
\indextt{\\UseReferences}\indextt{\\UseGapDocReferences}
`\\UseReferences\{<booki>\}', `\\UseGapDocReferences\{<booki>\}' &
If your manual cross-refers to another manual, `\\UseReferences' can be
used to load the labels of the other books in case cross-references
occur. <booki> should be the path of the directory containing the book
whose references you want to load. However, as said above this requires
changes to the `manual.tex' file if the package is not installed in the
standard location. `\\UseGapDocReferences' can also be used to load
\package{GAPDoc} style references, but this function exists only for backward
compatibility.
&
Just ensure you get the path to the
other manual's directory correct *relative* to the directory in which
your manual resides.
&
If your `manual.tex' file lives in `pkg/qwer/doc' and you want to use
references to the {\GAP} Tutorial use
\begintt
\UseGapDocReferences{../../../doc/tut}
\endtt
\indextt{\\TitlePage}
`\\TitlePage'&
produces a page containing the *title*. Please see the example.
\indextt{\\Colophon}
`\\Colophon'&
`\\Colophon' produces a page following the title that can be used for
more explicit author information, acknowledgements, dedications or
whatsoever.
\indextt{\\TableOfContents}\indextt{\\OneColumnTableOfContents}
`\\TableOfContents'&
produces a table of contents in double-column format. For short manuals,
the double-column format may be inappropriate; in this case, use
`\\OneColumnTableOfContents' instead.
\indextt{\\FrontMatter}
`\\FrontMatter'&
starts the front matter chapters such as a copyright notice or a preface.
&
The line
%\begintt
\){\kernttindent\\immediate\\write\\citeout\{\\bs bibdata\{<mybibliography>\}\}}
%\endtt
&
is for users of Bib{\TeX}. It will use the file `<mybibliography>.bib' to
fetch bibliography information.
\indextt{\\Chapters}
`\\Chapters'&
starts the chapters of the manual, which are included via `\\Input'.
`\\Input\{<filei>\}' inputs the file `<filei>.tex', i.e.~<filei> should
be the name of the file *without* the `.tex' extension. For the chapter
format, see Section~"gapmacro:Structuring the text: Chapters and Sections".
\indextt{\\Appendices}
`\\Appendices'&
starts the appendices, i.e.~it modifies the `\\Chapter' command to use
uppercase letters to number chapters.
%`\\Answers' produces an answers chapter, see "Exercises and Answers".
\indextt{\\Bibliography}
`\\Bibliography'&
produces a bibliography, i.e. it reads and typesets the `manual.bbl' file
produced by Bib{\TeX}.
\indextt{\\Index}
`\\Index'&
produces an index, i.e. it reads and typesets the `manual.ind' file
produced by the external `manualindex' program.
\indextt{\\EndOfBook}
`\\EndOfBook'&
Finally `\\EndOfBook' closes the book.
\enditems
*Example*
Assume you have a {\GAP} package `qwert' with two chapters `Qwert' and
`Extending Qwert', a copyright notice, and a preface, then your
`manual.tex' would basically look like:
\begintt
\input ../../../doc/gapmacro % The right path from pkg/qwert/doc
\Package{Qwert} % Defines macro {\Qwert}
\BeginningOfBook{qwert}
\TitlePage{
\centerline{\titlefont Qwert}\medskip % Package name
\centerline{\titlefont ---}\medskip
\centerline{\titlefont A GAP4 Package}\bigskip\bigskip
\centerline{\secfont Version 1.0}\medskip
% If the package interfaces with an external program ...
\centerline{\secfont Based on qwert Standalone Version 3.14}\vfill
\centerline{\secfont by}\vfill
\centerline{\secfont Q. Mustermensch}\medskip % Author
\centerline{Department of Mathematics}\medskip % Affiliation
\centerline{University of Erewhon}\medskip
\centerline{\secfont email: qmuster@erewhon.uxyz.edu.ut} % Email address
\vfill
\centerline{\secfont{\Month} \Year}
}
\TableOfContents
\FrontMatter
\Input{copyright}
\Input{preface}
\Chapters
\Input{qwert}
\Input{extend}
\Appendices
\Index
\EndOfBook
\endtt
\indextt{\\PseudoInput}\indextt{\\Day}\indextt{\\Month}\indextt{\\Year}
\indextt{\\Today}
Occasionally there will be the need for additional commands over and
above those shown above. The ones described below should be the *only*
exceptions.
\beginlist%unordered
\item{--}
There may be other packages that are referred to a lot, so that it's
worthwhile to add more `\\Package' commands. (There's nothing special
about `\\Package', you can use it to define macros for other packages
besides the package being documented.)
\item{--}
Besides the macros `\{\\Month\}' and `\{\\Year\}', which typeset the
current month (as an English word) and the year (all four digits),
respectively, there are also `\{\\Day\}' and `\{\\Today\}' which are
mainly intended for drafts. `\{\\Day\}' typesets the day of the month as
a number and `\{\\Today\}' is equivalent to: `\{\\Day\} \{\\Month\}
\{\\Year\}'.
\item{--}
Sometimes one desires a chapter to be unnumbered in the {\TeX}-produced
manuals, e.g.~the Tutorial manual has {\GAP}'s Copyright Notice as an
unnumbered chapter. To achieve this one inputs the file containing the
chapter via {\TeX}'s `\\input' command rather than `\\Input'. However,
neither the on-line help browser nor the HTML converter ``sees'' such
chapters. Thus if it is desired that the on-line help browser and the
HTML manuals should also have such chapters, they must be ``input'' again
via the `\\PseudoInput' command (not necessarily in the same manual).
\item{--}
For chapters that should only appear via the on-line help browser or in
the HTML manuals, one may use the `\\PseudoInput' command. Any
`\\PseudoInput' commands should come *after* all `\\Input' commands;
failure to do this will result in different numbering of `\\Input'
chapters for {\TeX}-produced and HTML manuals. The syntax of this command
is as follows:
\)\kernttindent\\PseudoInput\{<filename>\}\{<six-entry>\}\{<chaptername>\}
%display{tex}
\item{}
%enddisplay
where <filename> is the name of the file containing the chapter without
the `.tex' extension, as for the `\\Input' command, <six-entry> is the
section-index-entry for the chapter (written to the `manual.six' file)
and <chaptername> is the *actual* argument of the `\\Chapter' command
that appears at the beginning of `<filename>.tex'. The argument
<six-entry> enables the on-line text browser to reference the chapter by
a name other than <chaptername>. Thus a copyright chapter for the book
with name <name-of-book> might have <chaptername> ```Copyright Notice'''
but <six-entry> ```Copyright''', which would enable one to access the
chapter ```Copyright Notice''' via `?<name-of-book>:copyright' via the
on-line browser. The HTML converter adds an index entry for both
<six-entry> and <chaptername>.
\endlist
*Note*
Usage of the commands `\\input' and `\\PseudoInput' in the way described
above will necessitate special treatment of references to such chapters.
For such purposes, there is a special variant of the `\%display'
environment (see "Catering for Plain Text and HTML Formats"), e.g.~a
copyright notice appearing via `\\input' at the beginning of a
{\TeX}-produced manual and appearing in the non-{\TeX} manuals -- the
on-line help browser or HTML manual -- via a `\\PseudoInput' command as
described above, may be referenced via
\begintt
%display{tex}
See the copyright notice at the beginning of this book.
%display{nontex}
%See "Copyright".
%enddisplay
\endtt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Additional Typesetting Options}
\label{options!for gapmacro.tex}
There are a number of additional options which you can activate/
deactivate by adding the following {\TeX} just after the line
\){\kernttindent\\input ../gapmacro}.
Of course, you need not set options which are marked as default.
\beginitems
`\\usepsfonts' & (default) use the standard Postscript fonts for typesetting
`\\usecmfonts' & use the TeX standard (Computer Modern) fonts (this was the
behaviour until {\GAP} 4.4).
`\\addlinks' & (default) This inserts pdf links within the document, so
that you can click on a reference or citation. This will only work
with pdftex, otherwise this has no effect.
`\\nolinks' & This switches off additional pdf links within the document (this was the
behaviour until {\GAP} 4.4.
`\\citebooksfalse' & (default) References to external books will just print the
chapter/section/subsection number(s).
`\\citebookstrue' & References to external books will be printed as
`GAP Reference Manual, 2.7.12' instead of just `2.7.12', similarly
for the GAP tutorial. If you cite other books, you have to define
for each book `XXX' a macro `\\xxxManual' which expands to the text
which you want to be inserted before the number for package `XXX'.
(Note that the `xxx' in `\\xxxManual' must always be lower case, regardless
of the actual package name `XXX'.)
&
If you want to cite from the manual of a package ``OtherPackage'', then you should
add the line
\begintt
\gdef\otherpackageManual{The OtherPackage Manual}
\endtt
& at the beginning of your main {\TeX} input file.
`\\biblitemfalse' & (default, same as in {\GAP} 4.4) In the bibliography,
print abbreviations for papers right-aligned
`\\biblitemtrue' & Print abbreviations left-aligned in the bibliography. d
Depending on the abbreviations you use, you may need more indentation.
You may set `\\bibindent' to another value (the present default is 3 pc)
if you get overfull `\\hbox'es. (This effect also exists if you use
`\\bibitemsfalse'
but there is not very obvious because long abbreviations will
protrude into the left margin only.)
`\\casesensitivefalse' & (default) labels are case insensitive
`\\casesensitivetrue' & makes labels case sensitive (this is still experimental
and not currently supported by the html converter)
\enditems
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Structuring the text: Chapters and Sections}
\indextt{\\Chapter}\indextt{\\Section}
The contents of each chapter must be in its *own* `.tex' file. The
command `\\Chapter\{<chaptername>\}' starts a new chapter named
<chaptername>; it should constitute the first non-comment (and non-blank)
line of the file containing a chapter. A chapter begins with an
introduction to the chapter and is followed by sections created with the
`\\Section\{<secname>\}' command. The strings <chaptername> and <secname>
are automatically available as references (see Section~"Labels and
References").
There must be *no further commands* on the same line as the `\\Chapter'
or `\\Section' line, and there *must* be an empty line after a
`\\Chapter' or `\\Section' command. This means that `\\index' commands
referring to the chapter or section can be placed only after this empty
line.
Finally, the HTML converter requires that each `\\Section' line is
preceded by a line starting with at least 16 percentage signs
(conventionally, one actually types a full line of percentage signs). The
HTML converter stops converting a section whenever it hits such a line;
therefore do not add lines starting with 16 or more \% signs which are
*not* just before a `\\Section' command. Failure to include the line of
percentage signs before a `\\Section' line will cause the converter to
crash, due to the discovery of what it sees as two `\\Section' commands
within the one section.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Suppressing Indexing and Labelling of a Section and Resolving
Label Clashes}
\indextt{\\null!use in index suppression}
Sometimes one does not wish a section to be indexed. To suppress the
indexing of a section, simply add the macro `\\null' after the
`\\Section' command, e.g.
\)\kernttindent\\Section\{<section-name>\}\\null
and then <section-name> will still generate a label (so that you can
still refer to it via `Section~\"<section-name>\"'), but <section-name>
will not appear in the index.
\indextt{\\nolabel!use in index and label suppression}
Occasionally, one has a dedicated section for the description of a single
function. If the label generated for the section coincides with the label
for a subsection (generated by a `\\>' command) a multiply defined label
results. In these cases, one would generally rather that the section did
not generate a label or an index entry. To suppress the generation of
both the label and the index entry of such a section, simply add the
macro `\\nolabel' immediately after the `\\Section' command, e.g.~for a
section dedicated to the function <func>:
\)\kernttindent\\Section\{<func>\}\\nolabel
*Note:* Labels are generated by converting to lowercase and removing
whitespace. So coincidences can occur when you might not have expected
it. An alternative to index suppression to resolve label clashes is to
include a sub-label for the function in the `\\>' command (see
Section~"TeX Macros").
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Labels and References}
Each `\\Chapter', `\\Section' and `\\>' command generates a (short) label
<label>, which is extended by <name-of-book> (the argument of
`\\BeginningOfBook' mentioned earlier in Section~"The Main File"), to
create a ``long label'' <long-label>, and emitted to a file `manual.lab'.
The construction of <long-label> is `<name-of-book>:<label>', where the
<label> generated by either of the commands `\\Chapter' or `\\Section' is
just its <chaptername> or <secname> argument. For `\\>', there are a few
cases to consider, and we'll consider them in Section~"TeX Macros", where
we meet the various forms of the `\\>' command. To see how to resolve
problems with label clashes see Section~"Suppressing Indexing and
Labelling of a Section and Resolving Label Clashes".
\index{reference to a label}
A reference to a label <any-label> (long or short) is made by enclosing
<any-label> in a pair of double quotation marks: `\"<any-label>\"'; it is
replaced by the number of the `\\Chapter', `\\Section' or `\\>' command
that generated <any-label> in the first place. Generally, one only needs
to make references to long labels when referring to other manuals. For
references within the same manual, short labels are sufficient, except
when the short label itself contains a colon.
*Example*
Since the `\\BeginningOfBook' command for this manual defines
<name-of-book> to be `gapmacro',
the long label for the current section is
`gapmacro:Labels and References'
and so a reference to this section within
this manual might be: `Section \"Labels and References\"' (which is
typeset as: Section "Labels and References"). From another manual, a long
label reference is required.
*Another example*
A section of this document has the title
``Structuring the text: Chapters and Sections'',
which contains a colon. Hence, to refer to that section, one *must* use a
long label:
\begintt
Section "gapmacro:Structuring the text: Chapters and Sections"
\endtt
produces: Section "gapmacro:Structuring the text: Chapters and Sections".
*Note*
In actual fact long labels are first sanitised by conversion to lower case
and removal of superfluous white space (multiple blanks and new lines are
converted to a single space). The same sanitisation process is applied to
references. Thus,
\begintt
Section "gapmacro:Structuring the text: Chapters
and Sections"
\endtt
also produces:
Section "gapmacro:Structuring the text: Chapters
and Sections".
So, don't worry about references to labels being broken over lines
and think of them as being case-insensitive, except that the HTML
converter requires that one respects case for the <name-of-book>
component of a long label.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{TeX Macros}
\indextt{\\lq}\indextt{\\pif}\indextt{\\rq}\indextt{\\accent127}
\indextt{\\>}\indextt{\\.}\indextt{.}\indextt{\\index}\indextt{\\indextt}
\indextt{\\atindex}\index{indexing commands}\index{command mark-up}
\index{subsection mark-up}\indextt{\\fmark}\indextt{\\kernttindent}
\indextt{\\URL}\indextt{\\Mailto}
\indextt{A!Attribute mark-up}\indextt{F!Function mark-up}
\indextt{P!Property mark-up}\indextt{O!Operation mark-up}
\indextt{C!Category mark-up}\indextt{R!Representation mark-up}
\indextt{V!(global) Variable mark-up}
\indextt{\\Package}\indextt{\\package}
As the manual pages are also used as on-line help, and are automatically
converted to HTML, the use of special {\TeX} commands should be avoided.
The following macros can be used to structure the text, the mentioned
fonts are used when printing the manual, however the on-line help and
HTML are free to use other fonts or even colour. Since, the plain text
on-line help, doesn't have special fonts, it leaves in much of the
markup, including the left and right quotes that surround something
intended to be displayed in typewriter type, the angle brackets that
surround something intended to appear in italics, and the dollar-signs
enclosing mathematics; you will need to keep that in mind when reading
the following section.
\beginitems
`\lq<text>\pif' &
sets <text> in `typewriter style'.
This is typically used to denote {\GAP} keywords such as `for' and
`false' or variables that are not arguments to a function, e.g.,
`{\lq}for\pif' produces `for'.
See also `\<<text>>'.
Use `\\\<' to get a ``less than'' sign.
`\lq\lq<text>\pif\pif' &
encloses <text> in double quotes,
e.g., `\lq{\lq}double-quoted text\pif\pif' produces
``double-quoted text''.
In particular, `\lq\lq<text>\pif\pif' does *not* set `\lq<text>\pif'
in typewriter style; use `{\lq\{{\lq}text\pif\}\pif}' to produce
`{`text'}'. Double quotes are mainly used to mark a phrase which will
be defined later or is used in an uncommon way.
`\\lq' &
sets a single left quote: `\lq'.
For a phrase <text> that is to be defined later or is used in an
uncommon way, please use `\lq\lq<text>\pif\pif' (which encloses <text>
in double quotes rather than single quotes).
`\\rq', `\\pif' &
each set a single apostrophe (right quote): `\pif'. For the HTML and
on-line manuals `\\accent19\{\}' also sets an apostrophe; however the
{\TeX}-derived manuals produce an acute-d blankspace (what it in fact
is).
`\\accent127' &
sets an umlaut, e.g. `\\accent127a' produces `\accent127a'. Do not
use the shorthand `\\\"' (otherwise the HTML converter will not
translate it properly).
`\<<text>>' &
sets <text> in italics. This can also be used inside `\$...\$' and
`{`...'}'. Use `\\\<' to get a ``less than'' sign. `\<...>' is used
to denote a variable which is an argument of a function; a typical
application is the description of a function:
\begintt
\>Group( <gens> ) F
The function `Group' constructs a group generated by <gens>.
\endtt
&
The `F' at the end of the first line in the above example indicates
that `Group' is a function (see the `\\>' entry, below).
`*<text>*' &
sets <text> in *emphasized style*.
`\$a.b\$' &
Inside math mode, you can use `.' instead of `\\cdot' (a centred
multiplication dot). Use `\\.' for a full stop inside math mode. For
example, `\$a.b\$' produces $a.b$ while `\$a\\.b\$' produces $a\.b$.
`\\cite\{...\}' &
produces a reference to a bibliography entry (the
`\\cite[...]\{...\}' option of La{\TeX} is *not* supported).
`"<label>"' &
produces a reference to <label>. Labels are generated by the commands
`\\Chapter', `\\Section' (see~"Labels and References"), and `\\>'
commands (see below).
`\\index\{<index-entry>\}' &
defines an index entry <index-entry>. Besides appearing in the index,
<index-entry> is also written to the section index file `manual.six'
used by the on-line help. An exclamation mark (`!'), if present, is
used to partition <index-entry> into main entry (left part) and
subentry (right part) components, in the index. {\TeX} converts
<index-entry> to lowercase and sets it in roman type, in the index.
The HTML converter respects case and uses the default font, in
producing the HTML manual index. <index-entry> must be completely
free of special characters and font changing commands; if you need
special fonts, characters or commands use one of `\\indextt' or
`\\atindex'.
& Note that for the HTML converter to process indexing commands
(`\\index', `\\indextt' and `\\atindex') correctly they *must* be on
lines of their own. There can be several indexing commands on the
same line, but there should be no horizontal whitespace before each
indexing command, and if an indexing command needs to be broken over
lines place a `\%' at the point of the break at the end of the line
to mark a ``continuation''.
& For the HTML converter it works best to put indexing commands all
together at the beginning of a paragraph, rather than strewn between
lines of a paragraph. However, for the {\TeX}-produced manuals after
a maths display one gets a rogue space if you do this (this is a
bug); you can work around the bug by putting at least one word of the
paragraph followed by your line(s) of indexing commands.
& *Note* also that indexing commands do *not* produce labels for
cross-references; they *only* produce entries for the index. Labels
are *only* produced by the chapter (`\\Chapter'), section
(`\\Section') and subsection (`\\>') commands.
`\\indextt\{<index-entry>\}' &
is the same as `\\index\{<index-entry>\}', except that <index-entry>
is set by {\TeX} in typewriter style, respecting case; the HTML
converter sets <index-entry> in the default font. Again,
<index-entry> should be completely free of special characters and
font changing commands, and `!' may be used for sub-entries in the
same way as for `\\index'. Note that a sub-entry component, if
present, is *not* set in typewriter style for the {\TeX}-produced
manuals; if you want that it is, use `\\atindex'.
`\\atindex\{<sort-entry>\}\{|indexit\}' &
is simply a special form of the `\\index' command that tells {\TeX}
to typeset the page number in italics.
`\\atindex\{<sort-entry>\}\{@<index-entry>\}' &
The HTML converter treats this command as if it was
`\\index\{<index-entry>\}', except that it strips out any font
information and sets it in the default font, but nevertheless
respects case. <index-entry> may have `|indexit' at the end which is
ignored by the HTML converter.
& The {\TeX}-produced manuals set the index entry as <index-entry>
respecting font and case, and list it according to <sort-entry>. If a
sub-entry is required then it should be present behind a `!' in
*both* the <sort-entry> and <index-entry>; the only difference
between the sub-entry in <sort-entry> and that in <index-entry>, is
that the <sort-entry> sub-entry should be stripped of mark-up and
font changing command. The <index-entry> component is ignored when
constructing the `manual.six' files, and is also ignored by the HTML
converter. Anything after an `!' in <sort-entry> is ignored when
constructing the `manual.idx' file that is processed by MakeIndex.
Macros like `\{\\GAP\}' are allowed in <index-entry>. However, any
`\lq' that appears in <index-entry> *must* be preceded by
`\\noexpand'; <sort-entry> must be completely free of special
characters and font changing commands.
& In general, one should make <sort-entry> the same as <index-entry>
modulo fonts and other mark-up, e.g.,
\begintt
\atindex{Fred!Nerk}{@\noexpand`Fred'!\noexpand`Nerk'}
\endtt
`\{\\GAP\}' &
typesets {\GAP}.
`\\package\{<pkg>\}' &
typesets <pkg> in the font correct for {\GAP} packages (respecting
case). This is intended for cross-referencing other {\GAP} packages.
There is also the command `\\Package\{<mypkg>\}' command which
defines a macro `\\<mypkg>' so that when you type `\{\\<mypkg>\}'
(please include the curly braces) the text <mypkg> is typeset in the
right way for {\GAP} packages. The `\\Package' command should normally
be included in one's `manual.tex' file (see~"The Main File") and just
allows one to type `\{\\<mypkg>\}' rather than the longer
`\\Package\{<mypkg>\}' as one is frequently likely to do when
formulating one's own {\GAP} package documentation. So, just to be
clear about the difference between `\\Package' and `\\package',
`\\Package\{<mypkg>\}' defines a macro `\\<mypkg>' but produces no
text, and `\\package\{<pkg>\}' produces <pkg> set in the font that is
right for {\GAP} packages.
`\\>' &
produces a subsection.
The line following the `\\>' entry must either contain another `\\>'
entry (in which case the further entries are assumed to be variants
and do not start a new subsection) or must be empty.
The description text will follow this empty line.
& There are several forms of the `\\>' command.
In all forms, a label and index entry are generated; the HTML
converter uses the label to form an index entry, respecting case
and setting in roman type.
If the next non-space character is not a left quote (`\lq') it is
assumed that the subsection is for a ``function''; we exhibit
these forms first.
`\\><func>' &
While this form is supported; it is discouraged. If <func> is a
0-argument function, <func> should be followed by an empty pair of
brackets (see `\\><func>(<args>)' below). If <func> is actually a
global variable then `\\>\lq<global-var>{\rq} V' should be used
instead (see below). In order for this form to be parsed correctly
the remainder of the line to the right of <func> must be empty. It
generates <func> as both a label and index entry; <func> appears as
is, in typewriter type in the {\TeX}-derived manual index.
`\\><func>(<args>)' &
The macro uses the brackets after <func> to parse the arguments
<args>. Thus, it is necessary for the function to use brackets and
for the arguments to have none. (We use the term ``function'' loosely
here to mean ``a {\GAP} command with arguments''; we really mean an
object that {\GAP} knows as a: ``Function'', ``Property'',
``Operation'', ``Category'', or ``Representation'' --- but not
``Variable'', since a ``Variable'' does not have arguments.) The
label and index entry generated consists of the text between the `>'
and opening bracket. The index entry is set as is (i.e.\ without
conversion to lowercase) in typewriter type in the {\TeX}-derived
manual index. Here is an example of how to use `\\>'; the index entry
is ```Size''' (in typewriter type, with mixed case preserved).
\begintt
\>Size( <obj> ) A
\endtt
& The `A' indicates that `Size' is an ``Attribute''. Instead of `A'
there can be `F', `P', `O', `C', or `R' which indicate that a command
is a ``Function'' (probably the most common), ``Property'',
``Operation'', ``Category'', or ``Representation'', respectively. For
the forms of the `\\>' command followed by a left quote, `V'
indicating ``Variable'' (an object without arguments), is also
possible. (See Section ``Manual Conventions'' and
Chapter ``Types of Objects'' in the {\GAP} Reference Manual).
`\\><func>(<args>)!\{<sub-entry>\}' &
This is a special form of the previous command, that forms a label
`<func>!<sub-entry>' and an index entry with main entry <func> (set
in typewriter type and respecting case) and sub-entry <sub-entry>
(set in roman type but also respecting case).
& The remaining forms of the command `\\>' expect to be followed by a
`\lq'.
`\\>\lq<command>\rq\{<label>\}' &
works as `\\>' without `\lq...\rq', but will not use bracket
matching; it simply displays <command> as a header, which appears in
typewriter type. It will use <label> as both the label and index
entry, and the index entry is set in roman type. Whenever <label>
contains a `!', it is used to partition <label> into main entry (left
part) and subentry (right part) components, in the index.
\begintt
\>`<a> + <b>'{addition}
\>`Size( <obj> )'{size} A
\endtt
& In the first of the examples immediately above, the first form of
`\\>' cannot be used because no brackets occur. Also, observe that
there is no command type (it's not appropriate here); {\TeX} does not
need it to correctly parse a `\\>' entry, in general. The second
example differs from our previous `Size' example, in that the index
entry will be typeset as ``size'' (in roman type), rather than
``{`Size'}''. Also, the index entry is always converted to lowercase,
no matter what case or mixed case was used.
`\\>\lq<command>\rq\{<label>\}!\{<sub-entry>\}' &
is equivalent to: `\\>\lq<command>\rq\{<label>!<sub-entry>\}'.
`\\>\lq<command>\rq\{<label>\}@\{<index-entry>\}' &
works as `\\>\lq<command>\rq\{<label>\}', except that it uses <label>
for sorting the index entry and the index entry itself is printed as
<index-entry>. References to the subsection use <label>. (Note that
the HTML converter ignores everything after an `@' symbol in these
commands, essentially treating the command as if it were
`\\>\lq<command>\rq\{<label>\}'. However, the HTML converter also
always preserves the case in a label. ) Here are two examples.
\begintt
\>`Size( <obj> )'{size}@{`Size'} A
\>`Size( GL( <n>, <q> ) )'{Size!GL( n, q )}@{`Size'! `GL'( \noexpand<n>, \noexpand<q> )} A
\endtt
& The first of these examples is equivalent to ``{`\\>Size( \<obj> )'}''.
For the second example, it was necessary to use `\lq' and `\rq',
since the argument contained brackets. Note that `\\noexpand' is
needed before `\<' here, but not needed before `\lq' in the
<index-entry> argument. Otherwise, the rules for sub-entries are the
same as for `\\atindex'.
`\\>\lq<global-var>{\rq} V' &
This is actually a short-hand for:
``{`\\>\lq<global-var>\rq\{<global-var>\}@\{\lq<global-var>\rq\} V'}''
to save you some typing when creating subsections for global
variables, i.e., <global-var> is the label and the index entry
appears in typewriter type, with mixed case preserved.
`\\)\{\\fmark ...\}' &
is like `\\>' except that it produces no label and index entry. It is
`\\fmark' that produces the filled in right arrow. Omitting it
produces a line in typewriter type.
`\\)\{\\kernttindent ...\}' &
is useful for producing a line in typewriter type, that you might
otherwise have typed between `\\begintt' and `\\endtt', but where you
actually want the {\TeX} macros and variables `\<...>' to be
interpreted.
`\\URL\{<url>\}' &
prints the WWW URL <url>. In the HTML version this will be a HREF link.
`\\Mailto\{<email>\}' &
prints the email address <email>. In the HTML version this will be a
`mailto' link.
\enditems
*Note:*
When a {\TeX} macro is followed by a space, {\TeX} generally swallows up
the space; one way, and it is the {\GAP}-preferred way, of preventing the
space being swallowed up, is by enclosing the macro in `\{...\}'. When a
macro is often followed by a space, it's a good habit to get into to
*always* enclose that macro in `\{...\}' (the braces do nothing when the
macro is not followed by a space, and prevent {\TeX} from swallowing up
the space, otherwise). Thus the macro for {\GAP} should *always* be typed
`\{\\GAP\}'. Similarly, macros like `\\lq', `\\rq' and `\\pif' should
probably always appear in braces; moreover the word ``don{\pif}t''
typeset via ``{`don\{\\pif\}t'}'' will actually be interpreted correctly
by the on-line browser.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{TeX Macros for Domains}
\indextt{\\N}\indextt{\\Z}\indextt{\\Q}\indextt{\\R}
\indextt{\\C}\indextt{\\F}\indextt{\\calR}
The following macros are required for the following common domains:
\beginlist
\item{`\\N'}
the natural numbers (you should probably indicate whether by your
convention $\N$ includes zero or not, when using this);
\item{`\\Z'}
the integers;
\item{`\\Q'}
the rational numbers;
\item{`\\R'}
the real numbers;
\item{`\\C'}
the complex numbers;
\item{`\\F'}
a field; and
\item{`\\calR'}
a general domain e.g.~a ring.
\endlist
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Examples, Lists, and Verbatim}
\index{list environment!description}
\indextt{\\beginitems}\indextt{\\enditems}
% produce itemized texts with 3pc hanging indentation
In order to produce a list of items with descriptions use the
`\\beginitems', `\\enditems' environment, i.e. this is a ``description''
environment in the parlance of La{\TeX} and HTML.
For example, the following list describes `base', `knownBase', and
`reduced'.
The different item/description pairs must be separated by blank lines.
\begintt
\beginitems
`base' &
must be a list of points ...
`knownBase' &
If a base for <G> is known in advance ...
`reduced' (default `true') &
If this is `true' the resulting stabilizer chain will be ...
\enditems
\endtt
This will be printed as
\beginitems
`base' &
must be a list of points ...
`knownBase' &
If a base for <G> is known in advance ...
`reduced' (default `true') &
If this is `true' the resulting stabilizer chain will be ...
\enditems
\index{list environment!compact description}
\indextt{\\beginlist}\indextt{\\endlist}\indextt{\\item}\indextt{\\itemitem}
In order to produce a list in a more compact format,
use the `\\beginlist', `\\endlist' environment.
An example is the following list.
\begintt
\beginlist
\item{(a)}
first entry
\item{(b)}
second entry
\itemitem{--}
a sub-item of the second entry
\itemitem{--}
another sub-item of the second entry
\item{(c)}
third entry
\endlist
\endtt
It is printed as follows.
\beginlist
\item{(a)}
first entry
\item{(b)}
second entry
\itemitem{--}
a sub-item of the second entry
\itemitem{--}
another sub-item of the second entry
\item{(c)}
third entry
\endlist
\index{list environment!unordered}\index{list environment!ordered}
The above example will take advantage of the ordered and unordered list
environments in the HTML version, with the addition of slightly more mark-up.
First, we present the example again with that additional mark-up, and then
we explain how it works.
\begintt
\beginlist%ordered{a}
\item{(a)}
first entry
\item{(b)}
second entry
\itemitem{--}%unordered