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
<?xml version="1.0" encoding="UTF-8"?>
2
3
4
<!DOCTYPE Book SYSTEM "gapdoc.dtd"
5
[ <!ENTITY see '<Alt Only="LaTeX">$\to$</Alt><Alt Not="LaTeX">&#8594;</Alt>'>
6
]>
7
8
<Book Name="GAPDoc Example">
9
10
<TitlePage>
11
<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>
12
<Subtitle>Every element shows up</Subtitle>
13
<Version>Version <#Include SYSTEM "../version"></Version>
14
<TitleComment>
15
If the subtitle is not sufficient, this &lt;TitleComment>
16
element can be used for a slightly longer text on the front page.
17
</TitleComment>
18
<Author>Frank Lübeck
19
<Email>[email protected]</Email>
20
</Author>
21
<Author> Max Neunhöffer
22
<Email>neunhoef at mcs.st-and.ac.uk</Email>
23
</Author>
24
<Date>November 2017</Date>
25
<Address>
26
Lehrstuhl D für Mathematik<Br/> Pontdriesch
27
14/16<Br/> 52062 Aachen<Br/> (Germany)
28
</Address>
29
<Abstract>This document tries to use all elements that exist in &GAPDoc;.
30
In addition, the final output not only contains the usual
31
content, but also an appendix with the source text. There
32
are also links from the usual content to the corresponding
33
source text. This should enable new users to learn &GAPDoc;
34
quickly.
35
</Abstract>
36
<Copyright>&copyright; 2000-2017 by Frank Lübeck and Max Neunhöffer
37
</Copyright>
38
<Acknowledgements>We thank Lehrstuhl D für Mathematik.
39
</Acknowledgements>
40
<Colophon>This is the Colophon page.
41
</Colophon>
42
</TitlePage>
43
44
<TableOfContents/>
45
46
<Body>
47
Text before chapter <Ref Chap="First"/>. (&see; <Ref Sect="Two"/>)
48
49
<Chapter Label="First"><Heading>Sectioning Elements</Heading>
50
51
Text before the section <Ref Sect="FirstSect"/>. (&see; <Ref Sect="Two"/>)
52
53
<Label Name="ThreeBack"/>
54
<Section Label="FirstSect"><Heading>Normal subsections</Heading>
55
56
[&see; <Ref Sect="Three"/>]
57
58
<Subsection Label="Asub"><Heading>A subsection</Heading>
59
60
This is text in the first subsection.
61
62
</Subsection>
63
64
<Subsection Label="Another"><Heading>Another subsection</Heading>
65
66
This is text in the second subsection. This subsection
67
has a label, such that one can reference it.
68
69
</Subsection>
70
71
</Section>
72
73
<Section><Heading>ManSections</Heading>
74
<Label Name="FourBack"/>
75
76
[&see; <Ref Sect="Four"/>]
77
78
<ManSection>
79
<Func Name="f" Arg="x[,y]" Comm="calculates something"/>
80
<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>
81
<Description>
82
This function calculates something.
83
</Description>
84
</ManSection>
85
86
<ManSection>
87
<Meth Name="\^\{\}\[\]\&lt;\&amp;" Arg="c"
88
Label="for nothing" Comm="tricky name"/>
89
<Description>
90
This method is for an operation with a tricky name.
91
</Description>
92
</ManSection>
93
94
<ManSection>
95
<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>
96
<Description>
97
The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.
98
</Description>
99
</ManSection>
100
101
<ManSection>
102
<Meth Name="MyOperation" Label="First" Arg="x"
103
Comm="generic method"/>
104
<Description>
105
This method calculates something by the generic method.
106
</Description>
107
</ManSection>
108
109
<ManSection>
110
<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"
111
Comm="for bla arguments"/>
112
<Description>
113
This is the super-fast method for the operation
114
<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the
115
representation <Ref Filt="IsBla"/>. It will become even faster if
116
the optional argument <A>good_hint</A> is given.
117
</Description>
118
</ManSection>
119
120
<ManSection>
121
<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>
122
<Description>
123
The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>
124
an object in <A>filt</A>.
125
</Description>
126
</ManSection>
127
128
<ManSection>
129
<Filt Name="IsBla" Arg="obj" Comm="representation bla"
130
Type="representation"/>
131
<Description>
132
For objects in this representation there is a super-fast method
133
(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation
134
<Ref Oper="MyOperation"/>.
135
</Description>
136
</ManSection>
137
138
<ManSection>
139
<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>
140
<Description>
141
A property.
142
</Description>
143
</ManSection>
144
145
<ManSection>
146
<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>
147
<Description>
148
An attribute. Number of blobbs.
149
</Description>
150
</ManSection>
151
152
<ManSection>
153
<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>
154
<Description>
155
This global variable holds a list of all blibbs.
156
</Description>
157
</ManSection>
158
159
<ManSection>
160
<Fam Name="BlibbsFamily" Comm="family of blibbs"/>
161
<Description>
162
Family of all blibbs.
163
</Description>
164
</ManSection>
165
166
<ManSection>
167
<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>
168
<Description>
169
This info class is used throughout the library of blibbs.
170
</Description>
171
</ManSection>
172
173
</Section>
174
175
</Chapter>
176
177
178
<Chapter><Heading>Other Markup</Heading>
179
<Label Name="FiveBack"/>
180
181
<Section><Heading>Various types of text</Heading>
182
183
[&see; <Ref Sect="Five"/>]<P/>
184
185
In this section we present examples for all the various types of text
186
that are possible in &GAPDoc;:
187
<List>
188
<Item>
189
<Emph>This</Emph> is <E>emphasized</E>.</Item>
190
<Item>
191
<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.
192
</Item>
193
<Item>
194
<E>Arguments</E> of functions have an element. They look like this:
195
<Arg>x</Arg> and <A>y</A>.</Item>
196
<Item>
197
<E>Code</E> can be written with the Code element:
198
<Code>if x = y then Print("Equal"); fi;</Code> or
199
<C>while true do Print("Hello"); od;</C>.</Item>
200
<Item>
201
<E>Filenames</E> have their own element:
202
<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>
203
<Item>
204
<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things
205
are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>
206
<Item>
207
<E>Packages</E> are typeset like this:
208
<Package>Small Groups Library</Package>
209
</Item>
210
<Item>
211
<E>Quoted</E> text: <Q>This is a text in quotes.</Q>
212
</Item>
213
</List>
214
215
<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.
216
<Par/><E>Alternatives</E> for different output formats:
217
218
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
219
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
220
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>
221
<Alt Only="Text">Text</Alt> output.</Alt>
222
223
<P/>
224
225
<Label Name="SixBack"/>
226
There are also three elements to typeset <Q>verbatim-like</Q> text.
227
(&see; <Ref Sect="Six"/>)<P/>
228
The first is a <E>Listing</E>:
229
230
<Listing Type="GAP code">
231
<![CDATA[Sieve := function(n)
232
# Returns the primes less than n
233
local l,p,i;
234
l := [1..n]; Unbind(l[1]);
235
p := 2;
236
while p^2 <= n do
237
if IsBound(l[p]) then
238
i := 2 * p;
239
while i <= n do Unbind(l[i]); i := i + p; od;
240
fi;
241
p := p + 1;
242
od;
243
return Compacted(l);
244
end;]]>
245
</Listing>
246
247
Here is a <E>Log</E> of a &GAP; session using this function:
248
249
<Log>
250
gap&gt; Sieve(100);
251
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
252
67, 71, 73, 79, 83, 89, 97 ]
253
gap&gt; Length(last);
254
25
255
</Log>
256
257
Here is a &GAP; <E>Example</E> session that is automatically tested:
258
259
<Example>
260
gap&gt; s := Size(CharacterTable("M"));
261
808017424794512875886459904961710757005754368000000000
262
gap&gt; s &lt; 10^53;
263
false
264
gap&gt; s &lt; 10^54;
265
true
266
</Example>
267
268
</Section>
269
270
<Section><Heading>Formulae</Heading>
271
<Label Name="SevenBack"/>
272
273
[&see; <Ref Sect="Seven"/>]<P/>
274
275
There are three types of formulae. <P/>
276
The first is the <E>normal math mode</E> of &LaTeX;:
277
278
<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.
279
280
Then there are <E>displayed formulae</E>:
281
<Display>
282
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
283
\left(\sum_{j=1}^d y_j b_j \right) =
284
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
285
</Display>
286
287
If possible, use the <C>Alt</C> element to specify a better readable text
288
version of such a formula as in the following example:<P/>
289
290
<Alt Not="Text,HTML"><Display>
291
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
292
\left(\sum_{j=1}^d y_j b_j \right) =
293
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
294
</Display></Alt>
295
<Alt Only="Text,HTML"><Verb>
296
d d d
297
----- ----- ----- -----
298
\ \ \ \
299
==> ( ) x_i b_i )( ) y_j b_j ) = ) ( ) x_i y_j h_ijk ) b_k
300
/ / / /
301
----- ----- ----- -----
302
i = 1 j = 1 k = 1 i,j
303
</Verb><P/></Alt>
304
305
For small formulae without <Q>difficult</Q> parts use the <C>M</C>
306
element: <M>b_i</M>,
307
<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace
308
matters for text (or HTML) output.<P/>
309
310
Here are two formulae containing less than characters which are special
311
characters for XML:
312
<M><![CDATA[a < b < c < d]]></M> and <M>e &lt; f</M>.
313
<P/>
314
315
Using the <C>Mode</C> attribute of a <C>Display</C> element formulae
316
like
317
<Display Mode="M">a \longrightarrow a \bmod m\prime</Display>
318
can also be displayed nicely in text and HTML output.
319
</Section>
320
321
322
<Section Label="Cross"><Heading>Crossreferencing</Heading>
323
<Label Name="EightBack"/>
324
325
[&see; <Ref Sect="Eight"/>]<P/>
326
327
<Label Name="there"/>
328
329
In this section we demonstrate various references to parts of this
330
document. Here is a reference to this section: <Ref Sect="Cross"/>.
331
Here is a reference to chapter <Ref Chap="First"/>, to appendix
332
<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.
333
<P/>
334
335
We distinguish among others references
336
to functions (see <Ref Func="f"/>),
337
to methods with tricky name (see
338
<Ref Meth="\^\{\}\[\]\&lt;\&amp;" Label="for nothing"/>),
339
to operations (see <Ref Oper="MyOperation"/>),
340
to methods (see <Ref Meth="MyOperation" Label="First"/> or
341
<Ref Meth="MyOperation" Label="for bla"/>),
342
to filters (see <Ref Filt="IsBla"/>),
343
to properties (see <Ref Prop="IsBlubb"/>),
344
to attributes (see <Ref Attr="NumberBlobbs"/>),
345
to variables (<Ref Var="AllBlibbs"/>),
346
to families (see <Ref Fam="BlibbsFamily"/>),
347
and to info classes (see <Ref InfoClass="InfoBlibbs"/>).
348
<P/>
349
350
There are also references to labels: see <Ref Text="here" Label="there"/>,
351
to other books: see <Ref Sect="What is a DTD" BookName="GAPDoc"/> or
352
<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference
353
manual.
354
<P/>
355
356
References to sections come in two styles:
357
<Ref Chap="First" Style="Number"/>
358
or <Ref Chap="First" Style="Text"/>.
359
<P/>
360
361
Another type of cross referencing is bibliography. Here is a
362
citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.
363
<P/>
364
365
There are also URLs:<P/>
366
367
<URL>http://www.math.rwth-aachen.de/</URL><P/>
368
369
Email addresses have a special element:
370
<Email>[email protected]</Email>
371
<P/>
372
373
and Homepages another one:
374
<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>
375
<P/>
376
And here is a link to the <URL>
377
<Link>http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/EDIM/index.html#ARCHS</Link>
378
<LinkText><Package>EDIM</Package>
379
archives</LinkText></URL>.
380
<P/>
381
382
One can generate index entries as follows (look up the words
383
<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, <Q>Aachen, Hauptbahnhof</Q>, and
384
<Q><Package>GAPDoc</Package>, for &GAP; programmers</Q>).
385
<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>
386
<Index>RWTH</Index>
387
<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>
388
<Index Key="GAPDoc" Subkey="for GAP programmers"><Package>GAPDoc</Package>
389
<Subkey>for &GAP; programmers</Subkey></Index>
390
391
</Section>
392
393
394
<Section><Heading>Lists and Tables</Heading>
395
<Label Name="NineBack"/>
396
397
[&see; <Ref Sect="Nine"/>]<P/>
398
399
There are
400
<List>
401
<Item>lists</Item>
402
<Item>enumerations, and</Item>
403
<Item>tables</Item>
404
</List>
405
or:
406
<Enum>
407
<Item>lists</Item>
408
<Item>enumerations, and</Item>
409
<Item>tables</Item>
410
</Enum>
411
or with marks:
412
<List>
413
<Mark>lists:</Mark><Item> not numbered</Item>
414
<Mark>enumerations:</Mark><Item> numbered</Item>
415
<Mark>tables:</Mark><Item> two-dimensional</Item>
416
</List>
417
418
Lists can also be nested:
419
<Enum>
420
<Item>
421
<Enum>
422
<Item>first item of inner enumeration </Item>
423
<Item>second item of inner enumeration </Item>
424
</Enum>
425
</Item>
426
<Item>
427
<List>
428
<Item>first item of inner list </Item>
429
<Item>second item of inner list </Item>
430
</List>
431
</Item>
432
</Enum>
433
434
Here is a <E>table</E>:
435
436
<Table Align="|r|c|l|">
437
<Caption>Prices</Caption>
438
<HorLine/>
439
<Row>
440
<Item>Object</Item><Item>Price</Item><Item>available</Item>
441
</Row>
442
<HorLine/>
443
<HorLine/>
444
<Row>
445
<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>
446
</Row>
447
<HorLine/>
448
<Row>
449
<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>
450
</Row>
451
<HorLine/>
452
</Table>
453
454
</Section>
455
456
457
<Section><Heading>Entities and Special Characters</Heading>
458
<Label Name="TenBack"/>
459
460
[&see; <Ref Sect="Ten"/>]<P/>
461
462
Here is a table of special characters, the first two are special for
463
XML and must be typed in by entities in &GAPDoc; documents. The other
464
characters are special for &LaTeX; but in &GAPDoc; they can be typed
465
directly.
466
467
<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">
468
<Caption>Special characters in character data</Caption>
469
<HorLine/> <Row>
470
<Item><C>&amp;</C></Item>
471
<Item><C>&lt;</C></Item>
472
<Item><C>></C></Item>
473
<Item><C>#</C></Item>
474
<Item><C>$</C></Item>
475
<Item><C>%</C></Item>
476
<Item><C>~</C></Item>
477
<Item><C>\</C></Item>
478
<Item><C>{</C></Item>
479
<Item><C>}</C></Item>
480
<Item><C>_</C></Item>
481
<Item><C>^</C></Item>
482
<Item><C>&nbsp;</C></Item>
483
</Row> <HorLine/>
484
</Table>
485
486
And here are the predefined entities in &GAPDoc;:
487
488
<Table Align="|l|l|">
489
<Caption>Predefined Entities in the &GAPDoc; system</Caption>
490
<HorLine/>
491
<Row> <Item><C>&amp;GAP;</C></Item> <Item>&GAP;</Item> </Row>
492
<HorLine/>
493
<Row> <Item><C>&amp;GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>
494
<HorLine/>
495
<Row> <Item><C>&amp;TeX;</C></Item> <Item>&TeX;</Item> </Row>
496
<HorLine/>
497
<Row> <Item><C>&amp;LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>
498
<HorLine/>
499
<Row> <Item><C>&amp;BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>
500
<HorLine/>
501
<Row> <Item><C>&amp;MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>
502
<HorLine/>
503
<Row> <Item><C>&amp;XGAP;</C></Item> <Item>&XGAP;</Item> </Row>
504
<HorLine/>
505
<Row> <Item><C>&amp;copyright;</C></Item> <Item>&copyright;</Item> </Row>
506
<HorLine/>
507
</Table>
508
509
And some more for mathematical symbols:
510
&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.
511
512
</Section>
513
514
</Chapter>
515
516
</Body>
517
518
<Appendix Label="Appendix">
519
<Heading>An Appendix</Heading>
520
<Label Name="ElevenBack"/>
521
522
[&see; <Ref Sect="Eleven"/>]<P/>
523
524
This is an appendix.
525
</Appendix>
526
527
<Appendix Label="Source"><Heading>The Source</Heading>
528
529
<Section Label="One"><Heading>TitlePage (Source)</Heading>
530
531
<Listing>
532
<![CDATA[<TitlePage>
533
<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>
534
<Subtitle>Every element shows up</Subtitle>
535
<Version>Version <#Include SYSTEM "../version"></Version>
536
<TitleComment>
537
If the subtitle ist not sufficient, this &lt;TitleComment>
538
element can be used for a slightly longer text on the front page.
539
</TitleComment>
540
<Author>Frank Lübeck
541
<Email>[email protected]</Email>
542
</Author>
543
<Author> Max Neunhöffer
544
<Email>neunhoef at mcs.st-and.ac.uk</Email>
545
</Author>
546
<Date>September 2011</Date>
547
<Address>
548
Lehrstuhl D für Mathematik<Br/> Templergraben
549
64<Br/> 52062 Aachen<Br/> (Germany)
550
</Address>
551
<Abstract>This document tries to use all elements that exist in &GAPDoc;.
552
In addition, the final output not only contains the usual
553
content, but also an appendix with the source text. There
554
are also links from the usual content to the corresponding
555
source text. This should enable new users to learn &GAPDoc;
556
quickly.
557
</Abstract>
558
<Copyright>&copyright; 2000-2011 by Frank Lübeck and Max Neunhöffer
559
</Copyright>
560
<Acknowledgements>We thank Lehrstuhl D für Mathematik.
561
</Acknowledgements>
562
<Colophon>This is the Colophon page.
563
</Colophon>
564
</TitlePage>]]>
565
</Listing>
566
567
</Section>
568
569
570
<Section Label="Two"><Heading>Before First Chapter (Source)</Heading>
571
572
<Listing>
573
<![CDATA[<TableOfContents/>
574
575
<Body>
576
577
Text before chapter <Ref Chap="First"/>.
578
579
<Chapter Label="First"><Heading>Sectioning Elements</Heading>
580
581
Text before the section <Ref Sect="FirstSect"/>.]]>
582
</Listing>
583
584
</Section>
585
586
587
<Section Label="Three">
588
<Heading>First Chapter (Source)</Heading>
589
590
[<Ref Label="ThreeBack"/>]
591
592
<Listing>
593
<![CDATA[<Section Label="FirstSect"><Heading>Normal subsections</Heading>
594
595
<Subsection Label="Asub"><Heading>A subsection</Heading>
596
597
This is text in the first subsection.
598
599
</Subsection>
600
601
<Subsection Label="Another"><Heading>Another subsection</Heading>
602
603
This is text in the second subsection. This subsection
604
has a label, such that one can reference it.
605
606
</Subsection>
607
608
</Section>]]>
609
</Listing>
610
611
</Section>
612
613
614
<Section Label="Four"><Heading>ManSections (Source)</Heading>
615
616
[<Ref Label="FourBack"/>]
617
618
<Listing>
619
<![CDATA[<Section><Heading>ManSections</Heading>
620
621
<ManSection>
622
<Func Name="f" Arg="x[,y]" Comm="calculates something"/>
623
<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>
624
<Description>
625
This function calculates something.
626
</Description>
627
</ManSection>
628
629
<ManSection>
630
<Meth Name="\^\{\}\[\]\&lt;\&amp;" Arg="c"
631
Label="for nothing" Comm="tricky name"/>
632
<Description>
633
This method is for an operation with a tricky name.
634
</Description>
635
</ManSection>
636
637
<ManSection>
638
<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>
639
<Description>
640
The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.
641
</Description>
642
</ManSection>
643
644
<ManSection>
645
<Meth Name="MyOperation" Label="First" Arg="x"
646
Comm="generic method"/>
647
<Description>
648
This method calculates something by the generic method.
649
</Description>
650
</ManSection>
651
652
<ManSection>
653
<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"
654
Comm="for bla arguments"/>
655
<Description>
656
This is the super-fast method for the operation
657
<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the
658
representation <Ref Filt="IsBla"/>. It will become even faster if
659
the optional argument <A>good_hint</A> is given.
660
</Description>
661
</ManSection>
662
663
<ManSection>
664
<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>
665
<Description>
666
The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>
667
an object in <A>filt</A>.
668
</Description>
669
</ManSection>
670
671
<ManSection>
672
<Filt Name="IsBla" Arg="obj" Comm="representation bla"
673
Type="representation"/>
674
<Description>
675
For objects in this representation there is a super-fast method
676
(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation
677
<Ref Oper="MyOperation"/>.
678
</Description>
679
</ManSection>
680
681
<ManSection>
682
<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>
683
<Description>
684
A property.
685
</Description>
686
</ManSection>
687
688
<ManSection>
689
<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>
690
<Description>
691
An attribute. Number of blobbs.
692
</Description>
693
</ManSection>
694
695
<ManSection>
696
<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>
697
<Description>
698
This global variable holds a list of all blibbs.
699
</Description>
700
</ManSection>
701
702
<ManSection>
703
<Fam Name="BlibbsFamily" Comm="family of blibbs"/>
704
<Description>
705
Family of all blibbs.
706
</Description>
707
</ManSection>
708
709
<ManSection>
710
<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>
711
<Description>
712
This info class is used throughout the library of blibbs.
713
</Description>
714
</ManSection>
715
716
</Section>]]>
717
</Listing>
718
719
</Section>
720
721
722
<Section Label="Five"><Heading>Various Types of Text (Source)</Heading>
723
724
[<Ref Label="FiveBack"/>]
725
726
<Listing>
727
<![CDATA[<Chapter><Heading>Other Markup</Heading>
728
729
<Section><Heading>Various types of text</Heading>
730
731
In this section we present examples for all the various types of text
732
that are possible in &GAPDoc;:
733
<List>
734
<Item>
735
<Emph>This</Emph> is <E>emphasized</E>.</Item>
736
<Item>
737
<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.
738
</Item>
739
<Item>
740
<E>Arguments</E> of functions have an element. They look like this:
741
<Arg>x</Arg> and <A>y</A>.</Item>
742
<Item>
743
<E>Code</E> can be written with the Code element:
744
<Code>if x = y then Print("Equal"); fi;</Code> or
745
<C>while true do Print("Hello"); od;</C>.</Item>
746
<Item>
747
<E>Filenames</E> have their own element:
748
<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>
749
<Item>
750
<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things
751
are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>
752
<Item>
753
<E>Packages</E> are typeset like this:
754
<Package>Small Groups Library</Package>
755
</Item>
756
<Item>
757
<E>Quoted</E> text: <Q>This is a text in quotes.</Q>
758
</Item>
759
</List>
760
761
<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.
762
<Par/><E>Alternatives</E> for different output formats:
763
764
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
765
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
766
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]>]<![CDATA[]></Alt>
767
<Alt Only="Text">Text</Alt> output.</Alt>
768
769
<P/>]]>
770
</Listing>
771
772
</Section>
773
774
775
<Section Label="Six"><Heading>Verbatim-like text (Source)</Heading>
776
777
[<Ref Label="SixBack"/>]
778
779
<Listing>
780
<![CDATA[There are also three elements to typeset <Q>verbatim-like</Q> text.
781
<P/>
782
The first is a <E>Listing</E>:
783
784
<Listing Type="GAP code">
785
<![CDATA[Sieve := function(n)
786
# Returns the primes less than n
787
local l,p,i;
788
l := [1..n]; Unbind(l[1]);
789
p := 2;
790
while p^2 <= n do
791
if IsBound(l[p]) then
792
i := 2 * p;
793
while i <= n do Unbind(l[i]); i := i + p; od;
794
fi;
795
p := p + 1;
796
od;
797
return Compacted(l);
798
end;]]>]<![CDATA[]>
799
</Listing>
800
801
Here is a <E>Log</E> of a &GAP; session using this function:
802
803
<Log>
804
gap&gt; Sieve(100);
805
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
806
67, 71, 73, 79, 83, 89, 97 ]
807
gap&gt; Length(last);
808
25
809
</Log>
810
811
Here is a &GAP; <E>Example</E> session that is automatically tested:
812
813
<Example>
814
gap&gt; s := Size(CharacterTable("M"));
815
808017424794512875886459904961710757005754368000000000
816
gap&gt; s &lt; 10^53;
817
false
818
gap&gt; s &lt; 10^54;
819
true
820
</Example>
821
822
</Section>]]>
823
</Listing>
824
825
</Section>
826
827
828
<Section Label="Seven"><Heading>Formulae (Source)</Heading>
829
830
[<Ref Label="SevenBack"/>]
831
832
<Listing>
833
<![CDATA[<Section><Heading>Formulae</Heading>
834
835
There are three types of formulae. <P/>
836
The first is the <E>normal math mode</E> of &LaTeX;:
837
838
<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.
839
840
Then there are <E>displayed formulae</E>:
841
<Display>
842
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
843
\left(\sum_{j=1}^d y_j b_j \right) =
844
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
845
</Display>
846
847
If possible, use the <C>Alt</C> element to specify a better readable text
848
version of such a formula as in the following example:<P/>
849
850
<Alt Not="Text,HTML"><Display>
851
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
852
\left(\sum_{j=1}^d y_j b_j \right) =
853
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
854
</Display></Alt>
855
<Alt Only="Text,HTML"><Verb>
856
d d d
857
----- ----- ----- -----
858
\ \ \ \
859
==> ( ) x_i b_i )( ) y_i b_i ) = ) ( ) x_i y_j h_ijk ) b_k
860
/ / / /
861
----- ----- ----- -----
862
i = 1 i = 1 k = 1 i,j
863
</Verb><P/></Alt>
864
865
For small formulae without <Q>difficult</Q> parts use the <C>M</C>
866
element: <M>b_i</M>,
867
<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace
868
matters for text (or HTML) output).<P/>
869
870
Here are two formulae containing less than characters which are special
871
characters for XML:
872
<M><![CDATA[a < b < c < d]]]]>&gt;<![CDATA[</M> and <M>e &lt; f</M>.
873
</Section>]]>
874
</Listing>
875
876
</Section>
877
878
879
<Section Label="Eight"><Heading>Crossreferencing (Source)</Heading>
880
881
[<Ref Label="EightBack"/>]
882
883
<Listing>
884
<![CDATA[<Section Label="Cross"><Heading>Crossreferencing</Heading>
885
886
<Label Name="there"/>
887
888
In this section we demonstrate various references to parts of this
889
document. Here is a reference to this section: <Ref Sect="Cross"/>.
890
Here is a reference to chapter <Ref Chap="First"/>, to appendix
891
<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.
892
<P/>
893
894
We distinguish among others references
895
to functions (see <Ref Func="f"/>),
896
to methods with tricky name (see
897
<Ref Meth="\^\{\}\[\]\&lt;\&amp;" Label="for nothing"/>),
898
to operations (see <Ref Oper="MyOperation"/>),
899
to methods (see <Ref Meth="MyOperation" Label="First"/> or
900
<Ref Meth="MyOperation" Label="for bla"/>),
901
to filters (see <Ref Filt="IsBla"/>),
902
to properties (see <Ref Prop="IsBlubb"/>),
903
to attributes (see <Ref Attr="NumberBlobbs"/>),
904
to variables (<Ref Var="AllBlibbs"/>),
905
to families (see <Ref Fam="BlibbsFamily"/>),
906
and to info classes (see <Ref InfoClass="InfoBlibbs"/>).
907
<P/>
908
909
There are also references to labels: see <Ref Text="here" Label="there"/>,
910
to other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or
911
<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference
912
manual.
913
<P/>
914
915
References to sections come in two styles:
916
<Ref Chap="First" Style="Number"/>
917
or <Ref Chap="First" Style="Text"/>.
918
<P/>
919
920
Another type of cross referencing is bibliography. Here is a
921
citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.
922
<P/>
923
924
There are also URLs:<P/>
925
926
<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>
927
928
Email addresses have a special element:
929
<Email>[email protected]</Email>
930
<P/>
931
932
and Homepages another one:
933
<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>
934
<P/>
935
936
One can generate index entries as follows (look up the words
937
<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).
938
<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>
939
<Index>RWTH</Index>
940
<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>
941
<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc;
942
<Subkey>for &GAP; programmers</Subkey></Index>
943
944
</Section>]]>
945
</Listing>
946
947
</Section>
948
949
950
<Section Label="Nine"><Heading>Lists and Tables (Source)</Heading>
951
952
[<Ref Label="NineBack"/>]
953
954
<Listing>
955
<![CDATA[<Section><Heading>Lists and Tables</Heading>
956
957
There are
958
<List>
959
<Item>lists</Item>
960
<Item>enumerations, and</Item>
961
<Item>tables</Item>
962
</List>
963
or:
964
<Enum>
965
<Item>lists</Item>
966
<Item>enumerations, and</Item>
967
<Item>tables</Item>
968
</Enum>
969
or with marks:
970
<List>
971
<Mark>lists:</Mark><Item> not numbered</Item>
972
<Mark>enumerations:</Mark><Item> numbered</Item>
973
<Mark>tables:</Mark><Item> two-dimensional</Item>
974
</List>
975
976
Lists can also be nested:
977
<Enum>
978
<Item>
979
<Enum>
980
<Item>first item of inner enumeration </Item>
981
<Item>second item of inner enumeration </Item>
982
</Enum>
983
</Item>
984
<Item>
985
<List>
986
<Item>first item of inner list </Item>
987
<Item>second item of inner list </Item>
988
</List>
989
</Item>
990
</Enum>
991
992
Here is a <E>table</E>:
993
994
<Table Align="|r|c|l|">
995
<Caption>Prices</Caption>
996
<HorLine/>
997
<Row>
998
<Item>Object</Item><Item>Price</Item><Item>available</Item>
999
</Row>
1000
<HorLine/>
1001
<HorLine/>
1002
<Row>
1003
<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>
1004
</Row>
1005
<HorLine/>
1006
<Row>
1007
<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>
1008
</Row>
1009
<HorLine/>
1010
</Table>
1011
1012
</Section>]]>
1013
</Listing>
1014
1015
</Section>
1016
1017
1018
<Section Label="Ten">
1019
<Heading>Entities and Special Characters (Source)</Heading>
1020
1021
[<Ref Label="TenBack"/>]
1022
1023
<Listing>
1024
<![CDATA[<Section><Heading>Entities and Special Characters</Heading>
1025
<Label Name="TenBack"/>
1026
1027
[&see; <Ref Sect="Ten"/>]<P/>
1028
1029
Here is a table of special characters, the first two are special for
1030
XML and must be typed in by entities in &GAPDoc; documents. The other
1031
characters are special for &LaTeX; but in &GAPDoc; they can be typed
1032
directly.
1033
1034
<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">
1035
<Caption>Special characters in character data</Caption>
1036
<HorLine/> <Row>
1037
<Item><C>&amp;</C></Item>
1038
<Item><C>&lt;</C></Item>
1039
<Item><C>></C></Item>
1040
<Item><C>#</C></Item>
1041
<Item><C>$</C></Item>
1042
<Item><C>%</C></Item>
1043
<Item><C>~</C></Item>
1044
<Item><C>\</C></Item>
1045
<Item><C>{</C></Item>
1046
<Item><C>}</C></Item>
1047
<Item><C>_</C></Item>
1048
<Item><C>^</C></Item>
1049
<Item><C>&nbsp;</C></Item>
1050
</Row> <HorLine/>
1051
</Table>
1052
1053
And here are the predefined entities in &GAPDoc;:
1054
1055
<Table Align="|l|l|">
1056
<Caption>Predefined Entities in the &GAPDoc; system</Caption>
1057
<HorLine/>
1058
<Row> <Item><C>&amp;GAP;</C></Item> <Item>&GAP;</Item> </Row>
1059
<HorLine/>
1060
<Row> <Item><C>&amp;GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>
1061
<HorLine/>
1062
<Row> <Item><C>&amp;TeX;</C></Item> <Item>&TeX;</Item> </Row>
1063
<HorLine/>
1064
<Row> <Item><C>&amp;LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>
1065
<HorLine/>
1066
<Row> <Item><C>&amp;BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>
1067
<HorLine/>
1068
<Row> <Item><C>&amp;MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>
1069
<HorLine/>
1070
<Row> <Item><C>&amp;XGAP;</C></Item> <Item>&XGAP;</Item> </Row>
1071
<HorLine/>
1072
<Row> <Item><C>&amp;copyright;</C></Item> <Item>&copyright;</Item> </Row>
1073
<HorLine/>
1074
</Table>
1075
1076
And some more for mathematical symbols:
1077
&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.
1078
1079
</Section>
1080
1081
</Chapter>
1082
1083
</Body>]]>
1084
</Listing>
1085
1086
</Section>
1087
1088
1089
<Section Label="Eleven"><Heading>Appendix (Source)</Heading>
1090
1091
[<Ref Label="ElevenBack"/>]
1092
1093
<Listing Type="GAPDoc source">
1094
<![CDATA[<Appendix><Heading>An Appendix</Heading>
1095
1096
This is an appendix.
1097
</Appendix>]]>
1098
</Listing>
1099
1100
</Section>
1101
1102
</Appendix>
1103
1104
<Bibliography Databases="examplebib.xml" Style="alpha"/>
1105
<TheIndex/>
1106
1107
</Book>
1108
1109
1110