  
  [1XB The Source[0X
  
  
  [1XB.1 TitlePage (Source)[0X
  
  [4X------------------------------------------------------------------[0X
    [4X<TitlePage>[0X
    [4X  <Title>A Complete Example</Title>[0X
    [4X  <Subtitle>Every element shows up</Subtitle>[0X
    [4X  <Version>Version 1.0</Version>[0X
    [4X  <Author>Frank Lübeck [0X
    [4X          <Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email></Author>[0X
    [4X  <Author> Max Neunhöffer [0X
    [4X          <Email>neunhoef at mcs.st-and.ac.uk</Email>[0X
    [4X  </Author>[0X
    [4X  <Date>December 2000</Date>[0X
    [4X  <Abstract>This document tries to use all elements that exist in &GAPDoc;.[0X
    [4X            In addition, the final output not only contains the usual[0X
    [4X            content, but also an appendix with the source text. There[0X
    [4X            are also links from the usual content to the corresponding[0X
    [4X            source text. This should enable new users to learn &GAPDoc;[0X
    [4X            quickly.</Abstract>[0X
    [4X  <Copyright>&copyright; 2000 by Frank Lübeck and Max Neunhöffer</Copyright>[0X
    [4X  <Acknowledgements>We thank Lehrstuhl D für Mathematik.</Acknowledgements>[0X
    [4X  <Colophon>This is the Colophon page.</Colophon>[0X
    [4X</TitlePage>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.2 Before First Chapter (Source)[0X
  
  [4X------------------------------------------------------------------[0X
    [4X<TableOfContents/>[0X
    [4X[0X
    [4X<Body>[0X
    [4X[0X
    [4X  Text before chapter <Ref Chap="First"/>.[0X
    [4X[0X
    [4X<Chapter Label="First"><Heading>Sectioning Elements</Heading>[0X
    [4X[0X
    [4X  Text before the section <Ref Sect="FirstSect"/>.[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.3 First Chapter (Source)[0X
  
  [[14X1.[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Section Label="FirstSect"><Heading>Normal subsections</Heading>[0X
    [4X[0X
    [4X  <Subsection Label="Asub"><Heading>A subsection</Heading>[0X
    [4X[0X
    [4X   This is text in the first subsection.[0X
    [4X[0X
    [4X  </Subsection>[0X
    [4X[0X
    [4X  <Subsection Label="Another"><Heading>Another subsection</Heading>[0X
    [4X   [0X
    [4X   This is text in the second subsection. This subsection [0X
    [4X   has a label, such that one can reference it.[0X
    [4X[0X
    [4X  </Subsection>[0X
    [4X[0X
    [4X </Section>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.4 ManSections (Source)[0X
  
  [[14X1.2[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Section><Heading>ManSections</Heading>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Func Name="f" Arg="x[,y]" Comm="calculates something"/>[0X
    [4X   <Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>[0X
    [4X   <Description>[0X
    [4X    This function calculates something.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Meth Name="\^\{\}\[\]\&lt;\&amp;" Arg="c" [0X
    [4X         Label="for nothing" Comm="tricky name"/>[0X
    [4X   <Description>[0X
    [4X    This method is for an operation with a tricky name.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Oper Name="MyOperation" Arg="x" Comm="calculates something"/>[0X
    [4X   <Description>[0X
    [4X    The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X   [0X
    [4X  <ManSection>[0X
    [4X   <Meth Name="MyOperation" Label="First" Arg="x" [0X
    [4X         Comm="generic method"/>[0X
    [4X   <Description>[0X
    [4X    This method calculates something by the generic method.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"[0X
    [4X         Comm="for bla arguments"/>[0X
    [4X   <Description>[0X
    [4X    This is the super-fast method for the operation[0X
    [4X    <Ref Oper="MyOperation"/> if the argument <A>x</A> is in the[0X
    [4X    representation <Ref Filt="IsBla"/>. It will become even faster if[0X
    [4X    the optional argument <A>good_hint</A> is given.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Filt Name="IsBla" Arg="obj" Comm="representation bla"[0X
    [4X         Type="representation"/>[0X
    [4X   <Description>[0X
    [4X    For objects in this representation there is a super-fast method[0X
    [4X    (see <Ref Meth="MyOperation" Label="for bla"/>) for the operation[0X
    [4X    <Ref Oper="MyOperation"/>.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>[0X
    [4X   <Description>[0X
    [4X    A property.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>[0X
    [4X   <Description>[0X
    [4X    An attribute. Number of blobbs.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>[0X
    [4X   <Description>[0X
    [4X    This global variable holds a list of all blibbs.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <Fam Name="BlibbsFamily" Comm="family of blibbs"/>[0X
    [4X   <Description>[0X
    [4X    Family of all blibbs.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X[0X
    [4X  <ManSection>[0X
    [4X   <InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>[0X
    [4X   <Description>[0X
    [4X    This info class is used throughout the library of blibbs.[0X
    [4X   </Description>[0X
    [4X  </ManSection>[0X
    [4X    [0X
    [4X </Section>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.5 Various Types of Text (Source)[0X
  
  [[14X2.[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Chapter><Heading>Other Markup</Heading>[0X
    [4X[0X
    [4X<Section><Heading>Various types of text</Heading>[0X
    [4X[0X
    [4XIn this section we present examples for all the various types of text[0X
    [4Xthat are possible in &GAPDoc;: [0X
    [4X<List>[0X
    [4X <Item>[0X
    [4X  <Emph>This</Emph> is <E>emphasized</E>.</Item>[0X
    [4X <Item>[0X
    [4X  <E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.[0X
    [4X  </Item>[0X
    [4X <Item>[0X
    [4X  <E>Arguments</E> of functions have an element. They look like this: [0X
    [4X    <Arg>x</Arg> and <A>y</A>.</Item>[0X
    [4X <Item> [0X
    [4X  <E>Code</E> can be written with the Code element: [0X
    [4X    <Code>if x = y then Print("Equal"); fi;</Code> or[0X
    [4X    <C>while true do Print("Hello"); od;</C>.</Item> [0X
    [4X <Item>[0X
    [4X  <E>Filenames</E> have their own element:[0X
    [4X    <File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>[0X
    [4X <Item>[0X
    [4X  <E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things[0X
    [4X    are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>[0X
    [4X <Item>[0X
    [4X  <E>Packages</E> are typeset like this: [0X
    [4X    <Package>Small Groups Library</Package>[0X
    [4X </Item>[0X
    [4X <Item>[0X
    [4X  <E>Quoted</E> text: <Q>This is a text in quotes.</Q>[0X
    [4X </Item>[0X
    [4X</List>[0X
    [4X[0X
    [4X<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.[0X
    [4X<Par/><E>Alternatives</E> for different output formats:[0X
    [4X[0X
    [4X<Alt Only="LaTeX">This is &LaTeX; output.</Alt>[0X
    [4X<Alt Not="LaTeX">This is other than &LaTeX; output, namely:[0X
    [4X<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>[0X
    [4X<Alt Only="Text">Text</Alt> output.</Alt>[0X
    [4X[0X
    [4X<P/>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.6 Verbatim-like text (Source)[0X
  
  [[14X2.1[0m]
  
  [4X------------------------------------------------------------------[0X
    [4XThere are also three elements to typeset <Q>verbatim-like</Q> text.[0X
    [4X<P/>[0X
    [4XThe first is a <E>Listing</E>:[0X
    [4X[0X
    [4X<Listing Type="GAP code">[0X
    [4X<![CDATA[Sieve := function(n)[0X
    [4X  # Returns the primes less than n[0X
    [4X  local l,p,i;[0X
    [4X  l := [1..n]; Unbind(l[1]);[0X
    [4X  p := 2;[0X
    [4X  while p^2 <= n do[0X
    [4X      if IsBound(l[p]) then[0X
    [4X          i := 2 * p;[0X
    [4X          while i <= n do Unbind(l[i]); i := i + p; od;[0X
    [4X      fi;[0X
    [4X      p := p + 1;[0X
    [4X  od;[0X
    [4X  return Compacted(l);[0X
    [4Xend;]]>[0X
    [4X</Listing>[0X
    [4X[0X
    [4XHere is a <E>Log</E> of a &GAP; session using this function:[0X
    [4X[0X
    [4X<Log>[0X
    [4Xgap&gt; Sieve(100);[0X
    [4X[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,[0X
    [4X  67, 71, 73, 79, 83, 89, 97 ][0X
    [4Xgap&gt; Length(last);[0X
    [4X25[0X
    [4X</Log>[0X
    [4X[0X
    [4XHere is a &GAP; <E>Example</E> session that is automatically tested:[0X
    [4X[0X
    [4X<Example>[0X
    [4Xgap&gt; s := Size(CharacterTable("M"));[0X
    [4X808017424794512875886459904961710757005754368000000000[0X
    [4Xgap&gt; s &lt; 10^53;                     [0X
    [4Xfalse[0X
    [4Xgap&gt; s &lt; 10^54;[0X
    [4Xtrue[0X
    [4X</Example>[0X
    [4X[0X
    [4X</Section>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.7 Formulae (Source)[0X
  
  [[14X2.2[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Section><Heading>Formulae</Heading>[0X
    [4X[0X
    [4XThere are three types of formulae. <P/>[0X
    [4XThe first is the <E>normal math mode</E> of &LaTeX;: [0X
    [4X[0X
    [4X<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>. [0X
    [4X[0X
    [4XThen there are <E>displayed formulae</E>:[0X
    [4X<Display>[0X
    [4X   \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot[0X
    [4X   \left(\sum_{j=1}^d y_j b_j \right) =[0X
    [4X   \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k [0X
    [4X</Display>[0X
    [4X[0X
    [4XIf possible,  use the <C>Alt</C> element  to specify a better  readable text[0X
    [4Xversion of such a formula as in the following example:<P/>[0X
    [4X[0X
    [4X<Alt Not="Text,HTML"><Display>[0X
    [4X   \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot[0X
    [4X   \left(\sum_{j=1}^d y_j b_j \right) =[0X
    [4X   \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k [0X
    [4X</Display></Alt>[0X
    [4X<Alt Only="Text,HTML"><Verb>[0X
    [4X         d                d                 d   [0X
    [4X       -----            -----             -----  -----                 [0X
    [4X        \                \                 \      \                    [0X
    [4X ==> (   )  x_i b_i )(    )  y_i b_i ) =    )  (   )  x_i y_j h_ijk ) b_k[0X
    [4X        /                /                 /      /                    [0X
    [4X       -----            -----             -----  -----                [0X
    [4X       i = 1            i = 1             k = 1   i,j                [0X
    [4X</Verb><P/></Alt>[0X
    [4X[0X
    [4XFor small formulae without <Q>difficult</Q> parts use the <C>M</C>[0X
    [4Xelement: <M>b_i</M>,[0X
    [4X<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace [0X
    [4Xmatters for text (or HTML) output).<P/>[0X
    [4X[0X
    [4XHere are two formulae containing less than characters which are special[0X
    [4Xcharacters for XML:[0X
    [4X<M><![CDATA[a < b < c < d]]></M> and  <M>e &lt; f</M>.[0X
    [4X</Section>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.8 Crossreferencing (Source)[0X
  
  [[14X2.3[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Section Label="Cross"><Heading>Crossreferencing</Heading>[0X
    [4X[0X
    [4X<Label Name="there"/>[0X
    [4X[0X
    [4XIn this section we demonstrate various references to parts of this[0X
    [4Xdocument. Here is a reference to this section: <Ref Sect="Cross"/>.[0X
    [4XHere is a reference to chapter <Ref Chap="First"/>, to appendix[0X
    [4X<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>. [0X
    [4X<P/>[0X
    [4X[0X
    [4XWe distinguish among others references [0X
    [4X to functions (see <Ref Func="f"/>), [0X
    [4X to methods with tricky name (see [0X
    [4X                 <Ref Meth="\^\{\}\[\]\&lt;\&amp;" Label="for nothing"/>),[0X
    [4X to operations (see <Ref Oper="MyOperation"/>), [0X
    [4X to methods (see <Ref Meth="MyOperation" Label="First"/> or [0X
    [4X                 <Ref Meth="MyOperation" Label="for bla"/>), [0X
    [4X to filters (see <Ref Filt="IsBla"/>), [0X
    [4X to properties (see <Ref Prop="IsBlubb"/>),[0X
    [4X to attributes (see <Ref Attr="NumberBlobbs"/>), [0X
    [4X to variables (<Ref Var="AllBlibbs"/>), [0X
    [4X to families (see <Ref Fam="BlibbsFamily"/>),[0X
    [4X and to info classes (see <Ref InfoClass="InfoBlibbs"/>).[0X
    [4X<P/>[0X
    [4X[0X
    [4XThere are also references to labels: see <Ref Text="here" Label="there"/>,[0X
    [4Xto other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or[0X
    [4X<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference[0X
    [4Xmanual.[0X
    [4X<P/>[0X
    [4X[0X
    [4XReferences to sections come in two styles: [0X
    [4X<Ref Chap="First" Style="Number"/>[0X
    [4Xor <Ref Chap="First" Style="Text"/>.[0X
    [4X<P/>[0X
    [4X[0X
    [4XAnother type of cross referencing is bibliography. Here is a [0X
    [4Xcitation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.[0X
    [4X<P/>[0X
    [4X[0X
    [4XThere are also URLs:<P/>[0X
    [4X[0X
    [4X<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>[0X
    [4X[0X
    [4XEmail addresses have a special element:[0X
    [4X<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>[0X
    [4X<P/>[0X
    [4X[0X
    [4Xand Homepages another one:[0X
    [4X<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>[0X
    [4X<P/>[0X
    [4X[0X
    [4XOne can generate index entries as follows (look up the words [0X
    [4X<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).[0X
    [4X<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>[0X
    [4X<Index Key="Aachen" Subkey="Hauptbahnhof">Aachen</Index>[0X
    [4X<Index>RWTH</Index>[0X
    [4X[0X
    [4X</Section>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.9 Lists and Tables (Source)[0X
  
  [[14X2.4[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Section><Heading>Lists and Tables</Heading>[0X
    [4X[0X
    [4XThere are[0X
    [4X<List>[0X
    [4X <Item>lists</Item>[0X
    [4X <Item>enumerations, and</Item>[0X
    [4X <Item>tables</Item>[0X
    [4X</List>[0X
    [4Xor:[0X
    [4X<Enum>[0X
    [4X <Item>lists</Item>[0X
    [4X <Item>enumerations, and</Item>[0X
    [4X <Item>tables</Item>[0X
    [4X</Enum>[0X
    [4Xor with marks:[0X
    [4X<List>[0X
    [4X <Mark>lists:</Mark><Item> not numbered</Item>[0X
    [4X <Mark>enumerations:</Mark><Item> numbered</Item>[0X
    [4X <Mark>tables:</Mark><Item> two-dimensional</Item>[0X
    [4X</List>[0X
    [4X[0X
    [4XHere is a <E>table</E>:[0X
    [4X[0X
    [4X<Table Align="|r|c|l|">[0X
    [4X <Caption>Prices</Caption>[0X
    [4X <HorLine/>[0X
    [4X  <Row>[0X
    [4X   <Item>Object</Item><Item>Price</Item><Item>available</Item>[0X
    [4X  </Row>[0X
    [4X <HorLine/>[0X
    [4X <HorLine/>[0X
    [4X  <Row>[0X
    [4X   <Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>[0X
    [4X  </Row>[0X
    [4X <HorLine/>[0X
    [4X  <Row>[0X
    [4X   <Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>[0X
    [4X  </Row>[0X
    [4X <HorLine/>[0X
    [4X</Table>[0X
    [4X[0X
    [4X</Section>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.10 Entities and Special Characters (Source)[0X
  
  [[14X2.5[0m]
  
  [4X------------------------------------------------------------------[0X
    [4X<Section><Heading>Entities and Special Characters</Heading>[0X
    [4X<Label Name="TenBack"/>[0X
    [4X[0X
    [4X[&see; <Ref Sect="Ten"/>]<P/>[0X
    [4X[0X
    [4XHere is a table of special characters, the first two are special for[0X
    [4XXML and must be typed in by entities in &GAPDoc; documents. The other [0X
    [4Xcharacters are special for &LaTeX; but in &GAPDoc; they can be typed[0X
    [4Xdirectly. [0X
    [4X[0X
    [4X<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA"> [0X
    [4X <Caption>Special characters in character data</Caption>[0X
    [4X <HorLine/> <Row> [0X
    [4X  <Item><C>&amp;</C></Item>[0X
    [4X  <Item><C>&lt;</C></Item>[0X
    [4X  <Item><C>></C></Item>[0X
    [4X  <Item><C>#</C></Item>[0X
    [4X  <Item><C>$</C></Item>[0X
    [4X  <Item><C>%</C></Item>[0X
    [4X  <Item><C>~</C></Item>[0X
    [4X  <Item><C>\</C></Item>   [0X
    [4X  <Item><C>{</C></Item>[0X
    [4X  <Item><C>}</C></Item>[0X
    [4X  <Item><C>_</C></Item>[0X
    [4X  <Item><C>^</C></Item>[0X
    [4X  <Item><C>&nbsp;</C></Item>[0X
    [4X </Row> <HorLine/>[0X
    [4X</Table>[0X
    [4X[0X
    [4XAnd here are the predefined entities in &GAPDoc;:[0X
    [4X[0X
    [4X<Table Align="|l|l|">[0X
    [4X<Caption>Predefined Entities in the &GAPDoc; system</Caption>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;GAP;</C></Item>       <Item>&GAP;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;GAPDoc;</C></Item>    <Item>&GAPDoc;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;TeX;</C></Item>       <Item>&TeX;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;LaTeX;</C></Item>     <Item>&LaTeX;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;BibTeX;</C></Item>    <Item>&BibTeX;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;MeatAxe;</C></Item>   <Item>&MeatAxe;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;XGAP;</C></Item>      <Item>&XGAP;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X<Row> <Item><C>&amp;copyright;</C></Item> <Item>&copyright;</Item> </Row>[0X
    [4X<HorLine/>[0X
    [4X</Table>[0X
    [4X[0X
    [4XAnd some more for mathematical symbols: [0X
    [4X&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.[0X
    [4X[0X
    [4X</Section>[0X
    [4X[0X
    [4X</Chapter>[0X
    [4X[0X
    [4X</Body>[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XB.11 Appendix (Source)[0X
  
  [[14XA.[0m]
  
  [4X------------------------  GAPDoc source  -------------------------[0X
    [4X<Appendix><Heading>An Appendix</Heading>[0X
    [4X[0X
    [4XThis is an appendix.[0X
    [4X</Appendix>[0X
  [4X------------------------------------------------------------------[0X
  
