Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5e1854624d3bc613bdd0dd13d1ef9ac7 > files > 352

gap-system-4.4.12-5mdv2010.0.i586.rpm

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (GAPDoc) - Chapter 3: The Document Type Definition</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
</head>
<body>


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chapA.html">A</a>  <a href="chapB.html">B</a>  <a href="chapC.html">C</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">Top of Book</a>&nbsp;  &nbsp;<a href="chap2.html">Previous Chapter</a>&nbsp;  &nbsp;<a href="chap4.html">Next Chapter</a>&nbsp;  </div>

<p><a id="X7859CFF180D52D49" name="X7859CFF180D52D49"></a></p>
<div class="ChapSects"><a href="chap3.html#X7859CFF180D52D49">3 <span class="Heading">The Document Type Definition</span></a>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X7B76F6F786521F6B">3.1 <span class="Heading">What is a DTD?</span></a>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X7DB0F9E57879CC76">3.2 <span class="Heading">Overall Document Structure</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C7258A57B831934">3.2-1 <span class="Heading"><code class="code">&lt;Book&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X842B421A7FBCDD2C">3.2-2 <span class="Heading"><code class="code">&lt;TitlePage&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7BCC8E6F79021294">3.2-3 <span class="Heading"><code class="code">&lt;Title&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X82E82AF48217CC14">3.2-4 <span class="Heading"><code class="code">&lt;Subtitle&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X876962807DCC52B3">3.2-5 <span class="Heading"><code class="code">&lt;Version&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X87E7CD5B79230B90">3.2-6 <span class="Heading"><code class="code">&lt;TitleComment&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8731459C7E4C56DA">3.2-7 <span class="Heading"><code class="code">&lt;Author&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8264A69D7DCDD773">3.2-8 <span class="Heading"><code class="code">&lt;Date&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7EEF65A07A094F65">3.2-9 <span class="Heading"><code class="code">&lt;Address&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X833110FE79628313">3.2-10 <span class="Heading"><code class="code">&lt;Abstract&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X84BBD8307E08E62F">3.2-11 <span class="Heading"><code class="code">&lt;Copyright&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8143972D7C17838E">3.2-12 <span class="Heading"><code class="code">&lt;Acknowledgements&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C09A3398059D18C">3.2-13 <span class="Heading"><code class="code">&lt;Colophon&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7E97263A83DC26E9">3.2-14 <span class="Heading"><code class="code">&lt;TableOfContents&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X84F3DF21786A8751">3.2-15 <span class="Heading"><code class="code">&lt;Bibliography&gt;</code>
</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C53615A8477F1E5">3.2-16 <span class="Heading"><code class="code">&lt;TheIndex&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X80E2AD7481DD69D9">3.3 <span class="Heading">Sectioning Elements</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7B38415687510D0A">3.3-1 <span class="Heading"><code class="code">&lt;Body&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7A86B2BA7D688B6B">3.3-2 <span class="Heading"><code class="code">&lt;Chapter&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X79825E1C821D0B79">3.3-3 <span class="Heading"><code class="code">&lt;Heading&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C701B2779767556">3.3-4 <span class="Heading"><code class="code">&lt;Appendix&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X844DC2B47FB37339">3.3-5 <span class="Heading"><code class="code">&lt;Section&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X803ACA187E292969">3.3-6 <span class="Heading"><code class="code">&lt;Subsection&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X877B8B7C7EDD09E9">3.4 <span class="Heading">ManSection–a special kind of subsection</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8375D9CC8672A1D5">3.4-1 <span class="Heading"><code class="code">&lt;ManSection&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C41A7B5845205C4">3.4-2 <span class="Heading"><code class="code">&lt;Func&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7A15825E818A81CD">3.4-3 <span class="Heading"><code class="code">&lt;Oper&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X81196E2B7F286A01">3.4-4 <span class="Heading"><code class="code">&lt;Meth&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7D8D2C38828D5854">3.4-5 <span class="Heading"><code class="code">&lt;Filt&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7D6400A67C30B752">3.4-6 <span class="Heading"><code class="code">&lt;Prop&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X78CEEC5986987A97">3.4-7 <span class="Heading"><code class="code">&lt;Attr&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C3AACBE7BC6AABF">3.4-8 <span class="Heading"><code class="code">&lt;Var&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X85EE992E7FED2FE6">3.4-9 <span class="Heading"><code class="code">&lt;Fam&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X78F0D4D1811E5BAE">3.4-10 <span class="Heading"><code class="code">&lt;InfoClass&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X78595FB585569617">3.5 <span class="Heading">Cross Referencing and Citations</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8656F2338007406E">3.5-1 <span class="Heading"><code class="code">&lt;Ref&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7C85CA5484344DB5">3.5-2 <span class="Heading"><code class="code">&lt;Label&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X851DE9D279D8FB04">3.5-3 <span class="Heading"><code class="code">&lt;Cite&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X811042BA78843777">3.5-4 <span class="Heading"><code class="code">&lt;Index&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X81B3E46F839E1C5B">3.5-5 <span class="Heading"><code class="code">&lt;URL&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8310C4F084CD9DB9">3.5-6 <span class="Heading"><code class="code">&lt;Email&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7D5CC4267D04D7E7">3.5-7 <span class="Heading"><code class="code">&lt;Homepage&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X840099DF83823686">3.6 <span class="Heading">Structural Elements like Lists</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X785183F67DA402A0">3.6-1 <span class="Heading"><code class="code">&lt;List&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7B1545A9797442DC">3.6-2 <span class="Heading"><code class="code">&lt;Mark&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X86C204987AB4B13D">3.6-3 <span class="Heading"><code class="code">&lt;Item&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X78A52B00846562DE">3.6-4 <span class="Heading"><code class="code">&lt;Enum&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7F9CAA577EB4070B">3.6-5 <span class="Heading"><code class="code">&lt;Table&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X7CA1E1327AFBA578">3.7 <span class="Heading">Types of Text</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7B15C428861749FD">3.7-1 <span class="Heading"><code class="code">&lt;Emph&gt;</code> and <code class="code">&lt;E&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X80028C2483C9467E">3.7-2 <span class="Heading"><code class="code">&lt;Quoted&gt;</code> and <code class="code">&lt;Q&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X867BB95E7DC87014">3.7-3 <span class="Heading"><code class="code">&lt;Keyword&gt;</code> and <code class="code">&lt;K&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X86FD4CCA7F98351F">3.7-4 <span class="Heading"><code class="code">&lt;Arg&gt;</code> and 
                                 <code class="code">&lt;A&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X8400998B7B3A4379">3.7-5 <span class="Heading"><code class="code">&lt;Code&gt;</code> and 
                                  <code class="code">&lt;C&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X875AF9B4812C5249">3.7-6 <span class="Heading"><code class="code">&lt;File&gt;</code> and <code class="code">&lt;F&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7929BA7D78A977FF">3.7-7 <span class="Heading"><code class="code">&lt;Button&gt;</code> and <code class="code">&lt;B&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7F4FFA877B775188">3.7-8 <span class="Heading"><code class="code">&lt;Package&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7F531B157D656836">3.7-9 <span class="Heading"><code class="code">&lt;Listing&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X810DEA1E83A57CFE">3.7-10 <span class="Heading"><code class="code">&lt;Log&gt;</code> and
                                 <code class="code">&lt;Example&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7F8C4D018346B2CF">3.7-11 <span class="Heading"><code class="code">&lt;Verb&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X8145F6B37C04AA0A">3.8 <span class="Heading">Elements for Mathematical Formulae</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7AA02845868AA533">3.8-1 <span class="Heading"><code class="code">&lt;Math&gt;</code> 
                              and <code class="code">&lt;Display&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7ABF42328467E966">3.8-2 <span class="Heading"><code class="code">&lt;M&gt;</code></span></a>
</span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap3.html#X7A0D26B180BEDE37">3.9 <span class="Heading">Everything else</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X850E69017945AE3E">3.9-1 <span class="Heading"><code class="code">&lt;Alt&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X85D23A648444069F">3.9-2 <span class="Heading"><code class="code">&lt;Par&gt;</code> and 
                                 <code class="code">&lt;P&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7A3EF0647B10C1EC">3.9-3 <span class="Heading"><code class="code">&lt;Br&gt;</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap3.html#X7A81FB717A30B485">3.9-4 <span class="Heading"><code class="code">&lt;Ignore&gt;</code></span></a>
</span>
</div>
</div>

<h3>3 <span class="Heading">The Document Type Definition</span></h3>

<p>In this chapter we first explain what a "document type definition" is and then describe <code class="file">gapdoc.dtd</code> in detail. That file together with the current chapter define how a <strong class="pkg">GAPDoc</strong> document has to look like. It can be found in the main directory of the <strong class="pkg">GAPDoc</strong> package and it is reproduced in Appendix <a href="chapB.html#X85366C6480D58C51"><b>B</b></a>.</p>

<p>We do not give many examples in this chapter which is more intended as a formal reference for all <strong class="pkg">GAPDoc</strong> elements. Instead we provide an extra document with book name <code class="code">GAPDocExample</code> (also accessible from the <strong class="pkg">GAP</strong> online help). This uses all the constructs introduced in this chapter and you can easily compare the source code and how it looks like in the different output formats. Furthermore recall that many basic things about XML markup were already explained by example in the introductory chapter <a href="chap1.html#X7D4EE663818DA109"><b>1</b></a>.</p>

<p><a id="X7B76F6F786521F6B" name="X7B76F6F786521F6B"></a></p>

<h4>3.1 <span class="Heading">What is a DTD?</span></h4>

<p>A document type definition (DTD) is a formal declaration of how an XML document has to be structured. It is itself structured such that programs that handle documents can read it and treat the documents accordingly. There are for example parsers and validity checkers that use the DTD to validate an XML document, see <a href="chap2.html#X8561F07A81CABDD6"><b>2.1-14</b></a>.</p>

