Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

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

Path: gap4r8 / doc / ref / chap2.txt
Views: 415153
1
2
2 The Help System
3
4
This chapter describes the GAP help system. The help system lets you read
5
the documentation interactively.
6
7
8
2.1 Invoking the Help
9
10
The basic command to read GAP's documentation from within a GAP session is
11
as follows.
12
13
?[book:][?]topic
14
15
For an explanation and some examples see 'Tutorial: Help'.
16
17
Note that the first question mark must appear in the first position after
18
the gap>  prompt. The search strings book and topic are normalized in a
19
certain way (see the end of this section for details) before the search
20
starts. This makes the search case insensitive and there can be arbitrary
21
white space after the first question mark.
22
23
When there are several manual sections that match the query a numbered list
24
of topics is displayed. These matches can be accessed with ?number.
25
26
There are some further specially handled commands which start with a
27
question mark. They are explained in Section 2.2.
28
29
By default GAP shows the help sections as text in the terminal (window),
30
page by page if the shown text does not fit on the screen. But there are
31
several other choices to read (other formats of) the documents: via a viewer
32
for pdf files or via a web browser. This is explained below in Section 2.3.
33
34
Details of the string normalization process
35
36
Here is a precise description how the search strings book and topic are
37
normalized before a search starts: backslashes and double or single quotes
38
are removed, parentheses and braces are substituted by blanks, non-ASCII
39
characters are considered as ISO-latin1 characters and the accented letters
40
are substituted by their non-accented counterpart. Finally white space is
41
normalized.
42
43
44
2.2 Browsing through the Sections
45
46
Help books for GAP are organized in chapters, sections, and subsections.
47
There are a few special commands starting with a question mark (in the first
48
position after the gap>  prompt) which allow browsing a book section or
49
chapter wise.
50
51
?>
52
53
?<
54
55
The two help commands ?< and ?> allow one to browse through a whole help
56
book. ?< displays the section or subsection preceding the previously shown
57
(sub)section, and ?> takes you to the section or subsection following the
58
previously shown one.
59
60
?>>
61
62
?<<
63
64
?<< takes you back to the beginning of the current chapter. If you are
65
already at the start of a chapter ?<< takes you to the beginning of the
66
previous chapter. ?>> takes you to the beginning of the next chapter.
67
68
?-
69
70
?+
71
72
GAP remembers the last few sections that you have read. ?- takes you to the
73
one that you have read before the current one, and displays it again.
74
Further applications of ?- take you further back in this history. ?+
75
reverses this process, i.e., it takes you back to the section that you have
76
read after the current one. It is important to note that ?- and ?+ do not
77
alter the history like the other help commands.
78
79
?books
80
81
This command shows a list of the books which are currently known to the help
82
system. For each book there is a short name which is used with the book part
83
of the basic help query and there is a long name which hopefully tells you
84
what this book is about.
85
86
A short name which ends in (not loaded) refers to a GAP package whose
87
documentation is loaded but which needs a call of LoadPackage (76.2-1)
88
before you can use the described functions.
89
90
?[book:]sections
91
92
?[book:][chapters]
93
94
These commands show tables of contents for all available, respectively the
95
matching books. For some books these commands show the same, namely the
96
whole table of contents.
97
98
?
99
100
?&
101
102
These commands redisplay the last shown help section. In the form ?& the
103
next preferred help viewer is used for the display (provided one has chosen
104
several viewers), see SetHelpViewer (2.3-1) below.
105
106
107
2.3 Changing the Help Viewer
108
109
Books of the GAP help system or package manuals can be available in several
110
formats. Currently the following formats occur (not all of them may be
111
available for all books):
112
113
text
114
This is used for display in the terminal window in which GAP is
115
running. Complicated mathematical expressions may not be easy to read
116
in this format.
117
118
pdf
119
Adobe's pdf format. Can be used for printing and onscreen reading on
120
most current systems (with freely available software). Some manual
121
books contain hyperlinks in this format.
122
123
HTML
124
The format of web pages. Can be used with any web browser. There may
125
be hyperlink information available which allows a convenient browsing
126
through the book via cross-references. This format has the problem
127
that complicated formulae may be not be easy to read since there is no
128
syntax for formulae in HTML. (Some older manual books use special
129
symbol fonts for formulae and need a particular configuration of the
130
web browser for correct display. Some manuals may use technology for
131
quite sophisticated formula display.)
132
133
Depending on your operating system and available additional software you can
134
use several of these formats with GAP's help system. This is configured with
135
the following command.
136
137
2.3-1 SetHelpViewer
138
139
SetHelpViewer( viewer1, viewer2, ... )  function
140
141
This command takes an arbitrary number of arguments which must be strings
142
describing a viewer. The recognized viewers are explained below. A call with
143
no arguments shows the current setting.
144
145
The first given arguments are those with higher priority. So, if a help
146
section is available in the format needed by viewer1, this viewer is used.
147
If not, availability of the format for viewer2 is checked and so on. Recall
148
that the command ?& displays the last seen section again but with the next
149
possible viewer in your list, see 2.2.
150
151
The viewer "screen" (see below) is always silently appended since we assume
152
that each help book is available in text format.
153
154
If you want to change the default setting you can use a call of
155
SetUserPreference( "HelpViewers", [ ... ] ); (the list in the second
156
argument containing the viewers you want) in your gap.ini file (see 3.2).
157
158
"screen"
159
This is the default setting. The help is shown in text format using
160
the Pager (2.4-1) command. Hint: Text versions of manuals are
161
formatted assuming that your terminal displays at least 80 characters
162
per line, if this is not the case some sections may look very bad. We
163
suggest to use a terminal in UTF-8 encoding with a fixed width font
164
(this is the default on most modern Linux/Windows/Mac systems anyway).
165
Terminals in ISO-8859-X encoding will also work reasonably well (so
166
far, since we do not yet use many special characters which such
167
terminals could not display).
168
169
"firefox", "chrome", "mozilla", "netscape", "konqueror"
170
If a book is available in HTML format this is shown using the
171
corresponding web browser. How well this works, for example by using a
172
running instance of this browser, depends on your particular start
173
script of this browser. (Note, that for some old books the browser
174
must be configured to use symbol fonts.)
175
176
"browser"
177
(for MS Windows) If a book is available in HTML format, it will be
178
opened using the Windows default application (typically, a web
179
browser).
180
181
"links2", "w3m", "lynx"
182
If a book is available in HTML format this is shown using the text
183
based "links2" (in graphics mode), w3m or lynx web browser,
184
respectively, inside the terminal running GAP. (Formulae in some older
185
books which use symbol fonts may be unreadable.)
186
187
"mac default browser", "browser", "safari", "firefox"
188
(for Mac OS X) If a book is available in HTML format this is shown in
189
a web browser. The options "safari" and "firefox" use the
190
corresponding browsers. The other two options use the program default
191
browser (which can be set in Safari's preferences, in the "General"
192
tab).
193
194
"xpdf"
195
(on X-windows systems) If a book is available in pdf format it is
196
shown with the onscreen viewer program xpdf (which must be installed
197
on your system). This is a nice program, once it is running it is
198
reused by GAP for the next displays of help sections.
199
200
"acroread"
201
If a book is available in pdf format it is shown with the onscreen
202
viewer program acroread (which must be available on your system). This
203
program does not allow remote commands or startup with a given page.
204
Therefore the page numbers you have to visit are just printed on the
205
screen. When you are looking at several sections of the same book,
206
this viewer assumes that the acroread window still exists. When you go
207
to another book a new acroread window is launched.
208
209
"pdf viewer", "skim", "preview", "adobe reader"
210
(for Mac OS X) If a book is available in pdf format this is shown in a
211
pdf viewer. The options "skim", "preview" and "adobe reader" use the
212
corresponding viewers. The other two options use the pdf viewer which
213
you have chosen to open pdf files from the Finder. Note that only
214
"Skim" seems to be capable to open a pdf file on a given page. For the
215
other help viewers, the page numbers where the information can be
216
found will just be printed on the screen. None of the help viewers
217
seems to be capable of opening a pdf at a given named destination (i.
218
e., jump to precisely the place where the information can be found).
219
The pdf viewer "Skim" is open source software, it can be downloaded
220
from http://skim-app.sourceforge.net/.
221
222
"less" or "more"
223
This is the same as "screen" but additionally the user preferences
224
"Pager" and ""PagerOptions" are set, see the section 2.4 for more
225
details.
226
227
Please, send ideas for further viewer commands to
228
mailto:[email protected].
229
230
231
2.4 The Pager Command
232
233
GAP contains a builtin pager which shows a text string which does not fit on
234
the screen page by page. Its functionality is very rudimentary and
235
self-explaining. This is because (at least under UNIX) there are powerful
236
external standard programs which do this job.
237
238
2.4-1 Pager
239
240
Pager( lines )  function
241
242
This function can be used to display a text on screen using a pager, i.e.,
243
the text is shown page by page.
244
245
There is a default builtin pager in GAP which has very limited capabilities
246
but should work on any system.
247
248
At least on a UNIX system one should use an external pager program like less
249
or more. GAP assumes that this program has a command line option +nr which
250
starts the display of the text with line number nr.
251
252
Which pager is used can be controlled by setting the user preference
253
"Pager". The default value is "builtin" which means that the internal pager
254
is used.
255
256
On UNIX systems you probably want to set the user preference "Pager" to the
257
value "less" or "more", you can do this for example in your gap.ini file
258
(see 3.2). In that case you can also tell GAP a list of standard options for
259
the external pager, via the user preference "PagerOptions".
260
261
 Example 
