Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346<?xml version="1.0" encoding="UTF-8"?>123<!DOCTYPE Book SYSTEM "gapdoc.dtd"4[ <!ENTITY see '<Alt Only="LaTeX">$\to$</Alt><Alt Not="LaTeX">→</Alt>'>5]>67<Book Name="GAPDoc Example">89<TitlePage>10<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>11<Subtitle>Every element shows up</Subtitle>12<Version>Version <#Include SYSTEM "../version"></Version>13<TitleComment>14If the subtitle is not sufficient, this <TitleComment>15element can be used for a slightly longer text on the front page.16</TitleComment>17<Author>Frank Lübeck18<Email>[email protected]</Email>19</Author>20<Author> Max Neunhöffer21<Email>neunhoef at mcs.st-and.ac.uk</Email>22</Author>23<Date>November 2017</Date>24<Address>25Lehrstuhl D für Mathematik<Br/> Pontdriesch2614/16<Br/> 52062 Aachen<Br/> (Germany)27</Address>28<Abstract>This document tries to use all elements that exist in &GAPDoc;.29In addition, the final output not only contains the usual30content, but also an appendix with the source text. There31are also links from the usual content to the corresponding32source text. This should enable new users to learn &GAPDoc;33quickly.34</Abstract>35<Copyright>©right; 2000-2017 by Frank Lübeck and Max Neunhöffer36</Copyright>37<Acknowledgements>We thank Lehrstuhl D für Mathematik.38</Acknowledgements>39<Colophon>This is the Colophon page.40</Colophon>41</TitlePage>4243<TableOfContents/>4445<Body>46Text before chapter <Ref Chap="First"/>. (&see; <Ref Sect="Two"/>)4748<Chapter Label="First"><Heading>Sectioning Elements</Heading>4950Text before the section <Ref Sect="FirstSect"/>. (&see; <Ref Sect="Two"/>)5152<Label Name="ThreeBack"/>53<Section Label="FirstSect"><Heading>Normal subsections</Heading>5455[&see; <Ref Sect="Three"/>]5657<Subsection Label="Asub"><Heading>A subsection</Heading>5859This is text in the first subsection.6061</Subsection>6263<Subsection Label="Another"><Heading>Another subsection</Heading>6465This is text in the second subsection. This subsection66has a label, such that one can reference it.6768</Subsection>6970</Section>7172<Section><Heading>ManSections</Heading>73<Label Name="FourBack"/>7475[&see; <Ref Sect="Four"/>]7677<ManSection>78<Func Name="f" Arg="x[,y]" Comm="calculates something"/>79<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>80<Description>81This function calculates something.82</Description>83</ManSection>8485<ManSection>86<Meth Name="\^\{\}\[\]\<\&" Arg="c"87Label="for nothing" Comm="tricky name"/>88<Description>89This method is for an operation with a tricky name.90</Description>91</ManSection>9293<ManSection>94<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>95<Description>96The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.97</Description>98</ManSection>99100<ManSection>101<Meth Name="MyOperation" Label="First" Arg="x"102Comm="generic method"/>103<Description>104This method calculates something by the generic method.105</Description>106</ManSection>107108<ManSection>109<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"110Comm="for bla arguments"/>111<Description>112This is the super-fast method for the operation113<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the114representation <Ref Filt="IsBla"/>. It will become even faster if115the optional argument <A>good_hint</A> is given.116</Description>117</ManSection>118119<ManSection>120<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>121<Description>122The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>123an object in <A>filt</A>.124</Description>125</ManSection>126127<ManSection>128<Filt Name="IsBla" Arg="obj" Comm="representation bla"129Type="representation"/>130<Description>131For objects in this representation there is a super-fast method132(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation133<Ref Oper="MyOperation"/>.134</Description>135</ManSection>136137<ManSection>138<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>139<Description>140A property.141</Description>142</ManSection>143144<ManSection>145<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>146<Description>147An attribute. Number of blobbs.148</Description>149</ManSection>150151<ManSection>152<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>153<Description>154This global variable holds a list of all blibbs.155</Description>156</ManSection>157158<ManSection>159<Fam Name="BlibbsFamily" Comm="family of blibbs"/>160<Description>161Family of all blibbs.162</Description>163</ManSection>164165<ManSection>166<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>167<Description>168This info class is used throughout the library of blibbs.169</Description>170</ManSection>171172</Section>173174</Chapter>175176177<Chapter><Heading>Other Markup</Heading>178<Label Name="FiveBack"/>179180<Section><Heading>Various types of text</Heading>181182[&see; <Ref Sect="Five"/>]<P/>183184In this section we present examples for all the various types of text185that are possible in &GAPDoc;:186<List>187<Item>188<Emph>This</Emph> is <E>emphasized</E>.</Item>189<Item>190<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.191</Item>192<Item>193<E>Arguments</E> of functions have an element. They look like this:194<Arg>x</Arg> and <A>y</A>.</Item>195<Item>196<E>Code</E> can be written with the Code element:197<Code>if x = y then Print("Equal"); fi;</Code> or198<C>while true do Print("Hello"); od;</C>.</Item>199<Item>200<E>Filenames</E> have their own element:201<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>202<Item>203<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things204are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>205<Item>206<E>Packages</E> are typeset like this:207<Package>Small Groups Library</Package>208</Item>209<Item>210<E>Quoted</E> text: <Q>This is a text in quotes.</Q>211</Item>212</List>213214<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.215<Par/><E>Alternatives</E> for different output formats:216217<Alt Only="LaTeX">This is &LaTeX; output.</Alt>218<Alt Not="LaTeX">This is other than &LaTeX; output, namely:219<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>220<Alt Only="Text">Text</Alt> output.</Alt>221222<P/>223224<Label Name="SixBack"/>225There are also three elements to typeset <Q>verbatim-like</Q> text.226(&see; <Ref Sect="Six"/>)<P/>227The first is a <E>Listing</E>:228229<Listing Type="GAP code">230<![CDATA[Sieve := function(n)231# Returns the primes less than n232local l,p,i;233l := [1..n]; Unbind(l[1]);234p := 2;235while p^2 <= n do236if IsBound(l[p]) then237i := 2 * p;238while i <= n do Unbind(l[i]); i := i + p; od;239fi;240p := p + 1;241od;242return Compacted(l);243end;]]>244</Listing>245246Here is a <E>Log</E> of a &GAP; session using this function:247248<Log>249gap> Sieve(100);250[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,25167, 71, 73, 79, 83, 89, 97 ]252gap> Length(last);25325254</Log>255256Here is a &GAP; <E>Example</E> session that is automatically tested:257258<Example>259gap> s := Size(CharacterTable("M"));260808017424794512875886459904961710757005754368000000000261gap> s < 10^53;262false263gap> s < 10^54;264true265</Example>266267</Section>268269<Section><Heading>Formulae</Heading>270<Label Name="SevenBack"/>271272[&see; <Ref Sect="Seven"/>]<P/>273274There are three types of formulae. <P/>275The first is the <E>normal math mode</E> of &LaTeX;:276277<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.278279Then there are <E>displayed formulae</E>:280<Display>281\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot282\left(\sum_{j=1}^d y_j b_j \right) =283\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k284</Display>285286If possible, use the <C>Alt</C> element to specify a better readable text287version of such a formula as in the following example:<P/>288289<Alt Not="Text,HTML"><Display>290\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot291\left(\sum_{j=1}^d y_j b_j \right) =292\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k293</Display></Alt>294<Alt Only="Text,HTML"><Verb>295d d d296----- ----- ----- -----297\ \ \ \298==> ( ) x_i b_i )( ) y_j b_j ) = ) ( ) x_i y_j h_ijk ) b_k299/ / / /300----- ----- ----- -----301i = 1 j = 1 k = 1 i,j302</Verb><P/></Alt>303304For small formulae without <Q>difficult</Q> parts use the <C>M</C>305element: <M>b_i</M>,306<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace307matters for text (or HTML) output.<P/>308309Here are two formulae containing less than characters which are special310characters for XML:311<M><![CDATA[a < b < c < d]]></M> and <M>e < f</M>.312<P/>313314Using the <C>Mode</C> attribute of a <C>Display</C> element formulae315like316<Display Mode="M">a \longrightarrow a \bmod m\prime</Display>317can also be displayed nicely in text and HTML output.318</Section>319320321<Section Label="Cross"><Heading>Crossreferencing</Heading>322<Label Name="EightBack"/>323324[&see; <Ref Sect="Eight"/>]<P/>325326<Label Name="there"/>327328In this section we demonstrate various references to parts of this329document. Here is a reference to this section: <Ref Sect="Cross"/>.330Here is a reference to chapter <Ref Chap="First"/>, to appendix331<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.332<P/>333334We distinguish among others references335to functions (see <Ref Func="f"/>),336to methods with tricky name (see337<Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),338to operations (see <Ref Oper="MyOperation"/>),339to methods (see <Ref Meth="MyOperation" Label="First"/> or340<Ref Meth="MyOperation" Label="for bla"/>),341to filters (see <Ref Filt="IsBla"/>),342to properties (see <Ref Prop="IsBlubb"/>),343to attributes (see <Ref Attr="NumberBlobbs"/>),344to variables (<Ref Var="AllBlibbs"/>),345to families (see <Ref Fam="BlibbsFamily"/>),346and to info classes (see <Ref InfoClass="InfoBlibbs"/>).347<P/>348349There are also references to labels: see <Ref Text="here" Label="there"/>,350to other books: see <Ref Sect="What is a DTD" BookName="GAPDoc"/> or351<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference352manual.353<P/>354355References to sections come in two styles:356<Ref Chap="First" Style="Number"/>357or <Ref Chap="First" Style="Text"/>.358<P/>359360Another type of cross referencing is bibliography. Here is a361citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.362<P/>363364There are also URLs:<P/>365366<URL>http://www.math.rwth-aachen.de/</URL><P/>367368Email addresses have a special element:369<Email>[email protected]</Email>370<P/>371372and Homepages another one:373<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>374<P/>375And here is a link to the <URL>376<Link>http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/EDIM/index.html#ARCHS</Link>377<LinkText><Package>EDIM</Package>378archives</LinkText></URL>.379<P/>380381One can generate index entries as follows (look up the words382<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, <Q>Aachen, Hauptbahnhof</Q>, and383<Q><Package>GAPDoc</Package>, for &GAP; programmers</Q>).384<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>385<Index>RWTH</Index>386<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>387<Index Key="GAPDoc" Subkey="for GAP programmers"><Package>GAPDoc</Package>388<Subkey>for &GAP; programmers</Subkey></Index>389390</Section>391392393<Section><Heading>Lists and Tables</Heading>394<Label Name="NineBack"/>395396[&see; <Ref Sect="Nine"/>]<P/>397398There are399<List>400<Item>lists</Item>401<Item>enumerations, and</Item>402<Item>tables</Item>403</List>404or:405<Enum>406<Item>lists</Item>407<Item>enumerations, and</Item>408<Item>tables</Item>409</Enum>410or with marks:411<List>412<Mark>lists:</Mark><Item> not numbered</Item>413<Mark>enumerations:</Mark><Item> numbered</Item>414<Mark>tables:</Mark><Item> two-dimensional</Item>415</List>416417Lists can also be nested:418<Enum>419<Item>420<Enum>421<Item>first item of inner enumeration </Item>422<Item>second item of inner enumeration </Item>423</Enum>424</Item>425<Item>426<List>427<Item>first item of inner list </Item>428<Item>second item of inner list </Item>429</List>430</Item>431</Enum>432433Here is a <E>table</E>:434435<Table Align="|r|c|l|">436<Caption>Prices</Caption>437<HorLine/>438<Row>439<Item>Object</Item><Item>Price</Item><Item>available</Item>440</Row>441<HorLine/>442<HorLine/>443<Row>444<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>445</Row>446<HorLine/>447<Row>448<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>449</Row>450<HorLine/>451</Table>452453</Section>454455456<Section><Heading>Entities and Special Characters</Heading>457<Label Name="TenBack"/>458459[&see; <Ref Sect="Ten"/>]<P/>460461Here is a table of special characters, the first two are special for462XML and must be typed in by entities in &GAPDoc; documents. The other463characters are special for &LaTeX; but in &GAPDoc; they can be typed464directly.465466<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">467<Caption>Special characters in character data</Caption>468<HorLine/> <Row>469<Item><C>&</C></Item>470<Item><C><</C></Item>471<Item><C>></C></Item>472<Item><C>#</C></Item>473<Item><C>$</C></Item>474<Item><C>%</C></Item>475<Item><C>~</C></Item>476<Item><C>\</C></Item>477<Item><C>{</C></Item>478<Item><C>}</C></Item>479<Item><C>_</C></Item>480<Item><C>^</C></Item>481<Item><C> </C></Item>482</Row> <HorLine/>483</Table>484485And here are the predefined entities in &GAPDoc;:486487<Table Align="|l|l|">488<Caption>Predefined Entities in the &GAPDoc; system</Caption>489<HorLine/>490<Row> <Item><C>&GAP;</C></Item> <Item>&GAP;</Item> </Row>491<HorLine/>492<Row> <Item><C>&GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>493<HorLine/>494<Row> <Item><C>&TeX;</C></Item> <Item>&TeX;</Item> </Row>495<HorLine/>496<Row> <Item><C>&LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>497<HorLine/>498<Row> <Item><C>&BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>499<HorLine/>500<Row> <Item><C>&MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>501<HorLine/>502<Row> <Item><C>&XGAP;</C></Item> <Item>&XGAP;</Item> </Row>503<HorLine/>504<Row> <Item><C>&copyright;</C></Item> <Item>©right;</Item> </Row>505<HorLine/>506</Table>507508And some more for mathematical symbols:509&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.510511</Section>512513</Chapter>514515</Body>516517<Appendix Label="Appendix">518<Heading>An Appendix</Heading>519<Label Name="ElevenBack"/>520521[&see; <Ref Sect="Eleven"/>]<P/>522523This is an appendix.524</Appendix>525526<Appendix Label="Source"><Heading>The Source</Heading>527528<Section Label="One"><Heading>TitlePage (Source)</Heading>529530<Listing>531<![CDATA[<TitlePage>532<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>533<Subtitle>Every element shows up</Subtitle>534<Version>Version <#Include SYSTEM "../version"></Version>535<TitleComment>536If the subtitle ist not sufficient, this <TitleComment>537element can be used for a slightly longer text on the front page.538</TitleComment>539<Author>Frank Lübeck540<Email>[email protected]</Email>541</Author>542<Author> Max Neunhöffer543<Email>neunhoef at mcs.st-and.ac.uk</Email>544</Author>545<Date>September 2011</Date>546<Address>547Lehrstuhl D für Mathematik<Br/> Templergraben54864<Br/> 52062 Aachen<Br/> (Germany)549</Address>550<Abstract>This document tries to use all elements that exist in &GAPDoc;.551In addition, the final output not only contains the usual552content, but also an appendix with the source text. There553are also links from the usual content to the corresponding554source text. This should enable new users to learn &GAPDoc;555quickly.556</Abstract>557<Copyright>©right; 2000-2011 by Frank Lübeck and Max Neunhöffer558</Copyright>559<Acknowledgements>We thank Lehrstuhl D für Mathematik.560</Acknowledgements>561<Colophon>This is the Colophon page.562</Colophon>563</TitlePage>]]>564</Listing>565566</Section>567568569<Section Label="Two"><Heading>Before First Chapter (Source)</Heading>570571<Listing>572<![CDATA[<TableOfContents/>573574<Body>575576Text before chapter <Ref Chap="First"/>.577578<Chapter Label="First"><Heading>Sectioning Elements</Heading>579580Text before the section <Ref Sect="FirstSect"/>.]]>581</Listing>582583</Section>584585586<Section Label="Three">587<Heading>First Chapter (Source)</Heading>588589[<Ref Label="ThreeBack"/>]590591<Listing>592<![CDATA[<Section Label="FirstSect"><Heading>Normal subsections</Heading>593594<Subsection Label="Asub"><Heading>A subsection</Heading>595596This is text in the first subsection.597598</Subsection>599600<Subsection Label="Another"><Heading>Another subsection</Heading>601602This is text in the second subsection. This subsection603has a label, such that one can reference it.604605</Subsection>606607</Section>]]>608</Listing>609610</Section>611612613<Section Label="Four"><Heading>ManSections (Source)</Heading>614615[<Ref Label="FourBack"/>]616617<Listing>618<![CDATA[<Section><Heading>ManSections</Heading>619620<ManSection>621<Func Name="f" Arg="x[,y]" Comm="calculates something"/>622<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>623<Description>624This function calculates something.625</Description>626</ManSection>627628<ManSection>629<Meth Name="\^\{\}\[\]\<\&" Arg="c"630Label="for nothing" Comm="tricky name"/>631<Description>632This method is for an operation with a tricky name.633</Description>634</ManSection>635636<ManSection>637<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>638<Description>639The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.640</Description>641</ManSection>642643<ManSection>644<Meth Name="MyOperation" Label="First" Arg="x"645Comm="generic method"/>646<Description>647This method calculates something by the generic method.648</Description>649</ManSection>650651<ManSection>652<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"653Comm="for bla arguments"/>654<Description>655This is the super-fast method for the operation656<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the657representation <Ref Filt="IsBla"/>. It will become even faster if658the optional argument <A>good_hint</A> is given.659</Description>660</ManSection>661662<ManSection>663<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>664<Description>665The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>666an object in <A>filt</A>.667</Description>668</ManSection>669670<ManSection>671<Filt Name="IsBla" Arg="obj" Comm="representation bla"672Type="representation"/>673<Description>674For objects in this representation there is a super-fast method675(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation676<Ref Oper="MyOperation"/>.677</Description>678</ManSection>679680<ManSection>681<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>682<Description>683A property.684</Description>685</ManSection>686687<ManSection>688<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>689<Description>690An attribute. Number of blobbs.691</Description>692</ManSection>693694<ManSection>695<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>696<Description>697This global variable holds a list of all blibbs.698</Description>699</ManSection>700701<ManSection>702<Fam Name="BlibbsFamily" Comm="family of blibbs"/>703<Description>704Family of all blibbs.705</Description>706</ManSection>707708<ManSection>709<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>710<Description>711This info class is used throughout the library of blibbs.712</Description>713</ManSection>714715</Section>]]>716</Listing>717718</Section>719720721<Section Label="Five"><Heading>Various Types of Text (Source)</Heading>722723[<Ref Label="FiveBack"/>]724725<Listing>726<![CDATA[<Chapter><Heading>Other Markup</Heading>727728<Section><Heading>Various types of text</Heading>729730In this section we present examples for all the various types of text731that are possible in &GAPDoc;:732<List>733<Item>734<Emph>This</Emph> is <E>emphasized</E>.</Item>735<Item>736<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.737</Item>738<Item>739<E>Arguments</E> of functions have an element. They look like this:740<Arg>x</Arg> and <A>y</A>.</Item>741<Item>742<E>Code</E> can be written with the Code element:743<Code>if x = y then Print("Equal"); fi;</Code> or744<C>while true do Print("Hello"); od;</C>.</Item>745<Item>746<E>Filenames</E> have their own element:747<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>748<Item>749<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things750are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>751<Item>752<E>Packages</E> are typeset like this:753<Package>Small Groups Library</Package>754</Item>755<Item>756<E>Quoted</E> text: <Q>This is a text in quotes.</Q>757</Item>758</List>759760<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.761<Par/><E>Alternatives</E> for different output formats:762763<Alt Only="LaTeX">This is &LaTeX; output.</Alt>764<Alt Not="LaTeX">This is other than &LaTeX; output, namely:765<Alt Only="HTML"><![CDATA[<b>HTML</b>]]>]<![CDATA[]></Alt>766<Alt Only="Text">Text</Alt> output.</Alt>767768<P/>]]>769</Listing>770771</Section>772773774<Section Label="Six"><Heading>Verbatim-like text (Source)</Heading>775776[<Ref Label="SixBack"/>]777778<Listing>779<![CDATA[There are also three elements to typeset <Q>verbatim-like</Q> text.780<P/>781The first is a <E>Listing</E>:782783<Listing Type="GAP code">784<![CDATA[Sieve := function(n)785# Returns the primes less than n786local l,p,i;787l := [1..n]; Unbind(l[1]);788p := 2;789while p^2 <= n do790if IsBound(l[p]) then791i := 2 * p;792while i <= n do Unbind(l[i]); i := i + p; od;793fi;794p := p + 1;795od;796return Compacted(l);797end;]]>]<![CDATA[]>798</Listing>799800Here is a <E>Log</E> of a &GAP; session using this function:801802<Log>803gap> Sieve(100);804[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,80567, 71, 73, 79, 83, 89, 97 ]806gap> Length(last);80725808</Log>809810Here is a &GAP; <E>Example</E> session that is automatically tested:811812<Example>813gap> s := Size(CharacterTable("M"));814808017424794512875886459904961710757005754368000000000815gap> s < 10^53;816false817gap> s < 10^54;818true819</Example>820821</Section>]]>822</Listing>823824</Section>825826827<Section Label="Seven"><Heading>Formulae (Source)</Heading>828829[<Ref Label="SevenBack"/>]830831<Listing>832<![CDATA[<Section><Heading>Formulae</Heading>833834There are three types of formulae. <P/>835The first is the <E>normal math mode</E> of &LaTeX;:836837<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.838839Then there are <E>displayed formulae</E>:840<Display>841\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot842\left(\sum_{j=1}^d y_j b_j \right) =843\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k844</Display>845846If possible, use the <C>Alt</C> element to specify a better readable text847version of such a formula as in the following example:<P/>848849<Alt Not="Text,HTML"><Display>850\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot851\left(\sum_{j=1}^d y_j b_j \right) =852\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k853</Display></Alt>854<Alt Only="Text,HTML"><Verb>855d d d856----- ----- ----- -----857\ \ \ \858==> ( ) x_i b_i )( ) y_i b_i ) = ) ( ) x_i y_j h_ijk ) b_k859/ / / /860----- ----- ----- -----861i = 1 i = 1 k = 1 i,j862</Verb><P/></Alt>863864For small formulae without <Q>difficult</Q> parts use the <C>M</C>865element: <M>b_i</M>,866<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace867matters for text (or HTML) output).<P/>868869Here are two formulae containing less than characters which are special870characters for XML:871<M><![CDATA[a < b < c < d]]]]>><![CDATA[</M> and <M>e < f</M>.872</Section>]]>873</Listing>874875</Section>876877878<Section Label="Eight"><Heading>Crossreferencing (Source)</Heading>879880[<Ref Label="EightBack"/>]881882<Listing>883<![CDATA[<Section Label="Cross"><Heading>Crossreferencing</Heading>884885<Label Name="there"/>886887In this section we demonstrate various references to parts of this888document. Here is a reference to this section: <Ref Sect="Cross"/>.889Here is a reference to chapter <Ref Chap="First"/>, to appendix890<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.891<P/>892893We distinguish among others references894to functions (see <Ref Func="f"/>),895to methods with tricky name (see896<Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),897to operations (see <Ref Oper="MyOperation"/>),898to methods (see <Ref Meth="MyOperation" Label="First"/> or899<Ref Meth="MyOperation" Label="for bla"/>),900to filters (see <Ref Filt="IsBla"/>),901to properties (see <Ref Prop="IsBlubb"/>),902to attributes (see <Ref Attr="NumberBlobbs"/>),903to variables (<Ref Var="AllBlibbs"/>),904to families (see <Ref Fam="BlibbsFamily"/>),905and to info classes (see <Ref InfoClass="InfoBlibbs"/>).906<P/>907908There are also references to labels: see <Ref Text="here" Label="there"/>,909to other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or910<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference911manual.912<P/>913914References to sections come in two styles:915<Ref Chap="First" Style="Number"/>916or <Ref Chap="First" Style="Text"/>.917<P/>918919Another type of cross referencing is bibliography. Here is a920citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.921<P/>922923There are also URLs:<P/>924925<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>926927Email addresses have a special element:928<Email>[email protected]</Email>929<P/>930931and Homepages another one:932<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>933<P/>934935One can generate index entries as follows (look up the words936<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).937<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>938<Index>RWTH</Index>939<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>940<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc;941<Subkey>for &GAP; programmers</Subkey></Index>942943</Section>]]>944</Listing>945946</Section>947948949<Section Label="Nine"><Heading>Lists and Tables (Source)</Heading>950951[<Ref Label="NineBack"/>]952953<Listing>954<![CDATA[<Section><Heading>Lists and Tables</Heading>955956There are957<List>958<Item>lists</Item>959<Item>enumerations, and</Item>960<Item>tables</Item>961</List>962or:963<Enum>964<Item>lists</Item>965<Item>enumerations, and</Item>966<Item>tables</Item>967</Enum>968or with marks:969<List>970<Mark>lists:</Mark><Item> not numbered</Item>971<Mark>enumerations:</Mark><Item> numbered</Item>972<Mark>tables:</Mark><Item> two-dimensional</Item>973</List>974975Lists can also be nested:976<Enum>977<Item>978<Enum>979<Item>first item of inner enumeration </Item>980<Item>second item of inner enumeration </Item>981</Enum>982</Item>983<Item>984<List>985<Item>first item of inner list </Item>986<Item>second item of inner list </Item>987</List>988</Item>989</Enum>990991Here is a <E>table</E>:992993<Table Align="|r|c|l|">994<Caption>Prices</Caption>995<HorLine/>996<Row>997<Item>Object</Item><Item>Price</Item><Item>available</Item>998</Row>999<HorLine/>1000<HorLine/>1001<Row>1002<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>1003</Row>1004<HorLine/>1005<Row>1006<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>1007</Row>1008<HorLine/>1009</Table>10101011</Section>]]>1012</Listing>10131014</Section>101510161017<Section Label="Ten">1018<Heading>Entities and Special Characters (Source)</Heading>10191020[<Ref Label="TenBack"/>]10211022<Listing>1023<![CDATA[<Section><Heading>Entities and Special Characters</Heading>1024<Label Name="TenBack"/>10251026[&see; <Ref Sect="Ten"/>]<P/>10271028Here is a table of special characters, the first two are special for1029XML and must be typed in by entities in &GAPDoc; documents. The other1030characters are special for &LaTeX; but in &GAPDoc; they can be typed1031directly.10321033<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">1034<Caption>Special characters in character data</Caption>1035<HorLine/> <Row>1036<Item><C>&</C></Item>1037<Item><C><</C></Item>1038<Item><C>></C></Item>1039<Item><C>#</C></Item>1040<Item><C>$</C></Item>1041<Item><C>%</C></Item>1042<Item><C>~</C></Item>1043<Item><C>\</C></Item>1044<Item><C>{</C></Item>1045<Item><C>}</C></Item>1046<Item><C>_</C></Item>1047<Item><C>^</C></Item>1048<Item><C> </C></Item>1049</Row> <HorLine/>1050</Table>10511052And here are the predefined entities in &GAPDoc;:10531054<Table Align="|l|l|">1055<Caption>Predefined Entities in the &GAPDoc; system</Caption>1056<HorLine/>1057<Row> <Item><C>&GAP;</C></Item> <Item>&GAP;</Item> </Row>1058<HorLine/>1059<Row> <Item><C>&GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>1060<HorLine/>1061<Row> <Item><C>&TeX;</C></Item> <Item>&TeX;</Item> </Row>1062<HorLine/>1063<Row> <Item><C>&LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>1064<HorLine/>1065<Row> <Item><C>&BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>1066<HorLine/>1067<Row> <Item><C>&MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>1068<HorLine/>1069<Row> <Item><C>&XGAP;</C></Item> <Item>&XGAP;</Item> </Row>1070<HorLine/>1071<Row> <Item><C>&copyright;</C></Item> <Item>©right;</Item> </Row>1072<HorLine/>1073</Table>10741075And some more for mathematical symbols:1076&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.10771078</Section>10791080</Chapter>10811082</Body>]]>1083</Listing>10841085</Section>108610871088<Section Label="Eleven"><Heading>Appendix (Source)</Heading>10891090[<Ref Label="ElevenBack"/>]10911092<Listing Type="GAPDoc source">1093<![CDATA[<Appendix><Heading>An Appendix</Heading>10941095This is an appendix.1096</Appendix>]]>1097</Listing>10981099</Section>11001101</Appendix>11021103<Bibliography Databases="examplebib.xml" Style="alpha"/>1104<TheIndex/>11051106</Book>1107110811091110