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: 4183461[1X3 [33X[0;0YThe Document Type Definition[133X[101X23[33X[0;0YIn this chapter we first explain what a [21Xdocument type definition[121X is and then4describe [11Xgapdoc.dtd[111X in detail. That file together with the current chapter5define how a [5XGAPDoc[105X document has to look like. It can be found in the main6directory of the [5XGAPDoc[105X package and it is reproduced in Appendix [14XB[114X.[133X78[33X[0;0YWe do not give many examples in this chapter which is more intended as a9formal reference for all [5XGAPDoc[105X elements. Instead, we provide a separate10help book, see [14X???[114X. This uses all the constructs introduced in this chapter11and you can easily compare the source code and how it looks like in the12different output formats. Furthermore recall that many basic things about13XML markup were already explained by example in the introductory chapter [14X1[114X.[133X141516[1X3.1 [33X[0;0YWhat is a DTD?[133X[101X1718[33X[0;0YA document type definition (DTD) is a formal declaration of how an XML19document has to be structured. It is itself structured such that programs20that handle documents can read it and treat the documents accordingly. There21are for example parsers and validity checkers that use the DTD to validate22an XML document, see [14X2.1-14[114X.[133X2324[33X[0;0YThe main thing a DTD does is to specify which elements may occur in25documents of a certain document type, how they can be nested, and what26attributes they can or must have. So, for each element there is a rule.[133X2728[33X[0;0YNote that a DTD can [13Xnot[113X ensure that a document which is [21Xvalid[121X also makes29sense to the converters! It only says something about the formal structure30of the document.[133X3132[33X[0;0YFor the remaining part of this chapter we have divided the elements of33[5XGAPDoc[105X documents into several subsets, each of which will be discussed in34one of the next sections.[133X3536[33X[0;0YSee the following three subsections to learn by example, how a DTD works. We37do not want to be too formal here, but just enable the reader to understand38the declarations in [11Xgapdoc.dtd[111X. For precise descriptions of the syntax of39DTD's see again the official standard in:[133X4041[33X[0;0Y [7Xhttp://www.xml.com/axml/axml.html[107X[133X424344[1X3.2 [33X[0;0YOverall Document Structure[133X[101X4546[33X[0;0YA [5XGAPDoc[105X document contains on its top level exactly one element with name47[10XBook[110X. This element is declared in the DTD as follows:[133X484950[1X3.2-1 [33X[0;0Y[10X<Book>[110X[101X[1X[133X[101X5152[4X[32X From gapdoc.dtd [32X[104X53[4X<!ELEMENT Book (TitlePage,[104X54[4X TableOfContents?,[104X55[4X Body,[104X56[4X Appendix*,[104X57[4X Bibliography?,[104X58[4X TheIndex?)>[104X59[4X<!ATTLIST Book Name CDATA #REQUIRED>[104X60[4X[32X[104X6162[33X[0;0YAfter the keyword [10XELEMENT[110X and the name [10XBook[110X there is a list in parentheses.63This is a comma separated list of names of elements which can occur (in the64given order) in the content of a [10XBook[110X element. Each name in such a list can65be followed by one of the characters [21X[10X?[110X[121X, [21X[10X*[110X[121X or [21X[10X+[110X[121X, meaning that the66corresponding element can occur zero or one time, an arbitrary number of67times, or at least once, respectively. Without such an extra character the68corresponding element must occur exactly once. Instead of one name in this69list there can also be a list of elements names separated by [21X[10X|[110X[121X characters,70this denotes any element with one of the names (i.e., [21X[10X|[110X[121X means [21Xor[121X).[133X7172[33X[0;0YSo, the [10XBook[110X element must contain first a [10XTitlePage[110X element, then an73optional [10XTableOfContents[110X element, then a [10XBody[110X element, then zero or more74elements of type [10XAppendix[110X, then an optional [10XBibliography[110X element, and75finally an optional element of type [10XTheIndex[110X.[133X7677[33X[0;0YNote that [13Xonly[113X these elements are allowed in the content of the [10XBook[110X78element. No other elements or text is allowed in between. An exception of79this is that there may be whitespace between the end tag of one and the80start tag of the next element - this should be ignored when the document is81processed to some output format. An element like this is called an element82with [21Xelement content[121X.[133X8384[33X[0;0YThe second declaration starts with the keyword [10XATTLIST[110X and the element name85[10XBook[110X. After that there is a triple of whitespace separated parameters (in86general an arbitrary number of such triples, one for each allowed attribute87name). The first ([10XName[110X) is the name of an attribute for a [10XBook[110X element. The88second ([10XCDATA[110X) is always the same for all of our declarations, it means that89the value of the attribute consists of [21Xcharacter data[121X. The third parameter90[10X#REQUIRED[110X means that this attribute must be specified with any [10XBook[110X element.91Later we will also see optional attributes which are declared as [10X#IMPLIED[110X.[133X929394[1X3.2-2 [33X[0;0Y[10X<TitlePage>[110X[101X[1X[133X[101X9596[4X[32X From gapdoc.dtd [32X[104X97[4X<!ELEMENT TitlePage (Title, Subtitle?, Version?, TitleComment?, [104X98[4X Author+, Date?, Address?, Abstract?, Copyright?, [104X99[4X Acknowledgements? , Colophon? )>[104X100[4X[32X[104X101102[33X[0;0YWithin this element information for the title page is collected. Note that103more than one author can be specified. The elements must appear in this104order because there is no sensible way to specify in a DTD something like105[21Xthe following elements may occur in any order but each exactly once[121X.[133X106107[33X[0;0YBefore going on with the other elements inside the [10XBook[110X element we explain108the elements for the title page.[133X109110111[1X3.2-3 [33X[0;0Y[10X<Title>[110X[101X[1X[133X[101X112113[4X[32X From gapdoc.dtd [32X[104X114[4X<!ELEMENT Title (%Text;)*>[104X115[4X[32X[104X116117[33X[0;0YHere is the last construct you need to understand for reading [11Xgapdoc.dtd[111X.118The expression [21X[10X%Text;[110X[121X is a so-called [21Xparameter entity[121X. It is something like119a macro within the DTD. It is defined as follows:[133X120121[4X[32X From gapdoc.dtd [32X[104X122[4X<!ENTITY % Text "%InnerText; | List | Enum | Table">[104X123[4X[32X[104X124125[33X[0;0YThis means, that every occurrence of [21X[10X%Text;[110X[121X in the DTD is replaced by the126expression[133X127128[4X[32X From gapdoc.dtd [32X[104X129[4X%InnerText; | List | Enum | Table[104X130[4X[32X[104X131132[33X[0;0Ywhich is then expanded further because of the following definition:[133X133134[4X[32X From gapdoc.dtd [32X[104X135[4X<!ENTITY % InnerText "#PCDATA |[104X136[4X Alt |[104X137[4X Emph | E |[104X138[4X Par | P | Br |[104X139[4X Keyword | K | Arg | A | Quoted | Q | Code | C | [104X140[4X File | F | Button | B | Package |[104X141[4X M | Math | Display | [104X142[4X Example | Listing | Log | Verb |[104X143[4X URL | Email | Homepage | Address | Cite | Label | [104X144[4X Ref | Index" > [104X145[4X[32X[104X146147[33X[0;0YThese are the only two parameter entities we are using. They expand to lists148of element names which are explained in the sequel [13Xand[113X the keyword [10X#PCDATA[110X149(concatenated with the [21Xor[121X character [21X[10X|[110X[121X).[133X150151[33X[0;0YSo, the element ([10XTitle[110X) is of so-called [21Xmixed content[121X: It can contain [13Xparsed152character data[113X which does not contain further markup ([10X#PCDATA[110X) or any of the153other above mentioned elements. Mixed content must always have the asterisk154qualifier (like in [10XTitle[110X) such that any sequence of elements (of the above155list) and character data can be contained in a [10XTitle[110X element.[133X156157[33X[0;0YThe [10X%Text;[110X parameter entity is used in all places in the DTD, where [21Xnormal158text[121X should be allowed, including lists, enumerations, and tables, but [13Xno[113X159sectioning elements.[133X160161[33X[0;0YThe [10X%InnerText;[110X parameter entity is used in all places in the DTD, where162[21Xinner text[121X should be allowed. This means, that no structures like lists,163enumerations, and tables are allowed. This is used for example in headings.[133X164165166[1X3.2-4 [33X[0;0Y[10X<Subtitle>[110X[101X[1X[133X[101X167168[4X[32X From gapdoc.dtd [32X[104X169[4X<!ELEMENT Subtitle (%Text;)*>[104X170[4X[32X[104X171172[33X[0;0YContains the subtitle of the document.[133X173174175[1X3.2-5 [33X[0;0Y[10X<Version>[110X[101X[1X[133X[101X176177[4X[32X From gapdoc.dtd [32X[104X178[4X<!ELEMENT Version (#PCDATA|Alt)*>[104X179[4X[32X[104X180181[33X[0;0YNote that the version can only contain character data and no further markup182elements (except for [10XAlt[110X, which is necessary to resolve the entities183described in [14X2.2-3[114X). The converters will [13Xnot[113X put the word [21XVersion[121X in front184of the text in this element.[133X185186187[1X3.2-6 [33X[0;0Y[10X<TitleComment>[110X[101X[1X[133X[101X188189[4X[32X From gapdoc.dtd [32X[104X190[4X<!ELEMENT TitleComment (%Text;)*>[104X191[4X[32X[104X192193[33X[0;0YSometimes a title and subtitle are not sufficient to give a rough idea about194the content of a package. In this case use this optional element to specify195an additional text for the front page of the book. This text should be196short, use the [10XAbstract[110X element (see [14X3.2-10[114X) for longer explanations.[133X197198199[1X3.2-7 [33X[0;0Y[10X<Author>[110X[101X[1X[133X[101X200201[4X[32X From gapdoc.dtd [32X[104X202[4X<!ELEMENT Author (%Text;)*> <!-- There may be more than one Author! -->[104X203[4X[32X[104X204205[33X[0;0YAs noted in the comment there may be more than one element of this type.206This element should contain the name of an author and probably an207[10XEmail[110X-address and/or WWW-[10XHomepage[110X element for this author, see [14X3.5-6[114X208and [14X3.5-7[114X. You can also specify an individual postal address here, instead209of using the [10XAddress[110X element described below, see [14X3.2-9[114X.[133X210211212[1X3.2-8 [33X[0;0Y[10X<Date>[110X[101X[1X[133X[101X213214[4X[32X From gapdoc.dtd [32X[104X215[4X<!ELEMENT Date (#PCDATA)>[104X216[4X[32X[104X217218[33X[0;0YOnly character data is allowed in this element which gives a date for the219document. No automatic formatting is done.[133X220221222[1X3.2-9 [33X[0;0Y[10X<Address>[110X[101X[1X[133X[101X223224[4X[32X From gapdoc.dtd [32X[104X225[4X<!ELEMENT Address (#PCDATA|Alt|Br)*>[104X226[4X[32X[104X227228[33X[0;0YThis optional element can be used to specify a postal address of the author229or the authors. If there are several authors with different addresses then230put the [10XAddress[110X elements inside the [10XAuthor[110X elements.[133X231232[33X[0;0YUse the [10XBr[110X element (see [14X3.9-3[114X) to mark the line breaks in the usual233formatting of the address on a letter.[133X234235[33X[0;0YNote that often it is not necessary to use this element because a postal236address is easy to find via a link to a personal web page.[133X237238239[1X3.2-10 [33X[0;0Y[10X<Abstract>[110X[101X[1X[133X[101X240241[4X[32X From gapdoc.dtd [32X[104X242[4X<!ELEMENT Abstract (%Text;)*>[104X243[4X[32X[104X244245[33X[0;0YThis element contains an abstract of the whole book.[133X246247248[1X3.2-11 [33X[0;0Y[10X<Copyright>[110X[101X[1X[133X[101X249250[4X[32X From gapdoc.dtd [32X[104X251[4X<!ELEMENT Copyright (%Text;)*>[104X252[4X[32X[104X253254[33X[0;0YThis element is used for the copyright notice. Note the [10X©right;[110X entity255as described in section [14X2.2-3[114X.[133X256257258[1X3.2-12 [33X[0;0Y[10X<Acknowledgements>[110X[101X[1X[133X[101X259260[4X[32X From gapdoc.dtd [32X[104X261[4X<!ELEMENT Acknowledgements (%Text;)*>[104X262[4X[32X[104X263264[33X[0;0YThis element contains the acknowledgements.[133X265266267[1X3.2-13 [33X[0;0Y[10X<Colophon>[110X[101X[1X[133X[101X268269[4X[32X From gapdoc.dtd [32X[104X270[4X<!ELEMENT Colophon (%Text;)*>[104X271[4X[32X[104X272273[33X[0;0YThe [21Xcolophon[121X page is used to say something about the history of a document.[133X274275276[1X3.2-14 [33X[0;0Y[10X<TableOfContents>[110X[101X[1X[133X[101X277278[4X[32X From gapdoc.dtd [32X[104X279[4X<!ELEMENT TableOfContents EMPTY>[104X280[4X[32X[104X281282[33X[0;0YThis element may occur in the [10XBook[110X element after the [10XTitlePage[110X element. If283it is present, a table of contents is generated and inserted into the284document. Note that because this element is declared to be [10XEMPTY[110X one can use285the abbreviation[133X286287[4X[32X Example [32X[104X288[4X[28X<TableOfContents/>[128X[104X289[4X[32X[104X290291[33X[0;0Yto denote this empty element.[133X292293294[1X3.2-15 [33X[0;0Y[10X<Bibliography>[110X[101X[1X[133X[101X295296[4X[32X From gapdoc.dtd [32X[104X297[4X<!ELEMENT Bibliography EMPTY>[104X298[4X<!ATTLIST Bibliography Databases CDATA #REQUIRED[104X299[4X Style CDATA #IMPLIED>[104X300[4X[32X[104X301302[33X[0;0YThis element may occur in the [10XBook[110X element after the last [10XAppendix[110X element.303If it is present, a bibliography section is generated and inserted into the304document. The attribute [10XDatabases[110X must be specified, the names of several305data files can be specified, separated by commas.[133X306307[33X[0;0YTwo kinds of files can be specified in [10XDatabases[110X: The first are BibTeX files308as defined in [Lam85, Appendix B]. Such files must have a name with309extension [11X.bib[111X, and in [10XDatabases[110X the name must be given [13Xwithout[113X this310extension. Note that such [11X.bib[111X-files should be in latin1-encoding (or311ASCII-encoding). The second are files in BibXMLext format as defined in312Section [14X7.2[114X. These files must have an extension [11X.xml[111X and in [10XDatabases[110X the313[13Xfull[113X name must be specified.[133X314315[33X[0;0YWe suggest to use the BibXMLext format because it allows to produce316potentially nicer bibliography entries in text and HTML documents.[133X317318[33X[0;0YA bibliography style may be specified with the [10XStyle[110X attribute. The optional319[10XStyle[110X attribute (for LaTeX output of the document) must also be specified320without the [11X.bst[111X extension (the default is [10Xalpha[110X). See also section [14X3.5-3[114X321for a description of the [10XCite[110X element which is used to include bibliography322references into the text.[133X323324325[1X3.2-16 [33X[0;0Y[10X<TheIndex>[110X[101X[1X[133X[101X326327[4X[32X From gapdoc.dtd [32X[104X328[4X<!ELEMENT TheIndex EMPTY>[104X329[4X[32X[104X330331[33X[0;0YThis element may occur in the [10XBook[110X element after the [10XBibliography[110X element.332If it is present, an index is generated and inserted into the document.333There are elements in [5XGAPDoc[105X which implicitly generate index entries (e.g.,334[10XFunc[110X ([14X3.4-2[114X)) and there is an element [10XIndex[110X ([14X3.5-4[114X) for explicitly adding335index entries.[133X336337338[1X3.3 [33X[0;0YSectioning Elements[133X[101X339340[33X[0;0YA [5XGAPDoc[105X book is divided into [13Xchapters[113X, [13Xsections[113X, and [13Xsubsections[113X. The idea341is of course, that a chapter consists of sections, which in turn consist of342subsections. However for the sake of flexibility, the rules are not too343restrictive. Firstly, text is allowed everywhere in the body of the document344(and not only within sections). Secondly, the chapter level may be omitted.345The exact rules are described below.[133X346347[33X[0;0Y[13XAppendices[113X are a flavor of chapters, occurring after all regular chapters.348There is a special type of subsection called [21X[10XManSection[110X[121X. This is a349subsection devoted to the description of a function, operation or variable.350It is analogous to a manpage in the UNIX environment. Usually each function,351operation, method, and so on should have its own [10XManSection[110X.[133X352353[33X[0;0YCross referencing is done on the level of [10XSubsection[110Xs, respectively354[10XManSection[110Xs. The topics in [5XGAP[105X's online help are also pointing to355subsections. So, they should not be too long.[133X356357[33X[0;0YWe start our description of the sectioning elements [21Xtop-down[121X:[133X358359360[1X3.3-1 [33X[0;0Y[10X<Body>[110X[101X[1X[133X[101X361362[33X[0;0YThe [10XBody[110X element marks the main part of the document. It must occur after363the [10XTableOfContents[110X element. There is a big difference between [13Xinside[113X and364[13Xoutside[113X of this element: Whereas regular text is allowed nearly everywhere365in the [10XBody[110X element and its subelements, this is not true for the [13Xoutside[113X.366This has also implications on the handling of whitespace. [13XOutside[113X367superfluous whitespace is usually ignored when it occurs between elements.368[13XInside[113X of the [10XBody[110X element whitespace matters because character data is369allowed nearly everywhere. Here is the definition in the DTD:[133X370371[4X[32X From gapdoc.dtd [32X[104X372[4X<!ELEMENT Body ( %Text;| Chapter | Section )*>[104X373[4X[32X[104X374375[33X[0;0YThe fact that [10XChapter[110X and [10XSection[110X elements are allowed here leads to the376possibility to omit the chapter level entirely in the document. For a377description of [10X%Text;[110X see [14X3.2-3[114X.[133X378379[33X[0;0Y(Remark: The purpose of this element is to make sure that a [13Xvalid[113X [5XGAPDoc[105X380document has a correct overall structure, which is only possible when the381top element [10XBook[110X has element content.)[133X382383384[1X3.3-2 [33X[0;0Y[10X<Chapter>[110X[101X[1X[133X[101X385386[4X[32X From gapdoc.dtd [32X[104X387[4X<!ELEMENT Chapter (%Text;| Heading | Section)*>[104X388[4X<!ATTLIST Chapter Label CDATA #IMPLIED> <!-- For reference purposes -->[104X389[4X[32X[104X390391[33X[0;0YA [10XChapter[110X element can have a [10XLabel[110X attribute, such that this chapter can be392referenced later on with a [10XRef[110X element (see section [14X3.5-1[114X). Note that you393have to specify a label to reference the chapter as there is no automatic394labelling![133X395396[33X[0;0Y[10XChapter[110X elements can contain text (for a description of [10X%Text;[110X see [14X3.2-3[114X),397[10XSection[110X elements, and [10XHeading[110X elements.[133X398399[33X[0;0YThe following [13Xadditional[113X rule cannot be stated in the DTD because we want a400[10XChapter[110X element to have mixed content. There must be [13Xexactly one[113X [10XHeading[110X401element in the [10XChapter[110X element, containing the heading of the chapter. Here402is its definition:[133X403404405[1X3.3-3 [33X[0;0Y[10X<Heading>[110X[101X[1X[133X[101X406407[4X[32X From gapdoc.dtd [32X[104X408[4X<!ELEMENT Heading (%InnerText;)*>[104X409[4X[32X[104X410411[33X[0;0YThis element is used for headings in [10XChapter[110X, [10XSection[110X, [10XSubsection[110X, and412[10XAppendix[110X elements. It may only contain [10X%InnerText;[110X (for a description see413[14X3.2-3[114X).[133X414415[33X[0;0YEach of the mentioned sectioning elements must contain exactly one direct416[10XHeading[110X element (i.e., one which is not contained in another sectioning417element).[133X418419420[1X3.3-4 [33X[0;0Y[10X<Appendix>[110X[101X[1X[133X[101X421422[4X[32X From gapdoc.dtd [32X[104X423[4X<!ELEMENT Appendix (%Text;| Heading | Section)*>[104X424[4X<!ATTLIST Appendix Label CDATA #IMPLIED> <!-- For reference purposes -->[104X425[4X[32X[104X426427[33X[0;0YThe [10XAppendix[110X element behaves exactly like a [10XChapter[110X element (see [14X3.3-2[114X)428except for the position within the document and the numbering. While429chapters are counted with numbers (1., 2., 3., ...) the appendices are430counted with capital letters (A., B., ...).[133X431432[33X[0;0YAgain there is an optional [10XLabel[110X attribute used for references.[133X433434435[1X3.3-5 [33X[0;0Y[10X<Section>[110X[101X[1X[133X[101X436437[4X[32X From gapdoc.dtd [32X[104X438[4X<!ELEMENT Section (%Text;| Heading | Subsection | ManSection)*>[104X439[4X<!ATTLIST Section Label CDATA #IMPLIED> <!-- For reference purposes -->[104X440[4X[32X[104X441442[33X[0;0YA [10XSection[110X element can have a [10XLabel[110X attribute, such that this section can be443referenced later on with a [10XRef[110X element (see section [14X3.5-1[114X). Note that you444have to specify a label to reference the section as there is no automatic445labelling![133X446447[33X[0;0Y[10XSection[110X elements can contain text (for a description of [10X%Text;[110X see [14X3.2-3[114X),448[10XHeading[110X elements, and subsections.[133X449450[33X[0;0YThere must be exactly one direct [10XHeading[110X element in a [10XSection[110X element,451containing the heading of the section.[133X452453[33X[0;0YNote that a subsection is either a [10XSubsection[110X element or a [10XManSection[110X454element.[133X455456457[1X3.3-6 [33X[0;0Y[10X<Subsection>[110X[101X[1X[133X[101X458459[4X[32X From gapdoc.dtd [32X[104X460[4X<!ELEMENT Subsection (%Text;| Heading)*>[104X461[4X<!ATTLIST Subsection Label CDATA #IMPLIED> <!-- For reference purposes -->[104X462[4X[32X[104X463464[33X[0;0YThe [10XSubsection[110X element can have a [10XLabel[110X attribute, such that this subsection465can be referenced later on with a [10XRef[110X element (see section [14X3.5-1[114X). Note that466you have to specify a label to reference the subsection as there is no467automatic labelling![133X468469[33X[0;0Y[10XSubsection[110X elements can contain text (for a description of [10X%Text;[110X see470[14X3.2-3[114X), and [10XHeading[110X elements.[133X471472[33X[0;0YThere must be exactly one [10XHeading[110X element in a [10XSubsection[110X element,473containing the heading of the subsection.[133X474475[33X[0;0YAnother type of subsection is a [10XManSection[110X, explained now:[133X476477478[1X3.4 [33X[0;0YManSection–a special kind of subsection[133X[101X479480[33X[0;0Y[10XManSection[110Xs are intended to describe a function, operation, method,481variable, or some other technical instance. It is analogous to a manpage in482the UNIX environment.[133X483484485[1X3.4-1 [33X[0;0Y[10X<ManSection>[110X[101X[1X[133X[101X486487[4X[32X From gapdoc.dtd [32X[104X488[4X<!ELEMENT ManSection ( Heading?, [104X489[4X ((Func, Returns?) | (Oper, Returns?) | [104X490[4X (Meth, Returns?) | (Filt, Returns?) | [104X491[4X (Prop, Returns?) | (Attr, Returns?) |[104X492[4X (Constr, Returns?) |[104X493[4X Var | Fam | InfoClass)+, Description )>[104X494[4X<!ATTLIST ManSection Label CDATA #IMPLIED> <!-- For reference purposes -->[104X495[4X[104X496[4X<!ELEMENT Returns (%Text;)*>[104X497[4X<!ELEMENT Description (%Text;)*>[104X498[4X[32X[104X499500[33X[0;0YThe [10XManSection[110X element can have a [10XLabel[110X attribute, such that this subsection501can be referenced later on with a [10XRef[110X element (see section [14X3.5-1[114X). But this502is probably rarely necessary because the elements [10XFunc[110X and so on (explained503below) generate automatically labels for cross referencing.[133X504505[33X[0;0YThe content of a [10XManSection[110X element is one or more elements describing506certain items in [5XGAP[105X, each of them optionally followed by a [10XReturns[110X element,507followed by a [10XDescription[110X element, which contains [10X%Text;[110X (see [14X3.2-3[114X)508describing it. (Remember to include examples in the description as often as509possible, see [14X3.7-10[114X). The classes of items [5XGAPDoc[105X knows of are: functions510([10XFunc[110X), operations ([10XOper[110X), constructors ([10XConstr[110X), methods ([10XMeth[110X), filters511([10XFilt[110X), properties ([10XProp[110X), attributes ([10XAttr[110X), variables ([10XVar[110X), families512([10XFam[110X), and info classes ([10XInfoClass[110X). One [10XManSection[110X should only describe513several of such items when these are very closely related.[133X514515[33X[0;0YEach element for an item corresponding to a [5XGAP[105X function can be followed by516a [10XReturns[110X element. In output versions of the document the string [21XReturns: [121X517will be put in front of the content text. The text in the [10XReturns[110X element518should usually be a short hint about the type of object returned by the519function. This is intended to give a good mnemonic for the use of a function520(together with a good choice of names for the formal arguments).[133X521522[33X[0;0Y[10XManSection[110Xs are also sectioning elements which count as subsections. Usually523there should be no [10XHeading[110X-element in a [10XManSection[110X, in that case a heading524is generated automatically from the first [10XFunc[110X-like element. Sometimes this525default behaviour does not look appropriate, for example when there are526several [10XFunc[110X-like elements. For such cases an optional [10XHeading[110X is allowed.[133X527528529[1X3.4-2 [33X[0;0Y[10X<Func>[110X[101X[1X[133X[101X530531[4X[32X From gapdoc.dtd [32X[104X532[4X<!ELEMENT Func EMPTY>[104X533[4X<!ATTLIST Func Name CDATA #REQUIRED[104X534[4X Label CDATA #IMPLIED[104X535[4X Arg CDATA #REQUIRED[104X536[4X Comm CDATA #IMPLIED>[104X537[4X[32X[104X538539[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of a540function. The [10XName[110X attribute is required and its value is the name of the541function. The value of the [10XArg[110X attribute (also required) contains the full542list of arguments including optional parts, which are denoted by square543brackets. The argument names can be separated by whitespace, commas or the544square brackets for the optional arguments, like [10X"grp[, elm]"[110X or545[10X"xx[y[z] ]"[110X. If [5XGAP[105X options are used, this can be followed by a colon [10X:[110X and546one or more assignments, like [10X"n[, r]: tries := 100"[110X.[133X547548[33X[0;0YThe name of the function is also used as label for cross referencing. When549the name of the function appears in the text of the document it should550[13Xalways[113X be written with the [10XRef[110X element, see [14X3.5-1[114X. This allows to use a551unique typesetting style for function names and automatic cross referencing.[133X552553[33X[0;0YIf the optional [10XLabel[110X attribute is given, it is appended (with a colon [10X:[110X in554between) to the name of the function for cross referencing purposes. The555text of the label can also appear in the document text. So, it should be a556kind of short explanation.[133X557558[4X[32X Example [32X[104X559[4X[28X<Func Arg="x[, y]" Name="LibFunc" Label="for my objects"/>[128X[104X560[4X[32X[104X561562[33X[0;0YThe optional [10XComm[110X attribute should be a short description of the function,563usually at most one line long (this is currently nowhere used).[133X564565[33X[0;0YThis element automatically produces an index entry with the name of the566function and, if present, the text of the [10XLabel[110X attribute as subentry (see567also [14X3.2-16[114X and [14X3.5-4[114X).[133X568569570[1X3.4-3 [33X[0;0Y[10X<Oper>[110X[101X[1X[133X[101X571572[4X[32X From gapdoc.dtd [32X[104X573[4X<!ELEMENT Oper EMPTY>[104X574[4X<!ATTLIST Oper Name CDATA #REQUIRED[104X575[4X Label CDATA #IMPLIED[104X576[4X Arg CDATA #REQUIRED[104X577[4X Comm CDATA #IMPLIED>[104X578[4X[32X[104X579580[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of an581operation. The attributes are used exactly in the same way as in the [10XFunc[110X582element (see [14X3.4-2[114X).[133X583584[33X[0;0YNote that multiple descriptions of the same operation may occur in a585document because there may be several declarations in [5XGAP[105X. Furthermore there586may be several [10XManSection[110Xs for methods of this operation (see [14X3.4-5[114X) which587also use the same name. For reference purposes these must be distinguished588by different [10XLabel[110X attributes.[133X589590591[1X3.4-4 [33X[0;0Y[10X<Constr>[110X[101X[1X[133X[101X592593[4X[32X From gapdoc.dtd [32X[104X594[4X<!ELEMENT Constr EMPTY>[104X595[4X<!ATTLIST Constr Name CDATA #REQUIRED[104X596[4X Label CDATA #IMPLIED[104X597[4X Arg CDATA #REQUIRED[104X598[4X Comm CDATA #IMPLIED>[104X599[4X[32X[104X600601[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of a602constructor. The attributes are used exactly in the same way as in the [10XFunc[110X603element (see [14X3.4-2[114X).[133X604605[33X[0;0YNote that multiple descriptions of the same constructor may occur in a606document because there may be several declarations in [5XGAP[105X. Furthermore there607may be several [10XManSection[110Xs for methods of this constructor (see [14X3.4-5[114X) which608also use the same name. For reference purposes these must be distinguished609by different [10XLabel[110X attributes.[133X610611612[1X3.4-5 [33X[0;0Y[10X<Meth>[110X[101X[1X[133X[101X613614[4X[32X From gapdoc.dtd [32X[104X615[4X<!ELEMENT Meth EMPTY>[104X616[4X<!ATTLIST Meth Name CDATA #REQUIRED[104X617[4X Label CDATA #IMPLIED[104X618[4X Arg CDATA #REQUIRED[104X619[4X Comm CDATA #IMPLIED>[104X620[4X[32X[104X621622[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of a623method. The attributes are used exactly in the same way as in the [10XFunc[110X624element (see [14X3.4-2[114X).[133X625626[33X[0;0YFrequently, an operation is implemented by several different methods.627Therefore it seems to be interesting to document them independently. This is628possible by using the same method name in different [10XManSection[110Xs. It is629however required that these subsections and those describing the630corresponding operation are distinguished by different [10XLabel[110X attributes.[133X631632633[1X3.4-6 [33X[0;0Y[10X<Filt>[110X[101X[1X[133X[101X634635[4X[32X From gapdoc.dtd [32X[104X636[4X<!ELEMENT Filt EMPTY>[104X637[4X<!ATTLIST Filt Name CDATA #REQUIRED[104X638[4X Label CDATA #IMPLIED[104X639[4X Arg CDATA #IMPLIED[104X640[4X Comm CDATA #IMPLIED[104X641[4X Type CDATA #IMPLIED>[104X642[4X[32X[104X643644[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of a645filter. The first four attributes are used in the same way as in the [10XFunc[110X646element (see [14X3.4-2[114X), except that the [10XArg[110X attribute is optional.[133X647648[33X[0;0YThe [10XType[110X attribute can be any string, but it is thought to be something like649[21X[10XCategory[110X[121X or [21X[10XRepresentation[110X[121X.[133X650651652[1X3.4-7 [33X[0;0Y[10X<Prop>[110X[101X[1X[133X[101X653654[4X[32X From gapdoc.dtd [32X[104X655[4X<!ELEMENT Prop EMPTY>[104X656[4X<!ATTLIST Prop Name CDATA #REQUIRED[104X657[4X Label CDATA #IMPLIED[104X658[4X Arg CDATA #REQUIRED[104X659[4X Comm CDATA #IMPLIED>[104X660[4X[32X[104X661662[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of a663property. The attributes are used exactly in the same way as in the [10XFunc[110X664element (see [14X3.4-2[114X).[133X665666667[1X3.4-8 [33X[0;0Y[10X<Attr>[110X[101X[1X[133X[101X668669[4X[32X From gapdoc.dtd [32X[104X670[4X<!ELEMENT Attr EMPTY>[104X671[4X<!ATTLIST Attr Name CDATA #REQUIRED[104X672[4X Label CDATA #IMPLIED[104X673[4X Arg CDATA #REQUIRED[104X674[4X Comm CDATA #IMPLIED>[104X675[4X[32X[104X676677[33X[0;0YThis element is used within a [10XManSection[110X element to specify the usage of an678attribute (in [5XGAP[105X). The attributes are used exactly in the same way as in679the [10XFunc[110X element (see [14X3.4-2[114X).[133X680681682[1X3.4-9 [33X[0;0Y[10X<Var>[110X[101X[1X[133X[101X683684[4X[32X From gapdoc.dtd [32X[104X685[4X<!ELEMENT Var EMPTY>[104X686[4X<!ATTLIST Var Name CDATA #REQUIRED[104X687[4X Label CDATA #IMPLIED[104X688[4X Comm CDATA #IMPLIED>[104X689[4X[32X[104X690691[33X[0;0YThis element is used within a [10XManSection[110X element to document a global692variable. The attributes are used exactly in the same way as in the [10XFunc[110X693element (see [14X3.4-2[114X) except that there is no [10XArg[110X attribute.[133X694695696[1X3.4-10 [33X[0;0Y[10X<Fam>[110X[101X[1X[133X[101X697698[4X[32X From gapdoc.dtd [32X[104X699[4X<!ELEMENT Fam EMPTY>[104X700[4X<!ATTLIST Fam Name CDATA #REQUIRED[104X701[4X Label CDATA #IMPLIED[104X702[4X Comm CDATA #IMPLIED>[104X703[4X[32X[104X704705[33X[0;0YThis element is used within a [10XManSection[110X element to document a family. The706attributes are used exactly in the same way as in the [10XFunc[110X element (see707[14X3.4-2[114X) except that there is no [10XArg[110X attribute.[133X708709710[1X3.4-11 [33X[0;0Y[10X<InfoClass>[110X[101X[1X[133X[101X711712[4X[32X From gapdoc.dtd [32X[104X713[4X<!ELEMENT InfoClass EMPTY>[104X714[4X<!ATTLIST InfoClass Name CDATA #REQUIRED[104X715[4X Label CDATA #IMPLIED[104X716[4X Comm CDATA #IMPLIED>[104X717[4X[32X[104X718719[33X[0;0YThis element is used within a [10XManSection[110X element to document an info class.720The attributes are used exactly in the same way as in the [10XFunc[110X element (see721[14X3.4-2[114X) except that there is no [10XArg[110X attribute.[133X722723724[1X3.5 [33X[0;0YCross Referencing and Citations[133X[101X725726[33X[0;0YCross referencing in the [5XGAPDoc[105X system is somewhat different to the usual727LaTeX cross referencing in so far, that a reference knows [21Xwhich type of728object[121X it is referencing. For example a [21Xreference to a function[121X is729distinguished from a [21Xreference to a chapter[121X. The idea of this is, that the730markup must contain this information such that the converters can produce731better output. The HTML converter can for example typeset a function732reference just as the name of the function with a link to the description of733the function, or a chapter reference as a number with a link in the other734case.[133X735736[33X[0;0YReferencing is done with the [10XRef[110X element:[133X737738739[1X3.5-1 [33X[0;0Y[10X<Ref>[110X[101X[1X[133X[101X740741[4X[32X From gapdoc.dtd [32X[104X742[4X<!ELEMENT Ref EMPTY>[104X743[4X<!ATTLIST Ref Func CDATA #IMPLIED[104X744[4X Oper CDATA #IMPLIED[104X745[4X Constr CDATA #IMPLIED[104X746[4X Meth CDATA #IMPLIED[104X747[4X Filt CDATA #IMPLIED[104X748[4X Prop CDATA #IMPLIED[104X749[4X Attr CDATA #IMPLIED[104X750[4X Var CDATA #IMPLIED[104X751[4X Fam CDATA #IMPLIED[104X752[4X InfoClass CDATA #IMPLIED[104X753[4X Chap CDATA #IMPLIED[104X754[4X Sect CDATA #IMPLIED[104X755[4X Subsect CDATA #IMPLIED[104X756[4X Appendix CDATA #IMPLIED[104X757[4X Text CDATA #IMPLIED[104X758[4X[104X759[4X Label CDATA #IMPLIED[104X760[4X BookName CDATA #IMPLIED[104X761[4X Style (Text | Number) #IMPLIED> <!-- normally automatic -->[104X762[4X[32X[104X763764[33X[0;0YThe [10XRef[110X element is defined to be [10XEMPTY[110X. If one of the attributes [10XFunc[110X, [10XOper[110X,765[10XConstr[110X, [10XMeth[110X, [10XProp[110X, [10XAttr[110X, [10XVar[110X, [10XFam[110X, [10XInfoClass[110X, [10XChap[110X, [10XSect[110X, [10XSubsect[110X, [10XAppendix[110X766is given then there must be exactly one of these, making the reference one767to the corresponding object. The [10XLabel[110X attribute can be specified in768addition to make the reference unique, for example if more than one method769with a given name is present. (Note that there is no way to specify in the770DTD that exactly one of the first listed attributes must be given, this is771an additional rule.)[133X772773[33X[0;0YA reference to a [10XLabel[110X element defined below (see [14X3.5-2[114X) is done by giving774the [10XLabel[110X attribute and optionally the [10XText[110X attribute. If the [10XText[110X attribute775is present its value is typeset in place of the [10XRef[110X element, if linking is776possible (for example in HTML). If this is not possible, the section number777is typeset. This type of reference is also used for references to tables778(see [14X3.6-5[114X).[133X779780[33X[0;0YAn external reference into another book can be specified by using the781[10XBookName[110X attribute. In this case the [10XLabel[110X attribute or, if this is not782given, the function or section like attribute, is used to resolve the783reference. The generated reference points to the first hit when asking [21X?book784name: label[121X inside [5XGAP[105X.[133X785786[33X[0;0YThe optional attribute [10XStyle[110X can take only the values [10XText[110X and [10XNumber[110X. It787can be used with references to sectioning units and it gives a hint to the788converter programs, whether an explicit section number is generated or text.789Normally all references to sections generate numbers and references to a [5XGAP[105X790object generate the name of the corresponding object with some additional791link or sectioning information, which is the behavior of [10XStyle="Text"[110X. In792case [10XStyle="Number"[110X in all cases an explicit section number is generated. So[133X793794[4X[32X Example [32X[104X795[4X[28X<Ref Subsect="Func" Style="Text"/> described in section [128X[104X796[4X[28X<Ref Subsect="Func" Style="Number"/>[128X[104X797[4X[32X[104X798799[33X[0;0Yproduces: [14X'[33X[0;0Y[10X<Func>[110X[133X'[114X described in section [14X3.4-2[114X.[133X800801802[1X3.5-2 [33X[0;0Y[10X<Label>[110X[101X[1X[133X[101X803804[4X[32X From gapdoc.dtd [32X[104X805[4X<!ELEMENT Label EMPTY>[104X806[4X<!ATTLIST Label Name CDATA #REQUIRED>[104X807[4X[32X[104X808809[33X[0;0YThis element is used to define a label for referencing a certain position in810the document, if this is possible. If an exact reference is not possible811(like in a printed version of the document) a reference to the corresponding812subsection is generated. The value of the [10XName[110X attribute must be unique813under all [10XLabel[110X elements.[133X814815816[1X3.5-3 [33X[0;0Y[10X<Cite>[110X[101X[1X[133X[101X817818[4X[32X From gapdoc.dtd [32X[104X819[4X<!ELEMENT Cite EMPTY>[104X820[4X<!ATTLIST Cite Key CDATA #REQUIRED[104X821[4X Where CDATA #IMPLIED>[104X822[4X[32X[104X823824[33X[0;0YThis element is for bibliography citations. It is [10XEMPTY[110X by definition. The825attribute [10XKey[110X is the key for a lookup in a BibTeX database that has to be826specified in the [10XBibliography[110X element (see [14X3.2-15[114X). The value of the [10XWhere[110X827attribute specifies the position in the document as in the corresponding828LaTeX syntax [10X\cite[Where value]{Key value}[110X.[133X829830831[1X3.5-4 [33X[0;0Y[10X<Index>[110X[101X[1X[133X[101X832833[4X[32X From gapdoc.dtd [32X[104X834[4X<!ELEMENT Index (%InnerText;|Subkey)*>[104X835[4X<!ATTLIST Index Key CDATA #IMPLIED[104X836[4X Subkey CDATA #IMPLIED>[104X837[4X<!ELEMENT Subkey (%InnerText;)*>[104X838[4X[32X[104X839840[33X[0;0YThis element generates an index entry. The content of the element is typeset841in the index. It can optionally contain a [10XSubkey[110X element. If one or both of842the attributes [10XKey[110X and [10XSubkey[110X are given, then the attribute values are used843for sorting the index entries. Otherwise the content itself is used for844sorting. The attributes should be used when the content contains markup.845Note that all [10XFunc[110X and similar elements automatically generate index846entries. If the [10XTheIndex[110X element ([14X3.2-16[114X) is not present in the document all847[10XIndex[110X elements are ignored.[133X848849850[1X3.5-5 [33X[0;0Y[10X<URL>[110X[101X[1X[133X[101X851852[4X[32X From gapdoc.dtd [32X[104X853[4X<!ELEMENT URL (#PCDATA|Alt|Link|LinkText)*> <!-- Link, LinkText[104X854[4X variant for case where text needs further markup -->[104X855[4X<!ATTLIST URL Text CDATA #IMPLIED> <!-- This is for output formats[104X856[4X that have links like HTML -->[104X857[4X<!ELEMENT Link (%InnerText;)*> <!-- the URL -->[104X858[4X<!ELEMENT LinkText (%InnerText;)*> <!-- text for links, can contain markup -->[104X859[4X[104X860[4X[32X[104X861862[33X[0;0YThis element is for references into the internet. It specifies an URL and863optionally a text which can be used for a link (like in HTML or PDF versions864of the document). This can be specified in two ways: Either the URL is given865as element content and the text is given in the optional [10XText[110X attribute (in866this case the text cannot contain further markup), or the element contains867the two elements [10XLink[110X and [10XLinkText[110X which in turn contain the URL and the868text, respectively. The default value for the text is the URL itself.[133X869870871[1X3.5-6 [33X[0;0Y[10X<Email>[110X[101X[1X[133X[101X872873[4X[32X From gapdoc.dtd [32X[104X874[4X<!ELEMENT Email (#PCDATA|Alt|Link|LinkText)*>[104X875[4X[32X[104X876877[33X[0;0YThis element type is the special case of an URL specifying an email address.878The content of the element should be the email address without any prefix879like [21X[10Xmailto:[110X[121X. This address is typeset by all converters, also without any880prefix. In the case of an output document format like HTML the converter can881produce a link with a [21X[10Xmailto:[110X[121X prefix.[133X882883884[1X3.5-7 [33X[0;0Y[10X<Homepage>[110X[101X[1X[133X[101X885886[4X[32X From gapdoc.dtd [32X[104X887[4X<!ELEMENT Homepage (#PCDATA|Alt|Link|LinkText)*>[104X888[4X[32X[104X889890[33X[0;0YThis element type is the special case of an URL specifying a WWW-homepage.[133X891892893[1X3.6 [33X[0;0YStructural Elements like Lists[133X[101X894895[33X[0;0YThe [5XGAPDoc[105X system offers some limited access to structural elements like896lists, enumerations, and tables. Although it is possible to use all LaTeX897constructs one always has to think about other output formats. The elements898in this section are guaranteed to produce something reasonable in all output899formats.[133X900901902[1X3.6-1 [33X[0;0Y[10X<List>[110X[101X[1X[133X[101X903904[4X[32X From gapdoc.dtd [32X[104X905[4X<!ELEMENT List ( ((Mark,Item)|Item)+ )>[104X906[4X<!ATTLIST List Only CDATA #IMPLIED[104X907[4X Not CDATA #IMPLIED>[104X908[4X[32X[104X909910[33X[0;0YThis element produces a list. Each item in the list corresponds to an [10XItem[110X911element. Every [10XItem[110X element is optionally preceded by a [10XMark[110X element. The912content of this is used as a marker for the item. Note that this marker can913be a whole word or even a sentence. It will be typeset in some emphasized914fashion and most converters will provide some indentation for the rest of915the item.[133X916917[33X[0;0YThe [10XOnly[110X and [10XNot[110X attributes can be used to specify, that the list is918included into the output by only one type of converter ([10XOnly[110X) or all but one919type of converter ([10XNot[110X). Of course at most one of the two attributes may920occur in one element. The following values are allowed as of now: [21X[10XLaTeX[110X[121X,921[21X[10XHTML[110X[121X, and [21X[10XText[110X[121X. See also the [10XAlt[110X element in [14X3.9-1[114X for more about text922alternatives for certain converters.[133X923924925[1X3.6-2 [33X[0;0Y[10X<Mark>[110X[101X[1X[133X[101X926927[4X[32X From gapdoc.dtd [32X[104X928[4X<!ELEMENT Mark ( %InnerText;)*>[104X929[4X[32X[104X930931[33X[0;0YThis element is used in the [10XList[110X element to mark items. See [14X3.6-1[114X for an932explanation.[133X933934935[1X3.6-3 [33X[0;0Y[10X<Item>[110X[101X[1X[133X[101X936937[4X[32X From gapdoc.dtd [32X[104X938[4X<!ELEMENT Item ( %Text;)*>[104X939[4X[32X[104X940941[33X[0;0YThis element is used in the [10XList[110X, [10XEnum[110X, and [10XTable[110X elements to specify the942items. See sections [14X3.6-1[114X, [14X3.6-4[114X, and [14X3.6-5[114X for further information.[133X943944945[1X3.6-4 [33X[0;0Y[10X<Enum>[110X[101X[1X[133X[101X946947[4X[32X From gapdoc.dtd [32X[104X948[4X<!ELEMENT Enum ( Item+ )>[104X949[4X<!ATTLIST Enum Only CDATA #IMPLIED[104X950[4X Not CDATA #IMPLIED>[104X951[4X[32X[104X952953[33X[0;0YThis element is used like the [10XList[110X element (see [14X3.6-1[114X) except that the items954must not have marks attached to them. Instead, the items are numbered955automatically. The same comments about the [10XOnly[110X and [10XNot[110X attributes as above956apply.[133X957958959[1X3.6-5 [33X[0;0Y[10X<Table>[110X[101X[1X[133X[101X960961[4X[32X From gapdoc.dtd [32X[104X962[4X<!ELEMENT Table ( Caption?, (Row | HorLine)+ )>[104X963[4X<!ATTLIST Table Label CDATA #IMPLIED[104X964[4X Only CDATA #IMPLIED[104X965[4X Not CDATA #IMPLIED[104X966[4X Align CDATA #REQUIRED>[104X967[4X <!-- We allow | and l,c,r, nothing else -->[104X968[4X<!ELEMENT Row ( Item+ )>[104X969[4X<!ELEMENT HorLine EMPTY>[104X970[4X<!ELEMENT Caption ( %InnerText;)*>[104X971[4X[32X[104X972973[33X[0;0YA table in [5XGAPDoc[105X consists of an optional [10XCaption[110X element followed by a974sequence of [10XRow[110X and [10XHorLine[110X elements. A [10XHorLine[110X element produces a975horizontal line in the table. A [10XRow[110X element consists of a sequence of [10XItem[110X976elements as they also occur in [10XList[110X and [10XEnum[110X elements. The [10XOnly[110X and [10XNot[110X977attributes have the same functionality as described in the [10XList[110X element in978[14X3.6-1[114X.[133X979980[33X[0;0YThe [10XAlign[110X attribute is written like a LaTeX tabular alignment specifier but981only the letters [21X[10Xl[110X[121X, [21X[10Xr[110X[121X, [21X[10Xc[110X[121X, and [21X[10X|[110X[121X are allowed meaning left alignment, right982alignment, centered alignment, and a vertical line as delimiter between983columns respectively.[133X984985[33X[0;0YIf the [10XLabel[110X attribute is there, one can reference the table with the [10XRef[110X986element (see [14X3.5-1[114X) using its [10XLabel[110X attribute.[133X987988[33X[0;0YUsually only simple tables should be used. If you want a complicated table989in the LaTeX output you should provide alternatives for text and HTML990output. Note that in HTML-4.0 there is no possibility to interpret the [21X[10X|[110X[121X991column separators and [10XHorLine[110X elements as intended. There are lines between992all columns and rows or no lines at all.[133X993994995[1X3.7 [33X[0;0YTypes of Text[133X[101X996997[33X[0;0YThis section covers the markup of text. Various types of [21Xtext[121X exist. The998following elements are used in the [5XGAPDoc[105X system to mark them. They mostly999come in pairs, one long name which is easier to remember and a shortcut to1000make the markup [21Xlighter[121X.[133X10011002[33X[0;0YMost of the following elements are thought to contain only character data1003and no further markup elements. It is however necessary to allow [10XAlt[110X1004elements to resolve the entities described in section [14X2.2-3[114X.[133X100510061007[1X3.7-1 [33X[0;0Y[10X<Emph>[110X[101X[1X and [10X<E>[110X[101X[1X[133X[101X10081009[4X[32X From gapdoc.dtd [32X[104X1010[4X<!ELEMENT Emph (%InnerText;)*> <!-- Emphasize something -->[104X1011[4X<!ELEMENT E (%InnerText;)*> <!-- the same as shortcut -->[104X1012[4X[32X[104X10131014[33X[0;0YThis element is used to emphasize some piece of text. It may contain1015[10X%InnerText;[110X (see [14X3.2-3[114X).[133X101610171018[1X3.7-2 [33X[0;0Y[10X<Quoted>[110X[101X[1X and [10X<Q>[110X[101X[1X[133X[101X10191020[4X[32X From gapdoc.dtd [32X[104X1021[4X<!ELEMENT Quoted (%InnerText;)*> <!-- Quoted (in quotes) text -->[104X1022[4X<!ELEMENT Q (%InnerText;)*> <!-- Quoted text (shortcut) -->[104X1023[4X[32X[104X10241025[33X[0;0YThis element is used to put some piece of text into [21X [121X-quotes. It may contain1026[10X%InnerText;[110X (see [14X3.2-3[114X).[133X102710281029[1X3.7-3 [33X[0;0Y[10X<Keyword>[110X[101X[1X and [10X<K>[110X[101X[1X[133X[101X10301031[4X[32X From gapdoc.dtd [32X[104X1032[4X<!ELEMENT Keyword (#PCDATA|Alt)*> <!-- Keyword -->[104X1033[4X<!ELEMENT K (#PCDATA|Alt)*> <!-- Keyword (shortcut) -->[104X1034[4X[32X[104X10351036[33X[0;0YThis element is used to mark something as a [13Xkeyword[113X. Usually this will be a1037[5XGAP[105X keyword such as [21X[9Xif[109X[121X or [21X[9Xfor[109X[121X. No further markup elements are allowed within1038this element except for the [10XAlt[110X element, which is necessary.[133X103910401041[1X3.7-4 [33X[0;0Y[10X<Arg>[110X[101X[1X and [10X<A>[110X[101X[1X[133X[101X10421043[4X[32X From gapdoc.dtd [32X[104X1044[4X<!ELEMENT Arg (#PCDATA|Alt)*> <!-- Argument -->[104X1045[4X<!ELEMENT A (#PCDATA|Alt)*> <!-- Argument (shortcut) -->[104X1046[4X[32X[104X10471048[33X[0;0YThis element is used inside [10XDescription[110Xs in [10XManSection[110Xs to mark something as1049an [13Xargument[113X (of a function, operation, or such). It is guaranteed that the1050converters typeset those exactly as in the definition of functions. No1051further markup elements are allowed within this element.[133X105210531054[1X3.7-5 [33X[0;0Y[10X<Code>[110X[101X[1X and [10X<C>[110X[101X[1X[133X[101X10551056[4X[32X From gapdoc.dtd [32X[104X1057[4X<!ELEMENT Code (#PCDATA|Arg|Alt)*> <!-- GAP code -->[104X1058[4X<!ELEMENT C (#PCDATA|Arg|Alt)*> <!-- GAP code (shortcut) -->[104X1059[4X[32X[104X10601061[33X[0;0YThis element is used to mark something as a piece of [13Xcode[113X like for example a1062[5XGAP[105X expression. It is guaranteed that the converters typeset this exactly as1063in the [10XListing[110X element (compare section [14X3.7-9[114X). The only further markup1064elements allowed within this element are [10X<Arg>[110X elements (see [14X3.7-4[114X).[133X106510661067[1X3.7-6 [33X[0;0Y[10X<File>[110X[101X[1X and [10X<F>[110X[101X[1X[133X[101X10681069[4X[32X From gapdoc.dtd [32X[104X1070[4X<!ELEMENT File (#PCDATA|Alt)*> <!-- Filename -->[104X1071[4X<!ELEMENT F (#PCDATA|Alt)*> <!-- Filename (shortcut) -->[104X1072[4X[32X[104X10731074[33X[0;0YThis element is used to mark something as a [13Xfilename[113X or a [13Xpathname[113X in the1075file system. No further markup elements are allowed within this element.[133X107610771078[1X3.7-7 [33X[0;0Y[10X<Button>[110X[101X[1X and [10X<B>[110X[101X[1X[133X[101X10791080[4X[32X From gapdoc.dtd [32X[104X1081[4X<!ELEMENT Button (#PCDATA|Alt)*> <!-- "Button" (also Menu, Key, ...) -->[104X1082[4X<!ELEMENT B (#PCDATA|Alt)*> <!-- "Button" (shortcut) -->[104X1083[4X[32X[104X10841085[33X[0;0YThis element is used to mark something as a [13Xbutton[113X. It can also be used for1086other items in a graphical user interface like [13Xmenus[113X, [13Xmenu entries[113X, or [13Xkeys[113X.1087No further markup elements are allowed within this element.[133X108810891090[1X3.7-8 [33X[0;0Y[10X<Package>[110X[101X[1X[133X[101X10911092[4X[32X From gapdoc.dtd [32X[104X1093[4X<!ELEMENT Package (#PCDATA|Alt)*> <!-- A package name -->[104X1094[4X[32X[104X10951096[33X[0;0YThis element is used to mark something as a name of a [13Xpackage[113X. This is for1097example used to define the entities [5XGAP[105X, [5XXGAP[105X or [5XGAPDoc[105X (see section [14X2.2-3[114X).1098No further markup elements are allowed within this element.[133X109911001101[1X3.7-9 [33X[0;0Y[10X<Listing>[110X[101X[1X[133X[101X11021103[4X[32X From gapdoc.dtd [32X[104X1104[4X<!ELEMENT Listing (#PCDATA)> <!-- This is just for GAP code listings -->[104X1105[4X<!ATTLIST Listing Type CDATA #IMPLIED> <!-- a comment about the type of[104X1106[4X listed code, may appear in[104X1107[4X output -->[104X1108[4X[32X[104X11091110[33X[0;0YThis element is used to embed listings of programs into the document. Only1111character data and no other elements are allowed in the content. You should1112[13Xnot[113X use the character entities described in section [14X2.2-3[114X but instead type1113the characters directly. Only the general XML rules from section [14X2.1[114X apply.1114Note especially the usage of [10X<![CDATA[[110X sections described there. It is1115guaranteed that all converters use a fixed width font for typesetting1116[10XListing[110X elements. Compare also the usage of the [10XCode[110X and [10XC[110X elements in1117[14X3.7-5[114X.[133X11181119[33X[0;0YThe [10XType[110X attribute contains a comment about the type of listed code. It may1120appear in the output.[133X112111221123[1X3.7-10 [33X[0;0Y[10X<Log>[110X[101X[1X and [10X<Example>[110X[101X[1X[133X[101X11241125[4X[32X From gapdoc.dtd [32X[104X1126[4X<!ELEMENT Example (#PCDATA)> <!-- This is subject to the automatic [104X1127[4X example checking mechanism -->[104X1128[4X<!ELEMENT Log (#PCDATA)> <!-- This not -->[104X1129[4X[32X[104X11301131[33X[0;0YThese two elements behave exactly like the [10XListing[110X element (see [14X3.7-9[114X). They1132are thought for protocols of [5XGAP[105X sessions. The only difference between the1133two is that [10XExample[110X sections are intended to be subject to an automatic1134manual checking mechanism used to ensure the correctness of the [5XGAP[105X manual1135whereas [10XLog[110X is not touched by this (see section [14X5.4[114X for checking tools).[133X11361137[33X[0;0YTo get a good layout of the examples for display in a standard terminal we1138suggest to use [10XSizeScreen([72]);[110X (see [2XSizeScreen[102X ([14XReference: SizeScreen[114X)) in1139your [5XGAP[105X session before producing the content of [10XExample[110X elements.[133X114011411142[1X3.7-11 [33X[0;0Y[10X<Verb>[110X[101X[1X[133X[101X11431144[33X[0;0YThere is one further type of verbatim-like element.[133X11451146[4X[32X From gapdoc.dtd [32X[104X1147[4X<!ELEMENT Verb (#PCDATA)> [104X1148[4X[32X[104X11491150[33X[0;0YThe content of such an element is guaranteed to be put into an output1151version exactly as it is using some fixed width font. Before the content a1152new line is started. If the line after the end of the start tag consists of1153whitespace only then this part of the content is skipped.[133X11541155[33X[0;0YThis element is intended to be used together with the [10XAlt[110X element to specify1156pre-formatted ASCII alternatives for complicated [10XDisplay[110X formulae or [10XTable[110Xs.[133X115711581159[1X3.8 [33X[0;0YElements for Mathematical Formulae[133X[101X116011611162[1X3.8-1 [33X[0;0Y[10X<Math>[110X[101X[1X and [10X<Display>[110X[101X[1X[133X[101X11631164[4X[32X From gapdoc.dtd [32X[104X1165[4X<!-- Normal TeX math mode formula -->[104X1166[4X<!ELEMENT Math (#PCDATA|A|Arg|Alt)*> [104X1167[4X<!-- TeX displayed math mode formula -->[104X1168[4X<!ELEMENT Display (#PCDATA|A|Arg|Alt)*>[104X1169[4X<!-- Mode="M" causes <M>-style formatting -->[104X1170[4X<!ATTLIST Display Mode CDATA #IMPLIED>[104X1171[4X[32X[104X11721173[33X[0;0YThese elements are used for mathematical formulae. As described in section1174[14X2.2-2[114X they correspond to LaTeX's math and display math mode respectively.[133X11751176[33X[0;0YThe formulae are typed in as in LaTeX, [13Xexcept[113X that the standard XML1177entities, see [14X2.1-9[114X (in particular the characters [10X<[110X and [10X&[110X), must be escaped1178- either by using the corresponding entities or by enclosing the formula1179between [21X[10X<![CDATA[[110X[121X and [21X[10X]]>[110X[121X. (The main reference for LaTeX is [Lam85].)[133X11801181[33X[0;0YIt is also possible to use some unicode characters for mathematical symbols1182directly, provided that it can be translated by [2XEncode[102X ([14X6.2-2[114X) into [10X"LaTeX"[110X1183encoding and that [2XSimplifiedUnicodeString[102X ([14X6.2-2[114X) with arguments [10X"latin1"[110X1184and [10X"single"[110X returns something sensible. Currently, we support entities1185[10X&CC;[110X, [10X&ZZ;[110X, [10X&NN;[110X, [10X&PP;[110X, [10X&QQ;[110X, [10X&HH;[110X, [10X&RR;[110X for the corresponding black board1186bold letters ℂ, ℤ, ℕ, ℙ, ℚ, ℍ and ℝ, respectively.[133X11871188[33X[0;0YThe only element type that is allowed within the formula elements is the [10XArg[110X1189or [10XA[110X element (see [14X3.7-4[114X), which is used to typeset identifiers that are1190arguments to [5XGAP[105X functions or operations.[133X11911192[33X[0;0YIf a [10XDisplay[110X element has an attribute [10XMode[110X with value [10X"M"[110X, then the formula1193is formatted as in [10XM[110X elements (see [14X3.8-2[114X). Otherwise in text and HTML output1194the formula is shown as LaTeX source code.[133X11951196[33X[0;0YFor simple formulae (and you should try to make all your formulae simple!)1197attempt to use the [10XM[110X element or the [10XMode="M"[110X attribute in [10XDisplay[110X for which1198there is a well defined translation into text, which can be used for text1199and HTML output versions of the document. So, if possible try to avoid the1200[10XMath[110X elements and [10XDisplay[110X elements without attribute or provide useful text1201substitutes for complicated formulae via [10XAlt[110X elements (see [14X3.9-1[114X1202and [14X3.7-11[114X).[133X120312041205[1X3.8-2 [33X[0;0Y[10X<M>[110X[101X[1X[133X[101X12061207[4X[32X From gapdoc.dtd [32X[104X1208[4X<!-- Math with well defined translation to text output -->[104X1209[4X<!ELEMENT M (#PCDATA|A|Arg|Alt)*>[104X1210[4X[32X[104X12111212[33X[0;0YThe [21X[10XM[110X[121X element type is intended for formulae in the running text for which1213there is a sensible text version. For the LaTeX version of a [5XGAPDoc[105X document1214the [10XM[110X and [10XMath[110X elements are equivalent. The remarks in [14X3.8-1[114X about special1215characters and the [10XArg[110X element apply here as well. A document which has all1216formulae enclosed in [10XM[110X elements can be well readable in text terminal output1217and printed output versions.[133X12181219[33X[0;0YCompared to former versions of [5XGAPDoc[105X many more formulae can be put into [10XM[110X1220elements. Most modern terminal emulations support unicode characters and1221many mathematical symbols can now be represented by such characters. But1222even if a terminal can only display ASCII characters, the user will see some1223not too bad representation of a formula.[133X12241225[33X[0;0YAs examples, here are some LaTeX macros which have a sensible ASCII1226translation and are guaranteed to be translated accordingly by text (and1227HTML) converters (for a full list of handled Macros see1228[10XRecNames(TEXTMTRANSLATIONS)[110X):[133X12291230┌──────────────────────────┬─────┐1231│ \ast │ [10X*[110X │1232├──────────────────────────┼─────┤1233│ \bf │ [10X[110X │1234├──────────────────────────┼─────┤1235│ \bmod │ [10Xmod[110X │1236├──────────────────────────┼─────┤1237│ \cdot │ [10X*[110X │1238├──────────────────────────┼─────┤1239│ \colon │ [10X:[110X │1240├──────────────────────────┼─────┤1241│ \equiv │ [10X=[110X │1242├──────────────────────────┼─────┤1243│ \geq │ [10X>=[110X │1244├──────────────────────────┼─────┤1245│ \germ │ [10X[110X │1246├──────────────────────────┼─────┤1247│ \hookrightarrow │ [10X->[110X │1248├──────────────────────────┼─────┤1249│ \iff │ [10X<=>[110X │1250├──────────────────────────┼─────┤1251│ \langle │ [10X<[110X │1252├──────────────────────────┼─────┤1253│ \ldots │ [10X...[110X │1254├──────────────────────────┼─────┤1255│ \left │ [10X [110X │1256├──────────────────────────┼─────┤1257│ \leq │ [10X<=[110X │1258├──────────────────────────┼─────┤1259│ \leftarrow │ [10X<-[110X │1260├──────────────────────────┼─────┤1261│ \Leftarrow │ [10X<=[110X │1262├──────────────────────────┼─────┤1263│ \limits │ [10X [110X │1264├──────────────────────────┼─────┤1265│ \longrightarrow │ [10X-->[110X │1266├──────────────────────────┼─────┤1267│ \Longrightarrow │ [10X==>[110X │1268├──────────────────────────┼─────┤1269│ \mapsto │ [10X->[110X │1270├──────────────────────────┼─────┤1271│ \mathbb │ [10X [110X │1272├──────────────────────────┼─────┤1273│ \mathop │ [10X [110X │1274├──────────────────────────┼─────┤1275│ \mid │ [10X|[110X │1276├──────────────────────────┼─────┤1277│ \pmod │ [10Xmod[110X │1278├──────────────────────────┼─────┤1279│ \prime │ [10X'[110X │1280├──────────────────────────┼─────┤1281│ \rangle │ [10X>[110X │1282├──────────────────────────┼─────┤1283│ \right │ [10X [110X │1284├──────────────────────────┼─────┤1285│ \rightarrow │ [10X->[110X │1286├──────────────────────────┼─────┤1287│ \Rightarrow │ [10X=>[110X │1288├──────────────────────────┼─────┤1289│ \rm, \sf, \textrm, \text │ [10X[110X │1290├──────────────────────────┼─────┤1291│ \setminus │ [10X\[110X │1292├──────────────────────────┼─────┤1293│ \thinspace │ [10X [110X │1294├──────────────────────────┼─────┤1295│ \times │ [10Xx[110X │1296├──────────────────────────┼─────┤1297│ \to │ [10X->[110X │1298├──────────────────────────┼─────┤1299│ \vert │ [10X|[110X │1300├──────────────────────────┼─────┤1301│ \! │ [10X[110X │1302├──────────────────────────┼─────┤1303│ \, │ [10X[110X │1304├──────────────────────────┼─────┤1305│ \; │ [10X [110X │1306├──────────────────────────┼─────┤1307│ \{ │ [10X{[110X │1308├──────────────────────────┼─────┤1309│ \} │ [10X}[110X │1310└──────────────────────────┴─────┘13111312[1XTable:[101X LaTeX macros with special text translation131313141315[33X[0;0YIn all other macros only the backslash is removed (except for some macros1316describing more exotic symbols). Whitespace is normalized (to one blank) but1317not removed. Note that whitespace is not added, so you may want to add a few1318more spaces than you usually do in your LaTeX documents.[133X13191320[33X[0;0YBraces [10X{}[110X are removed in general, however pairs of double braces are1321converted to one pair of braces. This can be used to write [10X<M>x^{12}</M>[110X for1322[10Xx^12[110X and [10X<M>x_{{i+1}}</M>[110X for [10Xx_{i+1}[110X.[133X132313241325[1X3.9 [33X[0;0YEverything else[133X[101X132613271328[1X3.9-1 [33X[0;0Y[10X<Alt>[110X[101X[1X[133X[101X13291330[33X[0;0YThis element is used to specify alternatives for different output formats1331within normal text. See also sections [14X3.6-1[114X, [14X3.6-4[114X, and [14X3.6-5[114X for1332alternatives in lists and tables.[133X13331334[4X[32X From gapdoc.dtd [32X[104X1335[4X<!ELEMENT Alt (%InnerText;)*> <!-- This is only to allow "Only" and[104X1336[4X "Not" attributes for normal text -->[104X1337[4X<!ATTLIST Alt Only CDATA #IMPLIED[104X1338[4X Not CDATA #IMPLIED>[104X1339[4X[32X[104X13401341[33X[0;0YOf course exactly one of the two attributes must occur in one element. The1342attribute values must be one word or a list of words, separated by spaces or1343commas. The words which are currently recognized by the converter programs1344contained in [5XGAPDoc[105X are: [21X[10XLaTeX[110X[121X, [21X[10XHTML[110X[121X, and [21X[10XText[110X[121X. If the [10XOnly[110X attribute is1345specified then only the corresponding converter will include the content of1346the element into the output document. If the [10XNot[110X attribute is specified the1347corresponding converter will ignore the content of the element. You can use1348other words to specify special alternatives for other converters of [5XGAPDoc[105X1349documents.[133X13501351[33X[0;0YIn the case of [21X[10XHTML[110X[121X there is a second word which is recognized and this can1352either be [21X[10XMathJax[110X[121X or [21X[10XnoMathJax[110X[121X. For example a pair of [10XAlt[110X elements with [10X<Alt1353Only="HTML noMathJax">...[110X and [10X<Alt Not="HTML noMathJax">...[110X could provide1354special content for the case of HTML output without use of [5XMathJax[105X and every1355other output.[133X13561357[33X[0;0YWe fix a rule for handling the content of an [10XAlt[110X element with [10XOnly[110X1358attribute. In their content code for the corresponding output format is1359included directly. So, in case of HTML the content is HTML code, in case of1360LaTeX the content is LaTeX code. The converters don't apply any handling of1361special characters to this content. In the case of LaTeX the formatting of1362the code is not changed.[133X13631364[33X[0;0YWithin the element only [10X%InnerText;[110X (see [14X3.2-3[114X) is allowed. This is to1365ensure that the same set of chapters, sections, and subsections show up in1366all output formats.[133X136713681369[1X3.9-2 [33X[0;0Y[10X<Par>[110X[101X[1X and [10X<P>[110X[101X[1X[133X[101X13701371[4X[32X From gapdoc.dtd [32X[104X1372[4X<!ELEMENT Par EMPTY> <!-- this is intentionally empty! -->[104X1373[4X<!ELEMENT P EMPTY> <!-- the same as shortcut -->[104X1374[4X[32X[104X13751376[33X[0;0YThis [10XEMPTY[110X element marks the boundary of paragraphs. Note that an empty line1377in the input does not mark a new paragraph as opposed to the LaTeX1378convention.[133X13791380[33X[0;0Y(Remark: it would be much easier to parse a document and to understand its1381sectioning and paragraph structure when there was an element whose [13Xcontent[113X1382is the text of a paragraph. But in practice many paragraph boundaries are1383implicitly clear which would make it somewhat painful to enclose each1384paragraph in extra tags. The introduction of the [10XP[110X or [10XPar[110X elements as above1385delegates this pain to the writer of a conversion program for [5XGAPDoc[105X1386documents.)[133X138713881389[1X3.9-3 [33X[0;0Y[10X<Br>[110X[101X[1X[133X[101X13901391[4X[32X From gapdoc.dtd [32X[104X1392[4X<!ELEMENT Br EMPTY> <!-- a forced line break -->[104X1393[4X[32X[104X13941395[33X[0;0YThis element can be used to force a line break in the output versions of a1396[5XGAPDoc[105X element, it does not start a new paragraph. Please, do not use this1397instead of a [10XPar[110X element, this would often lead to ugly output versions of1398your document.[133X139914001401[1X3.9-4 [33X[0;0Y[10X<Ignore>[110X[101X[1X[133X[101X14021403[4X[32X From gapdoc.dtd [32X[104X1404[4X<!ELEMENT Ignore (%Text;| Chapter | Section | Subsection | ManSection |[104X1405[4X Heading)*>[104X1406[4X<!ATTLIST Ignore Remark CDATA #IMPLIED>[104X1407[4X[32X[104X14081409[33X[0;0YThis element can appear anywhere. Its content is ignored by the standard1410converters. It can be used, for example, to include data which are not part1411of the actual [5XGAPDoc[105X document, like source code, or to make not finished1412parts of the document invisible.[133X14131414[33X[0;0YOf course, one can use special converter programs which extract the contents1415of [10XIgnore[110X elements. Information on the type of the content can be stored in1416the optional attribute [10XRemark[110X.[133X1417141814191420