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

563501 views
1
2
B The Source
3
4
5
B.1 TitlePage (Source)
6
7

8
<TitlePage>
9
 <Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>
10
 <Subtitle>Every element shows up</Subtitle>
11
 <Version>Version 1.6.1
12
</Version>
13
 <TitleComment>
14
 If the subtitle ist not sufficient, this &lt;TitleComment> 
15
 element can be used for a slightly longer text on the front page.
16
 </TitleComment>
17
 <Author>Frank Lübeck 
18
 <Email>[email protected]</Email> 
19
 </Author>
20
 <Author> Max Neunhöffer 
21
 <Email>neunhoef at mcs.st-and.ac.uk</Email>
22
 </Author>
23
 <Date>September 2011</Date>
24
 <Address>
25
 Lehrstuhl D für Mathematik<Br/> Templergraben 
26
 64<Br/> 52062 Aachen<Br/> (Germany)
27
 </Address>
28
 <Abstract>This document tries to use all elements that exist in &GAPDoc;.
29
 In addition, the final output not only contains the usual
30
 content, but also an appendix with the source text. There
31
 are also links from the usual content to the corresponding
32
 source text. This should enable new users to learn &GAPDoc;
33
 quickly.
34
 </Abstract>
35
 <Copyright>&copyright; 2000-2011 by Frank Lübeck and Max Neunhöffer
36
 </Copyright>
37
 <Acknowledgements>We thank Lehrstuhl D für Mathematik.
38
 </Acknowledgements>
39
 <Colophon>This is the Colophon page.
40
 </Colophon>
41
</TitlePage>
42

43
44
45
B.2 Before First Chapter (Source)
46
47

48
<TableOfContents/>
49

50
<Body>
51

52
 Text before chapter <Ref Chap="First"/>.
53

54
<Chapter Label="First"><Heading>Sectioning Elements</Heading>
55

56
 Text before the section <Ref Sect="FirstSect"/>.
57

58
59
60
B.3 First Chapter (Source)
61
62
[1.]
63
64

65
<Section Label="FirstSect"><Heading>Normal subsections</Heading>
66

67
 <Subsection Label="Asub"><Heading>A subsection</Heading>
68

69
 This is text in the first subsection.
70

71
 </Subsection>
72

73
 <Subsection Label="Another"><Heading>Another subsection</Heading>
74
 
75
 This is text in the second subsection. This subsection 
76
 has a label, such that one can reference it.
77

78
 </Subsection>
79

80
 </Section>
81

82
83
84
B.4 ManSections (Source)
85
86
[1.2]
87
88

89
<Section><Heading>ManSections</Heading>
90

91
 <ManSection>
92
 <Func Name="f" Arg="x[,y]" Comm="calculates something"/>
93
 <Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>
94
 <Description>
95
 This function calculates something.
96
 </Description>
97
 </ManSection>
98

99
 <ManSection>
100
 <Meth Name="\^\{\}\[\]\&lt;\&amp;" Arg="c" 
101
 Label="for nothing" Comm="tricky name"/>
102
 <Description>
103
 This method is for an operation with a tricky name.
104
 </Description>
105
 </ManSection>
106

107
 <ManSection>
108
 <Oper Name="MyOperation" Arg="x" Comm="calculates something"/>
109
 <Description>
110
 The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.
111
 </Description>
112
 </ManSection>
113
 
114
 <ManSection>
115
 <Meth Name="MyOperation" Label="First" Arg="x" 
116
 Comm="generic method"/>
117
 <Description>
118
 This method calculates something by the generic method.
119
 </Description>
120
 </ManSection>
121

122
 <ManSection>
123
 <Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"
124
 Comm="for bla arguments"/>
125
 <Description>
126
 This is the super-fast method for the operation
127
 <Ref Oper="MyOperation"/> if the argument <A>x</A> is in the
128
 representation <Ref Filt="IsBla"/>. It will become even faster if
129
 the optional argument <A>good_hint</A> is given.
130
 </Description>
131
 </ManSection>
132

133
 <ManSection>
134
 <Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>
135
 <Description>
136
 The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>
137
 an object in <A>filt</A>.
138
 </Description>