262
 SetUserPreference( "Pager", "less" );
263
 SetUserPreference( "PagerOptions", ["-f","-r","-a","-i","-M","-j2"] );
264

265
266
The argument lines can have one of the following forms:
267
268
1 a string (i.e., lines are separated by newline characters)
269
270
2 a list of strings (without newline characters) which are interpreted
271
as lines of the text to be shown
272
273
3 a record with component lines as in 1. or 2. and optional further
274
components
275
276
In case 3. currently the following additional components are used:
277
278
formatted
279
can be false or true. If set to true the builtin pager tries to show
280
the text exactly as it is given (avoiding GAP's automatic line
281
breaking),
282
283
start
284
must be a positive integer. This is interpreted as the number of the
285
first line shown by the pager (one may see the beginning of the text
286
via back scrolling).
287
288
exitAtEnd
289
can be false or true. If set to true (the default), the builtin pager
290
is terminated as soon as the end of the list is shown; otherwise
291
entering the q key is necessary in order to return from the pager.
292
293
The Pager command is used by GAP's help system for displaying help sections
294
in text format. But, of course, it may be used for other purposes as well.
295
296
 Example 
297
gap> s6 := SymmetricGroup(6);;
298
gap> words := ["This", "is", "a", "very", "stupid", "example"];;
299
gap> l := List(s6, p-> Permuted(words, p));;
300
gap> Pager(List(l, a-> JoinStringsWithSeparator(a," ")));;
301

302
303
304