by Trent A. Fisher and Werner Lemberg - The GNU Operating System
by Trent A. Fisher and Werner Lemberg - The GNU Operating System
by Trent A. Fisher and Werner Lemberg - The GNU Operating System
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
32 <strong>The</strong> <strong>GNU</strong> Troff Manual<br />
4.3.2 General structure of an ‘ms’ document<br />
<strong>The</strong> ‘ms’ macro package expects a certain amount of structure, but not as<br />
much as packages such as ‘man’ or ‘mdoc’.<br />
<strong>The</strong> simplest documents can begin with a paragraph macro (such as LP<br />
or PP), <strong>and</strong> consist of text separated <strong>by</strong> paragraph macros or even blank<br />
lines. Longer documents have a structure as follows:<br />
Document type<br />
If you invoke the RP (report) macro on the first line of the document,<br />
groff prints the cover page information on its own page;<br />
otherwise it prints the information on the first page with your<br />
document text immediately following. Other document formats<br />
found in AT&T troff are specific to AT&T or Berkeley, <strong>and</strong> are<br />
not supported in groff.<br />
Format <strong>and</strong> layout<br />
By setting number registers, you can change your document’s<br />
type (font <strong>and</strong> size), margins, spacing, headers <strong>and</strong> footers, <strong>and</strong><br />
footnotes. See Section 4.3.3 [ms Document Control Registers],<br />
page 33, for more details.<br />
Cover page<br />
A cover page consists of a title, the author’s name <strong>and</strong> institution,<br />
an abstract, <strong>and</strong> the date. 2 See Section 4.3.4 [ms Cover<br />
Page Macros], page 36, for more details.<br />
Body Following the cover page is your document. You can use the<br />
‘ms’ macros to write reports, letters, books, <strong>and</strong> so forth. <strong>The</strong><br />
package is designed for structured documents, consisting of paragraphs<br />
interspersed with headings <strong>and</strong> augmented <strong>by</strong> lists, footnotes,<br />
tables, <strong>and</strong> other common constructs. See Section 4.3.5<br />
[ms Body Text], page 38, for more details.<br />
Table of contents<br />
Longer documents usually include a table of contents, which you<br />
can invoke <strong>by</strong> placing the TC macro at the end of your document.<br />
<strong>The</strong> ‘ms’ macros have minimal indexing facilities, consisting of<br />
the IX macro, which prints an entry on st<strong>and</strong>ard error. Printing<br />
the table of contents at the end is necessary since groff is a<br />
single-pass text formatter, thus it cannot determine the page<br />
number of each section until that section has actually been set<br />
<strong>and</strong> printed. Since ‘ms’ output is intended for hardcopy, you<br />
can manually relocate the pages containing the table of contents<br />
between the cover page <strong>and</strong> the body text after printing.<br />
2 Actually, only the title is required.