139
 </ManSection>
140

141
 <ManSection>
142
 <Filt Name="IsBla" Arg="obj" Comm="representation bla"
143
 Type="representation"/>
144
 <Description>
145
 For objects in this representation there is a super-fast method
146
 (see <Ref Meth="MyOperation" Label="for bla"/>) for the operation
147
 <Ref Oper="MyOperation"/>.
148
 </Description>
149
 </ManSection>
150

151
 <ManSection>
152
 <Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>
153
 <Description>
154
 A property.
155
 </Description>
156
 </ManSection>
157

158
 <ManSection>
159
 <Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>
160
 <Description>
161
 An attribute. Number of blobbs.
162
 </Description>
163
 </ManSection>
164

165
 <ManSection>
166
 <Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>
167
 <Description>
168
 This global variable holds a list of all blibbs.
169
 </Description>
170
 </ManSection>
171

172
 <ManSection>
173
 <Fam Name="BlibbsFamily" Comm="family of blibbs"/>
174
 <Description>
175
 Family of all blibbs.
176
 </Description>
177
 </ManSection>
178

179
 <ManSection>
180
 <InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>
181
 <Description>
182
 This info class is used throughout the library of blibbs.
183
 </Description>
184
 </ManSection>
185
 
186
 </Section>
187

188
189
190
B.5 Various Types of Text (Source)
191
192
[2.]
193
194

195
<Chapter><Heading>Other Markup</Heading>
196

197
<Section><Heading>Various types of text</Heading>
198

199
In this section we present examples for all the various types of text
200
that are possible in &GAPDoc;: 
201
<List>
202
 <Item>
203
 <Emph>This</Emph> is <E>emphasized</E>.</Item>
204
 <Item>
205
 <E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.
206
 </Item>
207
 <Item>
208
 <E>Arguments</E> of functions have an element. They look like this: 
209
 <Arg>x</Arg> and <A>y</A>.</Item>
210
 <Item> 
211
 <E>Code</E> can be written with the Code element: 
212
 <Code>if x = y then Print("Equal"); fi;</Code> or
213
 <C>while true do Print("Hello"); od;</C>.</Item> 
214
 <Item>
215
 <E>Filenames</E> have their own element:
216
 <File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>
217
 <Item>
218
 <E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things
219
 are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>
220
 <Item>
221
 <E>Packages</E> are typeset like this: 
222
 <Package>Small Groups Library</Package>
223
 </Item>
224
 <Item>
225
 <E>Quoted</E> text: <Q>This is a text in quotes.</Q>
226
 </Item>
227
</List>
228

229
<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.
230
<Par/><E>Alternatives</E> for different output formats:
231

232
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
233
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
234
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>
235
<Alt Only="Text">Text</Alt> output.</Alt>
236

237
<P/>
238

239
240
241
B.6 Verbatim-like text (Source)
242
243
[2.1]
244
245

246
There are also three elements to typeset <Q>verbatim-like</Q> text.
247
<P/>
248
The first is a <E>Listing</E>:
249

250
<Listing Type="GAP code">
251
<![CDATA[Sieve := function(n)
252
 # Returns the primes less than n
253
 local l,p,i;
254
 l := [1..n]; Unbind(l[1]);
255
 p := 2;
256
 while p^2 <= n do
257
 if IsBound(l[p]) then
258
 i := 2 * p;
259
 while i <= n do Unbind(l[i]); i := i + p; od;
260
 fi;
261
 p := p + 1;
262
 od;
263
 return Compacted(l);
264
end;]]>
265
</Listing>
266

267
Here is a <E>Log</E> of a &GAP; session using this function:
268

269
<Log>
270
gap&gt; Sieve(100);
271
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
272
 67, 71, 73, 79, 83, 89, 97 ]
273
gap&gt; Length(last);
274
25
275
</Log>
276

277
Here is a &GAP; <E>Example</E> session that is automatically tested:
278

279
<Example>
280
gap&gt; s := Size(CharacterTable("M"));
281
808017424794512875886459904961710757005754368000000000
282
gap&gt; s &lt; 10^53; 
283
false
284
gap&gt; s &lt; 10^54;
285
true
286
</Example>
287

