GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1[1XB [33X[0;0YThe Source[133X[101X234[1XB.1 [33X[0;0YTitlePage (Source)[133X[101X56[4X[32X[104X7[4X<TitlePage>[104X8[4X <Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>[104X9[4X <Subtitle>Every element shows up</Subtitle>[104X10[4X <Version>Version 1.6.1[104X11[4X</Version>[104X12[4X <TitleComment>[104X13[4X If the subtitle ist not sufficient, this <TitleComment> [104X14[4X element can be used for a slightly longer text on the front page.[104X15[4X </TitleComment>[104X16[4X <Author>Frank Lübeck [104X17[4X <Email>[email protected]</Email> [104X18[4X </Author>[104X19[4X <Author> Max Neunhöffer [104X20[4X <Email>neunhoef at mcs.st-and.ac.uk</Email>[104X21[4X </Author>[104X22[4X <Date>September 2011</Date>[104X23[4X <Address>[104X24[4X Lehrstuhl D für Mathematik<Br/> Templergraben [104X25[4X 64<Br/> 52062 Aachen<Br/> (Germany)[104X26[4X </Address>[104X27[4X <Abstract>This document tries to use all elements that exist in &GAPDoc;.[104X28[4X In addition, the final output not only contains the usual[104X29[4X content, but also an appendix with the source text. There[104X30[4X are also links from the usual content to the corresponding[104X31[4X source text. This should enable new users to learn &GAPDoc;[104X32[4X quickly.[104X33[4X </Abstract>[104X34[4X <Copyright>©right; 2000-2011 by Frank Lübeck and Max Neunhöffer[104X35[4X </Copyright>[104X36[4X <Acknowledgements>We thank Lehrstuhl D für Mathematik.[104X37[4X </Acknowledgements>[104X38[4X <Colophon>This is the Colophon page.[104X39[4X </Colophon>[104X40[4X</TitlePage>[104X41[4X[32X[104X424344[1XB.2 [33X[0;0YBefore First Chapter (Source)[133X[101X4546[4X[32X[104X47[4X<TableOfContents/>[104X48[4X[104X49[4X<Body>[104X50[4X[104X51[4X Text before chapter <Ref Chap="First"/>.[104X52[4X[104X53[4X<Chapter Label="First"><Heading>Sectioning Elements</Heading>[104X54[4X[104X55[4X Text before the section <Ref Sect="FirstSect"/>.[104X56[4X[32X[104X575859[1XB.3 [33X[0;0YFirst Chapter (Source)[133X[101X6061[33X[0;0Y[[14X1.[114X][133X6263[4X[32X[104X64[4X<Section Label="FirstSect"><Heading>Normal subsections</Heading>[104X65[4X[104X66[4X <Subsection Label="Asub"><Heading>A subsection</Heading>[104X67[4X[104X68[4X This is text in the first subsection.[104X69[4X[104X70[4X </Subsection>[104X71[4X[104X72[4X <Subsection Label="Another"><Heading>Another subsection</Heading>[104X73[4X [104X74[4X This is text in the second subsection. This subsection [104X75[4X has a label, such that one can reference it.[104X76[4X[104X77[4X </Subsection>[104X78[4X[104X79[4X </Section>[104X80[4X[32X[104X818283[1XB.4 [33X[0;0YManSections (Source)[133X[101X8485[33X[0;0Y[[14X1.2[114X][133X8687[4X[32X[104X88[4X<Section><Heading>ManSections</Heading>[104X89[4X[104X90[4X <ManSection>[104X91[4X <Func Name="f" Arg="x[,y]" Comm="calculates something"/>[104X92[4X <Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>[104X93[4X <Description>[104X94[4X This function calculates something.[104X95[4X </Description>[104X96[4X </ManSection>[104X97[4X[104X98[4X <ManSection>[104X99[4X <Meth Name="\^\{\}\[\]\<\&" Arg="c" [104X100[4X Label="for nothing" Comm="tricky name"/>[104X101[4X <Description>[104X102[4X This method is for an operation with a tricky name.[104X103[4X </Description>[104X104[4X </ManSection>[104X105[4X[104X106[4X <ManSection>[104X107[4X <Oper Name="MyOperation" Arg="x" Comm="calculates something"/>[104X108[4X <Description>[104X109[4X The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.[104X110[4X </Description>[104X111[4X </ManSection>[104X112[4X [104X113[4X <ManSection>[104X114[4X <Meth Name="MyOperation" Label="First" Arg="x" [104X115[4X Comm="generic method"/>[104X116[4X <Description>[104X117[4X This method calculates something by the generic method.[104X118[4X </Description>[104X119[4X </ManSection>[104X120[4X[104X121[4X <ManSection>[104X122[4X <Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"[104X123[4X Comm="for bla arguments"/>[104X124[4X <Description>[104X125[4X This is the super-fast method for the operation[104X126[4X <Ref Oper="MyOperation"/> if the argument <A>x</A> is in the[104X127[4X representation <Ref Filt="IsBla"/>. It will become even faster if[104X128[4X the optional argument <A>good_hint</A> is given.[104X129[4X </Description>[104X130[4X </ManSection>[104X131[4X[104X132[4X <ManSection>[104X133[4X <Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>[104X134[4X <Description>[104X135[4X The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>[104X136[4X an object in <A>filt</A>.[104X137[4X </Description>[104X138[4X </ManSection>[104X139[4X[104X140[4X <ManSection>[104X141[4X <Filt Name="IsBla" Arg="obj" Comm="representation bla"[104X142[4X Type="representation"/>[104X143[4X <Description>[104X144[4X For objects in this representation there is a super-fast method[104X145[4X (see <Ref Meth="MyOperation" Label="for bla"/>) for the operation[104X146[4X <Ref Oper="MyOperation"/>.[104X147[4X </Description>[104X148[4X </ManSection>[104X149[4X[104X150[4X <ManSection>[104X151[4X <Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>[104X152[4X <Description>[104X153[4X A property.[104X154[4X </Description>[104X155[4X </ManSection>[104X156[4X[104X157[4X <ManSection>[104X158[4X <Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>[104X159[4X <Description>[104X160[4X An attribute. Number of blobbs.[104X161[4X </Description>[104X162[4X </ManSection>[104X163[4X[104X164[4X <ManSection>[104X165[4X <Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>[104X166[4X <Description>[104X167[4X This global variable holds a list of all blibbs.[104X168[4X </Description>[104X169[4X </ManSection>[104X170[4X[104X171[4X <ManSection>[104X172[4X <Fam Name="BlibbsFamily" Comm="family of blibbs"/>[104X173[4X <Description>[104X174[4X Family of all blibbs.[104X175[4X </Description>[104X176[4X </ManSection>[104X177[4X[104X178[4X <ManSection>[104X179[4X <InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>[104X180[4X <Description>[104X181[4X This info class is used throughout the library of blibbs.[104X182[4X </Description>[104X183[4X </ManSection>[104X184[4X [104X185[4X </Section>[104X186[4X[32X[104X187188189[1XB.5 [33X[0;0YVarious Types of Text (Source)[133X[101X190191[33X[0;0Y[[14X2.[114X][133X192193[4X[32X[104X194[4X<Chapter><Heading>Other Markup</Heading>[104X195[4X[104X196[4X<Section><Heading>Various types of text</Heading>[104X197[4X[104X198[4XIn this section we present examples for all the various types of text[104X199[4Xthat are possible in &GAPDoc;: [104X200[4X<List>[104X201[4X <Item>[104X202[4X <Emph>This</Emph> is <E>emphasized</E>.</Item>[104X203[4X <Item>[104X204[4X <E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.[104X205[4X </Item>[104X206[4X <Item>[104X207[4X <E>Arguments</E> of functions have an element. They look like this: [104X208[4X <Arg>x</Arg> and <A>y</A>.</Item>[104X209[4X <Item> [104X210[4X <E>Code</E> can be written with the Code element: [104X211[4X <Code>if x = y then Print("Equal"); fi;</Code> or[104X212[4X <C>while true do Print("Hello"); od;</C>.</Item> [104X213[4X <Item>[104X214[4X <E>Filenames</E> have their own element:[104X215[4X <File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>[104X216[4X <Item>[104X217[4X <E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things[104X218[4X are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>[104X219[4X <Item>[104X220[4X <E>Packages</E> are typeset like this: [104X221[4X <Package>Small Groups Library</Package>[104X222[4X </Item>[104X223[4X <Item>[104X224[4X <E>Quoted</E> text: <Q>This is a text in quotes.</Q>[104X225[4X </Item>[104X226[4X</List>[104X227[4X[104X228[4X<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.[104X229[4X<Par/><E>Alternatives</E> for different output formats:[104X230[4X[104X231[4X<Alt Only="LaTeX">This is &LaTeX; output.</Alt>[104X232[4X<Alt Not="LaTeX">This is other than &LaTeX; output, namely:[104X233[4X<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>[104X234[4X<Alt Only="Text">Text</Alt> output.</Alt>[104X235[4X[104X236[4X<P/>[104X237[4X[32X[104X238239240[1XB.6 [33X[0;0YVerbatim-like text (Source)[133X[101X241242[33X[0;0Y[[14X2.1[114X][133X243244[4X[32X[104X245[4XThere are also three elements to typeset <Q>verbatim-like</Q> text.[104X246[4X<P/>[104X247[4XThe first is a <E>Listing</E>:[104X248[4X[104X249[4X<Listing Type="GAP code">[104X250[4X<![CDATA[Sieve := function(n)[104X251[4X # Returns the primes less than n[104X252[4X local l,p,i;[104X253[4X l := [1..n]; Unbind(l[1]);[104X254[4X p := 2;[104X255[4X while p^2 <= n do[104X256[4X if IsBound(l[p]) then[104X257[4X i := 2 * p;[104X258[4X while i <= n do Unbind(l[i]); i := i + p; od;[104X259[4X fi;[104X260[4X p := p + 1;[104X261[4X od;[104X262[4X return Compacted(l);[104X263[4Xend;]]>[104X264[4X</Listing>[104X265[4X[104X266[4XHere is a <E>Log</E> of a &GAP; session using this function:[104X267[4X[104X268[4X<Log>[104X269[4Xgap> Sieve(100);[104X270[4X[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,[104X271[4X 67, 71, 73, 79, 83, 89, 97 ][104X272[4Xgap> Length(last);[104X273[4X25[104X274[4X</Log>[104X275[4X[104X276[4XHere is a &GAP; <E>Example</E> session that is automatically tested:[104X277[4X[104X278[4X<Example>[104X279[4Xgap> s := Size(CharacterTable("M"));[104X280[4X808017424794512875886459904961710757005754368000000000[104X281[4Xgap> s < 10^53; [104X282[4Xfalse[104X283[4Xgap> s < 10^54;[104X284[4Xtrue[104X285[4X</Example>[104X286[4X[104X287[4X</Section>[104X288[4X[32X[104X289290291[1XB.7 [33X[0;0YFormulae (Source)[133X[101X292293[33X[0;0Y[[14X2.2[114X][133X294295[4X[32X[104X296[4X<Section><Heading>Formulae</Heading>[104X297[4X[104X298[4XThere are three types of formulae. <P/>[104X299[4XThe first is the <E>normal math mode</E> of &LaTeX;: [104X300[4X[104X301[4X<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>. [104X302[4X[104X303[4XThen there are <E>displayed formulae</E>:[104X304[4X<Display>[104X305[4X \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot[104X306[4X \left(\sum_{j=1}^d y_j b_j \right) =[104X307[4X \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k [104X308[4X</Display>[104X309[4X[104X310[4XIf possible, use the <C>Alt</C> element to specify a better readable text[104X311[4Xversion of such a formula as in the following example:<P/>[104X312[4X[104X313[4X<Alt Not="Text,HTML"><Display>[104X314[4X \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot[104X315[4X \left(\sum_{j=1}^d y_j b_j \right) =[104X316[4X \sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k [104X317[4X</Display></Alt>[104X318[4X<Alt Only="Text,HTML"><Verb>[104X319[4X d d d [104X320[4X ----- ----- ----- ----- [104X321[4X \ \ \ \ [104X322[4X ==> ( ) x_i b_i )( ) y_i b_i ) = ) ( ) x_i y_j h_ijk ) b_k[104X323[4X / / / / [104X324[4X ----- ----- ----- ----- [104X325[4X i = 1 i = 1 k = 1 i,j [104X326[4X</Verb><P/></Alt>[104X327[4X[104X328[4XFor small formulae without <Q>difficult</Q> parts use the <C>M</C>[104X329[4Xelement: <M>b_i</M>,[104X330[4X<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace [104X331[4Xmatters for text (or HTML) output).<P/>[104X332[4X[104X333[4XHere are two formulae containing less than characters which are special[104X334[4Xcharacters for XML:[104X335[4X<M><![CDATA[a < b < c < d]]></M> and <M>e < f</M>.[104X336[4X</Section>[104X337[4X[32X[104X338339340[1XB.8 [33X[0;0YCrossreferencing (Source)[133X[101X341342[33X[0;0Y[[14X2.3[114X][133X343344[4X[32X[104X345[4X<Section Label="Cross"><Heading>Crossreferencing</Heading>[104X346[4X[104X347[4X<Label Name="there"/>[104X348[4X[104X349[4XIn this section we demonstrate various references to parts of this[104X350[4Xdocument. Here is a reference to this section: <Ref Sect="Cross"/>.[104X351[4XHere is a reference to chapter <Ref Chap="First"/>, to appendix[104X352[4X<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>. [104X353[4X<P/>[104X354[4X[104X355[4XWe distinguish among others references [104X356[4X to functions (see <Ref Func="f"/>), [104X357[4X to methods with tricky name (see [104X358[4X <Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),[104X359[4X to operations (see <Ref Oper="MyOperation"/>), [104X360[4X to methods (see <Ref Meth="MyOperation" Label="First"/> or [104X361[4X <Ref Meth="MyOperation" Label="for bla"/>), [104X362[4X to filters (see <Ref Filt="IsBla"/>), [104X363[4X to properties (see <Ref Prop="IsBlubb"/>),[104X364[4X to attributes (see <Ref Attr="NumberBlobbs"/>), [104X365[4X to variables (<Ref Var="AllBlibbs"/>), [104X366[4X to families (see <Ref Fam="BlibbsFamily"/>),[104X367[4X and to info classes (see <Ref InfoClass="InfoBlibbs"/>).[104X368[4X<P/>[104X369[4X[104X370[4XThere are also references to labels: see <Ref Text="here" Label="there"/>,[104X371[4Xto other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or[104X372[4X<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference[104X373[4Xmanual.[104X374[4X<P/>[104X375[4X[104X376[4XReferences to sections come in two styles: [104X377[4X<Ref Chap="First" Style="Number"/>[104X378[4Xor <Ref Chap="First" Style="Text"/>.[104X379[4X<P/>[104X380[4X[104X381[4XAnother type of cross referencing is bibliography. Here is a [104X382[4Xcitation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.[104X383[4X<P/>[104X384[4X[104X385[4XThere are also URLs:<P/>[104X386[4X[104X387[4X<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>[104X388[4X[104X389[4XEmail addresses have a special element:[104X390[4X<Email>[email protected]</Email>[104X391[4X<P/>[104X392[4X[104X393[4Xand Homepages another one:[104X394[4X<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>[104X395[4X<P/>[104X396[4X[104X397[4XOne can generate index entries as follows (look up the words [104X398[4X<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).[104X399[4X<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>[104X400[4X<Index>RWTH</Index>[104X401[4X<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>[104X402[4X<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc; [104X403[4X<Subkey>for &GAP; programmers</Subkey></Index>[104X404[4X[104X405[4X</Section>[104X406[4X[32X[104X407408409[1XB.9 [33X[0;0YLists and Tables (Source)[133X[101X410411[33X[0;0Y[[14X2.4[114X][133X412413[4X[32X[104X414[4X<Section><Heading>Lists and Tables</Heading>[104X415[4X[104X416[4XThere are[104X417[4X<List>[104X418[4X <Item>lists</Item>[104X419[4X <Item>enumerations, and</Item>[104X420[4X <Item>tables</Item>[104X421[4X</List>[104X422[4Xor:[104X423[4X<Enum>[104X424[4X <Item>lists</Item>[104X425[4X <Item>enumerations, and</Item>[104X426[4X <Item>tables</Item>[104X427[4X</Enum>[104X428[4Xor with marks:[104X429[4X<List>[104X430[4X <Mark>lists:</Mark><Item> not numbered</Item>[104X431[4X <Mark>enumerations:</Mark><Item> numbered</Item>[104X432[4X <Mark>tables:</Mark><Item> two-dimensional</Item>[104X433[4X</List>[104X434[4X[104X435[4XLists can also be nested:[104X436[4X<Enum>[104X437[4X <Item>[104X438[4X <Enum>[104X439[4X <Item>first item of inner enumeration </Item>[104X440[4X <Item>second item of inner enumeration </Item>[104X441[4X </Enum>[104X442[4X </Item>[104X443[4X <Item>[104X444[4X <List>[104X445[4X <Item>first item of inner list </Item>[104X446[4X <Item>second item of inner list </Item>[104X447[4X </List>[104X448[4X </Item>[104X449[4X</Enum>[104X450[4X[104X451[4XHere is a <E>table</E>:[104X452[4X[104X453[4X<Table Align="|r|c|l|">[104X454[4X <Caption>Prices</Caption>[104X455[4X <HorLine/>[104X456[4X <Row>[104X457[4X <Item>Object</Item><Item>Price</Item><Item>available</Item>[104X458[4X </Row>[104X459[4X <HorLine/>[104X460[4X <HorLine/>[104X461[4X <Row>[104X462[4X <Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>[104X463[4X </Row>[104X464[4X <HorLine/>[104X465[4X <Row>[104X466[4X <Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>[104X467[4X </Row>[104X468[4X <HorLine/>[104X469[4X</Table>[104X470[4X[104X471[4X</Section>[104X472[4X[32X[104X473474475[1XB.10 [33X[0;0YEntities and Special Characters (Source)[133X[101X476477[33X[0;0Y[[14X2.5[114X][133X478479[4X[32X[104X480[4X<Section><Heading>Entities and Special Characters</Heading>[104X481[4X<Label Name="TenBack"/>[104X482[4X[104X483[4X[&see; <Ref Sect="Ten"/>]<P/>[104X484[4X[104X485[4XHere is a table of special characters, the first two are special for[104X486[4XXML and must be typed in by entities in &GAPDoc; documents. The other [104X487[4Xcharacters are special for &LaTeX; but in &GAPDoc; they can be typed[104X488[4Xdirectly. [104X489[4X[104X490[4X<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA"> [104X491[4X <Caption>Special characters in character data</Caption>[104X492[4X <HorLine/> <Row> [104X493[4X <Item><C>&</C></Item>[104X494[4X <Item><C><</C></Item>[104X495[4X <Item><C>></C></Item>[104X496[4X <Item><C>#</C></Item>[104X497[4X <Item><C>$</C></Item>[104X498[4X <Item><C>%</C></Item>[104X499[4X <Item><C>~</C></Item>[104X500[4X <Item><C>\</C></Item> [104X501[4X <Item><C>{</C></Item>[104X502[4X <Item><C>}</C></Item>[104X503[4X <Item><C>_</C></Item>[104X504[4X <Item><C>^</C></Item>[104X505[4X <Item><C> </C></Item>[104X506[4X </Row> <HorLine/>[104X507[4X</Table>[104X508[4X[104X509[4XAnd here are the predefined entities in &GAPDoc;:[104X510[4X[104X511[4X<Table Align="|l|l|">[104X512[4X<Caption>Predefined Entities in the &GAPDoc; system</Caption>[104X513[4X<HorLine/>[104X514[4X<Row> <Item><C>&GAP;</C></Item> <Item>&GAP;</Item> </Row>[104X515[4X<HorLine/>[104X516[4X<Row> <Item><C>&GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>[104X517[4X<HorLine/>[104X518[4X<Row> <Item><C>&TeX;</C></Item> <Item>&TeX;</Item> </Row>[104X519[4X<HorLine/>[104X520[4X<Row> <Item><C>&LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>[104X521[4X<HorLine/>[104X522[4X<Row> <Item><C>&BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>[104X523[4X<HorLine/>[104X524[4X<Row> <Item><C>&MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>[104X525[4X<HorLine/>[104X526[4X<Row> <Item><C>&XGAP;</C></Item> <Item>&XGAP;</Item> </Row>[104X527[4X<HorLine/>[104X528[4X<Row> <Item><C>&copyright;</C></Item> <Item>©right;</Item> </Row>[104X529[4X<HorLine/>[104X530[4X</Table>[104X531[4X[104X532[4XAnd some more for mathematical symbols: [104X533[4X&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.[104X534[4X[104X535[4X</Section>[104X536[4X[104X537[4X</Chapter>[104X538[4X[104X539[4X</Body>[104X540[4X[32X[104X541542543[1XB.11 [33X[0;0YAppendix (Source)[133X[101X544545[33X[0;0Y[[14XA.[114X][133X546547[4X[32X GAPDoc source [32X[104X548[4X<Appendix><Heading>An Appendix</Heading>[104X549[4X[104X550[4XThis is an appendix.[104X551[4X</Appendix>[104X552[4X[32X[104X553554555556