<p>The main thing a DTD does is to specify which elements may occur in documents of a certain document type, how they can be nested, and what attributes they can or must have. So, for each element there is a rule.</p>

<p>Note that a DTD can <em>not</em> ensure that a document which is "valid" also makes sense to the converters! It only says something about the formal structure of the document.</p>

<p>For the remaining part of this chapter we have divided the elements of <strong class="pkg">GAPDoc</strong> documents into several subsets, each of which will be discussed in one of the next sections.</p>

<p>See the following three subsections to learn by example, how a DTD works. We do not want to be too formal here, but just enable the reader to understand the declarations in <code class="file">gapdoc.dtd</code>. For precise descriptions of the syntax of DTD's see again the official standard in:</p>

<p>  <span class="URL"><a href="http://www.xml.com/axml/axml.html">http://www.xml.com/axml/axml.html</a></span></p>

<p><a id="X7DB0F9E57879CC76" name="X7DB0F9E57879CC76"></a></p>

<h4>3.2 <span class="Heading">Overall Document Structure</span></h4>

<p>A <strong class="pkg">GAPDoc</strong> document contains on its top level exactly one element with name <code class="code">Book</code>. This element is declared in the DTD as follows:</p>

<p><a id="X7C7258A57B831934" name="X7C7258A57B831934"></a></p>

<h5>3.2-1 <span class="Heading"><code class="code">&lt;Book&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Book (TitlePage,
                TableOfContents?,
                Body,
                Appendix*,
                Bibliography?,
                TheIndex?)&gt;
&lt;!ATTLIST Book Name CDATA #REQUIRED&gt;
</pre></td></tr></table>

<p>After the keyword <code class="code">ELEMENT</code> and the name <code class="code">Book</code> there is a list in parentheses. This is a comma separated list of names of elements which can occur (in the given order) in the content of a <code class="code">Book</code> element. Each name in such a list can be followed by one of the characters "<code class="code">?</code>", "<code class="code">*</code>" or "<code class="code">+</code>", meaning that the corresponding element can occur zero or one time, an arbitrary number of times, or at least once, respectively. Without such an extra character the corresponding element must occur exactly once. Instead of one name in this list there can also be a list of elements names separated by "<code class="code">|</code>" characters, this denotes any element with one of the names (i.e., "<code class="code">|</code>" means "or").</p>

<p>So, the <code class="code">Book</code> element must contain first a <code class="code">TitlePage</code> element, then an optional <code class="code">TableOfContents</code> element, then a <code class="code">Body</code> element, then zero or more elements of type <code class="code">Appendix</code>, then an optional <code class="code">Bibliography</code> element, and finally an optional element of type <code class="code">TheIndex</code>.</p>

<p>Note that <em>only</em> these elements are allowed in the content of the <code class="code">Book</code> element. No other elements or text is allowed in between. An exception of this is that there may be whitespace between the end tag of one and the start tag of the next element - this should be ignored when the document is processed to some output format. An element like this is called an element with "element content".</p>

<p>The second declaration starts with the keyword <code class="code">ATTLIST</code> and the element name <code class="code">Book</code>. After that there is a triple of whitespace separated parameters (in general an arbitrary number of such triples, one for each allowed attribute name). The first (<code class="code">Name</code>) is the name of an attribute for a <code class="code">Book</code> element. The second (<code class="code">CDATA</code>) is always the same for all of our declarations, it means that the value of the attribute consists of "character data". The third parameter <code class="code">#REQUIRED</code> means that this attribute must be specified with any <code class="code">Book</code> element. Later we will also see optional attributes which are declared as <code class="code">#IMPLIED</code>.</p>

<p><a id="X842B421A7FBCDD2C" name="X842B421A7FBCDD2C"></a></p>

<h5>3.2-2 <span class="Heading"><code class="code">&lt;TitlePage&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT TitlePage (Title, Subtitle?, Version?, TitleComment?, 
                     Author+, Date?, Address?, Abstract?, Copyright?, 
                     Acknowledgements? , Colophon? )&gt;
</pre></td></tr></table>

<p>Within this element information for the title page is collected. Note that more than one author can be specified. The elements must appear in this order because there is no sensible way to specify in a DTD something like "the following elements may occur in any order but each exactly once".</p>

<p>Before going on with the other elements inside the <code class="code">Book</code> element we explain the elements for the title page.</p>

<p><a id="X7BCC8E6F79021294" name="X7BCC8E6F79021294"></a></p>

<h5>3.2-3 <span class="Heading"><code class="code">&lt;Title&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Title (%Text;)*&gt;
</pre></td></tr></table>

<p>Here is the last construct you need to understand for reading <code class="file">gapdoc.dtd</code>. The expression "<code class="code">%Text;</code>" is a so-called "parameter entity". It is something like a macro within the DTD. It is defined as follows:</p>


<table class="example">
<tr><td><pre>
&lt;!ENTITY % Text "%InnerText; | List | Enum | Table"&gt;
</pre></td></tr></table>

<p>This means, that every occurrence of "<code class="code">%Text;</code>" in the DTD is replaced by the expression</p>


<table class="example">
<tr><td><pre>%InnerText; | List | Enum | Table
</pre></td></tr></table>

<p>which is then expanded further because of the following definition:</p>


<table class="example">
<tr><td><pre>
&lt;!ENTITY % InnerText "#PCDATA |
                      Alt |
                      Emph | E |
                      Par | P | Br |
                      Keyword | K | Arg | A | Quoted | Q | Code | C | 
                      File | F | Button | B | Package |
                      M | Math | Display | 
                      Example | Listing | Log | Verb |
                      URL | Email | Homepage | Address | Cite | Label | 
                      Ref | Index" &gt; 
</pre></td></tr></table>

<p>These are the only two parameter entities we are using. They expand to lists of element names which are explained in the sequel <em>and</em> the keyword <code class="code">#PCDATA</code> (concatenated with the "or" character "<code class="code">|</code>").</p>