288
</Section>
289

290
291
292
B.7 Formulae (Source)
293
294
[2.2]
295
296

297
<Section><Heading>Formulae</Heading>
298

299
There are three types of formulae. <P/>
300
The first is the <E>normal math mode</E> of &LaTeX;: 
301

302
<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>. 
303

304
Then there are <E>displayed formulae</E>:
305
<Display>
306
 \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
307
 \left(\sum_{j=1}^d y_j b_j \right) =
308
 \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k 
309
</Display>
310

311
If possible, use the <C>Alt</C> element to specify a better readable text
312
version of such a formula as in the following example:<P/>
313

314
<Alt Not="Text,HTML"><Display>
315
 \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
316
 \left(\sum_{j=1}^d y_j b_j \right) =
317
 \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k 
318
</Display></Alt>
319
<Alt Only="Text,HTML"><Verb>
320
 d d d 
321
 ----- ----- ----- ----- 
322
 \ \ \ \ 
323
 ==> ( ) x_i b_i )( ) y_i b_i ) = ) ( ) x_i y_j h_ijk ) b_k
324
 / / / / 
325
 ----- ----- ----- ----- 
326
 i = 1 i = 1 k = 1 i,j 
327
</Verb><P/></Alt>
328

329
For small formulae without <Q>difficult</Q> parts use the <C>M</C>
330
element: <M>b_i</M>,
331
<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace 
332
matters for text (or HTML) output).<P/>
333

334
Here are two formulae containing less than characters which are special
335
characters for XML:
336
<M><![CDATA[a < b < c < d]]></M> and <M>e &lt; f</M>.
337
</Section>
338

339
340
341
B.8 Crossreferencing (Source)
342
343
[2.3]
344
345

346
<Section Label="Cross"><Heading>Crossreferencing</Heading>
347

348
<Label Name="there"/>
349

350
In this section we demonstrate various references to parts of this
351
document. Here is a reference to this section: <Ref Sect="Cross"/>.
352
Here is a reference to chapter <Ref Chap="First"/>, to appendix
353
<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>. 
354
<P/>
355

356
We distinguish among others references 
357
 to functions (see <Ref Func="f"/>), 
358
 to methods with tricky name (see 
359
 <Ref Meth="\^\{\}\[\]\&lt;\&amp;" Label="for nothing"/>),
360
 to operations (see <Ref Oper="MyOperation"/>), 
361
 to methods (see <Ref Meth="MyOperation" Label="First"/> or 
362
 <Ref Meth="MyOperation" Label="for bla"/>), 
363
 to filters (see <Ref Filt="IsBla"/>), 
364
 to properties (see <Ref Prop="IsBlubb"/>),
365
 to attributes (see <Ref Attr="NumberBlobbs"/>), 
366
 to variables (<Ref Var="AllBlibbs"/>), 
367
 to families (see <Ref Fam="BlibbsFamily"/>),
368
 and to info classes (see <Ref InfoClass="InfoBlibbs"/>).
369
<P/>
370

371
There are also references to labels: see <Ref Text="here" Label="there"/>,
372
to other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or
373
<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference
374
manual.
375
<P/>
376

377
References to sections come in two styles: 
378
<Ref Chap="First" Style="Number"/>
379
or <Ref Chap="First" Style="Text"/>.
380
<P/>
381

382
Another type of cross referencing is bibliography. Here is a 
383
citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.
384
<P/>
385

386
There are also URLs:<P/>
387

388
<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>
389

390
Email addresses have a special element:
391
<Email>[email protected]</Email>
392
<P/>
393

394
and Homepages another one:
395
<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>
396
<P/>
397

398
One can generate index entries as follows (look up the words 
399
<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).
400
<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>
401
<Index>RWTH</Index>
402
<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>
403
<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc; 
404
<Subkey>for &GAP; programmers</Subkey></Index>
405

406
</Section>
407

408
409
410
B.9 Lists and Tables (Source)
411
412
[2.4]
413
414

415
<Section><Heading>Lists and Tables</Heading>
416

417
There are
418
<List>
419
 <Item>lists</Item>
420
 <Item>enumerations, and</Item>
