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% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)1\documentclass[a4paper,11pt]{report}23\usepackage{a4wide}4\sloppy5\pagestyle{myheadings}6\usepackage{amssymb}7\usepackage[latin1]{inputenc}8\usepackage{makeidx}9\makeindex10\usepackage{color}11\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}12\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}13\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}14\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}15\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}16\definecolor{Black}{rgb}{0.0,0.0,0.0}1718\definecolor{linkColor}{rgb}{0.0,0.0,0.554}19\definecolor{citeColor}{rgb}{0.0,0.0,0.554}20\definecolor{fileColor}{rgb}{0.0,0.0,0.554}21\definecolor{urlColor}{rgb}{0.0,0.0,0.554}22\definecolor{promptColor}{rgb}{0.0,0.0,0.589}23\definecolor{brkpromptColor}{rgb}{0.589,0.0,0.0}24\definecolor{gapinputColor}{rgb}{0.589,0.0,0.0}25\definecolor{gapoutputColor}{rgb}{0.0,0.0,0.0}2627%% for a long time these were red and blue by default,28%% now black, but keep variables to overwrite29\definecolor{FuncColor}{rgb}{0.0,0.0,0.0}30%% strange name because of pdflatex bug:31\definecolor{Chapter }{rgb}{0.0,0.0,0.0}32\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}333435\usepackage{fancyvrb}3637\usepackage{mathptmx,helvet}38\usepackage[T1]{fontenc}39\usepackage{textcomp}404142\usepackage[43pdftex=true,44bookmarks=true,45a4paper=true,46pdftitle={Written with GAPDoc},47pdfcreator={LaTeX with hyperref package / GAPDoc},48colorlinks=true,49backref=page,50breaklinks=true,51linkcolor=linkColor,52citecolor=citeColor,53filecolor=fileColor,54urlcolor=urlColor,55pdfpagemode={UseNone},56]{hyperref}5758\newcommand{\maintitlesize}{\fontsize{50}{55}\selectfont}5960% write page numbers to a .pnr log file for online help61\newwrite\pagenrlog62\immediate\openout\pagenrlog =\jobname.pnr63\immediate\write\pagenrlog{PAGENRS := [}64\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}65%% were never documented, give conflicts with some additional packages6667\newcommand{\GAP}{\textsf{GAP}}6869%% nicer description environments, allows long labels70\usepackage{enumitem}71\setdescription{style=nextline}7273%% depth of toc74\setcounter{tocdepth}{1}757677787980%% command for ColorPrompt style examples81\newcommand{\gapprompt}[1]{\color{promptColor}{\bfseries #1}}82\newcommand{\gapbrkprompt}[1]{\color{brkpromptColor}{\bfseries #1}}83\newcommand{\gapinput}[1]{\color{gapinputColor}{#1}}848586\begin{document}8788\logpage{[ 0, 0, 0 ]}89\begin{titlepage}90\mbox{}\vfill9192\begin{center}{\maintitlesize \textbf{A Complete Example ($\to$ \ref{One})\mbox{}}}\\93\vfill9495\hypersetup{pdftitle=A Complete Example ($\to$ \ref{One})}96\markright{\scriptsize \mbox{}\hfill A Complete Example ($\to$ \ref{One}) \hfill\mbox{}}97{\Huge \textbf{Every element shows up\mbox{}}}\\98\vfill99100{\Huge Version 1.6.1 \mbox{}}\\[1cm]101{November 2017\mbox{}}\\[1cm]102\mbox{}\\[2cm]103{\Large \textbf{Frank L{\"u}beck \mbox{}}}\\104{\Large \textbf{ Max Neunh{\"o}ffer \mbox{}}}\\105\hypersetup{pdfauthor=Frank L{\"u}beck ; Max Neunh{\"o}ffer }106\mbox{}\\[2cm]107\begin{minipage}{12cm}\noindent108If the subtitle is not sufficient, this {\textless}TitleComment{\textgreater}109element can be used for a slightly longer text on the front page. \end{minipage}110111\end{center}\vfill112113\mbox{}\\114{\mbox{}\\115\small \noindent \textbf{Frank L{\"u}beck } Email: \href{mailto://Frank.Luebeck@Math.RWTH-Aachen.De} {\texttt{Frank.Luebeck@Math.RWTH-Aachen.De}}}\\116{\mbox{}\\117\small \noindent \textbf{ Max Neunh{\"o}ffer } Email: \href{mailto://neunhoef at mcs.st-and.ac.uk} {\texttt{neunhoef at mcs.st-and.ac.uk}}}\\118119\noindent \textbf{Address: }\begin{minipage}[t]{8cm}\noindent120Lehrstuhl D f{\"u}r Mathematik\\121Pontdriesch 14/16\\12252062 Aachen\\123(Germany) \end{minipage}124\end{titlepage}125126\newpage\setcounter{page}{2}127{\small128\section*{Abstract}129\logpage{[ 0, 0, 1 ]}130This document tries to use all elements that exist in \textsf{GAPDoc}. In addition, the final output not only contains the usual content, but also131an appendix with the source text. There are also links from the usual content132to the corresponding source text. This should enable new users to learn \textsf{GAPDoc} quickly. \mbox{}}\\[1cm]133{\small134\section*{Copyright}135\logpage{[ 0, 0, 2 ]}136{\copyright} 2000-2017 by Frank L{\"u}beck and Max Neunh{\"o}ffer \mbox{}}\\[1cm]137{\small138\section*{Acknowledgements}139\logpage{[ 0, 0, 3 ]}140We thank Lehrstuhl D f{\"u}r Mathematik. \mbox{}}\\[1cm]141{\small142\section*{Colophon}143\logpage{[ 0, 0, 4 ]}144This is the Colophon page. \mbox{}}\\[1cm]145\newpage146147\def\contentsname{Contents\logpage{[ 0, 0, 5 ]}}148149\tableofcontents150\newpage151152Text before chapter \ref{First}. ($\to$ \ref{Two})153\chapter{\textcolor{Chapter }{Sectioning Elements}}\label{First}154\logpage{[ 1, 0, 0 ]}155\hyperdef{L}{X80E2AD7481DD69D9}{}156{157Text before the section \ref{FirstSect}. ($\to$ \ref{Two}) \label{ThreeBack}158\section{\textcolor{Chapter }{Normal subsections}}\label{FirstSect}159\logpage{[ 1, 1, 0 ]}160\hyperdef{L}{X7818BD01870A269E}{}161{162[$\to$ \ref{Three}]163\subsection{\textcolor{Chapter }{A subsection}}\label{Asub}164\logpage{[ 1, 1, 1 ]}165\hyperdef{L}{X7E193BD379F58A4C}{}166{167This is text in the first subsection. }168169170\subsection{\textcolor{Chapter }{Another subsection}}\label{Another}171\logpage{[ 1, 1, 2 ]}172\hyperdef{L}{X79C2A0097ADE9776}{}173{174This is text in the second subsection. This subsection has a label, such that175one can reference it. }176177}178179180\section{\textcolor{Chapter }{ManSections}}\logpage{[ 1, 2, 0 ]}181\hyperdef{L}{X7C2D89087EA8BC84}{}182{183\label{FourBack} [$\to$ \ref{Four}]184185\subsection{\textcolor{Chapter }{f}}186\logpage{[ 1, 2, 1 ]}\nobreak187\hyperdef{L}{X7FA1D0937FA1D093}{}188{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{f({\mdseries\slshape x[, y]})\index{f@\texttt{f}}189\label{f}190}\hfill{\scriptsize (function)}}\\191\textbf{\indent Returns:\ }192an element in \texttt{IsBlubb} (\ref{IsBlubb}) or \texttt{fail}.193194195196This function calculates something. }197198199200\subsection{\textcolor{Chapter }{\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}}\& (for nothing)}}201\logpage{[ 1, 2, 2 ]}\nobreak202\hyperdef{L}{X822B5C487B29E799}{}203{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\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}}\&({\mdseries\slshape c})\index{^{}[]<&@\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}}\&}!for nothing}204\label{^{}[]<&:for nothing}205}\hfill{\scriptsize (method)}}\\206207208This method is for an operation with a tricky name. }209210211212\subsection{\textcolor{Chapter }{MyOperation}}213\logpage{[ 1, 2, 3 ]}\nobreak214\hyperdef{L}{X7D33C2597988F481}{}215{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MyOperation({\mdseries\slshape x})\index{MyOperation@\texttt{MyOperation}}216\label{MyOperation}217}\hfill{\scriptsize (operation)}}\\218219220The operation \texttt{MyOperation} operates on \mbox{\texttt{\mdseries\slshape x}}. }221222223224\subsection{\textcolor{Chapter }{MyOperation (First)}}225\logpage{[ 1, 2, 4 ]}\nobreak226\hyperdef{L}{X783DCD4E826289D4}{}227{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MyOperation({\mdseries\slshape x})\index{MyOperation@\texttt{MyOperation}!First}228\label{MyOperation:First}229}\hfill{\scriptsize (method)}}\\230231232This method calculates something by the generic method. }233234235236\subsection{\textcolor{Chapter }{MyOperation (for bla)}}237\logpage{[ 1, 2, 5 ]}\nobreak238\hyperdef{L}{X7A5F4A287D06988C}{}239{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MyOperation({\mdseries\slshape x[, good{\textunderscore}hint]})\index{MyOperation@\texttt{MyOperation}!for bla}240\label{MyOperation:for bla}241}\hfill{\scriptsize (method)}}\\242243244This is the super-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. }245246247248\subsection{\textcolor{Chapter }{MyConstructor}}249\logpage{[ 1, 2, 6 ]}\nobreak250\hyperdef{L}{X86E3B93D87FE4828}{}251{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{MyConstructor({\mdseries\slshape filt, x})\index{MyConstructor@\texttt{MyConstructor}}252\label{MyConstructor}253}\hfill{\scriptsize (constructor)}}\\254255256The constructor \texttt{MyConstructor} constructs from \mbox{\texttt{\mdseries\slshape x}} an object in \mbox{\texttt{\mdseries\slshape filt}}. }257258259260\subsection{\textcolor{Chapter }{IsBla}}261\logpage{[ 1, 2, 7 ]}\nobreak262\hyperdef{L}{X82954B687D2DF3C2}{}263{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsBla({\mdseries\slshape obj})\index{IsBla@\texttt{IsBla}}264\label{IsBla}265}\hfill{\scriptsize (representation)}}\\266267268For objects in this representation there is a super-fast method (see \texttt{MyOperation} (\ref{MyOperation:for bla})) for the operation \texttt{MyOperation} (\ref{MyOperation}). }269270271272\subsection{\textcolor{Chapter }{IsBlubb}}273\logpage{[ 1, 2, 8 ]}\nobreak274\hyperdef{L}{X80C364DD7C919CCE}{}275{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{IsBlubb({\mdseries\slshape obj})\index{IsBlubb@\texttt{IsBlubb}}276\label{IsBlubb}277}\hfill{\scriptsize (property)}}\\278279280A property. }281282283284\subsection{\textcolor{Chapter }{NumberBlobbs}}285\logpage{[ 1, 2, 9 ]}\nobreak286\hyperdef{L}{X8052A45E7F9F054C}{}287{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{NumberBlobbs({\mdseries\slshape obj})\index{NumberBlobbs@\texttt{NumberBlobbs}}288\label{NumberBlobbs}289}\hfill{\scriptsize (attribute)}}\\290291292An attribute. Number of blobbs. }293294295296\subsection{\textcolor{Chapter }{AllBlibbs}}297\logpage{[ 1, 2, 10 ]}\nobreak298\hyperdef{L}{X7C00E05A7DDEF003}{}299{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{AllBlibbs\index{AllBlibbs@\texttt{AllBlibbs}}300\label{AllBlibbs}301}\hfill{\scriptsize (global variable)}}\\302303304This global variable holds a list of all blibbs. }305306307308\subsection{\textcolor{Chapter }{BlibbsFamily}}309\logpage{[ 1, 2, 11 ]}\nobreak310\hyperdef{L}{X7CBC935A8142E374}{}311{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{BlibbsFamily\index{BlibbsFamily@\texttt{BlibbsFamily}}312\label{BlibbsFamily}313}\hfill{\scriptsize (family)}}\\314315316Family of all blibbs. }317318319320\subsection{\textcolor{Chapter }{InfoBlibbs}}321\logpage{[ 1, 2, 12 ]}\nobreak322\hyperdef{L}{X84D7D77378AD030A}{}323{\noindent\textcolor{FuncColor}{$\triangleright$\enspace\texttt{InfoBlibbs\index{InfoBlibbs@\texttt{InfoBlibbs}}324\label{InfoBlibbs}325}\hfill{\scriptsize (info class)}}\\326327328This info class is used throughout the library of blibbs. }329330}331332}333334335\chapter{\textcolor{Chapter }{Other Markup}}\logpage{[ 2, 0, 0 ]}336\hyperdef{L}{X82793A7E7A3F2A54}{}337{338\label{FiveBack}339\section{\textcolor{Chapter }{Various types of text}}\logpage{[ 2, 1, 0 ]}340\hyperdef{L}{X7A480B9A795EF264}{}341{342[$\to$ \ref{Five}]343344In this section we present examples for all the various types of text that are345possible in \textsf{GAPDoc}:346\begin{itemize}347\item \emph{This} is \emph{emphasized}.348\item \emph{Keywords} are typeset like \texttt{this} and \texttt{that}.349\item \emph{Arguments} of functions have an element. They look like this: \mbox{\texttt{\mdseries\slshape x}} and \mbox{\texttt{\mdseries\slshape y}}.350\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;}.351\item \emph{Filenames} have their own element: \texttt{/usr/local/ca/gap4r2} or \texttt{pkg/xgap/doc}.352\item \emph{Buttons}, \emph{menus}, \emph{menu entries}, and such things are also supported: \textsc{OK} or \textsc{Cancel}.353\item \emph{Packages} are typeset like this: \textsf{Small Groups Library}354\item \emph{Quoted} text: ``This is a text in quotes.''355\end{itemize}356\emph{Paragraphs} are separated by the empty \texttt{Par} or \texttt{P} element.357358\emph{Alternatives} for different output formats: This is {\LaTeX} output.359360\label{SixBack} There are also three elements to typeset ``verbatim-like'' text. ($\to$ \ref{Six})361362The first is a \emph{Listing}:363\begin{Verbatim}[fontsize=\small,frame=single,label=GAP code]364Sieve := function(n)365# Returns the primes less than n366local l,p,i;367l := [1..n]; Unbind(l[1]);368p := 2;369while p^2 <= n do370if IsBound(l[p]) then371i := 2 * p;372while i <= n do Unbind(l[i]); i := i + p; od;373fi;374p := p + 1;375od;376return Compacted(l);377end;378\end{Verbatim}379Here is a \emph{Log} of a \textsf{GAP} session using this function:380\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]381!gapprompt@gap>| !gapinput@Sieve(100);|382[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,38367, 71, 73, 79, 83, 89, 97 ]384!gapprompt@gap>| !gapinput@Length(last);|38525386\end{Verbatim}387Here is a \textsf{GAP} \emph{Example} session that is automatically tested:388\begin{Verbatim}[commandchars=!@|,fontsize=\small,frame=single,label=Example]389!gapprompt@gap>| !gapinput@s := Size(CharacterTable("M"));|390808017424794512875886459904961710757005754368000000000391!gapprompt@gap>| !gapinput@s < 10^53; |392false393!gapprompt@gap>| !gapinput@s < 10^54;|394true395\end{Verbatim}396}397398399\section{\textcolor{Chapter }{Formulae}}\logpage{[ 2, 2, 0 ]}400\hyperdef{L}{X7AA5BF0279938BE0}{}401{402\label{SevenBack} [$\to$ \ref{Seven}]403404There are three types of formulae.405406The 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}:407\[ \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot408\left(\sum_{j=1}^d y_j b_j \right) = \sum_{k=1}^d \left( \sum_{i,j} x_i y_j409h_{ijk} \right) b_k \]410If possible, use the \texttt{Alt} element to specify a better readable text version of such a formula as in the411following example:412413414\[ \Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot415\left(\sum_{j=1}^d y_j b_j \right) = \sum_{k=1}^d \left( \sum_{i,j} x_i y_j416h_{ijk} \right) b_k \]417For 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.418419Here are two formulae containing less than characters which are special420characters for XML: $a < b < c < d$ and $e < f$.421422Using the \texttt{Mode} attribute of a \texttt{Display} element formulae like423\[a \longrightarrow a \bmod m\prime\]424can also be displayed nicely in text and HTML output. }425426427\section{\textcolor{Chapter }{Crossreferencing}}\label{Cross}428\logpage{[ 2, 3, 0 ]}429\hyperdef{L}{X833C410D85CF96A4}{}430{431\label{EightBack} [$\to$ \ref{Eight}]432433\label{there} In this section we demonstrate various references to parts of this document.434Here 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}.435436We 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}}\&} (\ref{^{}[]<&: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})).437438There 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.439440References to sections come in two styles: \ref{First} or \hyperref[First]{`Sectioning Elements'}.441442Another type of cross referencing is bibliography. Here is a citation: \cite[(5.22)]{CR1} is an interesting lemma.443444There are also URLs:445446\href{http://www.math.rwth-aachen.de/} {\texttt{http://www.math.rwth-aachen.de/}}447448Email addresses have a special element: \href{mailto://Frank.Luebeck@Math.RWTH-Aachen.De} {\texttt{Frank.Luebeck@Math.RWTH-Aachen.De}}449450and Homepages another one: \href{http://www-groups.mcs.st-and.ac.uk/~neunhoef/} {\texttt{http://www-groups.mcs.st-and.ac.uk/\texttt{\symbol{126}}neunhoef/}}451452And here is a link to the \href{http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/EDIM/index.html#ARCHS} {\textsf{EDIM} archives}.453454One can generate index entries as follows (look up the words ``{\TeX}-UserGroup'', ``RWTH'', ``Aachen, Hauptbahnhof'', and ``\textsf{GAPDoc}, for \textsf{GAP} programmers''). \index{TeX-Usergroup@{\TeX}-UserGroup} \index{RWTH} \index{Aachen!Hauptbahnhof} \index{GAPDoc@\textsf{GAPDoc}!for \textsf{GAP} programmers} }455456457\section{\textcolor{Chapter }{Lists and Tables}}\logpage{[ 2, 4, 0 ]}458\hyperdef{L}{X7F10E951789D6EDF}{}459{460\label{NineBack} [$\to$ \ref{Nine}]461462There are463\begin{itemize}464\item lists465\item enumerations, and466\item tables467\end{itemize}468or:469\begin{enumerate}470\item lists471\item enumerations, and472\item tables473\end{enumerate}474or with marks:475\begin{description}476\item[{lists:}] not numbered477\item[{enumerations:}] numbered478\item[{tables:}] two-dimensional479\end{description}480Lists can also be nested:481\begin{enumerate}482\item483\begin{enumerate}484\item first item of inner enumeration485\item second item of inner enumeration486\end{enumerate}487488\item489\begin{itemize}490\item first item of inner list491\item second item of inner list492\end{itemize}493494\end{enumerate}495Here is a \emph{table}: \begin{center}496\begin{tabular}{|r|c|l|}\hline497Object&498Price&499available\\500\hline501\hline502Shoe&503\$1,00&504there\\505\hline506Hat&507\$2,00&508not there\\509\hline510\end{tabular}\\[2mm]511\textbf{Table: }Prices\end{center}512513}514515516\section{\textcolor{Chapter }{Entities and Special Characters}}\logpage{[ 2, 5, 0 ]}517\hyperdef{L}{X83A355E68485D6D1}{}518{519\label{TenBack} [$\to$ \ref{Ten}]520521Here is a table of special characters, the first two are special for XML and522must 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}523\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}\hline524\texttt{\&}&525\texttt{{\textless}}&526\texttt{{\textgreater}}&527\texttt{\#}&528\texttt{\$}&529\texttt{\%}&530\texttt{\texttt{\symbol{126}}}&531\texttt{\texttt{\symbol{92}}}&532\texttt{\texttt{\symbol{123}}}&533\texttt{\texttt{\symbol{125}}}&534\texttt{{\textunderscore}}&535\texttt{\texttt{\symbol{94}}}&536\texttt{{\nobreakspace}}\\537\hline538\end{tabular}\\[2mm]539\textbf{Table: }Special characters in character data\end{center}540541And here are the predefined entities in \textsf{GAPDoc}: \begin{center}542\begin{tabular}{|l|l|}\hline543\texttt{\&GAP;}&544\textsf{GAP}\\545\hline546\texttt{\&GAPDoc;}&547\textsf{GAPDoc}\\548\hline549\texttt{\&TeX;}&550{\TeX}\\551\hline552\texttt{\&LaTeX;}&553{\LaTeX}\\554\hline555\texttt{\&BibTeX;}&556Bib{\TeX}\\557\hline558\texttt{\&MeatAxe;}&559\textsf{MeatAxe}\\560\hline561\texttt{\&XGAP;}&562\textsf{XGAP}\\563\hline564\texttt{\©right;}&565{\copyright}\\566\hline567\end{tabular}\\[2mm]568\textbf{Table: }Predefined Entities in the \textsf{GAPDoc} system\end{center}569570And some more for mathematical symbols: {\ensuremath{\mathbb C}},571{\ensuremath{\mathbb Z}}, {\ensuremath{\mathbb N}}, {\ensuremath{\mathbb P}},572{\ensuremath{\mathbb Q}}, {\ensuremath{\mathbb H}}, {\ensuremath{\mathbb R}}. }573574}575576577578\appendix579580581\chapter{\textcolor{Chapter }{An Appendix}}\label{Appendix}582\logpage{[ "A", 0, 0 ]}583\hyperdef{L}{X7B53252784137533}{}584{585\label{ElevenBack} [$\to$ \ref{Eleven}]586587This is an appendix. }588589590\chapter{\textcolor{Chapter }{The Source}}\label{Source}591\logpage{[ "B", 0, 0 ]}592\hyperdef{L}{X7B4F7623844A7E32}{}593{594595\section{\textcolor{Chapter }{TitlePage (Source)}}\label{One}596\logpage{[ "B", 1, 0 ]}597\hyperdef{L}{X7CFACB517D259F59}{}598{599600\begin{Verbatim}[fontsize=\small,frame=single,label=]601<TitlePage>602<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>603<Subtitle>Every element shows up</Subtitle>604<Version>Version 1.6.1605</Version>606<TitleComment>607If the subtitle ist not sufficient, this <TitleComment>608element can be used for a slightly longer text on the front page.609</TitleComment>610<Author>Frank L�beck611<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>612</Author>613<Author> Max Neunh�ffer614<Email>neunhoef at mcs.st-and.ac.uk</Email>615</Author>616<Date>September 2011</Date>617<Address>618Lehrstuhl D f�r Mathematik<Br/> Templergraben61964<Br/> 52062 Aachen<Br/> (Germany)620</Address>621<Abstract>This document tries to use all elements that exist in &GAPDoc;.622In addition, the final output not only contains the usual623content, but also an appendix with the source text. There624are also links from the usual content to the corresponding625source text. This should enable new users to learn &GAPDoc;626quickly.627</Abstract>628<Copyright>©right; 2000-2011 by Frank L�beck and Max Neunh�ffer629</Copyright>630<Acknowledgements>We thank Lehrstuhl D f�r Mathematik.631</Acknowledgements>632<Colophon>This is the Colophon page.633</Colophon>634</TitlePage>635\end{Verbatim}636}637638639\section{\textcolor{Chapter }{Before First Chapter (Source)}}\label{Two}640\logpage{[ "B", 2, 0 ]}641\hyperdef{L}{X7A4D1C8680D81F2A}{}642{643644\begin{Verbatim}[fontsize=\small,frame=single,label=]645<TableOfContents/>646647<Body>648649Text before chapter <Ref Chap="First"/>.650651<Chapter Label="First"><Heading>Sectioning Elements</Heading>652653Text before the section <Ref Sect="FirstSect"/>.654\end{Verbatim}655}656657658\section{\textcolor{Chapter }{First Chapter (Source)}}\label{Three}659\logpage{[ "B", 3, 0 ]}660\hyperdef{L}{X78308EBC7C2FF426}{}661{662[\ref{ThreeBack}]663\begin{Verbatim}[fontsize=\small,frame=single,label=]664<Section Label="FirstSect"><Heading>Normal subsections</Heading>665666<Subsection Label="Asub"><Heading>A subsection</Heading>667668This is text in the first subsection.669670</Subsection>671672<Subsection Label="Another"><Heading>Another subsection</Heading>673674This is text in the second subsection. This subsection675has a label, such that one can reference it.676677</Subsection>678679</Section>680\end{Verbatim}681}682683684\section{\textcolor{Chapter }{ManSections (Source)}}\label{Four}685\logpage{[ "B", 4, 0 ]}686\hyperdef{L}{X814E3376826E1DB0}{}687{688[\ref{FourBack}]689\begin{Verbatim}[fontsize=\small,frame=single,label=]690<Section><Heading>ManSections</Heading>691692<ManSection>693<Func Name="f" Arg="x[,y]" Comm="calculates something"/>694<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>695<Description>696This function calculates something.697</Description>698</ManSection>699700<ManSection>701<Meth Name="\^\{\}\[\]\<\&" Arg="c"702Label="for nothing" Comm="tricky name"/>703<Description>704This method is for an operation with a tricky name.705</Description>706</ManSection>707708<ManSection>709<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>710<Description>711The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.712</Description>713</ManSection>714715<ManSection>716<Meth Name="MyOperation" Label="First" Arg="x"717Comm="generic method"/>718<Description>719This method calculates something by the generic method.720</Description>721</ManSection>722723<ManSection>724<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"725Comm="for bla arguments"/>726<Description>727This is the super-fast method for the operation728<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the729representation <Ref Filt="IsBla"/>. It will become even faster if730the optional argument <A>good_hint</A> is given.731</Description>732</ManSection>733734<ManSection>735<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>736<Description>737The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>738an object in <A>filt</A>.739</Description>740</ManSection>741742<ManSection>743<Filt Name="IsBla" Arg="obj" Comm="representation bla"744Type="representation"/>745<Description>746For objects in this representation there is a super-fast method747(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation748<Ref Oper="MyOperation"/>.749</Description>750</ManSection>751752<ManSection>753<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>754<Description>755A property.756</Description>757</ManSection>758759<ManSection>760<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>761<Description>762An attribute. Number of blobbs.763</Description>764</ManSection>765766<ManSection>767<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>768<Description>769This global variable holds a list of all blibbs.770</Description>771</ManSection>772773<ManSection>774<Fam Name="BlibbsFamily" Comm="family of blibbs"/>775<Description>776Family of all blibbs.777</Description>778</ManSection>779780<ManSection>781<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>782<Description>783This info class is used throughout the library of blibbs.784</Description>785</ManSection>786787</Section>788\end{Verbatim}789}790791792\section{\textcolor{Chapter }{Various Types of Text (Source)}}\label{Five}793\logpage{[ "B", 5, 0 ]}794\hyperdef{L}{X82A731CA83FB9ADD}{}795{796[\ref{FiveBack}]797\begin{Verbatim}[fontsize=\small,frame=single,label=]798<Chapter><Heading>Other Markup</Heading>799800<Section><Heading>Various types of text</Heading>801802In this section we present examples for all the various types of text803that are possible in &GAPDoc;:804<List>805<Item>806<Emph>This</Emph> is <E>emphasized</E>.</Item>807<Item>808<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.809</Item>810<Item>811<E>Arguments</E> of functions have an element. They look like this:812<Arg>x</Arg> and <A>y</A>.</Item>813<Item>814<E>Code</E> can be written with the Code element:815<Code>if x = y then Print("Equal"); fi;</Code> or816<C>while true do Print("Hello"); od;</C>.</Item>817<Item>818<E>Filenames</E> have their own element:819<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>820<Item>821<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things822are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>823<Item>824<E>Packages</E> are typeset like this:825<Package>Small Groups Library</Package>826</Item>827<Item>828<E>Quoted</E> text: <Q>This is a text in quotes.</Q>829</Item>830</List>831832<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.833<Par/><E>Alternatives</E> for different output formats:834835<Alt Only="LaTeX">This is &LaTeX; output.</Alt>836<Alt Not="LaTeX">This is other than &LaTeX; output, namely:837<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>838<Alt Only="Text">Text</Alt> output.</Alt>839840<P/>841\end{Verbatim}842}843844845\section{\textcolor{Chapter }{Verbatim-like text (Source)}}\label{Six}846\logpage{[ "B", 6, 0 ]}847\hyperdef{L}{X824BD70087820CF0}{}848{849[\ref{SixBack}]850\begin{Verbatim}[fontsize=\small,frame=single,label=]851There are also three elements to typeset <Q>verbatim-like</Q> text.852<P/>853The first is a <E>Listing</E>:854855<Listing Type="GAP code">856<![CDATA[Sieve := function(n)857# Returns the primes less than n858local l,p,i;859l := [1..n]; Unbind(l[1]);860p := 2;861while p^2 <= n do862if IsBound(l[p]) then863i := 2 * p;864while i <= n do Unbind(l[i]); i := i + p; od;865fi;866p := p + 1;867od;868return Compacted(l);869end;]]>870</Listing>871872Here is a <E>Log</E> of a &GAP; session using this function:873874<Log>875gap> Sieve(100);876[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,87767, 71, 73, 79, 83, 89, 97 ]878gap> Length(last);87925880</Log>881882Here is a &GAP; <E>Example</E> session that is automatically tested:883884<Example>885gap> s := Size(CharacterTable("M"));886808017424794512875886459904961710757005754368000000000887gap> s < 10^53;888false889gap> s < 10^54;890true891</Example>892893</Section>894\end{Verbatim}895}896897898\section{\textcolor{Chapter }{Formulae (Source)}}\label{Seven}899\logpage{[ "B", 7, 0 ]}900\hyperdef{L}{X8516FAA07A95BBB5}{}901{902[\ref{SevenBack}]903\begin{Verbatim}[fontsize=\small,frame=single,label=]904<Section><Heading>Formulae</Heading>905906There are three types of formulae. <P/>907The first is the <E>normal math mode</E> of &LaTeX;:908909<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.910911Then there are <E>displayed formulae</E>:912<Display>913\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot914\left(\sum_{j=1}^d y_j b_j \right) =915\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k916</Display>917918If possible, use the <C>Alt</C> element to specify a better readable text919version of such a formula as in the following example:<P/>920921<Alt Not="Text,HTML"><Display>922\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot923\left(\sum_{j=1}^d y_j b_j \right) =924\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k925</Display></Alt>926<Alt Only="Text,HTML"><Verb>927d d d928----- ----- ----- -----929\ \ \ \930==> ( ) x_i b_i )( ) y_i b_i ) = ) ( ) x_i y_j h_ijk ) b_k931/ / / /932----- ----- ----- -----933i = 1 i = 1 k = 1 i,j934</Verb><P/></Alt>935936For small formulae without <Q>difficult</Q> parts use the <C>M</C>937element: <M>b_i</M>,938<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace939matters for text (or HTML) output).<P/>940941Here are two formulae containing less than characters which are special942characters for XML:943<M><![CDATA[a < b < c < d]]></M> and <M>e < f</M>.944</Section>945\end{Verbatim}946}947948949\section{\textcolor{Chapter }{Crossreferencing (Source)}}\label{Eight}950\logpage{[ "B", 8, 0 ]}951\hyperdef{L}{X7D19CF4782309661}{}952{953[\ref{EightBack}]954\begin{Verbatim}[fontsize=\small,frame=single,label=]955<Section Label="Cross"><Heading>Crossreferencing</Heading>956957<Label Name="there"/>958959In this section we demonstrate various references to parts of this960document. Here is a reference to this section: <Ref Sect="Cross"/>.961Here is a reference to chapter <Ref Chap="First"/>, to appendix962<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.963<P/>964965We distinguish among others references966to functions (see <Ref Func="f"/>),967to methods with tricky name (see968<Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),969to operations (see <Ref Oper="MyOperation"/>),970to methods (see <Ref Meth="MyOperation" Label="First"/> or971<Ref Meth="MyOperation" Label="for bla"/>),972to filters (see <Ref Filt="IsBla"/>),973to properties (see <Ref Prop="IsBlubb"/>),974to attributes (see <Ref Attr="NumberBlobbs"/>),975to variables (<Ref Var="AllBlibbs"/>),976to families (see <Ref Fam="BlibbsFamily"/>),977and to info classes (see <Ref InfoClass="InfoBlibbs"/>).978<P/>979980There are also references to labels: see <Ref Text="here" Label="there"/>,981to other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or982<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference983manual.984<P/>985986References to sections come in two styles:987<Ref Chap="First" Style="Number"/>988or <Ref Chap="First" Style="Text"/>.989<P/>990991Another type of cross referencing is bibliography. Here is a992citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.993<P/>994995There are also URLs:<P/>996997<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>998999Email addresses have a special element:1000<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>1001<P/>10021003and Homepages another one:1004<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>1005<P/>10061007One can generate index entries as follows (look up the words1008<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).1009<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>1010<Index>RWTH</Index>1011<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>1012<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc;1013<Subkey>for &GAP; programmers</Subkey></Index>10141015</Section>1016\end{Verbatim}1017}101810191020\section{\textcolor{Chapter }{Lists and Tables (Source)}}\label{Nine}1021\logpage{[ "B", 9, 0 ]}1022\hyperdef{L}{X7BB822947F626E1A}{}1023{1024[\ref{NineBack}]1025\begin{Verbatim}[fontsize=\small,frame=single,label=]1026<Section><Heading>Lists and Tables</Heading>10271028There are1029<List>1030<Item>lists</Item>1031<Item>enumerations, and</Item>1032<Item>tables</Item>1033</List>1034or:1035<Enum>1036<Item>lists</Item>1037<Item>enumerations, and</Item>1038<Item>tables</Item>1039</Enum>1040or with marks:1041<List>1042<Mark>lists:</Mark><Item> not numbered</Item>1043<Mark>enumerations:</Mark><Item> numbered</Item>1044<Mark>tables:</Mark><Item> two-dimensional</Item>1045</List>10461047Lists can also be nested:1048<Enum>1049<Item>1050<Enum>1051<Item>first item of inner enumeration </Item>1052<Item>second item of inner enumeration </Item>1053</Enum>1054</Item>1055<Item>1056<List>1057<Item>first item of inner list </Item>1058<Item>second item of inner list </Item>1059</List>1060</Item>1061</Enum>10621063Here is a <E>table</E>:10641065<Table Align="|r|c|l|">1066<Caption>Prices</Caption>1067<HorLine/>1068<Row>1069<Item>Object</Item><Item>Price</Item><Item>available</Item>1070</Row>1071<HorLine/>1072<HorLine/>1073<Row>1074<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>1075</Row>1076<HorLine/>1077<Row>1078<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>1079</Row>1080<HorLine/>1081</Table>10821083</Section>1084\end{Verbatim}1085}108610871088\section{\textcolor{Chapter }{Entities and Special Characters (Source)}}\label{Ten}1089\logpage{[ "B", 10, 0 ]}1090\hyperdef{L}{X80B478CD7E584F6F}{}1091{1092[\ref{TenBack}]1093\begin{Verbatim}[fontsize=\small,frame=single,label=]1094<Section><Heading>Entities and Special Characters</Heading>1095<Label Name="TenBack"/>10961097[&see; <Ref Sect="Ten"/>]<P/>10981099Here is a table of special characters, the first two are special for1100XML and must be typed in by entities in &GAPDoc; documents. The other1101characters are special for &LaTeX; but in &GAPDoc; they can be typed1102directly.11031104<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">1105<Caption>Special characters in character data</Caption>1106<HorLine/> <Row>1107<Item><C>&</C></Item>1108<Item><C><</C></Item>1109<Item><C>></C></Item>1110<Item><C>#</C></Item>1111<Item><C>$</C></Item>1112<Item><C>%</C></Item>1113<Item><C>~</C></Item>1114<Item><C>\</C></Item>1115<Item><C>{</C></Item>1116<Item><C>}</C></Item>1117<Item><C>_</C></Item>1118<Item><C>^</C></Item>1119<Item><C> </C></Item>1120</Row> <HorLine/>1121</Table>11221123And here are the predefined entities in &GAPDoc;:11241125<Table Align="|l|l|">1126<Caption>Predefined Entities in the &GAPDoc; system</Caption>1127<HorLine/>1128<Row> <Item><C>&GAP;</C></Item> <Item>&GAP;</Item> </Row>1129<HorLine/>1130<Row> <Item><C>&GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>1131<HorLine/>1132<Row> <Item><C>&TeX;</C></Item> <Item>&TeX;</Item> </Row>1133<HorLine/>1134<Row> <Item><C>&LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>1135<HorLine/>1136<Row> <Item><C>&BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>1137<HorLine/>1138<Row> <Item><C>&MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>1139<HorLine/>1140<Row> <Item><C>&XGAP;</C></Item> <Item>&XGAP;</Item> </Row>1141<HorLine/>1142<Row> <Item><C>&copyright;</C></Item> <Item>©right;</Item> </Row>1143<HorLine/>1144</Table>11451146And some more for mathematical symbols:1147&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.11481149</Section>11501151</Chapter>11521153</Body>1154\end{Verbatim}1155}115611571158\section{\textcolor{Chapter }{Appendix (Source)}}\label{Eleven}1159\logpage{[ "B", 11, 0 ]}1160\hyperdef{L}{X85E7E6BA81367928}{}1161{1162[\ref{ElevenBack}]1163\begin{Verbatim}[fontsize=\small,frame=single,label=GAPDoc source]1164<Appendix><Heading>An Appendix</Heading>11651166This is an appendix.1167</Appendix>1168\end{Verbatim}1169}11701171}11721173\def\bibname{References\logpage{[ "Bib", 0, 0 ]}1174\hyperdef{L}{X7A6F98FD85F02BFE}{}1175}11761177\bibliographystyle{alpha}1178\bibliography{examplebib.xml}11791180\addcontentsline{toc}{chapter}{References}11811182\def\indexname{Index\logpage{[ "Ind", 0, 0 ]}1183\hyperdef{L}{X83A0356F839C696F}{}1184}11851186\cleardoublepage1187\phantomsection1188\addcontentsline{toc}{chapter}{Index}118911901191\printindex11921193\newpage1194\immediate\write\pagenrlog{["End"], \arabic{page}];}1195\immediate\closeout\pagenrlog1196\end{document}119711981199