Goto Chapter: Top 1 2 A B Bib Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax off]

2 Other Markup
2.1 Various types of text
2.2 Formulae
2.3 Crossreferencing
2.4 Lists and Tables
2.5 Entities and Special Characters

### 2 Other Markup

#### 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:

- 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

#### 2.2 Formulae

[→ B.7]

There are three types of formulae.

The first is the normal math mode of LaTeX: \(b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k\). Then there are displayed formulae:

\[ \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot \left(\sum_{j=1}^d y_j b_j \right) = \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k \]

If possible, use the `Alt` element to specify a better readable text version of such a formula as in the following example:

             d                d                 d
           -----            -----             -----  -----
            \                \                 \      \
     ==> (   )  x_i b_i )(    )  y_j b_j ) =    )  (   )  x_i y_j h_ijk ) b_k
            /                /                 /      /
           -----            -----             -----  -----
           i = 1            j = 1             k = 1   i,j

For small formulae without difficult parts use the `M` element: \(b_i\), \(x^2\), \(x^2 + 2x + 1 = (x + 1)^2\). Note that here whitespace matters for text (or HTML) output.

Here are two formulae containing less than characters which are special characters for XML: \(a < b < c < d\) and \(e < f\).

Using the `Mode` attribute of a `Display` element formulae like

\[a \longrightarrow a \bmod m\prime\]

can also be displayed nicely in text and HTML output.

#### 2.3 Crossreferencing

[→ B.8]

In this section we demonstrate various references to parts of this document. Here is a reference to this section: 2.3. Here is a reference to chapter 1, to appendix A, and to subsection 1.1-1.

We distinguish among others references to functions (see `f` (1.2-1)), to methods with tricky name (see `\^\{\}\[\]\<\&` (1.2-2)), to operations (see `MyOperation` (1.2-3)), to methods (see `MyOperation` (1.2-4) or `MyOperation` (1.2-5)), to filters (see `IsBla` (1.2-7)), to properties (see `IsBlubb` (1.2-8)), to attributes (see `NumberBlobbs` (1.2-9)), to variables (`AllBlibbs` (1.2-10)), to families (see `BlibbsFamily` (1.2-11)), and to info classes (see `InfoBlibbs` (1.2-12)).

There are also references to labels: see here, to other books: see GAPDoc: What is a DTD? or `IsSubgroup` (Reference: IsSubgroup) in the GAP reference manual.

References to sections come in two styles: 1 or Sectioning Elements.

Another type of cross referencing is bibliography. Here is a citation: [CR81, (5.22)] is an interesting lemma.

There are also URLs:

https://www.math.rwth-aachen.de/

Email addresses have a special element: Frank.Luebeck@Math.RWTH-Aachen.De

and Homepages another one: https://www.math.rwth-aachen.de/~Frank.Luebeck/

And here is a link to the EDIM archives.

One can generate index entries as follows (look up the words TeX-UserGroup, RWTH, Aachen, Hauptbahnhof, and GAPDoc, for GAP programmers).

#### 2.4 Lists and Tables

[→ B.9]

There are

- lists

- enumerations, and

- tables

or:

1. lists

2. enumerations, and

3. tables

or with marks:

lists:

  not numbered

enumerations:

  numbered

tables:

  two-dimensional

Lists can also be nested:

1. 1. first item of inner enumeration

   2. second item of inner enumeration

2. - first item of inner list

   - second item of inner list

Here is a table:

Table: Prices
Object | Price | available
Shoe | $1,00 | there
Hat | $2,00 | not there

#### 2.5 Entities and Special Characters

[→ B.10]

Here is a table of special characters, the first two are special for XML and must be typed in by entities in GAPDoc documents. The other characters are special for LaTeX but in GAPDoc they can be typed directly.

Table: Special characters in character data
`&` | `<` | `>` | `#` | `$` | `%` | `~` | `\` | `{` | `}` | `_` | `^` | ``

And here are the predefined entities in GAPDoc:

Table: Predefined Entities in the GAPDoc system
`&GAP;` | GAP
`&GAPDoc;` | GAPDoc
`&TeX;` | TeX
`&LaTeX;` | LaTeX
`&BibTeX;` | BibTeX
`&MeatAxe;` | MeatAxe
`&XGAP;` | XGAP
`&copyright;` | ©

And some more for mathematical symbols: ℂ, ℤ, ℕ, ℙ, ℚ, ℍ, ℝ.

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 A B Bib Ind

generated by GAPDoc2HTML