CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
3 The Document Type Definition
3
4
In this chapter we first explain what a document type definition is and then
5
describe gapdoc.dtd in detail. That file together with the current chapter
6
define how a GAPDoc document has to look like. It can be found in the main
7
directory of the GAPDoc package and it is reproduced in Appendix B.
8
9
We do not give many examples in this chapter which is more intended as a
10
formal reference for all GAPDoc elements. Instead, we provide a separate
11
help book, see ???. This uses all the constructs introduced in this chapter
12
and you can easily compare the source code and how it looks like in the
13
different output formats. Furthermore recall that many basic things about
14
XML markup were already explained by example in the introductory chapter 1.
15
16
17
3.1 What is a DTD?
18
19
A document type definition (DTD) is a formal declaration of how an XML
20
document has to be structured. It is itself structured such that programs
21
that handle documents can read it and treat the documents accordingly. There
22
are for example parsers and validity checkers that use the DTD to validate
23
an XML document, see 2.1-14.
24
25
The main thing a DTD does is to specify which elements may occur in
26
documents of a certain document type, how they can be nested, and what
27
attributes they can or must have. So, for each element there is a rule.
28
29
Note that a DTD can not ensure that a document which is valid also makes
30
sense to the converters! It only says something about the formal structure
31
of the document.
32
33
For the remaining part of this chapter we have divided the elements of
34
GAPDoc documents into several subsets, each of which will be discussed in
35
one of the next sections.
36
37
See the following three subsections to learn by example, how a DTD works. We
38
do not want to be too formal here, but just enable the reader to understand
39
the declarations in gapdoc.dtd. For precise descriptions of the syntax of
40
DTD's see again the official standard in:
41
42
  http://www.xml.com/axml/axml.html
43
44
45
3.2 Overall Document Structure
46
47
A GAPDoc document contains on its top level exactly one element with name
48
Book. This element is declared in the DTD as follows:
49
50
51
3.2-1 <Book>
52
53
 From gapdoc.dtd 
54
<!ELEMENT Book (TitlePage,
55
 TableOfContents?,
56
 Body,
57
 Appendix*,
58
 Bibliography?,
59
 TheIndex?)>
60
<!ATTLIST Book Name CDATA #REQUIRED>
61

62
63
After the keyword ELEMENT and the name Book there is a list in parentheses.
64
This is a comma separated list of names of elements which can occur (in the
65
given order) in the content of a Book element. Each name in such a list can
66
be followed by one of the characters ?, * or +, meaning that the
67
corresponding element can occur zero or one time, an arbitrary number of
68
times, or at least once, respectively. Without such an extra character the
69
corresponding element must occur exactly once. Instead of one name in this
70
list there can also be a list of elements names separated by | characters,
71
this denotes any element with one of the names (i.e., | means or).
72
73
So, the Book element must contain first a TitlePage element, then an
74
optional TableOfContents element, then a Body element, then zero or more
75
elements of type Appendix, then an optional Bibliography element, and
76
finally an optional element of type TheIndex.
77
78
Note that only these elements are allowed in the content of the Book
79
element. No other elements or text is allowed in between. An exception of
80
this is that there may be whitespace between the end tag of one and the
81
start tag of the next element - this should be ignored when the document is
82
processed to some output format. An element like this is called an element
83
with element content.
84
85
The second declaration starts with the keyword ATTLIST and the element name
86
Book. After that there is a triple of whitespace separated parameters (in
87
general an arbitrary number of such triples, one for each allowed attribute
88
name). The first (Name) is the name of an attribute for a Book element. The
89
second (CDATA) is always the same for all of our declarations, it means that
90
the value of the attribute consists of character data. The third parameter
91
#REQUIRED means that this attribute must be specified with any Book element.
92
Later we will also see optional attributes which are declared as #IMPLIED.
93
94
95
3.2-2 <TitlePage>
96
97
 From gapdoc.dtd 
98
<!ELEMENT TitlePage (Title, Subtitle?, Version?, TitleComment?, 
99
 Author+, Date?, Address?, Abstract?, Copyright?, 
100
 Acknowledgements? , Colophon? )>
101

102
103
Within this element information for the title page is collected. Note that
104
more than one author can be specified. The elements must appear in this
105
order because there is no sensible way to specify in a DTD something like
106
the following elements may occur in any order but each exactly once.
107
108
Before going on with the other elements inside the Book element we explain
109
the elements for the title page.
110
111
112
3.2-3 <Title>
113
114
 From gapdoc.dtd 
115
<!ELEMENT Title (%Text;)*>
116

117
118
Here is the last construct you need to understand for reading gapdoc.dtd.
119
The expression %Text; is a so-called parameter entity. It is something like
120
a macro within the DTD. It is defined as follows:
121
122
 From gapdoc.dtd 
123
<!ENTITY % Text "%InnerText; | List | Enum | Table">
124

125
126
This means, that every occurrence of %Text; in the DTD is replaced by the
127
expression
128
129
 From gapdoc.dtd 
130
%InnerText; | List | Enum | Table
131

132
133
which is then expanded further because of the following definition:
134
135
 From gapdoc.dtd 
136
<!ENTITY % InnerText "#PCDATA |
137
 Alt |
138
 Emph | E |
139
 Par | P | Br |
140
 Keyword | K | Arg | A | Quoted | Q | Code | C | 
141
 File | F | Button | B | Package |
142
 M | Math | Display | 
143
 Example | Listing | Log | Verb |
144
 URL | Email | Homepage | Address | Cite | Label | 
145
 Ref | Index" > 
146