421
 <Item>tables</Item>
422
</List>
423
or:
424
<Enum>
425
 <Item>lists</Item>
426
 <Item>enumerations, and</Item>
427
 <Item>tables</Item>
428
</Enum>
429
or with marks:
430
<List>
431
 <Mark>lists:</Mark><Item> not numbered</Item>
432
 <Mark>enumerations:</Mark><Item> numbered</Item>
433
 <Mark>tables:</Mark><Item> two-dimensional</Item>
434
</List>
435

436
Lists can also be nested:
437
<Enum>
438
 <Item>
439
 <Enum>
440
 <Item>first item of inner enumeration </Item>
441
 <Item>second item of inner enumeration </Item>
442
 </Enum>
443
 </Item>
444
 <Item>
445
 <List>
446
 <Item>first item of inner list </Item>
447
 <Item>second item of inner list </Item>
448
 </List>
449
 </Item>
450
</Enum>
451

452
Here is a <E>table</E>:
453

454
<Table Align="|r|c|l|">
455
 <Caption>Prices</Caption>
456
 <HorLine/>
457
 <Row>
458
 <Item>Object</Item><Item>Price</Item><Item>available</Item>
459
 </Row>
460
 <HorLine/>
461
 <HorLine/>
462
 <Row>
463
 <Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>
464
 </Row>
465
 <HorLine/>
466
 <Row>
467
 <Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>
468
 </Row>
469
 <HorLine/>
470
</Table>
471

472
</Section>
473

474
475
476
B.10 Entities and Special Characters (Source)
477
478
[2.5]
479
480

481
<Section><Heading>Entities and Special Characters</Heading>
482
<Label Name="TenBack"/>
483

484
[&see; <Ref Sect="Ten"/>]<P/>
485

486
Here is a table of special characters, the first two are special for
487
XML and must be typed in by entities in &GAPDoc; documents. The other 
488
characters are special for &LaTeX; but in &GAPDoc; they can be typed
489
directly. 
490

491
<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA"> 
492
 <Caption>Special characters in character data</Caption>
493
 <HorLine/> <Row> 
494
 <Item><C>&amp;</C></Item>
495
 <Item><C>&lt;</C></Item>
496
 <Item><C>></C></Item>
497
 <Item><C>#</C></Item>
498
 <Item><C>$</C></Item>
499
 <Item><C>%</C></Item>
500
 <Item><C>~</C></Item>
501
 <Item><C>\</C></Item> 
502
 <Item><C>{</C></Item>
503
 <Item><C>}</C></Item>
504
 <Item><C>_</C></Item>
505
 <Item><C>^</C></Item>
506
 <Item><C>&nbsp;</C></Item>
507
 </Row> <HorLine/>
508
</Table>
509

510
And here are the predefined entities in &GAPDoc;:
511

512
<Table Align="|l|l|">
513
<Caption>Predefined Entities in the &GAPDoc; system</Caption>
514
<HorLine/>
515
<Row> <Item><C>&amp;GAP;</C></Item> <Item>&GAP;</Item> </Row>
516
<HorLine/>
517
<Row> <Item><C>&amp;GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>
518
<HorLine/>
519
<Row> <Item><C>&amp;TeX;</C></Item> <Item>&TeX;</Item> </Row>
520
<HorLine/>
521
<Row> <Item><C>&amp;LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>
522
<HorLine/>
523
<Row> <Item><C>&amp;BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>
524
<HorLine/>
525
<Row> <Item><C>&amp;MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>
526
<HorLine/>
527
<Row> <Item><C>&amp;XGAP;</C></Item> <Item>&XGAP;</Item> </Row>
528
<HorLine/>
529
<Row> <Item><C>&amp;copyright;</C></Item> <Item>&copyright;</Item> </Row>
530
<HorLine/>
531
</Table>
532

533
And some more for mathematical symbols: 
534
&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.
535

536
</Section>
537

538
</Chapter>
539

540
</Body>
541

542
543
544
B.11 Appendix (Source)
545
546
[A.]
547
548
 GAPDoc source 
549
<Appendix><Heading>An Appendix</Heading>
550

551
This is an appendix.
552
</Appendix>
553

554
555
556