%% for a long time these were red and blue by default, %% now black, but keep variables to overwrite \definecolor{FuncColor}{rgb}{0.0,0.0,0.0} %% strange name because of pdflatex bug: \definecolor{Chapter }{rgb}{0.0,0.0,0.0} \definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
% write page numbers to a .pnr log file for online help \newwrite\pagenrlog \immediate\openout\pagenrlog =\jobname.pnr \immediate\write\pagenrlog{PAGENRS := [} \newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}} %% were never documented, give conflicts with some additional packages
\newcommand{\GAP}{\textsf{GAP}}
%% nicer description environments, allows long labels \usepackage{enumitem} \setdescription{style=nextline}
\begin{center}{\maintitlesize\textbf{A Complete Example ($\to$ \ref{One})\mbox{}}}\\ \vfill
\hypersetup{pdftitle=A Complete Example ($\to$ \ref{One})} \markright{\scriptsize\mbox{}\hfill A Complete Example ($\to$ \ref{One}) \hfill\mbox{}}
{\Huge\textbf{Every element shows up\mbox{}}}\\ \vfill
{\Huge Version 1.6.7 \mbox{}}\\[1cm]
{February 2024\mbox{}}\\[1cm] \mbox{}\\[2cm]
{\Large\textbf{Frank L{\"u}beck \mbox{}}}\\
{\Large\textbf{ Max Neunh{\"o}ffer \mbox{}}}\\ \hypersetup{pdfauthor=Frank L{\"u}beck ; Max Neunh{\"o}ffer } \mbox{}\\[2cm] \begin{minipage}{12cm}\noindent
If the subtitle is not sufficient, this {\textless}TitleComment{\textgreater}
element can be used for a slightly longer text on the front page. \end{minipage}
\end{center}\vfill
\mbox{}\\
{\mbox{}\\ \small\noindent\textbf{Frank L{\"u}beck } Email: \href{mailto://Frank.Luebeck@Math.RWTH-Aachen.De} {\texttt{Frank.Luebeck@Math.RWTH\texttt{\symbol{45}}Aachen.De}}}\\
{\mbox{}\\ \small\noindent\textbf{ Max Neunh{\"o}ffer } Email: \href{mailto://neunhoef at mcs.st-and.ac.uk} {\texttt{neunhoef at mcs.st\texttt{\symbol{45}}and.ac.uk}}}\\
\newpage\setcounter{page}{2}
{\small \section*{Abstract} \logpage{[ 0, 0, 1 ]}
This document tries to use all elements that exist in \textsf{GAPDoc}. In addition, the final output not only contains the usual content, but also
an appendix with the source text. There are also links from the usual content
to the corresponding source text. This should enable new users to learn \textsf{GAPDoc} quickly. \mbox{}}\\[1cm]
{\small \section*{Copyright} \logpage{[ 0, 0, 2 ]}
{\copyright} 2000\texttt{\symbol{45}}2024 by Frank L{\"u}beck and Max
Neunh{\"o}ffer \mbox{}}\\[1cm]
{\small \section*{Acknowledgements} \logpage{[ 0, 0, 3 ]}
We thank Lehrstuhl f{\"u}r Algebra und Zahlentheorie (former Lehrstuhl D
f{\"u}r Mathematik). \mbox{}}\\[1cm]
{\small \section*{Colophon} \logpage{[ 0, 0, 4 ]}
This is the Colophon page. \mbox{}}\\[1cm] \newpage
\def\contentsname{Contents\logpage{[ 0, 0, 5 ]}}
\tableofcontents \newpage
Text before chapter \ref{First}. ($\to$ \ref{Two}) \chapter{\textcolor{Chapter }{Sectioning Elements}}\label{First} \logpage{[ 1, 0, 0 ]} \hyperdef{L}{X80E2AD7481DD69D9}{}
{
Text before the section \ref{FirstSect}. ($\to$ \ref{Two}) \label{ThreeBack} \section{\textcolor{Chapter }{Normal subsections}}\label{FirstSect} \logpage{[ 1, 1, 0 ]} \hyperdef{L}{X7818BD01870A269E}{}
{
[$\to$ \ref{Three}] \subsection{\textcolor{Chapter }{A subsection}}\label{Asub} \logpage{[ 1, 1, 1 ]} \hyperdef{L}{X7E193BD379F58A4C}{}
{
This is text in the first subsection. }
\subsection{\textcolor{Chapter }{Another subsection}}\label{Another} \logpage{[ 1, 1, 2 ]} \hyperdef{L}{X79C2A0097ADE9776}{}
{
This is text in the second subsection. This subsection has a label, such that
one can reference it. }
This is the super\texttt{\symbol{45}}fast method for the operation \texttt{MyOperation} (\ref{MyOperation}) if the argument \mbox{\texttt{\mdseries\slshape x}} is in the representation \texttt{IsBla} (\ref{IsBla}). It will become even faster if the optional argument \mbox{\texttt{\mdseries\slshape good{\textunderscore}hint}} is given. }
For objects in this representation there is a super\texttt{\symbol{45}}fast
method (see \texttt{MyOperation} (\ref{MyOperation:for bla})) for the operation \texttt{MyOperation} (\ref{MyOperation}). }
In this section we present examples for all the various types of text that are
possible in \textsf{GAPDoc}: \begin{itemize} \item\emph{This} is \emph{emphasized}. \item\emph{Keywords} are typeset like \texttt{this} and \texttt{that}. \item\emph{Arguments} of functions have an element. They look like this: \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}}. \item\emph{Code} can be written with the Code element: \texttt{if x = y then Print("Equal"); fi;} or \texttt{while true do Print("Hello"); od;}. \item\emph{Filenames} have their own element: \texttt{/usr/local/ca/gap4r2} or \texttt{pkg/xgap/doc}. \item\emph{Buttons}, \emph{menus}, \emph{menu entries}, and such things are also supported: \textsc{OK} or \textsc{Cancel}. \item\emph{Packages} are typeset like this: \textsf{Small Groups Library} \item\emph{Quoted} text: ``This is a text in quotes.'' \end{itemize} \emph{Paragraphs} are separated by the empty \texttt{Par} or \texttt{P} element.
\emph{Alternatives} for different output formats: This is {\LaTeX} output.
\label{SixBack} There are also three elements to typeset ``verbatim\texttt{\symbol{45}}like'' text. ($\to$ \ref{Six})
The first is a \emph{Listing}: \begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=GAP code]
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; \end{Verbatim}
Here is a \emph{Log} of a \textsf{GAP} session using this function: \begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
!gapprompt@gap>| !gapinput@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 ]
!gapprompt@gap>| !gapinput@Length(last);|
25 \end{Verbatim}
Here is a \textsf{GAP} \emph{Example} session that is automatically tested: \begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]
!gapprompt@gap>| !gapinput@s := Size(CharacterTable("M"));|
808017424794512875886459904961710757005754368000000000
!gapprompt@gap>| !gapinput@s < 10^53; |
false
!gapprompt@gap>| !gapinput@s < 10^54;|
true \end{Verbatim}
}
The first is the \emph{normal math mode} of {\LaTeX}: $b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k$. Then there are \emph{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 \texttt{Alt} element to specify a better readable text version of such a formula as in the
following example:
\[\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 \]
For small formulae without ``difficult'' parts use the \texttt{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 \texttt{Mode} attribute of a \texttt{Display} element formulae like \[a \longrightarrow a \bmod m\prime\]
can also be displayed nicely in text and HTML output. }
\label{there} In this section we demonstrate various references to parts of this document.
Here is a reference to this section: \ref{Cross}. Here is a reference to chapter \ref{First}, to appendix \ref{Appendix}, and to subsection \ref{Asub}.
We distinguish among others references to functions (see \texttt{f} (\ref{f})), to methods with tricky name (see \texttt{\texttt{\symbol{92}}\texttt{\symbol{94}}\texttt{\symbol{92}}\texttt{\symbol{123}}\texttt{\symbol{92}}\texttt{\symbol{125}}\texttt{\symbol{92}}[\texttt{\symbol{92}}]\texttt{\symbol{92}}{\textless}\texttt{\symbol{92}}\&pan>} (\ref{bSlash^bSlash{bSlash}bSlash[bSlash]bSlash<bSlash&:for nothing})), to operations (see \texttt{MyOperation} (\ref{MyOperation})), to methods (see \texttt{MyOperation} (\ref{MyOperation:First}) or \texttt{MyOperation} (\ref{MyOperation:for bla})), to filters (see \texttt{IsBla} (\ref{IsBla})), to properties (see \texttt{IsBlubb} (\ref{IsBlubb})), to attributes (see \texttt{NumberBlobbs} (\ref{NumberBlobbs})), to variables (\texttt{AllBlibbs} (\ref{AllBlibbs})), to families (see \texttt{BlibbsFamily} (\ref{BlibbsFamily})), and to info classes (see \texttt{InfoBlibbs} (\ref{InfoBlibbs})).
There are also references to labels: see \ref{there}, to other books: see (\textbf{GAPDoc: What is a DTD?}) or \texttt{IsSubgroup} (\textbf{Reference: IsSubgroup}) in the \textsf{GAP} reference manual.
References to sections come in two styles: \ref{First} or \hyperref[First]{`Sectioning Elements'}.
Another type of cross referencing is bibliography. Here is a citation: \cite[(5.22)]{CR1} is an interesting lemma.
Email addresses have a special element: \href{mailto://Frank.Luebeck@Math.RWTH-Aachen.De} {\texttt{Frank.Luebeck@Math.RWTH\texttt{\symbol{45}}Aachen.De}}
One can generate index entries as follows (look up the words ``{\TeX}\texttt{\symbol{45}}UserGroup'', ``RWTH'', ``Aachen, Hauptbahnhof'', and ``\textsf{GAPDoc}, for \textsf{GAP} programmers''). \index{TeX-Usergroup@{\TeX}\texttt{\symbol{45}}UserGroup} \index{RWTH} \index{Aachen!Hauptbahnhof} \index{GAPDoc@\textsf{GAPDoc}!for \textsf{GAP} programmers} }
There are \begin{itemize} \item lists \item enumerations, and \item tables \end{itemize}
or: \begin{enumerate} \item lists \item enumerations, and \item tables \end{enumerate}
or with marks: \begin{description} \item[{lists:}] not numbered \item[{enumerations:}] numbered \item[{tables:}] two\texttt{\symbol{45}}dimensional \end{description}
Lists can also be nested: \begin{enumerate} \item \begin{enumerate} \item first item of inner enumeration \item second item of inner enumeration \end{enumerate}
\item \begin{itemize} \item first item of inner list \item second item of inner list \end{itemize}
\end{enumerate}
Here is a \emph{table}: \begin{center} \begin{tabular}{|r|c|l|}\hline
Object&
Price&
available\\ \hline \hline
Shoe& \$1,00&
there\\ \hline
Hat& \$2,00&
not there\\ \hline \end{tabular}\\[2mm] \textbf{Table: }Prices\end{center}
}
\section{\textcolor{Chapter }{Entities and Special Characters}}\logpage{[ 2, 5, 0 ]} \hyperdef{L}{X83A355E68485D6D1}{}
{ \label{TenBack} [$\to$ \ref{Ten}]
Here is a table of special characters, the first two are special for XML and
must be typed in by entities in \textsf{GAPDoc} documents. The other characters are special for {\LaTeX} but in \textsf{GAPDoc} they can be typed directly. \mbox{}\label{charsInCDATA}\begin{center} \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}\hline \texttt{\&}& \texttt{{\textless}}& \texttt{{\textgreater}}& \texttt{\#}& \texttt{\$}& \texttt{\%}& \texttt{\texttt{\symbol{126}}}& \texttt{\texttt{\symbol{92}}}& \texttt{\texttt{\symbol{123}}}& \texttt{\texttt{\symbol{125}}}& \texttt{{\textunderscore}}& \texttt{\texttt{\symbol{94}}}& \texttt{{\nobreakspace}}\\ \hline \end{tabular}\\[2mm] \textbf{Table: }Special characters in character data\end{center}
<ManSection>
<Func Name="f" Arg="x[,y]" Comm="calculates something"/>
<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>
<Description>
This function calculates something.
</Description>
</ManSection>
<ManSection>
<Meth Name="\^\{\}\[\]\<\&" Arg="c"
Label="for nothing" Comm="tricky name"/>
<Description>
This method is for an operation with a tricky name.
</Description>
</ManSection>
<ManSection>
<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>
<Description>
The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.
</Description>
</ManSection>
<ManSection>
<Meth Name="MyOperation" Label="First" Arg="x"
Comm="generic method"/>
<Description>
This method calculates something by the generic method.
</Description>
</ManSection>
<ManSection>
<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"
Comm="for bla arguments"/>
<Description>
This is the super-fast method for the operation
<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the
representation <Ref Filt="IsBla"/>. It will become even faster if
the optional argument <A>good_hint</A> is given.
</Description>
</ManSection>
<ManSection>
<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>
<Description>
The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>
an object in <A>filt</A>.
</Description>
</ManSection>
<ManSection>
<Filt Name="IsBla" Arg="obj" Comm="representation bla"
Type="representation"/>
<Description>
For objects in this representation there is a super-fast method
(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation
<Ref Oper="MyOperation"/>.
</Description>
</ManSection>
<ManSection>
<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>
<Description>
A property.
</Description>
</ManSection>
<ManSection>
<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>
<Description>
An attribute. Number of blobbs.
</Description>
</ManSection>
<ManSection>
<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>
<Description>
This global variable holds a list of all blibbs.
</Description>
</ManSection>
<ManSection>
<Fam Name="BlibbsFamily" Comm="family of blibbs"/>
<Description>
Family of all blibbs.
</Description>
</ManSection>
<ManSection>
<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>
<Description>
This info class is used throughout the library of blibbs.
</Description>
</ManSection>
</Section> \end{Verbatim}
}
\section{\textcolor{Chapter }{Various Types of Text (Source)}}\label{Five} \logpage{[ "B", 5, 0 ]} \hyperdef{L}{X82A731CA83FB9ADD}{}
{
[\ref{FiveBack}] \begin{Verbatim}[commandchars=@|J,fontsize=\small,frame=single,label=]
<Chapter><Heading>Other Markup</Heading>
<Section><Heading>Various types of text</Heading>
In this section we present examples for all the various types of text
that are possible in &GAPDoc;:
<List>
<Item>
<Emph>This</Emph> is <E>emphasized</E>.</Item>
<Item>
<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.
</Item>
<Item>
<E>Arguments</E> of functions have an element. They look like this:
<Arg>x</Arg> and <A>y</A>.</Item>
<Item>
<E>Code</E> can be written with the Code element:
<Code>if x = y then Print("Equal"); fi;</Code> or
<C>while true do Print("Hello"); od;</C>.</Item>
<Item>
<E>Filenames</E> have their own element:
<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>
<Item>
<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things
are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>
<Item>
<E>Packages</E> are typeset like this:
<Package>Small Groups Library</Package>
</Item>
<Item>
<E>Quoted</E> text: <Q>This is a text in quotes.</Q>
</Item>
</List>
<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.
<Par/><E>Alternatives</E> for different output formats:
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>
<Alt Only="Text">Text</Alt> output.</Alt>
<P/> \end{Verbatim}
}
\section{\textcolor{Chapter }{Verbatim\texttt{\symbol{45}}like text (Source)}}\label{Six} \logpage{[ "B", 6, 0 ]} \hyperdef{L}{X824BD70087820CF0}{}
{
[\ref{SixBack}] \begin{Verbatim}[commandchars=@|F,fontsize=\small,frame=single,label=]
There are also three elements to typeset <Q>verbatim-like</Q> text.
<P/>
The first is a <E>Listing</E>:
<Listing Type="GAP code">
<![CDATA[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;]]>
</Listing>
Here is a <E>Log</E> of a &GAP; session using this function:
For small formulae without <Q>difficult</Q> parts use the <C>M</C>
element: <M>b_i</M>,
<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace
matters for text (or HTML) output).<P/>
Here are two formulae containing less than characters which are special
characters for XML:
<M><![CDATA[a < b < c < d]]></M> and <M>e < f</M>.
</Section> \end{Verbatim}
}
In this section we demonstrate various references to parts of this
document. Here is a reference to this section: <Ref Sect="Cross"/>.
Here is a reference to chapter <Ref Chap="First"/>, to appendix
<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.
<P/>
We distinguish among others references
to functions (see <Ref Func="f"/>),
to methods with tricky name (see
<Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),
to operations (see <Ref Oper="MyOperation"/>),
to methods (see <Ref Meth="MyOperation" Label="First"/> or
<Ref Meth="MyOperation" Label="for bla"/>),
to filters (see <Ref Filt="IsBla"/>),
to properties (see <Ref Prop="IsBlubb"/>),
to attributes (see <Ref Attr="NumberBlobbs"/>),
to variables (<Ref Var="AllBlibbs"/>),
to families (see <Ref Fam="BlibbsFamily"/>),
and to info classes (see <Ref InfoClass="InfoBlibbs"/>).
<P/>
There are also references to labels: see <Ref Text="here" Label="there"/>,
to other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or
<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference
manual.
<P/>
References to sections come in two styles:
<Ref Chap="First" Style="Number"/>
or <Ref Chap="First" Style="Text"/>.
<P/>
Another type of cross referencing is bibliography. Here is a
citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.
<P/>
One can generate index entries as follows (look up the words
<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).
<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>
<Index>RWTH</Index>
<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>
<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc;
<Subkey>for &GAP; programmers</Subkey></Index>
</Section> \end{Verbatim}
}
\section{\textcolor{Chapter }{Lists and Tables (Source)}}\label{Nine} \logpage{[ "B", 9, 0 ]} \hyperdef{L}{X7BB822947F626E1A}{}
{
[\ref{NineBack}] \begin{Verbatim}[commandchars=!@B,fontsize=\small,frame=single,label=]
<Section><Heading>Lists and Tables</Heading>
There are
<List>
<Item>lists</Item>
<Item>enumerations, and</Item>
<Item>tables</Item>
</List>
or:
<Enum>
<Item>lists</Item>
<Item>enumerations, and</Item>
<Item>tables</Item>
</Enum>
or with marks:
<List>
<Mark>lists:</Mark><Item> not numbered</Item>
<Mark>enumerations:</Mark><Item> numbered</Item>
<Mark>tables:</Mark><Item> two-dimensional</Item>
</List>
Lists can also be nested:
<Enum>
<Item>
<Enum>
<Item>first item of inner enumeration </Item>
<Item>second item of inner enumeration </Item>
</Enum>
</Item>
<Item>
<List>
<Item>first item of inner list </Item>
<Item>second item of inner list </Item>
</List>
</Item>
</Enum>
\section{\textcolor{Chapter }{Entities and Special Characters (Source)}}\label{Ten} \logpage{[ "B", 10, 0 ]} \hyperdef{L}{X80B478CD7E584F6F}{}
{
[\ref{TenBack}] \begin{Verbatim}[commandchars=!@F,fontsize=\small,frame=single,label=]
<Section><Heading>Entities and Special Characters</Heading>
<Label Name="TenBack"/>
[&see; <Ref Sect="Ten"/>]<P/>
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.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.