147
148
These are the only two parameter entities we are using. They expand to lists
149
of element names which are explained in the sequel and the keyword #PCDATA
150
(concatenated with the or character |).
151
152
So, the element (Title) is of so-called mixed content: It can contain parsed
153
character data which does not contain further markup (#PCDATA) or any of the
154
other above mentioned elements. Mixed content must always have the asterisk
155
qualifier (like in Title) such that any sequence of elements (of the above
156
list) and character data can be contained in a Title element.
157
158
The %Text; parameter entity is used in all places in the DTD, where normal
159
text should be allowed, including lists, enumerations, and tables, but no
160
sectioning elements.
161
162
The %InnerText; parameter entity is used in all places in the DTD, where
163
inner text should be allowed. This means, that no structures like lists,
164
enumerations, and tables are allowed. This is used for example in headings.
165
166
167
3.2-4 <Subtitle>
168
169
 From gapdoc.dtd 
170
<!ELEMENT Subtitle (%Text;)*>
171

172
173
Contains the subtitle of the document.
174
175
176
3.2-5 <Version>
177
178
 From gapdoc.dtd 
179
<!ELEMENT Version (#PCDATA|Alt)*>
180

181
182
Note that the version can only contain character data and no further markup
183
elements (except for Alt, which is necessary to resolve the entities
184
described in 2.2-3). The converters will not put the word Version in front
185
of the text in this element.
186
187
188
3.2-6 <TitleComment>
189
190
 From gapdoc.dtd 
191
<!ELEMENT TitleComment (%Text;)*>
192

193
194
Sometimes a title and subtitle are not sufficient to give a rough idea about
195
the content of a package. In this case use this optional element to specify
196
an additional text for the front page of the book. This text should be
197
short, use the Abstract element (see 3.2-10) for longer explanations.
198
199
200
3.2-7 <Author>
201
202
 From gapdoc.dtd 
203
<!ELEMENT Author (%Text;)*> <!-- There may be more than one Author! -->
204

205
206
As noted in the comment there may be more than one element of this type.
207
This element should contain the name of an author and probably an
208
Email-address and/or WWW-Homepage element for this author, see 3.5-6
209
and 3.5-7. You can also specify an individual postal address here, instead
210
of using the Address element described below, see 3.2-9.
211
212
213
3.2-8 <Date>
214
215
 From gapdoc.dtd 
216
<!ELEMENT Date (#PCDATA)>
217

218
219
Only character data is allowed in this element which gives a date for the
220
document. No automatic formatting is done.
221
222
223
3.2-9 <Address>
224
225
 From gapdoc.dtd 
226
<!ELEMENT Address (#PCDATA|Alt|Br)*>
227

228
229
This optional element can be used to specify a postal address of the author
230
or the authors. If there are several authors with different addresses then
231
put the Address elements inside the Author elements.
232
233
Use the Br element (see 3.9-3) to mark the line breaks in the usual
234
formatting of the address on a letter.
235
236
Note that often it is not necessary to use this element because a postal
237
address is easy to find via a link to a personal web page.
238
239
240
3.2-10 <Abstract>
241
242
 From gapdoc.dtd 
243
<!ELEMENT Abstract (%Text;)*>
244

245
246
This element contains an abstract of the whole book.
247
248
249
3.2-11 <Copyright>
250
251
 From gapdoc.dtd 
252
<!ELEMENT Copyright (%Text;)*>
253

254
255
This element is used for the copyright notice. Note the &copyright; entity
256
as described in section 2.2-3.
257
258
259
3.2-12 <Acknowledgements>
260
261
 From gapdoc.dtd 
262
<!ELEMENT Acknowledgements (%Text;)*>
263

264
265
This element contains the acknowledgements.
266
267
268
3.2-13 <Colophon>
269
270
 From gapdoc.dtd 
271
<!ELEMENT Colophon (%Text;)*>
272

273
274
The colophon page is used to say something about the history of a document.
275
276
277
3.2-14 <TableOfContents>
278
279
 From gapdoc.dtd 
280
<!ELEMENT TableOfContents EMPTY>
281

282
283
This element may occur in the Book element after the TitlePage element. If
284
it is present, a table of contents is generated and inserted into the
285
document. Note that because this element is declared to be EMPTY one can use
286
the abbreviation
287
288
 Example 
289
<TableOfContents/>
290

291
292
to denote this empty element.
293
294
295
3.2-15 <Bibliography>
296
297
 From gapdoc.dtd 
298
<!ELEMENT Bibliography EMPTY>
299
<!ATTLIST Bibliography Databases CDATA #REQUIRED
300
 Style CDATA #IMPLIED>
301

302
303
This element may occur in the Book element after the last Appendix element.
304
If it is present, a bibliography section is generated and inserted into the
305
document. The attribute Databases must be specified, the names of several
306
data files can be specified, separated by commas.
307
308
Two kinds of files can be specified in Databases: The first are BibTeX files
309
as defined in [Lam85, Appendix B]. Such files must have a name with
310
extension .bib, and in Databases the name must be given without this
311
extension. Note that such .bib-files should be in latin1-encoding (or
312
ASCII-encoding). The second are files in BibXMLext format as defined in
313
Section 7.2. These files must have an extension .xml and in Databases the
314
full name must be specified.
315
316
We suggest to use the BibXMLext format because it allows to produce
317
potentially nicer bibliography entries in text and HTML documents.
318
319
A bibliography style may be specified with the Style attribute. The optional
320
Style attribute (for LaTeX output of the document) must also be specified
321
without the .bst extension (the default is alpha). See also section 3.5-3
322
for a description of the Cite element which is used to include bibliography
323
references into the text.
324
325
326
3.2-16 <TheIndex>
327
328
 From gapdoc.dtd 
329
<!ELEMENT TheIndex EMPTY>
330

331
332
This element may occur in the Book element after the Bibliography element.
333
If it is present, an index is generated and inserted into the document.
334
There are elements in GAPDoc which implicitly generate index entries (e.g.,
335
Func (3.4-2)) and there is an element Index (3.5-4) for explicitly adding
336
index entries.
337
338
339
3.3 Sectioning Elements
340
341
A GAPDoc book is divided into chapters, sections, and subsections. The idea
342
is of course, that a chapter consists of sections, which in turn consist of
343
subsections. However for the sake of flexibility, the rules are not too
344
restrictive. Firstly, text is allowed everywhere in the body of the document
345
(and not only within sections). Secondly, the chapter level may be omitted.
346
The exact rules are described below.
347
348
Appendices are a flavor of chapters, occurring after all regular chapters.
349
There is a special type of subsection called ManSection. This is a
350
subsection devoted to the description of a function, operation or variable.
351
It is analogous to a manpage in the UNIX environment. Usually each function,
352
operation, method, and so on should have its own ManSection.
353
354
Cross referencing is done on the level of Subsections, respectively
355
ManSections. The topics in GAP's online help are also pointing to
356
subsections. So, they should not be too long.
357
358
We start our description of the sectioning elements top-down:
359
360
361
3.3-1 <Body>
362
363
The Body element marks the main part of the document. It must occur after
364
the TableOfContents element. There is a big difference between inside and
365
outside of this element: Whereas regular text is allowed nearly everywhere
366
in the Body element and its subelements, this is not true for the outside.
367
This has also implications on the handling of whitespace. Outside
368
superfluous whitespace is usually ignored when it occurs between elements.
369
Inside of the Body element whitespace matters because character data is
370
allowed nearly everywhere. Here is the definition in the DTD:
371
372
 From gapdoc.dtd 
373
<!ELEMENT Body ( %Text;| Chapter | Section )*>
374

375
376
The fact that Chapter and Section elements are allowed here leads to the
377
possibility to omit the chapter level entirely in the document. For a
378
description of %Text; see 3.2-3.
379
380
(Remark: The purpose of this element is to make sure that a valid GAPDoc
381
document has a correct overall structure, which is only possible when the
382
top element Book has element content.)
383
384
385
3.3-2 <Chapter>
386
387
 From gapdoc.dtd 
388
<!ELEMENT Chapter (%Text;| Heading | Section)*>
389
<!ATTLIST Chapter Label CDATA #IMPLIED> <!-- For reference purposes -->
390

391
392
A Chapter element can have a Label attribute, such that this chapter can be
393
referenced later on with a Ref element (see section 3.5-1). Note that you
394
have to specify a label to reference the chapter as there is no automatic
395
labelling!
396
397
Chapter elements can contain text (for a description of %Text; see 3.2-3),
398
Section elements, and Heading elements.
399
400
The following additional rule cannot be stated in the DTD because we want a
401
Chapter element to have mixed content. There must be exactly one Heading
402
element in the Chapter element, containing the heading of the chapter. Here
403
is its definition:
404
405
406
3.3-3 <Heading>
407
408
 From gapdoc.dtd 
409
<!ELEMENT Heading (%InnerText;)*>
410

411
412
This element is used for headings in Chapter, Section, Subsection, and
413
Appendix elements. It may only contain %InnerText; (for a description see
414
3.2-3).
415
416
Each of the mentioned sectioning elements must contain exactly one direct
417
Heading element (i.e., one which is not contained in another sectioning
418
element).
419
420
421
3.3-4 <Appendix>
422
423
 From gapdoc.dtd 
424
<!ELEMENT Appendix (%Text;| Heading | Section)*>
425
<!ATTLIST Appendix Label CDATA #IMPLIED> <!-- For reference purposes -->
426

427
428
The Appendix element behaves exactly like a Chapter element (see 3.3-2)
429
except for the position within the document and the numbering. While
430
chapters are counted with numbers (1., 2., 3., ...) the appendices are
431
counted with capital letters (A., B., ...).
432
433
Again there is an optional Label attribute used for references.
434
435
436
3.3-5 <Section>
437
438
 From gapdoc.dtd 
439
<!ELEMENT Section (%Text;| Heading | Subsection | ManSection)*>
440
<!ATTLIST Section Label CDATA #IMPLIED> <!-- For reference purposes -->
441

442
443
A Section element can have a Label attribute, such that this section can be
444
referenced later on with a Ref element (see section 3.5-1). Note that you
445
have to specify a label to reference the section as there is no automatic
446
labelling!
447
448
Section elements can contain text (for a description of %Text; see 3.2-3),
449
Heading elements, and subsections.
450
451
There must be exactly one direct Heading element in a Section element,
452
containing the heading of the section.
453
454
Note that a subsection is either a Subsection element or a ManSection
455
element.
456
457
458
3.3-6 <Subsection>
459
460
 From gapdoc.dtd 
461
<!ELEMENT Subsection (%Text;| Heading)*>
462
<!ATTLIST Subsection Label CDATA #IMPLIED> <!-- For reference purposes -->
463

464
465
The Subsection element can have a Label attribute, such that this subsection
466
can be referenced later on with a Ref element (see section 3.5-1). Note that
467
you have to specify a label to reference the subsection as there is no
468
automatic labelling!
469
470
Subsection elements can contain text (for a description of %Text; see
471
3.2-3), and Heading elements.
472
473
There must be exactly one Heading element in a Subsection element,
474
containing the heading of the subsection.
475
476
Another type of subsection is a ManSection, explained now:
477
478
479
3.4 ManSection–a special kind of subsection
480
481
ManSections are intended to describe a function, operation, method,
482
variable, or some other technical instance. It is analogous to a manpage in
483
the UNIX environment.
484
485
486
3.4-1 <ManSection>
487
488
 From gapdoc.dtd 
489
<!ELEMENT ManSection ( Heading?, 
490
 ((Func, Returns?) | (Oper, Returns?) | 
491
 (Meth, Returns?) | (Filt, Returns?) | 
492
 (Prop, Returns?) | (Attr, Returns?) |
493
 (Constr, Returns?) |
494
 Var | Fam | InfoClass)+, Description )>
495
<!ATTLIST ManSection Label CDATA #IMPLIED> <!-- For reference purposes -->
496

497
<!ELEMENT Returns (%Text;)*>
498
<!ELEMENT Description (%Text;)*>
499

500
501
The ManSection element can have a Label attribute, such that this subsection
502
can be referenced later on with a Ref element (see section 3.5-1). But this
503
is probably rarely necessary because the elements Func and so on (explained
504
below) generate automatically labels for cross referencing.
505
506
The content of a ManSection element is one or more elements describing
507
certain items in GAP, each of them optionally followed by a Returns element,
508
followed by a Description element, which contains %Text; (see 3.2-3)
509
describing it. (Remember to include examples in the description as often as
510
possible, see 3.7-10). The classes of items GAPDoc knows of are: functions
511
(Func), operations (Oper), constructors (Constr), methods (Meth), filters
512
(Filt), properties (Prop), attributes (Attr), variables (Var), families
513
(Fam), and info classes (InfoClass). One ManSection should only describe
514
several of such items when these are very closely related.
515
516
Each element for an item corresponding to a GAP function can be followed by
517
a Returns element. In output versions of the document the string Returns: 
518
will be put in front of the content text. The text in the Returns element
519
should usually be a short hint about the type of object returned by the
520
function. This is intended to give a good mnemonic for the use of a function
521
(together with a good choice of names for the formal arguments).
522
523
ManSections are also sectioning elements which count as subsections. Usually
524
there should be no Heading-element in a ManSection, in that case a heading
525
is generated automatically from the first Func-like element. Sometimes this
526
default behaviour does not look appropriate, for example when there are
527
several Func-like elements. For such cases an optional Heading is allowed.
528
529
530
3.4-2 <Func>
531
532
 From gapdoc.dtd 
533
<!ELEMENT Func EMPTY>
534
<!ATTLIST Func Name CDATA #REQUIRED
535
 Label CDATA #IMPLIED
536
 Arg CDATA #REQUIRED
537
 Comm CDATA #IMPLIED>
538

539
540
This element is used within a ManSection element to specify the usage of a
541
function. The Name attribute is required and its value is the name of the
542
function. The value of the Arg attribute (also required) contains the full
543
list of arguments including optional parts, which are denoted by square
544
brackets. The argument names can be separated by whitespace, commas or the
545
square brackets for the optional arguments, like "grp[, elm]" or
546
"xx[y[z] ]". If GAP options are used, this can be followed by a colon : and
547
one or more assignments, like "n[, r]: tries := 100".
548
549
The name of the function is also used as label for cross referencing. When
550
the name of the function appears in the text of the document it should
551
always be written with the Ref element, see 3.5-1. This allows to use a
552
unique typesetting style for function names and automatic cross referencing.
553
554
If the optional Label attribute is given, it is appended (with a colon : in
555
between) to the name of the function for cross referencing purposes. The
556
text of the label can also appear in the document text. So, it should be a
557
kind of short explanation.
558
559
 Example 
560
<Func Arg="x[, y]" Name="LibFunc" Label="for my objects"/>
561

562
563
The optional Comm attribute should be a short description of the function,
564
usually at most one line long (this is currently nowhere used).
565
566
This element automatically produces an index entry with the name of the
567
function and, if present, the text of the Label attribute as subentry (see
568
also 3.2-16 and 3.5-4).
569
570
571
3.4-3 <Oper>
572
573
 From gapdoc.dtd 
574
<!ELEMENT Oper EMPTY>
575
<!ATTLIST Oper Name CDATA #REQUIRED
576
 Label CDATA #IMPLIED
577
 Arg CDATA #REQUIRED
578
 Comm CDATA #IMPLIED>
579

580
581
This element is used within a ManSection element to specify the usage of an
582
operation. The attributes are used exactly in the same way as in the Func
583
element (see 3.4-2).
584
585
Note that multiple descriptions of the same operation may occur in a
586
document because there may be several declarations in GAP. Furthermore there
587
may be several ManSections for methods of this operation (see 3.4-5) which
588
also use the same name. For reference purposes these must be distinguished
589
by different Label attributes.
590
591
592
3.4-4 <Constr>
593
594
 From gapdoc.dtd 
595
<!ELEMENT Constr EMPTY>
596
<!ATTLIST Constr Name CDATA #REQUIRED
597
 Label CDATA #IMPLIED
598
 Arg CDATA #REQUIRED
599
 Comm CDATA #IMPLIED>
600

601
602
This element is used within a ManSection element to specify the usage of a
603
constructor. The attributes are used exactly in the same way as in the Func
604
element (see 3.4-2).
605
606
Note that multiple descriptions of the same constructor may occur in a
607
document because there may be several declarations in GAP. Furthermore there
608
may be several ManSections for methods of this constructor (see 3.4-5) which
609
also use the same name. For reference purposes these must be distinguished
610
by different Label attributes.
611
612
613
3.4-5 <Meth>
614
615
 From gapdoc.dtd 
616
<!ELEMENT Meth EMPTY>
617
<!ATTLIST Meth Name CDATA #REQUIRED
618
 Label CDATA #IMPLIED
619
 Arg CDATA #REQUIRED
620
 Comm CDATA #IMPLIED>
621

622
623
This element is used within a ManSection element to specify the usage of a
624
method. The attributes are used exactly in the same way as in the Func
625
element (see 3.4-2).
626
627
Frequently, an operation is implemented by several different methods.
628
Therefore it seems to be interesting to document them independently. This is
629
possible by using the same method name in different ManSections. It is
630
however required that these subsections and those describing the
631
corresponding operation are distinguished by different Label attributes.
632
633
634
3.4-6 <Filt>
635
636
 From gapdoc.dtd 
637
<!ELEMENT Filt EMPTY>
638
<!ATTLIST Filt Name CDATA #REQUIRED
639
 Label CDATA #IMPLIED
640
 Arg CDATA #IMPLIED
641
 Comm CDATA #IMPLIED
642
 Type CDATA #IMPLIED>
643

644
645
This element is used within a ManSection element to specify the usage of a
646
filter. The first four attributes are used in the same way as in the Func
647
element (see 3.4-2), except that the Arg attribute is optional.
648
649
The Type attribute can be any string, but it is thought to be something like
650
Category or Representation.
651
652
653
3.4-7 <Prop>
654
655
 From gapdoc.dtd 
656
<!ELEMENT Prop EMPTY>
657
<!ATTLIST Prop Name CDATA #REQUIRED
658
 Label CDATA #IMPLIED
659
 Arg CDATA #REQUIRED
660
 Comm CDATA #IMPLIED>
661

662
663
This element is used within a ManSection element to specify the usage of a
664
property. The attributes are used exactly in the same way as in the Func
665
element (see 3.4-2).
666
667
668
3.4-8 <Attr>
669
670
 From gapdoc.dtd 
671
<!ELEMENT Attr EMPTY>
672
<!ATTLIST Attr Name CDATA #REQUIRED
673
 Label CDATA #IMPLIED
674
 Arg CDATA #REQUIRED
675
 Comm CDATA #IMPLIED>
676

677
678
This element is used within a ManSection element to specify the usage of an
679
attribute (in GAP). The attributes are used exactly in the same way as in
680
the Func element (see 3.4-2).
681
682
683
3.4-9 <Var>
684
685
 From gapdoc.dtd 
686
<!ELEMENT Var EMPTY>
687
<!ATTLIST Var Name CDATA #REQUIRED
688
 Label CDATA #IMPLIED
689
 Comm CDATA #IMPLIED>
690

691
692
This element is used within a ManSection element to document a global
693
variable. The attributes are used exactly in the same way as in the Func
694
element (see 3.4-2) except that there is no Arg attribute.
695
696
697
3.4-10 <Fam>
698
699
 From gapdoc.dtd 
700
<!ELEMENT Fam EMPTY>
701
<!ATTLIST Fam Name CDATA #REQUIRED
702
 Label CDATA #IMPLIED
703
 Comm CDATA #IMPLIED>
704

705
706
This element is used within a ManSection element to document a family. The
707
attributes are used exactly in the same way as in the Func element (see
708
3.4-2) except that there is no Arg attribute.
709
710
711
3.4-11 <InfoClass>
712
713
 From gapdoc.dtd 
714
<!ELEMENT InfoClass EMPTY>
715
<!ATTLIST InfoClass Name CDATA #REQUIRED
716
 Label CDATA #IMPLIED
717
 Comm CDATA #IMPLIED>
718

719
720
This element is used within a ManSection element to document an info class.
721
The attributes are used exactly in the same way as in the Func element (see
722
3.4-2) except that there is no Arg attribute.
723
724
725
3.5 Cross Referencing and Citations
726
727
Cross referencing in the GAPDoc system is somewhat different to the usual
728
LaTeX cross referencing in so far, that a reference knows which type of
729
object it is referencing. For example a reference to a function is
730
distinguished from a reference to a chapter. The idea of this is, that the
731
markup must contain this information such that the converters can produce
732
better output. The HTML converter can for example typeset a function
733
reference just as the name of the function with a link to the description of
734
the function, or a chapter reference as a number with a link in the other
735
case.
736
737
Referencing is done with the Ref element:
738
739
740
3.5-1 <Ref>
741
742
 From gapdoc.dtd 
743
<!ELEMENT Ref EMPTY>
744
<!ATTLIST Ref Func CDATA #IMPLIED
745
 Oper CDATA #IMPLIED
746
 Constr CDATA #IMPLIED
747
 Meth CDATA #IMPLIED
748
 Filt CDATA #IMPLIED
749
 Prop CDATA #IMPLIED
750
 Attr CDATA #IMPLIED
751
 Var CDATA #IMPLIED
752
 Fam CDATA #IMPLIED
753
 InfoClass CDATA #IMPLIED
754
 Chap CDATA #IMPLIED
755
 Sect CDATA #IMPLIED
756
 Subsect CDATA #IMPLIED
757
 Appendix CDATA #IMPLIED
758
 Text CDATA #IMPLIED
759

760
 Label CDATA #IMPLIED
761
 BookName CDATA #IMPLIED
762
 Style (Text | Number) #IMPLIED> <!-- normally automatic -->
763

764
765
The Ref element is defined to be EMPTY. If one of the attributes Func, Oper,
766
Constr, Meth, Prop, Attr, Var, Fam, InfoClass, Chap, Sect, Subsect, Appendix
767
is given then there must be exactly one of these, making the reference one
768
to the corresponding object. The Label attribute can be specified in
769
addition to make the reference unique, for example if more than one method
770
with a given name is present. (Note that there is no way to specify in the
771
DTD that exactly one of the first listed attributes must be given, this is
772
an additional rule.)
773
774
A reference to a Label element defined below (see 3.5-2) is done by giving
775
the Label attribute and optionally the Text attribute. If the Text attribute
776
is present its value is typeset in place of the Ref element, if linking is
777
possible (for example in HTML). If this is not possible, the section number
778
is typeset. This type of reference is also used for references to tables
779
(see 3.6-5).
780
781
An external reference into another book can be specified by using the
782
BookName attribute. In this case the Label attribute or, if this is not
783
given, the function or section like attribute, is used to resolve the
784
reference. The generated reference points to the first hit when asking ?book
785
name: label inside GAP.
786
787
The optional attribute Style can take only the values Text and Number. It
788
can be used with references to sectioning units and it gives a hint to the
789
converter programs, whether an explicit section number is generated or text.
790
Normally all references to sections generate numbers and references to a GAP
791
object generate the name of the corresponding object with some additional
792
link or sectioning information, which is the behavior of Style="Text". In
793
case Style="Number" in all cases an explicit section number is generated. So
794
795
 Example 
796
<Ref Subsect="Func" Style="Text"/> described in section 
797
<Ref Subsect="Func" Style="Number"/>
798

799
800
produces: '<Func>' described in section 3.4-2.
801
802
803
3.5-2 <Label>
804
805
 From gapdoc.dtd 
806
<!ELEMENT Label EMPTY>
807
<!ATTLIST Label Name CDATA #REQUIRED>
808

809
810
This element is used to define a label for referencing a certain position in
811
the document, if this is possible. If an exact reference is not possible
812
(like in a printed version of the document) a reference to the corresponding
813
subsection is generated. The value of the Name attribute must be unique
814
under all Label elements.
815
816
817
3.5-3 <Cite>
818
819
 From gapdoc.dtd 
820
<!ELEMENT Cite EMPTY>
821
<!ATTLIST Cite Key CDATA #REQUIRED
822
 Where CDATA #IMPLIED>
823

824
825
This element is for bibliography citations. It is EMPTY by definition. The
826
attribute Key is the key for a lookup in a BibTeX database that has to be
827
specified in the Bibliography element (see 3.2-15). The value of the Where
828
attribute specifies the position in the document as in the corresponding
829
LaTeX syntax \cite[Where value]{Key value}.
830
831
832
3.5-4 <Index>
833
834
 From gapdoc.dtd 
835
<!ELEMENT Index (%InnerText;|Subkey)*>
836
<!ATTLIST Index Key CDATA #IMPLIED
837
 Subkey CDATA #IMPLIED>
838
<!ELEMENT Subkey (%InnerText;)*>
839

840
841
This element generates an index entry. The content of the element is typeset
842
in the index. It can optionally contain a Subkey element. If one or both of
843
the attributes Key and Subkey are given, then the attribute values are used
844
for sorting the index entries. Otherwise the content itself is used for
845
sorting. The attributes should be used when the content contains markup.
846
Note that all Func and similar elements automatically generate index
847
entries. If the TheIndex element (3.2-16) is not present in the document all
848
Index elements are ignored.
849
850
851
3.5-5 <URL>
852
853
 From gapdoc.dtd 
854
<!ELEMENT URL (#PCDATA|Alt|Link|LinkText)*> <!-- Link, LinkText
855
 variant for case where text needs further markup -->
856
<!ATTLIST URL Text CDATA #IMPLIED> <!-- This is for output formats
857
 that have links like HTML -->
858
<!ELEMENT Link (%InnerText;)*> <!-- the URL -->
859
<!ELEMENT LinkText (%InnerText;)*> <!-- text for links, can contain markup -->
860

861

862
863
This element is for references into the internet. It specifies an URL and
864
optionally a text which can be used for a link (like in HTML or PDF versions
865
of the document). This can be specified in two ways: Either the URL is given
866
as element content and the text is given in the optional Text attribute (in
867
this case the text cannot contain further markup), or the element contains
868
the two elements Link and LinkText which in turn contain the URL and the
869
text, respectively. The default value for the text is the URL itself.
870
871
872
3.5-6 <Email>
873
874
 From gapdoc.dtd 
875
<!ELEMENT Email (#PCDATA|Alt|Link|LinkText)*>
876

877
878
This element type is the special case of an URL specifying an email address.
879
The content of the element should be the email address without any prefix
880
like mailto:. This address is typeset by all converters, also without any
881
prefix. In the case of an output document format like HTML the converter can
882
produce a link with a mailto: prefix.
883
884
885
3.5-7 <Homepage>
886
887
 From gapdoc.dtd 
888
<!ELEMENT Homepage (#PCDATA|Alt|Link|LinkText)*>
889

890
891
This element type is the special case of an URL specifying a WWW-homepage.
892
893
894
3.6 Structural Elements like Lists
895
896
The GAPDoc system offers some limited access to structural elements like
897
lists, enumerations, and tables. Although it is possible to use all LaTeX
898
constructs one always has to think about other output formats. The elements
899
in this section are guaranteed to produce something reasonable in all output
900
formats.
901
902
903
3.6-1 <List>
904
905
 From gapdoc.dtd 
906
<!ELEMENT List ( ((Mark,Item)|Item)+ )>
907
<!ATTLIST List Only CDATA #IMPLIED
908
 Not CDATA #IMPLIED>
909

910
911
This element produces a list. Each item in the list corresponds to an Item
912
element. Every Item element is optionally preceded by a Mark element. The
913
content of this is used as a marker for the item. Note that this marker can
914
be a whole word or even a sentence. It will be typeset in some emphasized
915
fashion and most converters will provide some indentation for the rest of
916
the item.
917
918
The Only and Not attributes can be used to specify, that the list is
919
included into the output by only one type of converter (Only) or all but one
920
type of converter (Not). Of course at most one of the two attributes may
921
occur in one element. The following values are allowed as of now: LaTeX,
922
HTML, and Text. See also the Alt element in 3.9-1 for more about text
923
alternatives for certain converters.
924
925
926
3.6-2 <Mark>
927
928
 From gapdoc.dtd 
929
<!ELEMENT Mark ( %InnerText;)*>
930

931
932
This element is used in the List element to mark items. See 3.6-1 for an
933
explanation.
934
935
936
3.6-3 <Item>
937
938
 From gapdoc.dtd 
939
<!ELEMENT Item ( %Text;)*>
940

941
942
This element is used in the List, Enum, and Table elements to specify the
943
items. See sections 3.6-1, 3.6-4, and 3.6-5 for further information.
944
945
946
3.6-4 <Enum>
947
948
 From gapdoc.dtd 
949
<!ELEMENT Enum ( Item+ )>
950
<!ATTLIST Enum Only CDATA #IMPLIED
951
 Not CDATA #IMPLIED>
952

953
954
This element is used like the List element (see 3.6-1) except that the items
955
must not have marks attached to them. Instead, the items are numbered
956
automatically. The same comments about the Only and Not attributes as above
957
apply.
958
959
960
3.6-5 <Table>
961
962
 From gapdoc.dtd 
963
<!ELEMENT Table ( Caption?, (Row | HorLine)+ )>
964
<!ATTLIST Table Label CDATA #IMPLIED
965
 Only CDATA #IMPLIED
966
 Not CDATA #IMPLIED
967
 Align CDATA #REQUIRED>
968
 <!-- We allow | and l,c,r, nothing else -->
969
<!ELEMENT Row ( Item+ )>
970
<!ELEMENT HorLine EMPTY>
971
<!ELEMENT Caption ( %InnerText;)*>
972

973
974
A table in GAPDoc consists of an optional Caption element followed by a
975
sequence of Row and HorLine elements. A HorLine element produces a
976
horizontal line in the table. A Row element consists of a sequence of Item
977
elements as they also occur in List and Enum elements. The Only and Not
978
attributes have the same functionality as described in the List element in
979
3.6-1.
980
981
The Align attribute is written like a LaTeX tabular alignment specifier but
982
only the letters l, r, c, and | are allowed meaning left alignment, right
983
alignment, centered alignment, and a vertical line as delimiter between
984
columns respectively.
985
986
If the Label attribute is there, one can reference the table with the Ref
987
element (see 3.5-1) using its Label attribute.
988
989
Usually only simple tables should be used. If you want a complicated table
990
in the LaTeX output you should provide alternatives for text and HTML
991
output. Note that in HTML-4.0 there is no possibility to interpret the |
992
column separators and HorLine elements as intended. There are lines between
993
all columns and rows or no lines at all.
994
995
996
3.7 Types of Text
997
998
This section covers the markup of text. Various types of text exist. The
999
following elements are used in the GAPDoc system to mark them. They mostly
1000
come in pairs, one long name which is easier to remember and a shortcut to
1001
make the markup lighter.
1002
1003
Most of the following elements are thought to contain only character data
1004
and no further markup elements. It is however necessary to allow Alt
1005
elements to resolve the entities described in section 2.2-3.
1006
1007
1008
3.7-1 <Emph> and <E>
1009
1010
 From gapdoc.dtd 
1011
<!ELEMENT Emph (%InnerText;)*> <!-- Emphasize something -->
1012
<!ELEMENT E (%InnerText;)*> <!-- the same as shortcut -->
1013

1014
1015
This element is used to emphasize some piece of text. It may contain
1016
%InnerText; (see 3.2-3).
1017
1018
1019
3.7-2 <Quoted> and <Q>
1020
1021
 From gapdoc.dtd 
1022
<!ELEMENT Quoted (%InnerText;)*> <!-- Quoted (in quotes) text -->
1023
<!ELEMENT Q (%InnerText;)*> <!-- Quoted text (shortcut) -->
1024

1025
1026
This element is used to put some piece of text into  -quotes. It may contain
1027
%InnerText; (see 3.2-3).
1028
1029
1030
3.7-3 <Keyword> and <K>
1031
1032
 From gapdoc.dtd 
1033
<!ELEMENT Keyword (#PCDATA|Alt)*> <!-- Keyword -->
1034
<!ELEMENT K (#PCDATA|Alt)*> <!-- Keyword (shortcut) -->
1035

1036
1037
This element is used to mark something as a keyword. Usually this will be a
1038
GAP keyword such as if or for. No further markup elements are allowed within
1039
this element except for the Alt element, which is necessary.
1040
1041
1042
3.7-4 <Arg> and <A>
1043
1044
 From gapdoc.dtd 
1045
<!ELEMENT Arg (#PCDATA|Alt)*> <!-- Argument -->
1046
<!ELEMENT A (#PCDATA|Alt)*> <!-- Argument (shortcut) -->
1047

1048
1049
This element is used inside Descriptions in ManSections to mark something as
1050
an argument (of a function, operation, or such). It is guaranteed that the
1051
converters typeset those exactly as in the definition of functions. No
1052
further markup elements are allowed within this element.
1053
1054
1055
3.7-5 <Code> and <C>
1056
1057
 From gapdoc.dtd 
1058
<!ELEMENT Code (#PCDATA|Arg|Alt)*> <!-- GAP code -->
1059
<!ELEMENT C (#PCDATA|Arg|Alt)*> <!-- GAP code (shortcut) -->
1060

1061
1062
This element is used to mark something as a piece of code like for example a
1063
GAP expression. It is guaranteed that the converters typeset this exactly as
1064
in the Listing element (compare section 3.7-9). The only further markup
1065
elements allowed within this element are <Arg> elements (see 3.7-4).
1066
1067
1068
3.7-6 <File> and <F>
1069
1070
 From gapdoc.dtd 
1071
<!ELEMENT File (#PCDATA|Alt)*> <!-- Filename -->
1072
<!ELEMENT F (#PCDATA|Alt)*> <!-- Filename (shortcut) -->
1073

1074
1075
This element is used to mark something as a filename or a pathname in the
1076
file system. No further markup elements are allowed within this element.
1077
1078
1079
3.7-7 <Button> and <B>
1080
1081
 From gapdoc.dtd 
1082
<!ELEMENT Button (#PCDATA|Alt)*> <!-- "Button" (also Menu, Key, ...) -->
1083
<!ELEMENT B (#PCDATA|Alt)*> <!-- "Button" (shortcut) -->
1084

1085
1086
This element is used to mark something as a button. It can also be used for
1087
other items in a graphical user interface like menus, menu entries, or keys.
1088
No further markup elements are allowed within this element.
1089
1090
1091
3.7-8 <Package>
1092
1093
 From gapdoc.dtd 
1094
<!ELEMENT Package (#PCDATA|Alt)*> <!-- A package name -->
1095

1096
1097
This element is used to mark something as a name of a package. This is for
1098
example used to define the entities GAP, XGAP or GAPDoc (see section 2.2-3).
1099
No further markup elements are allowed within this element.
1100
1101
1102
3.7-9 <Listing>
1103
1104
 From gapdoc.dtd 
1105
<!ELEMENT Listing (#PCDATA)> <!-- This is just for GAP code listings -->
1106
<!ATTLIST Listing Type CDATA #IMPLIED> <!-- a comment about the type of
1107
 listed code, may appear in
1108
 output -->
1109

1110
1111
This element is used to embed listings of programs into the document. Only
1112
character data and no other elements are allowed in the content. You should
1113
not use the character entities described in section 2.2-3 but instead type
1114
the characters directly. Only the general XML rules from section 2.1 apply.
1115
Note especially the usage of <![CDATA[ sections described there. It is
1116
guaranteed that all converters use a fixed width font for typesetting
1117
Listing elements. Compare also the usage of the Code and C elements in
1118
3.7-5.
1119
1120
The Type attribute contains a comment about the type of listed code. It may
1121
appear in the output.
1122
1123
1124
3.7-10 <Log> and <Example>
1125
1126
 From gapdoc.dtd 
1127
<!ELEMENT Example (#PCDATA)> <!-- This is subject to the automatic 
1128
 example checking mechanism -->
1129
<!ELEMENT Log (#PCDATA)> <!-- This not -->
1130

1131
1132
These two elements behave exactly like the Listing element (see 3.7-9). They
1133
are thought for protocols of GAP sessions. The only difference between the
1134
two is that Example sections are intended to be subject to an automatic
1135
manual checking mechanism used to ensure the correctness of the GAP manual
1136
whereas Log is not touched by this (see section 5.4 for checking tools).
1137
1138
To get a good layout of the examples for display in a standard terminal we
1139
suggest to use SizeScreen([72]); (see SizeScreen (Reference: SizeScreen)) in
1140
your GAP session before producing the content of Example elements.
1141
1142
1143
3.7-11 <Verb>
1144
1145
There is one further type of verbatim-like element.
1146
1147
 From gapdoc.dtd 
1148
<!ELEMENT Verb (#PCDATA)> 
1149

1150
1151
The content of such an element is guaranteed to be put into an output
1152
version exactly as it is using some fixed width font. Before the content a
1153
new line is started. If the line after the end of the start tag consists of
1154
whitespace only then this part of the content is skipped.
1155
1156
This element is intended to be used together with the Alt element to specify
1157
pre-formatted ASCII alternatives for complicated Display formulae or Tables.
1158
1159
1160
3.8 Elements for Mathematical Formulae
1161
1162
1163
3.8-1 <Math> and <Display>
1164
1165
 From gapdoc.dtd 
1166
<!-- Normal TeX math mode formula -->
1167
<!ELEMENT Math (#PCDATA|A|Arg|Alt)*> 
1168
<!-- TeX displayed math mode formula -->
1169
<!ELEMENT Display (#PCDATA|A|Arg|Alt)*>
1170
<!-- Mode="M" causes <M>-style formatting -->
1171
<!ATTLIST Display Mode CDATA #IMPLIED>
1172

1173
1174
These elements are used for mathematical formulae. As described in section
1175
2.2-2 they correspond to LaTeX's math and display math mode respectively.
1176
1177
The formulae are typed in as in LaTeX, except that the standard XML
1178
entities, see 2.1-9 (in particular the characters < and &), must be escaped
1179
- either by using the corresponding entities or by enclosing the formula
1180
between <![CDATA[ and ]]>. (The main reference for LaTeX is [Lam85].)
1181
1182
It is also possible to use some unicode characters for mathematical symbols
1183
directly, provided that it can be translated by Encode (6.2-2) into "LaTeX"
1184
encoding and that SimplifiedUnicodeString (6.2-2) with arguments "latin1"
1185
and "single" returns something sensible. Currently, we support entities
1186
&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR; for the corresponding black board
1187
bold letters ℂ, ℤ, ℕ, ℙ, ℚ, ℍ and ℝ, respectively.
1188
1189
The only element type that is allowed within the formula elements is the Arg
1190
or A element (see 3.7-4), which is used to typeset identifiers that are
1191
arguments to GAP functions or operations.
1192
1193
If a Display element has an attribute Mode with value "M", then the formula
1194
is formatted as in M elements (see 3.8-2). Otherwise in text and HTML output
1195
the formula is shown as LaTeX source code.
1196
1197
For simple formulae (and you should try to make all your formulae simple!)
1198
attempt to use the M element or the Mode="M" attribute in Display for which
1199
there is a well defined translation into text, which can be used for text
1200
and HTML output versions of the document. So, if possible try to avoid the
1201
Math elements and Display elements without attribute or provide useful text
1202
substitutes for complicated formulae via Alt elements (see 3.9-1
1203
and 3.7-11).
1204
1205
1206
3.8-2 <M>
1207
1208
 From gapdoc.dtd 
1209
<!-- Math with well defined translation to text output -->
1210
<!ELEMENT M (#PCDATA|A|Arg|Alt)*>
1211

1212
1213
The M element type is intended for formulae in the running text for which
1214
there is a sensible text version. For the LaTeX version of a GAPDoc document
1215
the M and Math elements are equivalent. The remarks in 3.8-1 about special
1216
characters and the Arg element apply here as well. A document which has all
1217
formulae enclosed in M elements can be well readable in text terminal output
1218
and printed output versions.
1219
1220
Compared to former versions of GAPDoc many more formulae can be put into M
1221
elements. Most modern terminal emulations support unicode characters and
1222
many mathematical symbols can now be represented by such characters. But
1223
even if a terminal can only display ASCII characters, the user will see some
1224
not too bad representation of a formula.
1225
1226
As examples, here are some LaTeX macros which have a sensible ASCII
1227
translation and are guaranteed to be translated accordingly by text (and
1228
HTML) converters (for a full list of handled Macros see
1229
RecNames(TEXTMTRANSLATIONS)):
1230
1231
┌──────────────────────────┬─────┐
1232
│ \ast │ * │
1233
├──────────────────────────┼─────┤
1234
│ \bf │  │
1235
├──────────────────────────┼─────┤
1236
│ \bmod │ mod │
1237
├──────────────────────────┼─────┤
1238
│ \cdot │ * │
1239
├──────────────────────────┼─────┤
1240
│ \colon │ : │
1241
├──────────────────────────┼─────┤
1242
│ \equiv │ = │
1243
├──────────────────────────┼─────┤
1244
│ \geq │ >= │
1245
├──────────────────────────┼─────┤
1246
│ \germ │  │
1247
├──────────────────────────┼─────┤
1248
│ \hookrightarrow │ -> │
1249
├──────────────────────────┼─────┤
1250
│ \iff │ <=> │
1251
├──────────────────────────┼─────┤
1252
│ \langle │ < │
1253
├──────────────────────────┼─────┤
1254
│ \ldots │ ... │
1255
├──────────────────────────┼─────┤
1256
│ \left │   │
1257
├──────────────────────────┼─────┤
1258
│ \leq │ <= │
1259
├──────────────────────────┼─────┤
1260
│ \leftarrow │ <- │
1261
├──────────────────────────┼─────┤
1262
│ \Leftarrow │ <= │
1263
├──────────────────────────┼─────┤
1264
│ \limits │   │
1265
├──────────────────────────┼─────┤
1266
│ \longrightarrow │ --> │
1267
├──────────────────────────┼─────┤
1268
│ \Longrightarrow │ ==> │
1269
├──────────────────────────┼─────┤
1270
│ \mapsto │ -> │
1271
├──────────────────────────┼─────┤
1272
│ \mathbb │   │
1273
├──────────────────────────┼─────┤
1274
│ \mathop │   │
1275
├──────────────────────────┼─────┤
1276
│ \mid │ | │
1277
├──────────────────────────┼─────┤
1278
│ \pmod │ mod │
1279
├──────────────────────────┼─────┤
1280
│ \prime │ ' │
1281
├──────────────────────────┼─────┤
1282
│ \rangle │ > │
1283
├──────────────────────────┼─────┤
1284
│ \right │   │
1285
├──────────────────────────┼─────┤
1286
│ \rightarrow │ -> │
1287
├──────────────────────────┼─────┤
1288
│ \Rightarrow │ => │
1289
├──────────────────────────┼─────┤
1290
│ \rm, \sf, \textrm, \text │  │
1291
├──────────────────────────┼─────┤
1292
│ \setminus │ \ │
1293
├──────────────────────────┼─────┤
1294
│ \thinspace │   │
1295
├──────────────────────────┼─────┤
1296
│ \times │ x │
1297
├──────────────────────────┼─────┤
1298
│ \to │ -> │
1299
├──────────────────────────┼─────┤
1300
│ \vert │ | │
1301
├──────────────────────────┼─────┤
1302
│ \! │  │
1303
├──────────────────────────┼─────┤
1304
│ \, │  │
1305
├──────────────────────────┼─────┤
1306
│ \; │   │
1307
├──────────────────────────┼─────┤
1308
│ \{ │ { │
1309
├──────────────────────────┼─────┤
1310
│ \} │ } │
1311
└──────────────────────────┴─────┘
1312
1313
Table: LaTeX macros with special text translation
1314
1315
1316
In all other macros only the backslash is removed (except for some macros
1317
describing more exotic symbols). Whitespace is normalized (to one blank) but
1318
not removed. Note that whitespace is not added, so you may want to add a few
1319
more spaces than you usually do in your LaTeX documents.
1320
1321
Braces {} are removed in general, however pairs of double braces are
1322
converted to one pair of braces. This can be used to write <M>x^{12}</M> for
1323
x^12 and <M>x_{{i+1}}</M> for x_{i+1}.
1324
1325
1326
3.9 Everything else
1327
1328
1329
3.9-1 <Alt>
1330
1331
This element is used to specify alternatives for different output formats
1332
within normal text. See also sections 3.6-1, 3.6-4, and 3.6-5 for
1333
alternatives in lists and tables.
1334
1335
 From gapdoc.dtd 
1336
<!ELEMENT Alt (%InnerText;)*> <!-- This is only to allow "Only" and
1337
 "Not" attributes for normal text -->
1338
<!ATTLIST Alt Only CDATA #IMPLIED
1339
 Not CDATA #IMPLIED>
1340

1341
1342
Of course exactly one of the two attributes must occur in one element. The
1343
attribute values must be one word or a list of words, separated by spaces or
1344
commas. The words which are currently recognized by the converter programs
1345
contained in GAPDoc are: LaTeX, HTML, and Text. If the Only attribute is
1346
specified then only the corresponding converter will include the content of
1347
the element into the output document. If the Not attribute is specified the
1348
corresponding converter will ignore the content of the element. You can use
1349
other words to specify special alternatives for other converters of GAPDoc
1350
documents.
1351
1352
In the case of HTML there is a second word which is recognized and this can
1353
either be MathJax or noMathJax. For example a pair of Alt elements with <Alt
1354
Only="HTML noMathJax">... and <Alt Not="HTML noMathJax">... could provide
1355
special content for the case of HTML output without use of MathJax and every
1356
other output.
1357
1358
We fix a rule for handling the content of an Alt element with Only
1359
attribute. In their content code for the corresponding output format is
1360
included directly. So, in case of HTML the content is HTML code, in case of
1361
LaTeX the content is LaTeX code. The converters don't apply any handling of
1362
special characters to this content. In the case of LaTeX the formatting of
1363
the code is not changed.
1364
1365
Within the element only %InnerText; (see 3.2-3) is allowed. This is to
1366
ensure that the same set of chapters, sections, and subsections show up in
1367
all output formats.
1368
1369
1370
3.9-2 <Par> and <P>
1371
1372
 From gapdoc.dtd 
1373
<!ELEMENT Par EMPTY> <!-- this is intentionally empty! -->
1374
<!ELEMENT P EMPTY> <!-- the same as shortcut -->
1375

1376
1377
This EMPTY element marks the boundary of paragraphs. Note that an empty line
1378
in the input does not mark a new paragraph as opposed to the LaTeX
1379
convention.
1380
1381
(Remark: it would be much easier to parse a document and to understand its
1382
sectioning and paragraph structure when there was an element whose content
1383
is the text of a paragraph. But in practice many paragraph boundaries are
1384
implicitly clear which would make it somewhat painful to enclose each
1385
paragraph in extra tags. The introduction of the P or Par elements as above
1386
delegates this pain to the writer of a conversion program for GAPDoc
1387
documents.)
1388
1389
1390
3.9-3 <Br>
1391
1392
 From gapdoc.dtd 
1393
<!ELEMENT Br EMPTY> <!-- a forced line break -->
1394

1395
1396
This element can be used to force a line break in the output versions of a
1397
GAPDoc element, it does not start a new paragraph. Please, do not use this
1398
instead of a Par element, this would often lead to ugly output versions of
1399
your document.
1400
1401
1402
3.9-4 <Ignore>
1403
1404
 From gapdoc.dtd 
1405
<!ELEMENT Ignore (%Text;| Chapter | Section | Subsection | ManSection |
1406
 Heading)*>
1407
<!ATTLIST Ignore Remark CDATA #IMPLIED>
1408

1409
1410
This element can appear anywhere. Its content is ignored by the standard
1411
converters. It can be used, for example, to include data which are not part
1412
of the actual GAPDoc document, like source code, or to make not finished
1413
parts of the document invisible.
1414
1415
Of course, one can use special converter programs which extract the contents
1416
of Ignore elements. Information on the type of the content can be stored in
1417
the optional attribute Remark.
1418
1419
1420