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
2 Other Markup
3
4
5
2.1 Various types of text
6
7
[→ B.5]
8
9
In this section we present examples for all the various types of text that
10
are possible in GAPDoc:
11
12
 This is emphasized.
13
14
 Keywords are typeset like this and that.
15
16
 Arguments of functions have an element. They look like this: x and y.
17
18
 Code can be written with the Code element: if x = y then
19
Print("Equal"); fi; or while true do Print("Hello"); od;.
20
21
 Filenames have their own element: /usr/local/ca/gap4r2 or
22
pkg/xgap/doc.
23
24
 Buttons, menus, menu entries, and such things are also supported: OK
25
or Cancel.
26
27
 Packages are typeset like this: Small Groups Library
28
29
 Quoted text: This is a text in quotes.
30
31
Paragraphs are separated by the empty Par or P element.
32
33
Alternatives for different output formats: This is other than LaTeX output,
34
namely: Text output.
35
36
There are also three elements to typeset verbatim-like text. (→ B.6)
37
38
The first is a Listing:
39
40
 GAP code 
41
Sieve := function(n)
42
 # Returns the primes less than n
43
 local l,p,i;
44
 l := [1..n]; Unbind(l[1]);
45
 p := 2;
46
 while p^2 <= n do
47
 if IsBound(l[p]) then
48
 i := 2 * p;
49
 while i <= n do Unbind(l[i]); i := i + p; od;
50
 fi;
51
 p := p + 1;
52
 od;
53
 return Compacted(l);
54
end;
55

56
57
Here is a Log of a GAP session using this function:
58
59
 Example 
60
gap> Sieve(100);
61
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
62
 67, 71, 73, 79, 83, 89, 97 ]
63
gap> Length(last);
64
25
65

66
67
Here is a GAP Example session that is automatically tested:
68
69
 Example 
70
gap> s := Size(CharacterTable("M"));
71
808017424794512875886459904961710757005754368000000000
72
gap> s < 10^53; 
73
false
74
gap> s < 10^54;
75
true
76

77
78
79
2.2 Formulae
80
81
[→ B.7]
82
83
There are three types of formulae.
84
85
The first is the normal math mode of LaTeX: b_i \cdot b_j = \sum_{k=1}^d
86
h_{ijk} b_k. Then there are displayed formulae:
87
88
89
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
90
\left(\sum_{j=1}^d y_j b_j \right) = \sum_{k=1}^d \left( \sum_{i,j} x_i y_j
91
h_{ijk} \right) b_k
92
93

94
95
If possible, use the Alt element to specify a better readable text version
96
of such a formula as in the following example:
97
98
d d d
99
----- ----- ----- -----
100
\ \ \ \
101
==> ( ) x_i b_i )( ) y_j b_j ) = ) ( ) x_i y_j h_ijk ) b_k
102
/ / / /
103
----- ----- ----- -----
104
i = 1 j = 1 k = 1 i,j
105
106
For small formulae without difficult parts use the M element: b_i, x^2, x^2
107
+ 2x + 1 = (x + 1)^2. Note that here whitespace matters for text (or HTML)
108
output.
109
110
Here are two formulae containing less than characters which are special
111
characters for XML: a < b < c < d and e < f.
112
113
Using the Mode attribute of a Display element formulae like
114
115
116
a ⟶ a mod m'
117
118
can also be displayed nicely in text and HTML output.
119
120
121
2.3 Crossreferencing
122
123
[→ B.8]
124
125
In this section we demonstrate various references to parts of this document.
126
Here is a reference to this section: 2.3. Here is a reference to chapter 1,
127
to appendix A, and to subsection 1.1-1.
128
129
We distinguish among others references to functions (see f (1.2-1)), to
130
methods with tricky name (see \^\{\}\[\]\<\& (1.2-2)), to operations (see
131
MyOperation (1.2-3)), to methods (see MyOperation (1.2-4) or MyOperation
132
(1.2-5)), to filters (see IsBla (1.2-7)), to properties (see IsBlubb
133
(1.2-8)), to attributes (see NumberBlobbs (1.2-9)), to variables (AllBlibbs
134
(1.2-10)), to families (see BlibbsFamily (1.2-11)), and to info classes (see
135
InfoBlibbs (1.2-12)).
136
137
There are also references to labels: see 2.3, to other books: see 'GAPDoc:
138
What is a DTD?' or IsSubgroup (Reference: IsSubgroup) in the GAP reference
139
manual.
140
141
References to sections come in two styles: 1 or 'Sectioning Elements'.
142
143
Another type of cross referencing is bibliography. Here is a citation:
144
[CR81, (5.22)] is an interesting lemma.
145
146
There are also URLs:
147
148
http://www.math.rwth-aachen.de/
149
150
Email addresses have a special element:
151
mailto:[email protected]
152
153
and Homepages another one: http://www-groups.mcs.st-and.ac.uk/~neunhoef/
154
155
And here is a link to the EDIM archives
156
(http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/EDIM/index.html#ARCHS).
157
158
One can generate index entries as follows (look up the words TeX-UserGroup,
159
RWTH, Aachen, Hauptbahnhof, and GAPDoc, for GAP programmers).
160
161
162
2.4 Lists and Tables
163
164
[→ B.9]
165
166
There are
167
168
 lists
169
170
 enumerations, and
171
172
 tables
173
174
or:
175
176
1 lists
177
178
2 enumerations, and
179
180
3 tables
181
182
or with marks:
183
184
lists:
185
not numbered
186
187
enumerations:
188
numbered
189
190
tables:
191
two-dimensional
192
193
Lists can also be nested:
194
195
1 1 first item of inner enumeration
196
197
2 second item of inner enumeration
198
199
2  first item of inner list
200
201
 second item of inner list
202
203
Here is a table:
204
205
┌────────┬───────┬───────────┐
206
│ Object │ Price │ available │
207
├────────┼───────┼───────────┤
208
├────────┼───────┼───────────┤
209
│ Shoe │ $1,00 │ there │
210
├────────┼───────┼───────────┤
211
│ Hat │ $2,00 │ not there │
212
└────────┴───────┴───────────┘
213
214
Table: Prices
215
216
217
218
2.5 Entities and Special Characters
219
220
[→ B.10]
221
222
Here is a table of special characters, the first two are special for XML and
223
must be typed in by entities in GAPDoc documents. The other characters are
224
special for LaTeX but in GAPDoc they can be typed directly.
225
226
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
227
│ & │ < │ > │ # │ $ │ % │ ~ │ \ │ { │ } │ _ │ ^ │   │
228
└───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
229
230
Table: Special characters in character data
231
232
233
And here are the predefined entities in GAPDoc:
234
235
┌─────────────┬─────────┐
236
│ &GAP; │ GAP │
237
├─────────────┼─────────┤
238
│ &GAPDoc; │ GAPDoc │
239
├─────────────┼─────────┤
240
│ &TeX; │ TeX │
241
├─────────────┼─────────┤
242
│ &LaTeX; │ LaTeX │
243
├─────────────┼─────────┤
244
│ &BibTeX; │ BibTeX │
245
├─────────────┼─────────┤
246
│ &MeatAxe; │ MeatAxe │
247
├─────────────┼─────────┤
248
│ &XGAP; │ XGAP │
249
├─────────────┼─────────┤
250
│ &copyright; │ © │
251
└─────────────┴─────────┘
252
253
Table: Predefined Entities in the GAPDoc system
254
255
256
And some more for mathematical symbols: ℂ, ℤ, ℕ, ℙ, ℚ, ℍ, ℝ.
257
258
259