2.1 Various types of text

[→ B.5]

In this section we present examples for all the various types of text that are possible in GAPDoc:

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