[→ B.5]
In this section we present examples for all the various types of text that are possible in GAPDoc:
This is emphasized.
Keywords are typeset like this
and that
.
Arguments of functions have an element. They look like this: x and y.
Code can be written with the Code element: if x = y then Print("Equal"); fi;
or while true do Print("Hello"); od;
.
Filenames have their own element: /usr/local/ca/gap4r2
or pkg/xgap/doc
.
Buttons, menus, menu entries, and such things are also supported: OK or Cancel.
Packages are typeset like this: Small Groups Library
Quoted text: "This is a text in quotes."
Paragraphs are separated by the empty Par
or P
element.
Alternatives for different output formats: This is other than LaTeX output, namely: HTML output.
There are also three elements to typeset "verbatim-like" text. (→ B.6)
The first is a Listing:
Sieve := function(n) # Returns the primes less than n local l,p,i; l := [1..n]; Unbind(l[1]); p := 2; while p^2 <= n do if IsBound(l[p]) then i := 2 * p; while i <= n do Unbind(l[i]); i := i + p; od; fi; p := p + 1; od; return Compacted(l); end;
Here is a Log of a GAP session using this function:
gap> Sieve(100); [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 ] gap> Length(last); 25
Here is a GAP Example session that is automatically tested:
gap> s := Size(CharacterTable("M")); 808017424794512875886459904961710757005754368000000000 gap> s < 10^53; false gap> s < 10^54; true