2.1 The Main File

The main TeX file is called ``manual.tex''. This file should contain only the following commands:


\input ../gapmacro.tex
\BeginningOfBook{name-of-book}
\UseReferences{book1}
...
\UseReferences{bookn}
\TitlePage{title}
\Colophon{text}
\TableOfContents
\FrontMatter
\immediate\write\citeout{\bs bibdata{mybibliography}}
\Input{file1}
...
\Input{filen}
\Chapters
\Input{file1}
...
\Input{filen}
\Appendices
\Input{file1}
...
\Input{filen}
\Bibliography
\Index
\EndOfBook

The first line inputs the file ``gapmacro.tex''. If you are writing a share package either copy this file or use a relative path. The former method will always work but requires you to keep the file consistent with the system while the latter forces users to change the ``manual.tex'' file if they are installing a package in a private location. See also Section GAP Root Directory in the Reference Manual.

\BeginningOfBook starts the book, name-of-book is used for cross-references, see Labels and References. If you are writing a share package use the name of your package here.

If your manual consists of more than one book the command \UseReferences can be used to load the labels of the other books in case cross-references occur. booki is the path of the directory containing the book whose references you want to load. If you are writing a share package and you need to reference the main GAP manual, use \UseReferences for each book you want to reference. However, as said above this requires changes to the ``manual.tex'' file if the package is not installed in the standard location.

Example

If your ``manual.tex'' file lives in ``pkg/qwer/doc'' and you want to use references to the tutorial use

\UseReferences{../../../doc/tut}

\TitlePage produces a page containing the title.

\Colophon produces a page following the title that can be used for more explicit author information, acknowledgements, dedications or whatsoever.

\TableOfContents produces a table of contents.

\FrontMatter starts the front matter chapters such as a copyright notice or a preface.

The line

\immediate\write\citeout{\bs bibdata{<mybibliography>}}
is for users of BibTeX. It will use the file mybibliography.bib to fetch bibliography information.

\Chapters starts the chapters of the manual, which are included via \Input. For the chapter format, see Section Chapters and Sections.

\Appendices starts the appendices. \Bibliography produces a bibliography, and \Index an index.

Finally \EndOfBook closes the book.

Example

Assume you have a share package ``qwert'' with two chapters ``Qwert'' and ``Extending Qwert'', a copyright notice, a preface, no exercises, then your ``manual.tex'' would basically look like:

\input gapmacro.tex
\BeginningOfBook{qwert}
  \TitlePage{
    \centerline{\titlefont The Share Package ``qwert''}
    \centerline{\secfont by}
    \centerline{\titlefont Q. Mustermensch}
  }
  \TableOfContents
  \FrontMatter
    \Input{copyright}
    \Input{preface}
  \Chapters
    \Input{qwert}
    \Input{extend}
  \Appendices
    \Index
\EndOfBook

[Top] [Up] [Next] [Index]

GAP 4 manual
February 2000