| www.delorie.com/gnu/docs/groff/groff_51.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use the following macros to create a cover page for your document in the order shown.
no
.RP
macro) is to print a subset of the
cover page on page 1 of your document.
If you use the word no as an optional argument,
groff prints a title page but
does not repeat any of the title page information
(title, author, abstract, etc.)
on page 1 of the document.
nroff.
troff.
groff collects text following the .TL
macro into the title, until reaching the author name or abstract.
.AU John Doe .AI University of West Bumblefuzz .AU Martha Buck .AI Monolithic Corporation ... |
no as an optional argument suppresses this heading.
The following is example mark-up for a title page.
.RP .TL The Inevitability of Code Bloat in Commercial and Free Software .AU J. Random Luser .AI University of West Bumblefuzz .AB This report examines the long-term growth of the code bases in two large, popular software packages; the free Emacs and the commercial Microsoft Word. While differences appear in the type or order of features added, due to the different methodologies used, the results are the same in the end. .PP The free software approach is shown to be superior in that while free software can become as bloated as commercial offerings, free software tends to have fewer serious bugs and the added features are in line with user demand. .AE ... the rest of the paper follows ... |
This section describes macros used to mark up the body of your document. Examples include paragraphs, sections, and other groups.
The following paragraph types are available.
<BLOCKQUOTE> element.
The next paragraph or heading returns margins to normal.
The following markup uses all four paragraph macros.
.NH 2 Cases used in the study .LP The following software and versions were considered for this report. .PP For commercial software, we chose .B "Microsoft Word for Windows" , starting with version 1.0 through the current version (Word 2000). .PP For free software, we chose .B Emacs , from its first appearance as a standalone editor through the current version (v20). See [Bloggs 2002] for details. .QP Franklin's Law applied to software: software expands to outgrow both RAM and disk space over time. .LP Bibliography: .XP Bloggs, Joseph R., .I "Everyone's a Critic" , Underground Press, March 2002. A definitive work that answers all questions and criticisms about the quality and usability of free software. |
Use headings to create a hierarchical structure for your document. The `ms' macros print headings in bold, using the same font family and point size as the body text.
The following describes the heading macros:
S followed by numeric
arguments to set the heading level explicitly.
If you specify heading levels out of sequence, such as invoking
`.NH 3' after `.NH 1', groff
prints a warning on standard error.
The `ms' macros provide a variety of methods to highlight or emphasize text:
groff prints it in the
previous font after the bold text, with no intervening space
(this allows you to set punctuation after the highlighted text
without highlighting the punctuation).
Similarly, it prints the third argument (if any) in the previous
font before the first argument.
For example,
.B foo ) ( |
prints (foo).
If you give this macro no arguments, groff
prints all text following in bold until
the next highlighting, paragraph, or heading macro.
B macro otherwise.
B macro otherwise.
constant width face.
It operates similarly to the B macro otherwise.
B macro otherwise.
\0).
groff
prints it in the previous font after
the underlined text, with no intervening space.
PS register).
The .IP macro handles duties for all lists.
\[bu])
for unordered lists, a number (or auto-incrementing number
register) for numbered lists, or a word or phrase for indented
(glossary-style) lists.
The width specifies the indent for the body of each list item; its default unit is `n'. Once specified, the indent remains the same for all list items in the document until specified again.
The following is an example of a bulleted list.
A bulleted list: .IP \[bu] 2 lawyers .IP \[bu] guns .IP \[bu] money |
Produces:
A bulleted list: o lawyers o guns o money |
The following is an example of a numbered list.
.nr step 1 1 A numbered list: .IP \n[step] 3 lawyers .IP \n+[step] guns .IP \n+[step] money |
Produces:
A numbered list: 1. lawyers 2. guns 3. money |
Note the use of the auto-incrementing number register in this example.
The following is an example of a glossary-style list.
A glossary-style list: .IP lawyers 0.4i Two or more attorneys. .IP guns Firearms, preferably large-caliber. .IP money Gotta pay for those lawyers and guns! |
Produces:
A glossary-style list:
lawyers
Two or more attorneys.
guns Firearms, preferably large-caliber.
money
Gotta pay for those lawyers and guns!
|
In the last example, the IP macro places the definition
on the same line as the term if it has enough space; otherwise,
it breaks to the next line and starts the definition below the
term.
This may or may not be the effect you want, especially if some
of the definitions break and some do not.
The following examples show two possible ways to force a break.
The first workaround uses the br
request to force a break after printing the term or label.
A glossary-style list: .IP lawyers 0.4i Two or more attorneys. .IP guns .br Firearms, preferably large-caliber. .IP money Gotta pay for those lawyers and guns! |
The second workaround uses the \p escape to force the break.
Note the space following the escape; this is important.
If you omit the space, groff prints the first word on
the same line as the term or label (if it fits) then
breaks the line.
A glossary-style list: .IP lawyers 0.4i Two or more attorneys. .IP guns \p Firearms, preferably large-caliber. .IP money Gotta pay for those lawyers and guns! |
To set nested lists, use the RS and RE macros.
See section 4.3.5.5 Indents, for more information.
For example:
.IP \[bu] 2 Lawyers: .RS .IP \[bu] Dewey, .IP \[bu] Cheatham, .IP \[bu] and Howe. .RE .IP \[bu] Guns |
Produces:
o Lawyers: o Dewey, o Cheatham, o and Howe. o Guns |
In many situations, you may need to indent a section of text while still wrapping and filling. See section 4.3.5.4 Lists, for an example of nested lists.
PI register controls the amount of indent,
allowing the indented text to line up under hanging
and indented paragraphs.
See section 4.3.5.7 Displays and keeps, for macros to indent and turn off filling.
Use the ta request to define tab stops as needed.
See section 5.11 Tabs and Fields.
TA macro to create a different set
of default tab stops.
Use displays to show text-based examples or figures (such as code listings).
Displays turn off filling, so lines of code are displayed
as-is without inserting br requests in between each line.
Displays can be kept on a single page, or allowed
to break across pages.
LD macro allows the display to break across pages.
The DE macro ends the display.
DI register.
The `.DS I' call generates a page break, if necessary,
to keep the entire display on one page.
The ID macro allows the display to break across pages.
The DE macro ends the display.
BD macro allows the display to break across pages.
The DE macro ends the display.
CD macro allows the display to break across pages.
The DE macro ends the display.
RD macro allows the display to break across pages.
The DE macro ends the display.
On occasion, you may want to keep other text together on a page.
For example, you may want to keep two paragraphs together, or
a paragraph that refers to a table (or list, or other item)
immediately following.
The `ms' macros provide the KS and KE
macros for this purpose.
KS macro begins a block of text to be kept on a
single page, and the KE macro ends the block.
groff
holds the contents of the keep and allows text following
the keep (in the source file) to fill in the remainder of
the current page.
When the page breaks, whether by an explicit bp
request or by reaching the end of the page, groff
prints the floating keep at the top of the new page.
This is useful for printing large graphics or tables
that do not need to appear exactly where specified.
You can also use the ne request to force a page break if
there is not enough vertical space remaining on the page.
Use the following macros to draw a box around a section of text (such as a display).
B1 macro begins the box; the B2 macro ends it.
Text in the box is automatically placed in a diversion (keep).
The `ms' macros support the standard
groff preprocessors:
tbl, pic, eqn, and refer.
You mark text meant for preprocessors by enclosing it
in pairs of tags as follows.
tbl preprocessor.
The optional argument H to TS instructs groff
to create a running header with the information
up to the TH macro.
groff prints the header at the beginning of the
table; if the table runs onto another page, groff
prints the header on the next page as well.
pic preprocessor.
You can create a pic file by hand, using the AT&T
pic manual available on the Web as a reference, or by using
a graphics program such as xfig.
eqn preprocessor.
The optional align argument can be C, L, or@w{
I to center (the default), left-justify, or indent the equation.
refer preprocessor.
The GNU refer(1) man page provides a comprehensive
reference to the preprocessor and the format of the bibliographic
database.
4.3.5.9 An example multi-page table
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |