1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Book SYSTEM "gapdoc.dtd"
[ <!ENTITY see '<Alt Only="LaTeX">$\to$</Alt><Alt Not="LaTeX">→</Alt>'>
]>
<Book Name="GAPDoc Example">
<TitlePage>
<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>
<Subtitle>Every element shows up</Subtitle>
<Version>Version <#Include SYSTEM "../version"></Version>
<TitleComment>
If the subtitle is not sufficient, this <TitleComment>
element can be used for a slightly longer text on the front page.
</TitleComment>
<Author>Frank Lübeck
<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>
</Author>
<Author> Max Neunhöffer
<Email>neunhoef at mcs.st-and.ac.uk</Email>
</Author>
<Date>October 2018</Date>
<Address>
Lehrstuhl D für Mathematik<Br/> Pontdriesch
14/16<Br/> 52062 Aachen<Br/> (Germany)
</Address>
<Abstract>This document tries to use all elements that exist in &GAPDoc;.
In addition, the final output not only contains the usual
content, but also an appendix with the source text. There
are also links from the usual content to the corresponding
source text. This should enable new users to learn &GAPDoc;
quickly.
</Abstract>
<Copyright>©right; 2000-2018 by Frank Lübeck and Max Neunhöffer
</Copyright>
<Acknowledgements>We thank Lehrstuhl D für Mathematik.
</Acknowledgements>
<Colophon>This is the Colophon page.
</Colophon>
</TitlePage>
<TableOfContents/>
<Body>
Text before chapter <Ref Chap="First"/>. (&see; <Ref Sect="Two"/>)
<Chapter Label="First"><Heading>Sectioning Elements</Heading>
Text before the section <Ref Sect="FirstSect"/>. (&see; <Ref Sect="Two"/>)
<Label Name="ThreeBack"/>
<Section Label="FirstSect"><Heading>Normal subsections</Heading>
[&see; <Ref Sect="Three"/>]
<Subsection Label="Asub"><Heading>A subsection</Heading>
This is text in the first subsection.
</Subsection>
<Subsection Label="Another"><Heading>Another subsection</Heading>
This is text in the second subsection. This subsection
has a label, such that one can reference it.
</Subsection>
</Section>
<Section><Heading>ManSections</Heading>
<Label Name="FourBack"/>
[&see; <Ref Sect="Four"/>]
<ManSection>
<Func Name="f" Arg="x[,y]" Comm="calculates something"/>
<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>
<Description>
This function calculates something.
</Description>
</ManSection>
<ManSection>
<Meth Name="\^\{\}\[\]\<\&" Arg="c"
Label="for nothing" Comm="tricky name"/>
<Description>
This method is for an operation with a tricky name.
</Description>
</ManSection>
<ManSection>
<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>
<Description>
The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.
</Description>
</ManSection>
<ManSection>
<Meth Name="MyOperation" Label="First" Arg="x"
Comm="generic method"/>
<Description>
This method calculates something by the generic method.
</Description>
</ManSection>
<ManSection>
<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"
Comm="for bla arguments"/>
<Description>
This is the super-fast method for the operation
<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the
representation <Ref Filt="IsBla"/>. It will become even faster if
the optional argument <A>good_hint</A> is given.
</Description>
</ManSection>
<ManSection>
<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>
<Description>
The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>
an object in <A>filt</A>.
</Description>
</ManSection>
<ManSection>
<Filt Name="IsBla" Arg="obj" Comm="representation bla"
Type="representation"/>
<Description>
For objects in this representation there is a super-fast method
(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation
<Ref Oper="MyOperation"/>.
</Description>
</ManSection>
<ManSection>
<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>
<Description>
A property.
</Description>
</ManSection>
<ManSection>
<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>
<Description>
An attribute. Number of blobbs.
</Description>
</ManSection>
<ManSection>
<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>
<Description>
This global variable holds a list of all blibbs.
</Description>
</ManSection>
<ManSection>
<Fam Name="BlibbsFamily" Comm="family of blibbs"/>
<Description>
Family of all blibbs.
</Description>
</ManSection>
<ManSection>
<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>
<Description>
This info class is used throughout the library of blibbs.
</Description>
</ManSection>
</Section>
</Chapter>
<Chapter><Heading>Other Markup</Heading>
<Label Name="FiveBack"/>
<Section><Heading>Various types of text</Heading>
[&see; <Ref Sect="Five"/>]<P/>
In this section we present examples for all the various types of text
that are possible in &GAPDoc;:
<List>
<Item>
<Emph>This</Emph> is <E>emphasized</E>.</Item>
<Item>
<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.
</Item>
<Item>
<E>Arguments</E> of functions have an element. They look like this:
<Arg>x</Arg> and <A>y</A>.</Item>
<Item>
<E>Code</E> can be written with the Code element:
<Code>if x = y then Print("Equal"); fi;</Code> or
<C>while true do Print("Hello"); od;</C>.</Item>
<Item>
<E>Filenames</E> have their own element:
<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>
<Item>
<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things
are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>
<Item>
<E>Packages</E> are typeset like this:
<Package>Small Groups Library</Package>
</Item>
<Item>
<E>Quoted</E> text: <Q>This is a text in quotes.</Q>
</Item>
</List>
<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.
<Par/><E>Alternatives</E> for different output formats:
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]></Alt>
<Alt Only="Text">Text</Alt> output.</Alt>
<P/>
<Label Name="SixBack"/>
There are also three elements to typeset <Q>verbatim-like</Q> text.
(&see; <Ref Sect="Six"/>)<P/>
The first is a <E>Listing</E>:
<Listing Type="GAP code">
<![CDATA[Sieve := function(n)
# Returns the primes less than n
local l,p,i;
l := [1..n]; Unbind(l[1]);
p := 2;
while p^2 <= n do
if IsBound(l[p]) then
i := 2 * p;
while i <= n do Unbind(l[i]); i := i + p; od;
fi;
p := p + 1;
od;
return Compacted(l);
end;]]>
</Listing>
Here is a <E>Log</E> of a &GAP; session using this function:
<Log>
gap> Sieve(100);
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
67, 71, 73, 79, 83, 89, 97 ]
gap> Length(last);
25
</Log>
Here is a &GAP; <E>Example</E> session that is automatically tested:
<Example>
gap> s := Size(CharacterTable("M"));
808017424794512875886459904961710757005754368000000000
gap> s < 10^53;
false
gap> s < 10^54;
true
</Example>
</Section>
<Section><Heading>Formulae</Heading>
<Label Name="SevenBack"/>
[&see; <Ref Sect="Seven"/>]<P/>
There are three types of formulae. <P/>
The first is the <E>normal math mode</E> of &LaTeX;:
<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.
Then there are <E>displayed formulae</E>:
<Display>
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
\left(\sum_{j=1}^d y_j b_j \right) =
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
</Display>
If possible, use the <C>Alt</C> element to specify a better readable text
version of such a formula as in the following example:<P/>
<Alt Not="Text,HTML"><Display>
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
\left(\sum_{j=1}^d y_j b_j \right) =
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
</Display></Alt>
<Alt Only="Text,HTML"><Verb>
d d d
----- ----- ----- -----
\ \ \ \
==> ( ) x_i b_i )( ) y_j b_j ) = ) ( ) x_i y_j h_ijk ) b_k
/ / / /
----- ----- ----- -----
i = 1 j = 1 k = 1 i,j
</Verb><P/></Alt>
For small formulae without <Q>difficult</Q> parts use the <C>M</C>
element: <M>b_i</M>,
<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace
matters for text (or HTML) output.<P/>
Here are two formulae containing less than characters which are special
characters for XML:
<M><![CDATA[a < b < c < d]]></M> and <M>e < f</M>.
<P/>
Using the <C>Mode</C> attribute of a <C>Display</C> element formulae
like
<Display Mode="M">a \longrightarrow a \bmod m\prime</Display>
can also be displayed nicely in text and HTML output.
</Section>
<Section Label="Cross"><Heading>Crossreferencing</Heading>
<Label Name="EightBack"/>
[&see; <Ref Sect="Eight"/>]<P/>
<Label Name="there"/>
In this section we demonstrate various references to parts of this
document. Here is a reference to this section: <Ref Sect="Cross"/>.
Here is a reference to chapter <Ref Chap="First"/>, to appendix
<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.
<P/>
We distinguish among others references
to functions (see <Ref Func="f"/>),
to methods with tricky name (see
<Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),
to operations (see <Ref Oper="MyOperation"/>),
to methods (see <Ref Meth="MyOperation" Label="First"/> or
<Ref Meth="MyOperation" Label="for bla"/>),
to filters (see <Ref Filt="IsBla"/>),
to properties (see <Ref Prop="IsBlubb"/>),
to attributes (see <Ref Attr="NumberBlobbs"/>),
to variables (<Ref Var="AllBlibbs"/>),
to families (see <Ref Fam="BlibbsFamily"/>),
and to info classes (see <Ref InfoClass="InfoBlibbs"/>).
<P/>
There are also references to labels: see <Ref Text="here" Label="there"/>,
to other books: see <Ref Sect="What is a DTD" BookName="GAPDoc"/> or
<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference
manual.
<P/>
References to sections come in two styles:
<Ref Chap="First" Style="Number"/>
or <Ref Chap="First" Style="Text"/>.
<P/>
Another type of cross referencing is bibliography. Here is a
citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.
<P/>
There are also URLs:<P/>
<URL>http://www.math.rwth-aachen.de/</URL><P/>
Email addresses have a special element:
<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>
<P/>
and Homepages another one:
<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>
<P/>
And here is a link to the <URL>
<Link>http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/EDIM/index.html#ARCHS</Link>
<LinkText><Package>EDIM</Package>
archives</LinkText></URL>.
<P/>
One can generate index entries as follows (look up the words
<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, <Q>Aachen, Hauptbahnhof</Q>, and
<Q><Package>GAPDoc</Package>, for &GAP; programmers</Q>).
<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>
<Index>RWTH</Index>
<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>
<Index Key="GAPDoc" Subkey="for GAP programmers"><Package>GAPDoc</Package>
<Subkey>for &GAP; programmers</Subkey></Index>
</Section>
<Section><Heading>Lists and Tables</Heading>
<Label Name="NineBack"/>
[&see; <Ref Sect="Nine"/>]<P/>
There are
<List>
<Item>lists</Item>
<Item>enumerations, and</Item>
<Item>tables</Item>
</List>
or:
<Enum>
<Item>lists</Item>
<Item>enumerations, and</Item>
<Item>tables</Item>
</Enum>
or with marks:
<List>
<Mark>lists:</Mark><Item> not numbered</Item>
<Mark>enumerations:</Mark><Item> numbered</Item>
<Mark>tables:</Mark><Item> two-dimensional</Item>
</List>
Lists can also be nested:
<Enum>
<Item>
<Enum>
<Item>first item of inner enumeration </Item>
<Item>second item of inner enumeration </Item>
</Enum>
</Item>
<Item>
<List>
<Item>first item of inner list </Item>
<Item>second item of inner list </Item>
</List>
</Item>
</Enum>
Here is a <E>table</E>:
<Table Align="|r|c|l|">
<Caption>Prices</Caption>
<HorLine/>
<Row>
<Item>Object</Item><Item>Price</Item><Item>available</Item>
</Row>
<HorLine/>
<HorLine/>
<Row>
<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>
</Row>
<HorLine/>
<Row>
<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>
</Row>
<HorLine/>
</Table>
</Section>
<Section><Heading>Entities and Special Characters</Heading>
<Label Name="TenBack"/>
[&see; <Ref Sect="Ten"/>]<P/>
Here is a table of special characters, the first two are special for
XML and must be typed in by entities in &GAPDoc; documents. The other
characters are special for &LaTeX; but in &GAPDoc; they can be typed
directly.
<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">
<Caption>Special characters in character data</Caption>
<HorLine/> <Row>
<Item><C>&</C></Item>
<Item><C><</C></Item>
<Item><C>></C></Item>
<Item><C>#</C></Item>
<Item><C>$</C></Item>
<Item><C>%</C></Item>
<Item><C>~</C></Item>
<Item><C>\</C></Item>
<Item><C>{</C></Item>
<Item><C>}</C></Item>
<Item><C>_</C></Item>
<Item><C>^</C></Item>
<Item><C> </C></Item>
</Row> <HorLine/>
</Table>
And here are the predefined entities in &GAPDoc;:
<Table Align="|l|l|">
<Caption>Predefined Entities in the &GAPDoc; system</Caption>
<HorLine/>
<Row> <Item><C>&GAP;</C></Item> <Item>&GAP;</Item> </Row>
<HorLine/>
<Row> <Item><C>&GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>
<HorLine/>
<Row> <Item><C>&TeX;</C></Item> <Item>&TeX;</Item> </Row>
<HorLine/>
<Row> <Item><C>&LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>
<HorLine/>
<Row> <Item><C>&BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>
<HorLine/>
<Row> <Item><C>&MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>
<HorLine/>
<Row> <Item><C>&XGAP;</C></Item> <Item>&XGAP;</Item> </Row>
<HorLine/>
<Row> <Item><C>&copyright;</C></Item> <Item>©right;</Item> </Row>
<HorLine/>
</Table>
And some more for mathematical symbols:
&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.
</Section>
</Chapter>
</Body>
<Appendix Label="Appendix">
<Heading>An Appendix</Heading>
<Label Name="ElevenBack"/>
[&see; <Ref Sect="Eleven"/>]<P/>
This is an appendix.
</Appendix>
<Appendix Label="Source"><Heading>The Source</Heading>
<Section Label="One"><Heading>TitlePage (Source)</Heading>
<Listing>
<![CDATA[<TitlePage>
<Title>A Complete Example (&see; <Ref Sect="One"/>)</Title>
<Subtitle>Every element shows up</Subtitle>
<Version>Version <#Include SYSTEM "../version"></Version>
<TitleComment>
If the subtitle ist not sufficient, this <TitleComment>
element can be used for a slightly longer text on the front page.
</TitleComment>
<Author>Frank Lübeck
<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>
</Author>
<Author> Max Neunhöffer
<Email>neunhoef at mcs.st-and.ac.uk</Email>
</Author>
<Date>September 2011</Date>
<Address>
Lehrstuhl D für Mathematik<Br/> Templergraben
64<Br/> 52062 Aachen<Br/> (Germany)
</Address>
<Abstract>This document tries to use all elements that exist in &GAPDoc;.
In addition, the final output not only contains the usual
content, but also an appendix with the source text. There
are also links from the usual content to the corresponding
source text. This should enable new users to learn &GAPDoc;
quickly.
</Abstract>
<Copyright>©right; 2000-2011 by Frank Lübeck and Max Neunhöffer
</Copyright>
<Acknowledgements>We thank Lehrstuhl D für Mathematik.
</Acknowledgements>
<Colophon>This is the Colophon page.
</Colophon>
</TitlePage>]]>
</Listing>
</Section>
<Section Label="Two"><Heading>Before First Chapter (Source)</Heading>
<Listing>
<![CDATA[<TableOfContents/>
<Body>
Text before chapter <Ref Chap="First"/>.
<Chapter Label="First"><Heading>Sectioning Elements</Heading>
Text before the section <Ref Sect="FirstSect"/>.]]>
</Listing>
</Section>
<Section Label="Three">
<Heading>First Chapter (Source)</Heading>
[<Ref Label="ThreeBack"/>]
<Listing>
<![CDATA[<Section Label="FirstSect"><Heading>Normal subsections</Heading>
<Subsection Label="Asub"><Heading>A subsection</Heading>
This is text in the first subsection.
</Subsection>
<Subsection Label="Another"><Heading>Another subsection</Heading>
This is text in the second subsection. This subsection
has a label, such that one can reference it.
</Subsection>
</Section>]]>
</Listing>
</Section>
<Section Label="Four"><Heading>ManSections (Source)</Heading>
[<Ref Label="FourBack"/>]
<Listing>
<![CDATA[<Section><Heading>ManSections</Heading>
<ManSection>
<Func Name="f" Arg="x[,y]" Comm="calculates something"/>
<Returns>an element in <Ref Filt="IsBlubb" /> or <K>fail</K>.</Returns>
<Description>
This function calculates something.
</Description>
</ManSection>
<ManSection>
<Meth Name="\^\{\}\[\]\<\&" Arg="c"
Label="for nothing" Comm="tricky name"/>
<Description>
This method is for an operation with a tricky name.
</Description>
</ManSection>
<ManSection>
<Oper Name="MyOperation" Arg="x" Comm="calculates something"/>
<Description>
The operation <Ref Oper="MyOperation"/> operates on <Arg>x</Arg>.
</Description>
</ManSection>
<ManSection>
<Meth Name="MyOperation" Label="First" Arg="x"
Comm="generic method"/>
<Description>
This method calculates something by the generic method.
</Description>
</ManSection>
<ManSection>
<Meth Name="MyOperation" Label="for bla" Arg="x[, good_hint]"
Comm="for bla arguments"/>
<Description>
This is the super-fast method for the operation
<Ref Oper="MyOperation"/> if the argument <A>x</A> is in the
representation <Ref Filt="IsBla"/>. It will become even faster if
the optional argument <A>good_hint</A> is given.
</Description>
</ManSection>
<ManSection>
<Constr Name="MyConstructor" Arg="filt, x" Comm="constructs something"/>
<Description>
The constructor <Ref Oper="MyConstructor"/> constructs from <Arg>x</Arg>
an object in <A>filt</A>.
</Description>
</ManSection>
<ManSection>
<Filt Name="IsBla" Arg="obj" Comm="representation bla"
Type="representation"/>
<Description>
For objects in this representation there is a super-fast method
(see <Ref Meth="MyOperation" Label="for bla"/>) for the operation
<Ref Oper="MyOperation"/>.
</Description>
</ManSection>
<ManSection>
<Prop Name="IsBlubb" Arg="obj" Comm="property, whether object is blubb"/>
<Description>
A property.
</Description>
</ManSection>
<ManSection>
<Attr Name="NumberBlobbs" Arg="obj" Comm="number of blobbs"/>
<Description>
An attribute. Number of blobbs.
</Description>
</ManSection>
<ManSection>
<Var Name="AllBlibbs" Comm="list of all blibbs in the system"/>
<Description>
This global variable holds a list of all blibbs.
</Description>
</ManSection>
<ManSection>
<Fam Name="BlibbsFamily" Comm="family of blibbs"/>
<Description>
Family of all blibbs.
</Description>
</ManSection>
<ManSection>
<InfoClass Name="InfoBlibbs" Comm="InfoClass for the library of blibbs"/>
<Description>
This info class is used throughout the library of blibbs.
</Description>
</ManSection>
</Section>]]>
</Listing>
</Section>
<Section Label="Five"><Heading>Various Types of Text (Source)</Heading>
[<Ref Label="FiveBack"/>]
<Listing>
<![CDATA[<Chapter><Heading>Other Markup</Heading>
<Section><Heading>Various types of text</Heading>
In this section we present examples for all the various types of text
that are possible in &GAPDoc;:
<List>
<Item>
<Emph>This</Emph> is <E>emphasized</E>.</Item>
<Item>
<E>Keywords</E> are typeset like <Keyword>this</Keyword> and <K>that</K>.
</Item>
<Item>
<E>Arguments</E> of functions have an element. They look like this:
<Arg>x</Arg> and <A>y</A>.</Item>
<Item>
<E>Code</E> can be written with the Code element:
<Code>if x = y then Print("Equal"); fi;</Code> or
<C>while true do Print("Hello"); od;</C>.</Item>
<Item>
<E>Filenames</E> have their own element:
<File>/usr/local/ca/gap4r2</File> or <F>pkg/xgap/doc</F>.</Item>
<Item>
<E>Buttons</E>, <E>menus</E>, <E>menu entries</E>, and such things
are also supported: <B>OK</B> or <Button>Cancel</Button>.</Item>
<Item>
<E>Packages</E> are typeset like this:
<Package>Small Groups Library</Package>
</Item>
<Item>
<E>Quoted</E> text: <Q>This is a text in quotes.</Q>
</Item>
</List>
<E>Paragraphs</E> are separated by the empty <C>Par</C> or <C>P</C> element.
<Par/><E>Alternatives</E> for different output formats:
<Alt Only="LaTeX">This is &LaTeX; output.</Alt>
<Alt Not="LaTeX">This is other than &LaTeX; output, namely:
<Alt Only="HTML"><![CDATA[<b>HTML</b>]]>]<![CDATA[]></Alt>
<Alt Only="Text">Text</Alt> output.</Alt>
<P/>]]>
</Listing>
</Section>
<Section Label="Six"><Heading>Verbatim-like text (Source)</Heading>
[<Ref Label="SixBack"/>]
<Listing>
<![CDATA[There are also three elements to typeset <Q>verbatim-like</Q> text.
<P/>
The first is a <E>Listing</E>:
<Listing Type="GAP code">
<![CDATA[Sieve := function(n)
# Returns the primes less than n
local l,p,i;
l := [1..n]; Unbind(l[1]);
p := 2;
while p^2 <= n do
if IsBound(l[p]) then
i := 2 * p;
while i <= n do Unbind(l[i]); i := i + p; od;
fi;
p := p + 1;
od;
return Compacted(l);
end;]]>]<![CDATA[]>
</Listing>
Here is a <E>Log</E> of a &GAP; session using this function:
<Log>
gap> Sieve(100);
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
67, 71, 73, 79, 83, 89, 97 ]
gap> Length(last);
25
</Log>
Here is a &GAP; <E>Example</E> session that is automatically tested:
<Example>
gap> s := Size(CharacterTable("M"));
808017424794512875886459904961710757005754368000000000
gap> s < 10^53;
false
gap> s < 10^54;
true
</Example>
</Section>]]>
</Listing>
</Section>
<Section Label="Seven"><Heading>Formulae (Source)</Heading>
[<Ref Label="SevenBack"/>]
<Listing>
<![CDATA[<Section><Heading>Formulae</Heading>
There are three types of formulae. <P/>
The first is the <E>normal math mode</E> of &LaTeX;:
<Math>b_i \cdot b_j = \sum_{k=1}^d h_{ijk} b_k</Math>.
Then there are <E>displayed formulae</E>:
<Display>
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
\left(\sum_{j=1}^d y_j b_j \right) =
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
</Display>
If possible, use the <C>Alt</C> element to specify a better readable text
version of such a formula as in the following example:<P/>
<Alt Not="Text,HTML"><Display>
\Longrightarrow \quad \left(\sum_{i=1}^d x_i b_i \right) \cdot
\left(\sum_{j=1}^d y_j b_j \right) =
\sum_{k=1}^d \left( \sum_{i,j} x_i y_j h_{ijk} \right) b_k
</Display></Alt>
<Alt Only="Text,HTML"><Verb>
d d d
----- ----- ----- -----
\ \ \ \
==> ( ) x_i b_i )( ) y_i b_i ) = ) ( ) x_i y_j h_ijk ) b_k
/ / / /
----- ----- ----- -----
i = 1 i = 1 k = 1 i,j
</Verb><P/></Alt>
For small formulae without <Q>difficult</Q> parts use the <C>M</C>
element: <M>b_i</M>,
<M>x^2</M>, <M>x^2 + 2x + 1 = (x + 1)^2</M>. Note that here whitespace
matters for text (or HTML) output).<P/>
Here are two formulae containing less than characters which are special
characters for XML:
<M><![CDATA[a < b < c < d]]]]>><![CDATA[</M> and <M>e < f</M>.
</Section>]]>
</Listing>
</Section>
<Section Label="Eight"><Heading>Crossreferencing (Source)</Heading>
[<Ref Label="EightBack"/>]
<Listing>
<![CDATA[<Section Label="Cross"><Heading>Crossreferencing</Heading>
<Label Name="there"/>
In this section we demonstrate various references to parts of this
document. Here is a reference to this section: <Ref Sect="Cross"/>.
Here is a reference to chapter <Ref Chap="First"/>, to appendix
<Ref Appendix="Appendix"/>, and to subsection <Ref Subsect="Asub"/>.
<P/>
We distinguish among others references
to functions (see <Ref Func="f"/>),
to methods with tricky name (see
<Ref Meth="\^\{\}\[\]\<\&" Label="for nothing"/>),
to operations (see <Ref Oper="MyOperation"/>),
to methods (see <Ref Meth="MyOperation" Label="First"/> or
<Ref Meth="MyOperation" Label="for bla"/>),
to filters (see <Ref Filt="IsBla"/>),
to properties (see <Ref Prop="IsBlubb"/>),
to attributes (see <Ref Attr="NumberBlobbs"/>),
to variables (<Ref Var="AllBlibbs"/>),
to families (see <Ref Fam="BlibbsFamily"/>),
and to info classes (see <Ref InfoClass="InfoBlibbs"/>).
<P/>
There are also references to labels: see <Ref Text="here" Label="there"/>,
to other books: see <Ref Sect="syntaxXML" BookName="gapdoc"/> or
<Ref Oper="IsSubgroup" BookName="ref"/> in the &GAP; reference
manual.
<P/>
References to sections come in two styles:
<Ref Chap="First" Style="Number"/>
or <Ref Chap="First" Style="Text"/>.
<P/>
Another type of cross referencing is bibliography. Here is a
citation: <Cite Key="CR1" Where="(5.22)"/> is an interesting lemma.
<P/>
There are also URLs:<P/>
<URL>http://www.math.rwth-aachen.de/LDfM/</URL><P/>
Email addresses have a special element:
<Email>Frank.Luebeck@Math.RWTH-Aachen.De</Email>
<P/>
and Homepages another one:
<Homepage>http://www-groups.mcs.st-and.ac.uk/~neunhoef/</Homepage>
<P/>
One can generate index entries as follows (look up the words
<Q>&TeX;-UserGroup</Q>, <Q>RWTH</Q>, and <Q>Aachen, Hauptbahnhof</Q>).
<Index Key="TeX-Usergroup">&TeX;-UserGroup</Index>
<Index>RWTH</Index>
<Index>Aachen <Subkey>Hauptbahnhof</Subkey></Index>
<Index Key="GAPDoc" Subkey="for GAP programmers">&GAPDoc;
<Subkey>for &GAP; programmers</Subkey></Index>
</Section>]]>
</Listing>
</Section>
<Section Label="Nine"><Heading>Lists and Tables (Source)</Heading>
[<Ref Label="NineBack"/>]
<Listing>
<![CDATA[<Section><Heading>Lists and Tables</Heading>
There are
<List>
<Item>lists</Item>
<Item>enumerations, and</Item>
<Item>tables</Item>
</List>
or:
<Enum>
<Item>lists</Item>
<Item>enumerations, and</Item>
<Item>tables</Item>
</Enum>
or with marks:
<List>
<Mark>lists:</Mark><Item> not numbered</Item>
<Mark>enumerations:</Mark><Item> numbered</Item>
<Mark>tables:</Mark><Item> two-dimensional</Item>
</List>
Lists can also be nested:
<Enum>
<Item>
<Enum>
<Item>first item of inner enumeration </Item>
<Item>second item of inner enumeration </Item>
</Enum>
</Item>
<Item>
<List>
<Item>first item of inner list </Item>
<Item>second item of inner list </Item>
</List>
</Item>
</Enum>
Here is a <E>table</E>:
<Table Align="|r|c|l|">
<Caption>Prices</Caption>
<HorLine/>
<Row>
<Item>Object</Item><Item>Price</Item><Item>available</Item>
</Row>
<HorLine/>
<HorLine/>
<Row>
<Item>Shoe</Item><Item>$1,00</Item><Item>there</Item>
</Row>
<HorLine/>
<Row>
<Item>Hat</Item><Item>$2,00</Item><Item>not there</Item>
</Row>
<HorLine/>
</Table>
</Section>]]>
</Listing>
</Section>
<Section Label="Ten">
<Heading>Entities and Special Characters (Source)</Heading>
[<Ref Label="TenBack"/>]
<Listing>
<![CDATA[<Section><Heading>Entities and Special Characters</Heading>
<Label Name="TenBack"/>
[&see; <Ref Sect="Ten"/>]<P/>
Here is a table of special characters, the first two are special for
XML and must be typed in by entities in &GAPDoc; documents. The other
characters are special for &LaTeX; but in &GAPDoc; they can be typed
directly.
<Table Align="|c|c|c|c|c|c|c|c|c|c|c|c|c|" Label="charsInCDATA">
<Caption>Special characters in character data</Caption>
<HorLine/> <Row>
<Item><C>&</C></Item>
<Item><C><</C></Item>
<Item><C>></C></Item>
<Item><C>#</C></Item>
<Item><C>$</C></Item>
<Item><C>%</C></Item>
<Item><C>~</C></Item>
<Item><C>\</C></Item>
<Item><C>{</C></Item>
<Item><C>}</C></Item>
<Item><C>_</C></Item>
<Item><C>^</C></Item>
<Item><C> </C></Item>
</Row> <HorLine/>
</Table>
And here are the predefined entities in &GAPDoc;:
<Table Align="|l|l|">
<Caption>Predefined Entities in the &GAPDoc; system</Caption>
<HorLine/>
<Row> <Item><C>&GAP;</C></Item> <Item>&GAP;</Item> </Row>
<HorLine/>
<Row> <Item><C>&GAPDoc;</C></Item> <Item>&GAPDoc;</Item> </Row>
<HorLine/>
<Row> <Item><C>&TeX;</C></Item> <Item>&TeX;</Item> </Row>
<HorLine/>
<Row> <Item><C>&LaTeX;</C></Item> <Item>&LaTeX;</Item> </Row>
<HorLine/>
<Row> <Item><C>&BibTeX;</C></Item> <Item>&BibTeX;</Item> </Row>
<HorLine/>
<Row> <Item><C>&MeatAxe;</C></Item> <Item>&MeatAxe;</Item> </Row>
<HorLine/>
<Row> <Item><C>&XGAP;</C></Item> <Item>&XGAP;</Item> </Row>
<HorLine/>
<Row> <Item><C>&copyright;</C></Item> <Item>©right;</Item> </Row>
<HorLine/>
</Table>
And some more for mathematical symbols:
&CC;, &ZZ;, &NN;, &PP;, &QQ;, &HH;, &RR;.
</Section>
</Chapter>
</Body>]]>
</Listing>
</Section>
<Section Label="Eleven"><Heading>Appendix (Source)</Heading>
[<Ref Label="ElevenBack"/>]
<Listing Type="GAPDoc source">
<![CDATA[<Appendix><Heading>An Appendix</Heading>
This is an appendix.
</Appendix>]]>
</Listing>
</Section>
</Appendix>
<Bibliography Databases="examplebib.xml" Style="alpha"/>
<TheIndex/>
</Book>
|