<p>So, the element (<code class="code">Title</code>) is of so-called "mixed content": It can contain <em>parsed character data</em> which does not contain further markup (<code class="code">#PCDATA</code>) or any of the other above mentioned elements. Mixed content must always have the asterisk qualifier (like in <code class="code">Title</code>) such that any sequence of elements (of the above list) and character data can be contained in a <code class="code">Title</code> element.</p>

<p>The <code class="code">%Text;</code> parameter entity is used in all places in the DTD, where "normal text" should be allowed, including lists, enumerations, and tables, but <em>no</em> sectioning elements.</p>

<p>The <code class="code">%InnerText;</code> parameter entity is used in all places in the DTD, where "inner text" should be allowed. This means, that no structures like lists, enumerations, and tables are allowed. This is used for example in headings.</p>

<p><a id="X82E82AF48217CC14" name="X82E82AF48217CC14"></a></p>

<h5>3.2-4 <span class="Heading"><code class="code">&lt;Subtitle&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Subtitle (%Text;)*&gt;
</pre></td></tr></table>

<p>Contains the subtitle of the document.</p>

<p><a id="X876962807DCC52B3" name="X876962807DCC52B3"></a></p>

<h5>3.2-5 <span class="Heading"><code class="code">&lt;Version&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Version (#PCDATA|Alt)*&gt;
</pre></td></tr></table>

<p>Note that the version can only contain character data and no further markup elements (except for <code class="code">Alt</code>, which is necessary to resolve the entities described in <a href="chap2.html#X7BDFF6D37FBED400"><b>2.2-3</b></a>). The converters will <em>not</em> put the word "Version" in front of the text in this element.</p>

<p><a id="X87E7CD5B79230B90" name="X87E7CD5B79230B90"></a></p>

<h5>3.2-6 <span class="Heading"><code class="code">&lt;TitleComment&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT TitleComment (%Text;)*&gt;
</pre></td></tr></table>

<p>Sometimes a title and subtitle are not sufficient to give a rough idea about the content of a package. In this case use this optional element to specify an additional text for the front page of the book. This text should be short, use the <code class="code">Abstract</code> element (see <a href="chap3.html#X833110FE79628313"><b>3.2-10</b></a>) for longer explanations.</p>

<p><a id="X8731459C7E4C56DA" name="X8731459C7E4C56DA"></a></p>

<h5>3.2-7 <span class="Heading"><code class="code">&lt;Author&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Author (%Text;)*&gt;    &lt;!-- There may be more than one Author! --&gt;
</pre></td></tr></table>

<p>As noted in the comment there may be more than one element of this type. This element should contain the name of an author and probably an <code class="code">Email</code>-address and/or WWW-<code class="code">Homepage</code> element for this author, see <a href="chap3.html#X8310C4F084CD9DB9"><b>3.5-6</b></a> and <a href="chap3.html#X7D5CC4267D04D7E7"><b>3.5-7</b></a>. You can also specify an individual postal address here, instead of using the <code class="code">Address</code> element described below, see <a href="chap3.html#X7EEF65A07A094F65"><b>3.2-9</b></a>.</p>

<p><a id="X8264A69D7DCDD773" name="X8264A69D7DCDD773"></a></p>

<h5>3.2-8 <span class="Heading"><code class="code">&lt;Date&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Date (#PCDATA)&gt;
</pre></td></tr></table>

<p>Only character data is allowed in this element which gives a date for the document. No automatic formatting is done.</p>

<p><a id="X7EEF65A07A094F65" name="X7EEF65A07A094F65"></a></p>

<h5>3.2-9 <span class="Heading"><code class="code">&lt;Address&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Address (#PCDATA|Alt|Br)*&gt;
</pre></td></tr></table>

<p>This optional element can be used to specify a postal address of the author or the authors. If there are several authors with different addresses then put the <code class="code">Address</code> elements inside the <code class="code">Author</code> elements.</p>

<p>Use the <code class="code">Br</code> element (see <a href="chap3.html#X7A3EF0647B10C1EC"><b>3.9-3</b></a>) to mark the line breaks in the usual formatting of the address on a letter.</p>

<p>Note that often it is not necessary to use this element because a postal address is easy to find via a link to a personal web page.</p>

<p><a id="X833110FE79628313" name="X833110FE79628313"></a></p>

<h5>3.2-10 <span class="Heading"><code class="code">&lt;Abstract&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Abstract (%Text;)*&gt;
</pre></td></tr></table>

<p>This element contains an abstract of the whole book.</p>

<p><a id="X84BBD8307E08E62F" name="X84BBD8307E08E62F"></a></p>

<h5>3.2-11 <span class="Heading"><code class="code">&lt;Copyright&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Copyright (%Text;)*&gt;
</pre></td></tr></table>

<p>This element is used for the copyright notice. Note the <code class="code">&amp;copyright;</code> entity as described in section <a href="chap2.html#X7BDFF6D37FBED400"><b>2.2-3</b></a>.</p>

<p><a id="X8143972D7C17838E" name="X8143972D7C17838E"></a></p>

<h5>3.2-12 <span class="Heading"><code class="code">&lt;Acknowledgements&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Acknowledgements (%Text;)*&gt;
</pre></td></tr></table>

<p>This element contains the acknowledgements.</p>

<p><a id="X7C09A3398059D18C" name="X7C09A3398059D18C"></a></p>

<h5>3.2-13 <span class="Heading"><code class="code">&lt;Colophon&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Colophon (%Text;)*&gt;
</pre></td></tr></table>

<p>The "colophon" page is used to say something about the history of a document.</p>

<p><a id="X7E97263A83DC26E9" name="X7E97263A83DC26E9"></a></p>

<h5>3.2-14 <span class="Heading"><code class="code">&lt;TableOfContents&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT TableOfContents EMPTY&gt;
</pre></td></tr></table>

<p>This element may occur in the <code class="code">Book</code> element after the <code class="code">TitlePage</code> element. If it is present, a table of contents is generated and inserted into the document. Note that because this element is declared to be <code class="code">EMPTY</code> one can use the abbreviation</p>


<table class="example">
<tr><td><pre>
&lt;TableOfContents/&gt;
</pre></td></tr></table>

<p>to denote this empty element.</p>

<p><a id="X84F3DF21786A8751" name="X84F3DF21786A8751"></a></p>

<h5>3.2-15 <span class="Heading"><code class="code">&lt;Bibliography&gt;</code>
</span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Bibliography EMPTY&gt;
&lt;!ATTLIST Bibliography Databases CDATA #REQUIRED
                       Style CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element may occur in the <code class="code">Book</code> element after the last <code class="code">Appendix</code> element. If it is present, a bibliography section is generated and inserted into the document. The attribute <code class="code">Databases</code> must be specified, the names of several data files can be specified, separated by commas.</p>

<p>Two kinds of files can be specified in <code class="code">Databases</code>: The first are BibTeX files as defined in <a href="chapBib.html#biBLa85">[Lam85, Appendix B]</a>. Such files must have a name with extension <code class="file">.bib</code>, and in <code class="code">Databases</code> the name must be given <em>without</em> this extension. The second are files in BibXMLext format as defined in Section <a href="chap7.html#X7FB8F6BD80D859D1"><b>7.2</b></a>. These files must have an extension <code class="file">.xml</code> and in <code class="code">Databases</code> the <em>full</em> name must be specified.</p>

<p>We suggest to use the BibXMLext format because it allows to produce potentially nicer bibliography entries in text and HTML documents.</p>

<p>A bibliography style may be specified with the <code class="code">Style</code> attribute. The optional <code class="code">Style</code> attribute (for LaTeX output of the document) must also be specified without the <code class="file">.bst</code> extension (the default is <code class="code">alpha</code>). See also section <a href="chap3.html#X851DE9D279D8FB04"><b>3.5-3</b></a> for a description of the <code class="code">Cite</code> element which is used to include bibliography references into the text.</p>

<p><a id="X7C53615A8477F1E5" name="X7C53615A8477F1E5"></a></p>

<h5>3.2-16 <span class="Heading"><code class="code">&lt;TheIndex&gt;</code></span></h5>


<table class="example">
<tr><td><pre>&lt;!ELEMENT TheIndex EMPTY&gt;</pre></td></tr></table>

<p>This element may occur in the <code class="code">Book</code> element after the <code class="code">Bibliography</code> element. If it is present, an index is generated and inserted into the document. There are elements in <strong class="pkg">GAPDoc</strong> which implicitly generate index entries (e.g., <code class="code">Func</code> (<a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>)) and there is an element <code class="code">Index</code> (<a href="chap3.html#X811042BA78843777"><b>3.5-4</b></a>) for explicitly adding index entries.</p>

<p><a id="X80E2AD7481DD69D9" name="X80E2AD7481DD69D9"></a></p>

<h4>3.3 <span class="Heading">Sectioning Elements</span></h4>

<p>A <strong class="pkg">GAPDoc</strong> book is divided into <em>chapters</em>, <em>sections</em>, and <em>subsections</em>. The idea is of course, that a chapter consists of sections, which in turn consist of subsections. However for the sake of flexibility, the rules are not too restrictive. Firstly, text is allowed everywhere in the body of the document (and not only within sections). Secondly, the chapter level may be omitted. The exact rules are described below.</p>

<p><em>Appendices</em> are a flavor of chapters, occurring after all regular chapters. There is a special type of subsection called "<code class="code">ManSection</code>". This is a subsection devoted to the description of a function, operation or variable. It is analogous to a manpage in the UNIX environment. Usually each function, operation, method, and so on should have its own <code class="code">ManSection</code>.</p>

<p>Cross referencing is done on the level of <code class="code">Subsection</code>s, respectively <code class="code">ManSection</code>s. The topics in <strong class="pkg">GAP</strong>'s online help are also pointing to subsections. So, they should not be too long.</p>

<p>We start our description of the sectioning elements "top-down":</p>

<p><a id="X7B38415687510D0A" name="X7B38415687510D0A"></a></p>

<h5>3.3-1 <span class="Heading"><code class="code">&lt;Body&gt;</code></span></h5>

<p>The <code class="code">Body</code> element marks the main part of the document. It must occur after the <code class="code">TableOfContents</code> element. There is a big difference between <em>inside</em> and <em>outside</em> of this element: Whereas regular text is allowed nearly everywhere in the <code class="code">Body</code> element and its subelements, this is not true for the <em>outside</em>. This has also implications on the handling of whitespace. <em>Outside</em> superfluous whitespace is usually ignored when it occurs between elements. <em>Inside</em> of the <code class="code">Body</code> element whitespace matters because character data is allowed nearly everywhere. Here is the definition in the DTD:</p>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Body  ( %Text;| Chapter | Section )*&gt;
</pre></td></tr></table>

<p>The fact that <code class="code">Chapter</code> and <code class="code">Section</code> elements are allowed here leads to the possibility to omit the chapter level entirely in the document. For a description of <code class="code">%Text;</code> see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>.</p>

<p>(Remark: The purpose of this element is to make sure that a <em>valid</em> <strong class="pkg">GAPDoc</strong> document has a correct overall structure, which is only possible when the top element <code class="code">Book</code> has element content.)</p>

<p><a id="X7A86B2BA7D688B6B" name="X7A86B2BA7D688B6B"></a></p>

<h5>3.3-2 <span class="Heading"><code class="code">&lt;Chapter&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Chapter (%Text;| Heading | Section)*&gt;
&lt;!ATTLIST Chapter Label CDATA #IMPLIED&gt;    &lt;!-- For reference purposes --&gt;
</pre></td></tr></table>

<p>A <code class="code">Chapter</code> element can have a <code class="code">Label</code> attribute, such that this chapter can be referenced later on with a <code class="code">Ref</code> element (see section <a href="chap3.html#X8656F2338007406E"><b>3.5-1</b></a>). Note that you have to specify a label to reference the chapter as there is no automatic labelling!</p>

<p><code class="code">Chapter</code> elements can contain text (for a description of <code class="code">%Text;</code> see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>), <code class="code">Section</code> elements, and <code class="code">Heading</code> elements.</p>

<p>The following <em>additional</em> rule cannot be stated in the DTD because we want a <code class="code">Chapter</code> element to have mixed content. There must be <em>exactly one</em> <code class="code">Heading</code> element in the <code class="code">Chapter</code> element, containing the heading of the chapter. Here is its definition:</p>

<p><a id="X79825E1C821D0B79" name="X79825E1C821D0B79"></a></p>

<h5>3.3-3 <span class="Heading"><code class="code">&lt;Heading&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Heading (%InnerText;)*&gt;
</pre></td></tr></table>

<p>This element is used for headings in <code class="code">Chapter</code>, <code class="code">Section</code>, <code class="code">Subsection</code>, and <code class="code">Appendix</code> elements. It may only contain <code class="code">%InnerText;</code> (for a description see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>).</p>

<p>Each of the mentioned sectioning elements must contain exactly one direct <code class="code">Heading</code> element (i.e., one which is not contained in another sectioning element).</p>

<p><a id="X7C701B2779767556" name="X7C701B2779767556"></a></p>

<h5>3.3-4 <span class="Heading"><code class="code">&lt;Appendix&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Appendix (%Text;| Heading | Section)*&gt;
&lt;!ATTLIST Appendix Label CDATA #IMPLIED&gt;   &lt;!-- For reference purposes --&gt;
</pre></td></tr></table>

<p>The <code class="code">Appendix</code> element behaves exactly like a <code class="code">Chapter</code> element (see <a href="chap3.html#X7A86B2BA7D688B6B"><b>3.3-2</b></a>) except for the position within the document and the numbering. While chapters are counted with numbers (1., 2., 3., ...) the appendices are counted with capital letters (A., B., ...).</p>

<p>Again there is an optional <code class="code">Label</code> attribute used for references.</p>

<p><a id="X844DC2B47FB37339" name="X844DC2B47FB37339"></a></p>

<h5>3.3-5 <span class="Heading"><code class="code">&lt;Section&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Section (%Text;| Heading | Subsection | ManSection)*&gt;
&lt;!ATTLIST Section Label CDATA #IMPLIED&gt;    &lt;!-- For reference purposes --&gt;
</pre></td></tr></table>

<p>A <code class="code">Section</code> element can have a <code class="code">Label</code> attribute, such that this section can be referenced later on with a <code class="code">Ref</code> element (see section <a href="chap3.html#X8656F2338007406E"><b>3.5-1</b></a>). Note that you have to specify a label to reference the section as there is no automatic labelling!</p>

<p><code class="code">Section</code> elements can contain text (for a description of <code class="code">%Text;</code> see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>), <code class="code">Heading</code> elements, and subsections.</p>

<p>There must be exactly one direct <code class="code">Heading</code> element in a <code class="code">Section</code> element, containing the heading of the section.</p>

<p>Note that a subsection is either a <code class="code">Subsection</code> element or a <code class="code">ManSection</code> element.</p>

<p><a id="X803ACA187E292969" name="X803ACA187E292969"></a></p>

<h5>3.3-6 <span class="Heading"><code class="code">&lt;Subsection&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Subsection (%Text;| Heading)*&gt;
&lt;!ATTLIST Subsection Label CDATA #IMPLIED&gt; &lt;!-- For reference purposes --&gt;
</pre></td></tr></table>

<p>The <code class="code">Subsection</code> element can have a <code class="code">Label</code> attribute, such that this subsection can be referenced later on with a <code class="code">Ref</code> element (see section <a href="chap3.html#X8656F2338007406E"><b>3.5-1</b></a>). Note that you have to specify a label to reference the subsection as there is no automatic labelling!</p>

<p><code class="code">Subsection</code> elements can contain text (for a description of <code class="code">%Text;</code> see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>), and <code class="code">Heading</code> elements.</p>

<p>There must be exactly one <code class="code">Heading</code> element in a <code class="code">Subsection</code> element, containing the heading of the subsection.</p>

<p>Another type of subsection is a <code class="code">ManSection</code>, explained now:</p>

<p><a id="X877B8B7C7EDD09E9" name="X877B8B7C7EDD09E9"></a></p>

<h4>3.4 <span class="Heading">ManSection–a special kind of subsection</span></h4>

<p><code class="code">ManSection</code>s are intended to describe a function, operation, method, variable, or some other technical instance. It is analogous to a manpage in the UNIX environment.</p>

<p><a id="X8375D9CC8672A1D5" name="X8375D9CC8672A1D5"></a></p>

<h5>3.4-1 <span class="Heading"><code class="code">&lt;ManSection&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT ManSection ( Heading?, 
                      ((Func, Returns?) | (Oper, Returns?) | 
                       (Meth, Returns?) | (Filt, Returns?) | 
                       (Prop, Returns?) | (Attr, Returns?) |
                       Var | Fam | InfoClass)+, Description )&gt;
&lt;!ATTLIST ManSection Label CDATA #IMPLIED&gt; &lt;!-- For reference purposes --&gt;

&lt;!ELEMENT Returns (%Text;)*&gt;
&lt;!ELEMENT Description (%Text;)*&gt;
</pre></td></tr></table>

<p>The <code class="code">ManSection</code> element can have a <code class="code">Label</code> attribute, such that this subsection can be referenced later on with a <code class="code">Ref</code> element (see section <a href="chap3.html#X8656F2338007406E"><b>3.5-1</b></a>). But this is probably rarely necessary because the elements <code class="code">Func</code> and so on (explained below) generate automatically labels for cross referencing.</p>

<p>The content of a <code class="code">ManSection</code> element is one or more elements describing certain items in <strong class="pkg">GAP</strong>, each of them optionally followed by a <code class="code">Returns</code> element, followed by a <code class="code">Description</code> element, which contains <code class="code">%Text;</code> (see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>) describing it. (Remember to include examples in the description as often as possible, see <a href="chap3.html#X810DEA1E83A57CFE"><b>3.7-10</b></a>). The classes of items <strong class="pkg">GAPDoc</strong> knows of are: functions (<code class="code">Func</code>), operations (<code class="code">Oper</code>), methods (<code class="code">Meth</code>), filters (<code class="code">Filt</code>), properties (<code class="code">Prop</code>), attributes (<code class="code">Attr</code>), variables (<code class="code">Var</code>), families (<code class="code">Fam</code>), and info classes (<code class="code">InfoClass</code>). One <code class="code">ManSection</code> should only describe several of such items when these are very closely related.</p>

<p>Each element for an item corresponding to a <strong class="pkg">GAP</strong> function can be followed by a <code class="code">Returns</code> element. In output versions of the document the string "Returns: " will be put in front of the content text. The text in the <code class="code">Returns</code> element should usually be a short hint about the type of object returned by the function. This is intended to give a good mnemonic for the use of a function (together with a good choice of names for the formal arguments).</p>

<p><code class="code">ManSection</code>s are also sectioning elements which count as subsections. Usually there should be no <code class="code">Heading</code>-element in a <code class="code">ManSection</code>, in that case a heading is generated automatically from the first <code class="code">Func</code>-like element. Sometimes this default behaviour does not look appropriate, for example when there are several <code class="code">Func</code>-like elements. For such cases an optional <code class="code">Heading</code> is allowed.</p>

<p><a id="X7C41A7B5845205C4" name="X7C41A7B5845205C4"></a></p>

<h5>3.4-2 <span class="Heading"><code class="code">&lt;Func&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Func EMPTY&gt;
&lt;!ATTLIST Func Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Arg   CDATA #REQUIRED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to specify the usage of a function. The <code class="code">Name</code> attribute is required and its value is the name of the function. The value of the <code class="code">Arg</code> attribute (also required) contains the full list of arguments including optional parts, which are denoted by square brackets. The argument names can be separated by whitespace, commas or the square brackets for the optional arguments, like <code class="code">"grp[, elm]"</code> or <code class="code">"xx[y[z] ]"</code>.</p>

<p>The name of the function is also used as label for cross referencing. When the name of the function appears in the text of the document it should <em>always</em> be written with the <code class="code">Ref</code> element, see <a href="chap3.html#X8656F2338007406E"><b>3.5-1</b></a>. This allows to use a unique typesetting style for function names and automatic cross referencing.</p>

<p>If the optional <code class="code">Label</code> attribute is given, it is appended (with a colon <code class="code">:</code> in between) to the name of the function for cross referencing purposes. The text of the label can also appear in the document text. So, it should be a kind of short explanation.</p>


<table class="example">
<tr><td><pre>
&lt;Func Arg="x[, y]" Name="LibFunc" Label="for my objects"/&gt;
</pre></td></tr></table>

<p>The optional <code class="code">Comm</code> attribute should be a short description of the function, usually at most one line long (this is currently nowhere used).</p>

<p>This element automatically produces an index entry with the name of the function and, if present, the text of the <code class="code">Label</code> attribute as subentry (see also <a href="chap3.html#X7C53615A8477F1E5"><b>3.2-16</b></a> and <a href="chap3.html#X811042BA78843777"><b>3.5-4</b></a>).</p>

<p><a id="X7A15825E818A81CD" name="X7A15825E818A81CD"></a></p>

<h5>3.4-3 <span class="Heading"><code class="code">&lt;Oper&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Oper EMPTY&gt;
&lt;!ATTLIST Oper Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Arg   CDATA #REQUIRED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to specify the usage of an operation. The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>).</p>

<p>Note that multiple descriptions of the same operation may occur in a document because there may be several declarations in <strong class="pkg">GAP</strong>. Furthermore there may be several <code class="code">ManSection</code>s for methods of this operation (see <a href="chap3.html#X81196E2B7F286A01"><b>3.4-4</b></a>) which also use the same name. For reference purposes these must be distinguished by different <code class="code">Label</code> attributes.</p>

<p><a id="X81196E2B7F286A01" name="X81196E2B7F286A01"></a></p>

<h5>3.4-4 <span class="Heading"><code class="code">&lt;Meth&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Meth EMPTY&gt;
&lt;!ATTLIST Meth Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Arg   CDATA #REQUIRED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to specify the usage of a method. The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>).</p>

<p>Frequently, an operation is implemented by several different methods. Therefore it seems to be interesting to document them independently. This is possible by using the same method name in different <code class="code">ManSection</code>s. It is however required that these subsections and those describing the corresponding operation are distinguished by different <code class="code">Label</code> attributes.</p>

<p><a id="X7D8D2C38828D5854" name="X7D8D2C38828D5854"></a></p>

<h5>3.4-5 <span class="Heading"><code class="code">&lt;Filt&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Filt EMPTY&gt;
&lt;!ATTLIST Filt Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Arg   CDATA #IMPLIED
               Comm  CDATA #IMPLIED
               Type  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to specify the usage of a filter. The first four attributes are used in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>), except that the <code class="code">Arg</code> attribute is optional.</p>

<p>The <code class="code">Type</code> attribute can be any string, but it is thought to be something like "<code class="code">Category</code>" or "<code class="code">Representation</code>".</p>

<p><a id="X7D6400A67C30B752" name="X7D6400A67C30B752"></a></p>

<h5>3.4-6 <span class="Heading"><code class="code">&lt;Prop&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Prop EMPTY&gt;
&lt;!ATTLIST Prop Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Arg   CDATA #REQUIRED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to specify the usage of a property. The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>).</p>

<p><a id="X78CEEC5986987A97" name="X78CEEC5986987A97"></a></p>

<h5>3.4-7 <span class="Heading"><code class="code">&lt;Attr&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Attr EMPTY&gt;
&lt;!ATTLIST Attr Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Arg   CDATA #REQUIRED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to specify the usage of an attribute (in <strong class="pkg">GAP</strong>). The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>).</p>

<p><a id="X7C3AACBE7BC6AABF" name="X7C3AACBE7BC6AABF"></a></p>

<h5>3.4-8 <span class="Heading"><code class="code">&lt;Var&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Var  EMPTY&gt;
&lt;!ATTLIST Var  Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to document a global variable. The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>) except that there is no <code class="code">Arg</code> attribute.</p>

<p><a id="X85EE992E7FED2FE6" name="X85EE992E7FED2FE6"></a></p>

<h5>3.4-9 <span class="Heading"><code class="code">&lt;Fam&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Fam  EMPTY&gt;
&lt;!ATTLIST Fam  Name  CDATA #REQUIRED
               Label CDATA #IMPLIED
               Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to document a family. The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>) except that there is no <code class="code">Arg</code> attribute.</p>

<p><a id="X78F0D4D1811E5BAE" name="X78F0D4D1811E5BAE"></a></p>

<h5>3.4-10 <span class="Heading"><code class="code">&lt;InfoClass&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT InfoClass EMPTY&gt;
&lt;!ATTLIST InfoClass Name  CDATA #REQUIRED
                    Label CDATA #IMPLIED
                    Comm  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used within a <code class="code">ManSection</code> element to document an info class. The attributes are used exactly in the same way as in the <code class="code">Func</code> element (see <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>) except that there is no <code class="code">Arg</code> attribute.</p>

<p><a id="X78595FB585569617" name="X78595FB585569617"></a></p>

<h4>3.5 <span class="Heading">Cross Referencing and Citations</span></h4>

<p>Cross referencing in the <strong class="pkg">GAPDoc</strong> system is somewhat different to the usual LaTeX cross referencing in so far, that a reference knows "which type of object" it is referencing. For example a "reference to a function" is distinguished from a "reference to a chapter". The idea of this is, that the markup must contain this information such that the converters can produce better output. The HTML converter can for example typeset a function reference just as the name of the function with a link to the description of the function, or a chapter reference as a number with a link in the other case.</p>

<p>Referencing is done with the <code class="code">Ref</code> element:</p>

<p><a id="X8656F2338007406E" name="X8656F2338007406E"></a></p>

<h5>3.5-1 <span class="Heading"><code class="code">&lt;Ref&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Ref EMPTY&gt;
&lt;!ATTLIST Ref Func      CDATA #IMPLIED
              Oper      CDATA #IMPLIED
              Meth      CDATA #IMPLIED
              Filt      CDATA #IMPLIED
              Prop      CDATA #IMPLIED
              Attr      CDATA #IMPLIED
              Var       CDATA #IMPLIED
              Fam       CDATA #IMPLIED
              InfoClass CDATA #IMPLIED
              Chap      CDATA #IMPLIED
              Sect      CDATA #IMPLIED
              Subsect   CDATA #IMPLIED
              Appendix  CDATA #IMPLIED
              Text      CDATA #IMPLIED

              Label     CDATA #IMPLIED
              BookName  CDATA #IMPLIED
              Style (Text | Number) #IMPLIED&gt;  &lt;!-- normally automatic --&gt;
</pre></td></tr></table>

<p>The <code class="code">Ref</code> element is defined to be <code class="code">EMPTY</code>. If one of the attributes <code class="code">Func</code>, <code class="code">Oper</code>, <code class="code">Meth</code>, <code class="code">Prop</code>, <code class="code">Attr</code>, <code class="code">Var</code>, <code class="code">Fam</code>, <code class="code">InfoClass</code>, <code class="code">Chap</code>, <code class="code">Sect</code>, <code class="code">Subsect</code>, <code class="code">Appendix</code> is given then there must be exactly one of these, making the reference one to the corresponding object. The <code class="code">Label</code> attribute can be specified in addition to make the reference unique, for example if more than one method with a given name is present. (Note that there is no way to specify in the DTD that exactly one of the first listed attributes must be given, this is an additional rule.)</p>

<p>A reference to a <code class="code">Label</code> element defined below (see <a href="chap3.html#X7C85CA5484344DB5"><b>3.5-2</b></a>) is done by giving the <code class="code">Label</code> attribute and optionally the <code class="code">Text</code> attribute. If the <code class="code">Text</code> attribute is present its value is typeset in place of the <code class="code">Ref</code> element, if linking is possible (for example in HTML). If this is not possible, the section number is typeset. This type of reference is also used for references to tables (see <a href="chap3.html#X7F9CAA577EB4070B"><b>3.6-5</b></a>).</p>

<p>An external reference into another book can be specified by using the <code class="code">BookName</code> attribute. In this case the <code class="code">Label</code> attribute or, if this is not given, the function or section like attribute, is used to resolve the reference. The generated reference points to the first hit when asking "?book name: label" inside <strong class="pkg">GAP</strong>.</p>

<p>The optional attribute <code class="code">Style</code> can take only the values <code class="code">Text</code> and <code class="code">Number</code>. It can be used with references to sectioning units and it gives a hint to the converter programs, whether an explicit section number is generated or text. Normally all references to sections generate numbers and references to a <strong class="pkg">GAP</strong> object generate the name of the corresponding object with some additional link or sectioning information, which is the behavior of <code class="code">Style="Text"</code>. In case <code class="code">Style="Number"</code> in all cases an explicit section number is generated. So</p>


<table class="example">
<tr><td><pre>
&lt;Ref Subsect="Func" Style="Text"/&gt; described in section 
&lt;Ref Subsect="Func" Style="Number"/&gt;
</pre></td></tr></table>

<p>produces: <b><span class="Heading"><code class="code">&lt;Func&gt;</code></span></b> (<a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>) described in section <a href="chap3.html#X7C41A7B5845205C4"><b>3.4-2</b></a>.</p>

<p><a id="X7C85CA5484344DB5" name="X7C85CA5484344DB5"></a></p>

<h5>3.5-2 <span class="Heading"><code class="code">&lt;Label&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Label EMPTY&gt;
&lt;!ATTLIST Label Name CDATA #REQUIRED&gt;
</pre></td></tr></table>

<p>This element is used to define a label for referencing a certain position in the document, if this is possible. If an exact reference is not possible (like in a printed version of the document) a reference to the corresponding subsection is generated. The value of the <code class="code">Name</code> attribute must be unique under all <code class="code">Label</code> elements.</p>

<p><a id="X851DE9D279D8FB04" name="X851DE9D279D8FB04"></a></p>

<h5>3.5-3 <span class="Heading"><code class="code">&lt;Cite&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Cite EMPTY&gt;
&lt;!ATTLIST Cite Key CDATA #REQUIRED
               Where CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is for bibliography citations. It is <code class="code">EMPTY</code> by definition. The attribute <code class="code">Key</code> is the key for a lookup in a BibTeX database that has to be specified in the <code class="code">Bibliography</code> element (see <a href="chap3.html#X84F3DF21786A8751"><b>3.2-15</b></a>). The value of the <code class="code">Where</code> attribute specifies the position in the document as in the corresponding LaTeX syntax <code class="code">\cite[Where value]{Key value}</code>.</p>

<p><a id="X811042BA78843777" name="X811042BA78843777"></a></p>

<h5>3.5-4 <span class="Heading"><code class="code">&lt;Index&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Index (%InnerText;|Subkey)*&gt;
&lt;!ATTLIST Index Key    CDATA #IMPLIED
                Subkey CDATA #IMPLIED&gt;
&lt;!ELEMENT Subkey (%InnerText;)*&gt;
</pre></td></tr></table>

<p>This element generates an index entry. The text within the element is typeset in the index entry, which is sorted under the value, that is specified in the <code class="code">Key</code> and <code class="code">Subkey</code> attributes. If they are not specified, the typeset text itself is used as the key.</p>

<p>A subkey can be specified in the simpler version as an attribute, but then no further markup can be used for the subkey. Optionally, the subkey text can be given in a <code class="code">Subkey</code> element, in this case the attribute value is used for sorting but the typeset text is taken from the content of <code class="code">Subkey</code>.</p>

<p>Note that all <code class="code">Func</code> and similar elements automatically generate index entries. If the <code class="code">TheIndex</code> element (<a href="chap3.html#X7C53615A8477F1E5"><b>3.2-16</b></a>) is not present in the document all <code class="code">Index</code> elements are ignored.</p>

<p><a id="X81B3E46F839E1C5B" name="X81B3E46F839E1C5B"></a></p>

<h5>3.5-5 <span class="Heading"><code class="code">&lt;URL&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT URL (#PCDATA|Alt|Link|LinkText)*&gt;  &lt;!-- Link, LinkText
     variant for case where text needs further markup --&gt;
&lt;!ATTLIST URL Text CDATA #IMPLIED&gt;   &lt;!-- This is for output formats
                                          that have links like HTML --&gt;
&lt;!ELEMENT Link     (%InnerText;)*&gt; &lt;!-- the URL --&gt;
&lt;!ELEMENT LinkText (%InnerText;)*&gt; &lt;!-- text for links, can contain markup --&gt;

</pre></td></tr></table>

<p>This element is for references into the internet. It specifies an URL and optionally a text which can be used for a link (like in HTML or PDF versions of the document). This can be specified in two ways: Either the URL is given as element content and the text is given in the optional <code class="code">Text</code> attribute (in this case the text cannot contain further markup), or the element contains the two elements <code class="code">Link</code> and <code class="code">LinkText</code> which in turn contain the URL and the text, respectively. The default value for the text is the URL itself.</p>

<p><a id="X8310C4F084CD9DB9" name="X8310C4F084CD9DB9"></a></p>

<h5>3.5-6 <span class="Heading"><code class="code">&lt;Email&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Email (#PCDATA|Alt|Link|LinkText)*&gt;
</pre></td></tr></table>

<p>This element type is the special case of an URL specifying an email address. The content of the element should be the email address without any prefix like "<code class="code">mailto:</code>". This address is typeset by all converters, also without any prefix. In the case of an output document format like HTML the converter can produce a link with a "<code class="code">mailto:</code>" prefix.</p>

<p><a id="X7D5CC4267D04D7E7" name="X7D5CC4267D04D7E7"></a></p>

<h5>3.5-7 <span class="Heading"><code class="code">&lt;Homepage&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Homepage (#PCDATA|Alt|Link|LinkText)*&gt;
</pre></td></tr></table>

<p>This element type is the special case of an URL specifying a WWW-homepage.</p>

<p><a id="X840099DF83823686" name="X840099DF83823686"></a></p>

<h4>3.6 <span class="Heading">Structural Elements like Lists</span></h4>

<p>The <strong class="pkg">GAPDoc</strong> system offers some limited access to structural elements like lists, enumerations, and tables. Although it is possible to use all LaTeX constructs one always has to think about other output formats. The elements in this section are guaranteed to produce something reasonable in all output formats.</p>

<p><a id="X785183F67DA402A0" name="X785183F67DA402A0"></a></p>

<h5>3.6-1 <span class="Heading"><code class="code">&lt;List&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT List ( ((Mark,Item)|(BigMark,Item)|Item)+ )&gt;
&lt;!ATTLIST List Only CDATA #IMPLIED
               Not  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element produces a list. Each item in the list corresponds to an <code class="code">Item</code> element. Every <code class="code">Item</code> element is optionally preceded by a <code class="code">Mark</code> element. The content of this is used as a marker for the item. Note that this marker can be a whole word or even a sentence. It will be typeset in some emphasized fashion and most converters will provide some indentation for the rest of the item.</p>

<p>The <code class="code">Only</code> and <code class="code">Not</code> attributes can be used to specify, that the list is included into the output by only one type of converter (<code class="code">Only</code>) or all but one type of converter (<code class="code">Not</code>). Of course at most one of the two attributes may occur in one element. The following values are allowed as of now: "<code class="code">LaTeX</code>", "<code class="code">HTML</code>", and "<code class="code">Text</code>". See also the <code class="code">Alt</code> element in <a href="chap3.html#X850E69017945AE3E"><b>3.9-1</b></a> for more about text alternatives for certain converters.</p>

<p><a id="X7B1545A9797442DC" name="X7B1545A9797442DC"></a></p>

<h5>3.6-2 <span class="Heading"><code class="code">&lt;Mark&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Mark ( %InnerText;)*&gt;
</pre></td></tr></table>

<p>This element is used in the <code class="code">List</code> element to mark items. See <a href="chap3.html#X785183F67DA402A0"><b>3.6-1</b></a> for an explanation.</p>

<p><a id="X86C204987AB4B13D" name="X86C204987AB4B13D"></a></p>

<h5>3.6-3 <span class="Heading"><code class="code">&lt;Item&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Item ( %Text;)*&gt;
</pre></td></tr></table>

<p>This element is used in the <code class="code">List</code>, <code class="code">Enum</code>, and <code class="code">Table</code> elements to specify the items. See sections <a href="chap3.html#X785183F67DA402A0"><b>3.6-1</b></a>, <a href="chap3.html#X78A52B00846562DE"><b>3.6-4</b></a>, and <a href="chap3.html#X7F9CAA577EB4070B"><b>3.6-5</b></a> for further information.</p>

<p><a id="X78A52B00846562DE" name="X78A52B00846562DE"></a></p>

<h5>3.6-4 <span class="Heading"><code class="code">&lt;Enum&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Enum ( Item+ )&gt;
&lt;!ATTLIST Enum Only CDATA #IMPLIED
               Not  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element is used like the <code class="code">List</code> element (see <a href="chap3.html#X785183F67DA402A0"><b>3.6-1</b></a>) except that the items must not have marks attached to them. Instead, the items are numbered automatically. The same comments about the <code class="code">Only</code> and <code class="code">Not</code> attributes as above apply.</p>

<p><a id="X7F9CAA577EB4070B" name="X7F9CAA577EB4070B"></a></p>

<h5>3.6-5 <span class="Heading"><code class="code">&lt;Table&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Table ( Caption?, (Row | HorLine)+ )&gt;
&lt;!ATTLIST Table Label   CDATA #IMPLIED
                Only    CDATA #IMPLIED
                Not     CDATA #IMPLIED
                Align   CDATA #REQUIRED&gt;
                &lt;!-- We allow | and l,c,r, nothing else --&gt;
&lt;!ELEMENT Row   ( Item+ )&gt;
&lt;!ELEMENT HorLine EMPTY&gt;
&lt;!ELEMENT Caption ( %InnerText;)*&gt;
</pre></td></tr></table>

<p>A table in <strong class="pkg">GAPDoc</strong> consists of an optional <code class="code">Caption</code> element followed by a sequence of <code class="code">Row</code> and <code class="code">HorLine</code> elements. A <code class="code">HorLine</code> element produces a horizontal line in the table. A <code class="code">Row</code> element consists of a sequence of <code class="code">Item</code> elements as they also occur in <code class="code">List</code> and <code class="code">Enum</code> elements. The <code class="code">Only</code> and <code class="code">Not</code> attributes have the same functionality as described in the <code class="code">List</code> element in <a href="chap3.html#X785183F67DA402A0"><b>3.6-1</b></a>.</p>

<p>The <code class="code">Align</code> attribute is written like a LaTeX tabular alignment specifier but only the letters "<code class="code">l</code>", "<code class="code">r</code>", "<code class="code">c</code>", and "<code class="code">|</code>" are allowed meaning left alignment, right alignment, centered alignment, and a vertical line as delimiter between columns respectively.</p>

<p>If the <code class="code">Label</code> attribute is there, one can reference the table with the <code class="code">Ref</code> element (see <a href="chap3.html#X8656F2338007406E"><b>3.5-1</b></a>) using its <code class="code">Label</code> attribute.</p>

<p>Usually only simple tables should be used. If you want a complicated table in the LaTeX output you should provide alternatives for text and HTML output. Note that in HTML-4.0 there is no possibility to interpret the "<code class="code">|</code>" column separators and <code class="code">HorLine</code> elements as intended. There are lines between all columns and rows or no lines at all.</p>

<p><a id="X7CA1E1327AFBA578" name="X7CA1E1327AFBA578"></a></p>

<h4>3.7 <span class="Heading">Types of Text</span></h4>

<p>This section covers the markup of text. Various types of "text" exist. The following elements are used in the <strong class="pkg">GAPDoc</strong> system to mark them. They mostly come in pairs, one long name which is easier to remember and a shortcut to make the markup "lighter".</p>

<p>Most of the following elements are thought to contain only character data and no further markup elements. It is however necessary to allow <code class="code">Alt</code> elements to resolve the entities described in section <a href="chap2.html#X7BDFF6D37FBED400"><b>2.2-3</b></a>.</p>

<p><a id="X7B15C428861749FD" name="X7B15C428861749FD"></a></p>

<h5>3.7-1 <span class="Heading"><code class="code">&lt;Emph&gt;</code> and <code class="code">&lt;E&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Emph (%InnerText;)*&gt;    &lt;!-- Emphasize something --&gt;
&lt;!ELEMENT E    (%InnerText;)*&gt;    &lt;!-- the same as shortcut --&gt;
</pre></td></tr></table>

<p>This element is used to emphasize some piece of text. It may contain <code class="code">%InnerText;</code> (see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>).</p>

<p><a id="X80028C2483C9467E" name="X80028C2483C9467E"></a></p>

<h5>3.7-2 <span class="Heading"><code class="code">&lt;Quoted&gt;</code> and <code class="code">&lt;Q&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Quoted (%InnerText;)*&gt;   &lt;!-- Quoted (in quotes) text --&gt;
&lt;!ELEMENT Q (%InnerText;)*&gt;        &lt;!-- Quoted text (shortcut) --&gt;
</pre></td></tr></table>

<p>This element is used to put some piece of text into " "-quotes. It may contain <code class="code">%InnerText;</code> (see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>).</p>

<p><a id="X867BB95E7DC87014" name="X867BB95E7DC87014"></a></p>

<h5>3.7-3 <span class="Heading"><code class="code">&lt;Keyword&gt;</code> and <code class="code">&lt;K&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Keyword (#PCDATA|Alt)*&gt;  &lt;!-- Keyword --&gt;
&lt;!ELEMENT K (#PCDATA|Alt)*&gt;        &lt;!-- Keyword (shortcut) --&gt;
</pre></td></tr></table>

<p>This element is used to mark something as a <em>keyword</em>. Usually this will be a <strong class="pkg">GAP</strong> keyword such as "<code class="keyw">if</code>" or "<code class="keyw">for</code>". No further markup elements are allowed within this element except for the <code class="code">Alt</code> element, which is necessary.</p>

<p><a id="X86FD4CCA7F98351F" name="X86FD4CCA7F98351F"></a></p>

<h5>3.7-4 <span class="Heading"><code class="code">&lt;Arg&gt;</code> and 
                                 <code class="code">&lt;A&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Arg (#PCDATA|Alt)*&gt;      &lt;!-- Argument --&gt;
&lt;!ELEMENT A (#PCDATA|Alt)*&gt;        &lt;!-- Argument (shortcut) --&gt;
</pre></td></tr></table>

<p>This element is used inside <code class="code">Description</code>s in <code class="code">ManSection</code>s to mark something as an <em>argument</em> (of a function, operation, or such). It is guaranteed that the converters typeset those exactly as in the definition of functions. No further markup elements are allowed within this element.</p>

<p><a id="X8400998B7B3A4379" name="X8400998B7B3A4379"></a></p>

<h5>3.7-5 <span class="Heading"><code class="code">&lt;Code&gt;</code> and 
                                  <code class="code">&lt;C&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Code (#PCDATA|Alt)*&gt;     &lt;!-- GAP code --&gt;
&lt;!ELEMENT C (#PCDATA|Alt)*&gt;        &lt;!-- GAP code (shortcut) --&gt;
</pre></td></tr></table>

<p>This element is used to mark something as a piece of <em>code</em> like for example a <strong class="pkg">GAP</strong> expression. It is guaranteed that the converters typeset this exactly as in the <code class="code">Listing</code> element (compare section <a href="chap3.html#X7F531B157D656836"><b>3.7-9</b></a>. No further markup elements are allowed within this element.</p>

<p><a id="X875AF9B4812C5249" name="X875AF9B4812C5249"></a></p>

<h5>3.7-6 <span class="Heading"><code class="code">&lt;File&gt;</code> and <code class="code">&lt;F&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT File (#PCDATA|Alt)*&gt;     &lt;!-- Filename --&gt;
&lt;!ELEMENT F (#PCDATA|Alt)*&gt;        &lt;!-- Filename (shortcut) --&gt;
</pre></td></tr></table>

<p>This element is used to mark something as a <em>filename</em> or a <em>pathname</em> in the file system. No further markup elements are allowed within this element.</p>

<p><a id="X7929BA7D78A977FF" name="X7929BA7D78A977FF"></a></p>

<h5>3.7-7 <span class="Heading"><code class="code">&lt;Button&gt;</code> and <code class="code">&lt;B&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Button (#PCDATA|Alt)*&gt;   &lt;!-- "Button" (also Menu, Key, ...) --&gt;
&lt;!ELEMENT B (#PCDATA|Alt)*&gt;        &lt;!-- "Button" (shortcut) --&gt;
</pre></td></tr></table>

<p>This element is used to mark something as a <em>button</em>. It can also be used for other items in a graphical user interface like <em>menus</em>, <em>menu entries</em>, or <em>keys</em>. No further markup elements are allowed within this element.</p>

<p><a id="X7F4FFA877B775188" name="X7F4FFA877B775188"></a></p>

<h5>3.7-8 <span class="Heading"><code class="code">&lt;Package&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Package (#PCDATA|Alt)*&gt;   &lt;!-- A package name --&gt;
</pre></td></tr></table>

<p>This element is used to mark something as a name of a <em>package</em>. This is for example used to define the entities <strong class="pkg">GAP</strong>, <strong class="pkg">XGAP</strong> or <strong class="pkg">GAPDoc</strong> (see section <a href="chap2.html#X7BDFF6D37FBED400"><b>2.2-3</b></a>). No further markup elements are allowed within this element.</p>

<p><a id="X7F531B157D656836" name="X7F531B157D656836"></a></p>

<h5>3.7-9 <span class="Heading"><code class="code">&lt;Listing&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Listing (#PCDATA)&gt;  &lt;!-- This is just for GAP code listings --&gt;
&lt;!ATTLIST Listing Type CDATA #IMPLIED&gt; &lt;!-- a comment about the type of
                                            listed code, may appear in
                                            output --&gt;
</pre></td></tr></table>

<p>This element is used to embed listings of programs into the document. Only character data and no other elements are allowed in the content. You should <em>not</em> use the character entities described in section <a href="chap2.html#X7BDFF6D37FBED400"><b>2.2-3</b></a> but instead type the characters directly. Only the general XML rules from section <a href="chap2.html#X7B3A544986A1A9EA"><b>2.1</b></a> apply. Note especially the usage of <code class="code">&lt;![CDATA[</code> sections described there. It is guaranteed that all converters use a fixed width font for typesetting <code class="code">Listing</code> elements. Compare also the usage of the <code class="code">Code</code> and <code class="code">C</code> elements in <a href="chap3.html#X8400998B7B3A4379"><b>3.7-5</b></a>.</p>

<p>The <code class="code">Type</code> attribute contains a comment about the type of listed code. It may appear in the output.</p>

<p><a id="X810DEA1E83A57CFE" name="X810DEA1E83A57CFE"></a></p>

<h5>3.7-10 <span class="Heading"><code class="code">&lt;Log&gt;</code> and
                                 <code class="code">&lt;Example&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Example (#PCDATA)&gt;  &lt;!-- This is subject to the automatic 
                                   example checking mechanism --&gt;
&lt;!ELEMENT Log (#PCDATA)&gt;      &lt;!-- This not --&gt;
</pre></td></tr></table>

<p>These two elements behave exactly like the <code class="code">Listing</code> element (see <a href="chap3.html#X7F531B157D656836"><b>3.7-9</b></a>). They are thought for protocols of <strong class="pkg">GAP</strong> sessions. The only difference between the two is that <code class="code">Example</code> sections are intended to be subject to an automatic manual checking mechanism used to ensure the correctness of the <strong class="pkg">GAP</strong> manual whereas <code class="code">Log</code> is not touched by this.</p>

<p><a id="X7F8C4D018346B2CF" name="X7F8C4D018346B2CF"></a></p>

<h5>3.7-11 <span class="Heading"><code class="code">&lt;Verb&gt;</code></span></h5>

<p>There is one further type of verbatim-like element.</p>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Verb  (#PCDATA)&gt; 
</pre></td></tr></table>

<p>The content of such an element is guaranteed to be put into an output version exactly as it is using some fixed width font. Before the content a new line is started. If the line after the end of the start tag consists of whitespace only then this part of the content is skipped.</p>

<p>This element is intended to be used together with the <code class="code">Alt</code> element to specify pre-formatted ASCII alternatives for complicated <code class="code">Display</code> formulae or <code class="code">Table</code>s.</p>

<p><a id="X8145F6B37C04AA0A" name="X8145F6B37C04AA0A"></a></p>

<h4>3.8 <span class="Heading">Elements for Mathematical Formulae</span></h4>

<p><a id="X7AA02845868AA533" name="X7AA02845868AA533"></a></p>

<h5>3.8-1 <span class="Heading"><code class="code">&lt;Math&gt;</code> 
                              and <code class="code">&lt;Display&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!-- Normal TeX math mode formula --&gt;
&lt;!ELEMENT Math (#PCDATA|A|Arg|Alt)*&gt;   
&lt;!-- TeX displayed math mode formula --&gt;
&lt;!ELEMENT Display (#PCDATA|A|Arg|Alt)*&gt;
</pre></td></tr></table>

<p>These elements are used for mathematical formulae. As described in section <a href="chap2.html#X7EAE0C5A835F126F"><b>2.2-2</b></a> they correspond to LaTeX's math and display math mode respectively.</p>

<p>The formulae are typed in as in LaTeX, <em>except</em> that the standard XML entities, see <a href="chap2.html#X78FB56C77B1F391A"><b>2.1-9</b></a> (in particular the characters <code class="code">&lt;</code> and <code class="code">&amp;</code>), must be escaped - either by using the corresponding entities or by enclosing the formula between "<code class="code">&lt;![CDATA[</code>" and "<code class="code">]]&gt;</code>". (The main reference for LaTeX is <a href="chapBib.html#biBLa85">[Lam85]</a>.)</p>

<p>It is also possible to use some unicode characters for mathematical symbols directly, provided that it can be translated by <code class="func">Encode</code> (<a href="chap6.html#X818A31567EB30A39"><b>6.2-2</b></a>) into <code class="code">"LaTeX"</code> encoding and that <code class="func">SimplifiedUnicodeString</code> (<a href="chap6.html#X818A31567EB30A39"><b>6.2-2</b></a>) with arguments <code class="code">"latin1"</code> and <code class="code">"single"</code> returns something sensible. Currently, we support entities <code class="code">&amp;CC;</code>, <code class="code">&amp;ZZ;</code>, <code class="code">&amp;NN;</code>, <code class="code">&amp;PP;</code>, <code class="code">&amp;QQ;</code>, <code class="code">&amp;HH;</code>, <code class="code">&amp;RR;</code> for the corresponding black board bold letters ℂ, ℤ, ℕ,ℙ, ℚ, ℍ and ℝ, respectively.</p>

<p>The only element type that is allowed within the formula elements is the <code class="code">Arg</code> or <code class="code">A</code> element (see <a href="chap3.html#X86FD4CCA7F98351F"><b>3.7-4</b></a>), which is used to typeset identifiers that are arguments to <strong class="pkg">GAP</strong> functions or operations.</p>

<p>In text and HTML output these formulae are shown as LaTeX source code. For simple formulae (and you should try to make all your formulae simple!) there is the element <code class="code">M</code> (see <a href="chap3.html#X7ABF42328467E966"><b>3.8-2</b></a>) for which there is a well defined translation into text, which can be used for text and HTML output versions of the document. So, if possible try to avoid the <code class="code">Math</code> and <code class="code">Display</code> elements or provide useful text substitutes for complicated formulae via <code class="code">Alt</code> elements (see <a href="chap3.html#X850E69017945AE3E"><b>3.9-1</b></a> and <a href="chap3.html#X7F8C4D018346B2CF"><b>3.7-11</b></a>).</p>

<p><a id="X7ABF42328467E966" name="X7ABF42328467E966"></a></p>

<h5>3.8-2 <span class="Heading"><code class="code">&lt;M&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!-- Math with well defined translation to text output --&gt;
&lt;!ELEMENT M (#PCDATA|A|Arg|Alt)*&gt;
</pre></td></tr></table>

<p>The "<code class="code">M</code>" element type is intended for formulae in the running text for which there is a sensible ASCII version. For the LaTeX version of a <strong class="pkg">GAPDoc</strong> document the <code class="code">M</code> and <code class="code">Math</code> elements are equivalent. The remarks in <a href="chap3.html#X7AA02845868AA533"><b>3.8-1</b></a> about special characters and the <code class="code">Arg</code> element apply here as well. A document which has all formulae enclosed in <code class="code">M</code> elements can be well readable in text terminal output and printed output versions.</p>

<p>The following LaTeX macros have a sensible ASCII translation and are guaranteed to be translated accordingly by text (and HTML) converters:</p>

<div class="pcenter"><table class="GAPDocTable">
<caption class="GAPDocTable"><b>Table: </b>LaTeX macros with special text translation</caption>
<tr>
<td class="tdleft">\ast</td>
<td class="tdleft"><code class="code">*</code></td>
</tr>
<tr>
<td class="tdleft">\bf</td>
<td class="tdleft"><code class="code"></code></td>
</tr>
<tr>
<td class="tdleft">\bmod</td>
<td class="tdleft"><code class="code">mod</code></td>
</tr>
<tr>
<td class="tdleft">\cdot</td>
<td class="tdleft"><code class="code">*</code></td>
</tr>
<tr>
<td class="tdleft">\colon</td>
<td class="tdleft"><code class="code">:</code></td>
</tr>
<tr>
<td class="tdleft">\equiv</td>
<td class="tdleft"><code class="code">=</code></td>
</tr>
<tr>
<td class="tdleft">\geq</td>
<td class="tdleft"><code class="code">&gt;=</code></td>
</tr>
<tr>
<td class="tdleft">\germ</td>
<td class="tdleft"><code class="code"></code></td>
</tr>
<tr>
<td class="tdleft">\hookrightarrow</td>
<td class="tdleft"><code class="code">-&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\iff</td>
<td class="tdleft"><code class="code">&lt;=&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\langle</td>
<td class="tdleft"><code class="code">&lt;</code></td>
</tr>
<tr>
<td class="tdleft">\ldots</td>
<td class="tdleft"><code class="code">...</code></td>
</tr>
<tr>
<td class="tdleft">\left</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\leq</td>
<td class="tdleft"><code class="code">&lt;=</code></td>
</tr>
<tr>
<td class="tdleft">\leftarrow</td>
<td class="tdleft"><code class="code">&lt;-</code></td>
</tr>
<tr>
<td class="tdleft">\Leftarrow</td>
<td class="tdleft"><code class="code">&lt;=</code></td>
</tr>
<tr>
<td class="tdleft">\limits</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\longrightarrow</td>
<td class="tdleft"><code class="code">--&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\Longrightarrow</td>
<td class="tdleft"><code class="code">==&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\mapsto</td>
<td class="tdleft"><code class="code">-&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\mathbb</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\mathop</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\mid</td>
<td class="tdleft"><code class="code">|</code></td>
</tr>
<tr>
<td class="tdleft">\pmod</td>
<td class="tdleft"><code class="code">mod</code></td>
</tr>
<tr>
<td class="tdleft">\prime</td>
<td class="tdleft"><code class="code">'</code></td>
</tr>
<tr>
<td class="tdleft">\rangle</td>
<td class="tdleft"><code class="code">&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\right</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\rightarrow</td>
<td class="tdleft"><code class="code">-&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\Rightarrow</td>
<td class="tdleft"><code class="code">=&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\rm, \sf, \textrm, \text</td>
<td class="tdleft"><code class="code"></code></td>
</tr>
<tr>
<td class="tdleft">\setminus</td>
<td class="tdleft"><code class="code">\</code></td>
</tr>
<tr>
<td class="tdleft">\thinspace</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\times</td>
<td class="tdleft"><code class="code">x</code></td>
</tr>
<tr>
<td class="tdleft">\to</td>
<td class="tdleft"><code class="code">-&gt;</code></td>
</tr>
<tr>
<td class="tdleft">\vert</td>
<td class="tdleft"><code class="code">|</code></td>
</tr>
<tr>
<td class="tdleft">\!</td>
<td class="tdleft"><code class="code"></code></td>
</tr>
<tr>
<td class="tdleft">\,</td>
<td class="tdleft"><code class="code"></code></td>
</tr>
<tr>
<td class="tdleft">\;</td>
<td class="tdleft"><code class="code"> </code></td>
</tr>
<tr>
<td class="tdleft">\{</td>
<td class="tdleft"><code class="code">{</code></td>
</tr>
<tr>
<td class="tdleft">\}</td>
<td class="tdleft"><code class="code">}</code></td>
</tr>
</table><br /><p>&nbsp;</p><br />
</div>

<p>In all other macros only the backslash is removed. Whitespace is normalized (to one blank) but not removed. Note that whitespace is not added, so you may want to add a few more spaces than you usually do in your LaTeX documents.</p>

<p>Braces <code class="code">{}</code> are removed in general, however pairs of double braces are converted to one pair of braces. This can be used to write <code class="code">&lt;M&gt;x^{12}&lt;/M&gt;</code> for <code class="code">x^12</code> and <code class="code">&lt;M&gt;x_{{i+1}}&lt;/M&gt;</code> for <code class="code">x_{i+1}</code>.</p>

<p><a id="X7A0D26B180BEDE37" name="X7A0D26B180BEDE37"></a></p>

<h4>3.9 <span class="Heading">Everything else</span></h4>

<p><a id="X850E69017945AE3E" name="X850E69017945AE3E"></a></p>

<h5>3.9-1 <span class="Heading"><code class="code">&lt;Alt&gt;</code></span></h5>

<p>This element is used to specify alternatives for different output formats within normal text. See also sections <a href="chap3.html#X785183F67DA402A0"><b>3.6-1</b></a>, <a href="chap3.html#X78A52B00846562DE"><b>3.6-4</b></a>, and <a href="chap3.html#X7F9CAA577EB4070B"><b>3.6-5</b></a> for alternatives in lists and tables.</p>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Alt (%InnerText;)*&gt;  &lt;!-- This is only to allow "Only" and
                                    "Not" attributes for normal text --&gt;
&lt;!ATTLIST Alt Only CDATA #IMPLIED
              Not  CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>Of course exactly one of the two attributes must occur in one element. The attribute values must be one word or a list of words, separated by spaces or commas. The words which are currently recognized by the converter programs contained in <strong class="pkg">GAPDoc</strong> are: "<code class="code">LaTeX</code>", "<code class="code">HTML</code>", and "<code class="code">Text</code>". If the <code class="code">Only</code> attribute is specified then only the corresponding converter will include the content of the element into the output document. If the <code class="code">Not</code> attribute is specified the corresponding converter will ignore the content of the element. You can use other words to specify special alternatives for other converters of <strong class="pkg">GAPDoc</strong> documents.</p>

<p>We fix a rule for handling the content of an <code class="code">Alt</code> element with <code class="code">Only</code> attribute. In their content code for the corresponding output format is included directly. So, in case of HTML the content is HTML code, in case of LaTeX the content is LaTeX code. The converters don't apply any handling of special characters to this content.</p>

<p>Within the element only <code class="code">%InnerText;</code> (see <a href="chap3.html#X7BCC8E6F79021294"><b>here</b></a>) is allowed. This is to ensure that the same set of chapters, sections, and subsections show up in all output formats.</p>

<p><a id="X85D23A648444069F" name="X85D23A648444069F"></a></p>

<h5>3.9-2 <span class="Heading"><code class="code">&lt;Par&gt;</code> and 
                                 <code class="code">&lt;P&gt;</code></span></h5>


<table class="example">
<tr><td><pre>
&lt;!ELEMENT Par EMPTY&gt;    &lt;!-- this is intentionally empty! --&gt;
&lt;!ELEMENT P EMPTY&gt;      &lt;!-- the same as shortcut  --&gt;
</pre></td></tr></table>

<p>This <code class="code">EMPTY</code> element marks the boundary of paragraphs. Note that an empty line in the input does not mark a new paragraph as opposed to the LaTeX convention.</p>

<p>(Remark: it would be much easier to parse a document and to understand its sectioning and paragraph structure when there was an element whose <em>content</em> is the text of a paragraph. But in practice many paragraph boundaries are implicitly clear which would make it somewhat painful to enclose each paragraph in extra tags. The introduction of the <code class="code">P</code> or <code class="code">Par</code> elements as above delegates this pain to the writer of a conversion program for <strong class="pkg">GAPDoc</strong> documents.)</p>

<p><a id="X7A3EF0647B10C1EC" name="X7A3EF0647B10C1EC"></a></p>

<h5>3.9-3 <span class="Heading"><code class="code">&lt;Br&gt;</code></span></h5>


<table class="example">
<tr><td><pre> 
&lt;!ELEMENT Br EMPTY&gt;     &lt;!-- a forced line break  --&gt;
</pre></td></tr></table>

<p>This element can be used to force a line break in the output versions of a <strong class="pkg">GAPDoc</strong> element, it does not start a new paragraph. Please, do not use this instead of a <code class="code">Par</code> element, this would often lead to ugly output versions of your document.</p>

<p><a id="X7A81FB717A30B485" name="X7A81FB717A30B485"></a></p>

<h5>3.9-4 <span class="Heading"><code class="code">&lt;Ignore&gt;</code></span></h5>


<table class="example">
<tr><td><pre> 
&lt;!ELEMENT Ignore (%Text;| Chapter | Section | Subsection | ManSection |
                  Heading)*&gt;
&lt;!ATTLIST Ignore Remark CDATA #IMPLIED&gt;
</pre></td></tr></table>

<p>This element can appear anywhere. Its content is ignored by the standard converters. It can be used, for example, to include data which are not part of the actual <strong class="pkg">GAPDoc</strong> document, like source code, or to make not finished parts of the document invisible.</p>

<p>Of course, one can use special converter programs which extract the contents of <code class="code">Ignore</code> elements. Information on the type of the content can be stored in the optional attribute <code class="code">Remark</code>.</p>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">Top of Book</a>&nbsp;  &nbsp;<a href="chap2.html">Previous Chapter</a>&nbsp;  &nbsp;<a href="chap4.html">Next Chapter</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chapA.html">A</a>  <a href="chapB.html">B</a>  <a href="chapC.html">C</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>