[ Previous | Next | Table of Contents | Index | Legal | ]

Commands Reference, Volume 5


troff Command

Purpose

Formats text for printing on typesetting devices.

Syntax

troff -a ] [  -i ] [  -q ] [  -z ] [  -F Directory ] [  -n Number ] [  -o List ] [  -r ANumber ] [  -s Number ] [  -T Name ] [  -mm | -me | -mptx | -ms | -man | -mv ] [ -M Media ] [ File ... |  ]

Description

The troff command reads one or more files and formats the text for printing on a phototypesetter or comparable device. A postprocessor is then required to post process the output of the troff command to the target device. See the accompanying example.

If no file is specified or the - (minus) flag is not the last parameter, standard input is read by default.

For the 3812, 3816, and Hewlett-Packard LaserJet Series II printer, the default fonts are the native fonts for the printer. Additional fonts also are available for these printers, which may be loaded through the use of the troff .fp directive. These fonts are stored on the host in the directory /usr/lib/font/devPrinter/bitmaps, and downloaded to the printer as necessary.

Typefaces

Three different typefaces are provided in four styles. The following chart shows the relationship between typeface, style, and the name that the troff command uses to access the font.

Note: The fonts in this set are based on the Computer Modern letter forms developed by Donald E Knuth. (Refer to Knuth, Donald: Computer Modern Typefaces. Addison-Wesley, 1986.)

Typeface      Regular     Italic       Bold        Italic

Roman         cr          cR           Cr          CR

Sans Serif    cs          cS           Cs          CS

Typewriter    ct          cT           Ct          CT

troff special sp

These fonts are all provided in the standard 15 troff sizes: 6, 7, 8, 9, 10, 11, 12, 14, 16, 28, 20, 22, 24, 28, and 36 points.

For example, .fp 1 Cr loads the Roman bold font into position 1.

Note: The .tl request cannot be used before the first break-producing request in the input to the troff command.

Flags


-a Sends a printable ASCII approximation of the results to standard output.
-FDirectory Accesses font information from the Directory/devName directory instead of the default /usr/lib/font/devName directory (where Name is specified by the -T flag).
-i Reads standard input after there are no more files.
-M Media Specifies a paper size in order to determine the amount of imageable area on the paper. Valid values for the Media variable are:

A4
Specifies a paper size of 8.3 X 11.7 inches (210 X 297 mm).

A5
Specifies a paper size of 5.83 X 8.27 inches (148 X 210 mm).

B5
Specifies a paper size of 6.9 X 9.8 inches (176 X 250 mm).

EXEC
Specifies a paper size of 7.25 X 10.5 inches (184.2 X 266.7 mm).

LEGAL
Specifies a paper size of 8.5 X 14 inches (215.9 X 355.6 mm).

LETTER
Specifies a paper size of 8.5 X 11 inches (215.9 X 279.4 mm). This is the default value.

Note: The Media variable is not case-sensitive.
-nNumber Numbers the first printed page with the value specified by the Number variable.
-oList Prints only pages specified by the List variable, which consists of a comma-separated list of page numbers and ranges:
  • A range of Start-Stop means print pages Start through Stop. For example: 9-15 prints pages 9 through 15.
  • An initial -Stop means print from the beginning to page Stop.
  • A final Start- means print from pageStart to the end.
  • A combination of page numbers and ranges prints the specified pages. For example: -3,6-8,10,12- prints from the beginning through page 3, pages 6 through 8, page 10, and page 12 to the end.

    Note: When this flag is used in a pipeline (for example, with one or more of the pic, eqn, or tbl commands), you may receive a broken pipe message if the last page in the document is not specified in the List variable. This broken pipe message is not an indication of any problem and can be ignored.

-q Calls the simultaneous input and output mode of the .rd request.
-rANumber Sets the register specified by the A variable to the specified number. The A variable value must have a one-character ASCII name.
-sNumber Generates output to make the typesetter stop every specified number of pages.
-TName Prepares the output for the specified printing device. Phototypesetters or comparable printing devices use the following Name variables for operating system international extended characters. The default is ibm3816.

Note: You get a message that reads bad point sizeif your device does not support the point size that you specified. The troff command uses the closest valid point size to continue formatting.

canonls
Canon Lasershot LBP-B406S/D/E,A404/E,A304E.

ibm3812
3812 Pageprinter II.

ibm3816
3816 Pageprinter.

hplj
Hewlett-Packard LaserJet II.

ibm5585H-T
5585-H01 Traditional Chinese Language support.

ibm5587G
5587-G01, 5584-H02, 5585-H01, 5587-H01, and 5589-H01 Kanji Printer multibyte language support.

psc
PostScript printer.

X100
AIXwindows display.

Note: You also can set the TYPESETTER environment variable to one of the preceding values instead of using the -TName flag of the troff command.
-man Selects the man macro processing package.
-me Selects the me macro processing package.
-mm Selects the mm macro processing package.
-mptx Selects the mptx macro processing package.
-ms Selects the ms macro processing package.
-mv Selects the mv macro processing package.

Note: See Macro Packages for Formatting Tools for more information on the macros.

-z Prints only messages generated by .tm (workstation message) requests.
- Forces input to be read from standard input.

Environment Variables


TYPESETTER Contains information about a particular printing device.

Examples

The following is an example of the troff command:

troff -Tibm3812 File | ibm3812 | qprt

Macro Packages for Formatting Tools

The following macro packages are part of the Formatting Tools in the Text Formatting System and are described in more detail on the next pages:

man Enables you to create your own manual pages from online manual pages.
me Provides macros for formatting papers.
mm Formats documents with nroff and troff formatters.
mptx Formats a permuted index.
ms Provides a formatting facility for various styles of articles, theses, and books.
mv Typesets English-language view graphs and slides by using the troffcommand.

man Macro Package for the nroff and troff Commands

The man macro package is provided to enable users to create their own manual pages from online manual pages that have been processed with either the nroff command or troff command. The man macro package is used with either the nroff command or the troff command.

Note: The man macro package cannot be used to process the InfoExplorer information bases into manual pages.

Special macros, strings, and number registers exist, internal to the man macro package, in addition to the following lists of format macros, strings, and registers. Except for the names predefined by the troff command and the d, m, and y number registers, all such internal names are of the form SymbolAlpha, where Symbol is one of ), ], or }, and Alphais any alphanumeric character.

The man macro package uses only the Roman font. If the input text of an entry contains requests for other fonts (for example, the .I format macro, .RB request, or \fI request) the corresponding fonts must be mounted.

Format Macros

The following macros are used to alter the characteristics of manual pages that are formatted using the manmacro package.

Type font and size are reset to default values before each paragraph and after processing font- and size-setting macros (for example, the .I format macro, .SM format macro, and .B format macro).

Tab stops are neither used nor set by any of the format macros except the .DT format macro and the .TH format macro.

.B [Text]
Makes text bold.

The Text variable represent up to six words; use " " (double quotation marks) to include character spaces in a word. If the variable is empty, this treatment is applied to the next input text line that contains text to be printed. For example, use the .I format macro to italicize an entire line, or use the .SM and .B format macros to produce an entire line of small-bold text. By default, hyphenation is turned off for the nroff command, but remains on for the troff command.

.DT
Restores default tab settings every 5 ens for the nroff command and every 7.2 ens for the troff command.

.HP [Indent]
Begins a paragraph with a hanging indent as specified by the Indentvariable.

If the Indent variable is omitted, the previous Indent value is used. This value is set to its default (5 ens for the nroff command and 7.2 ens for the troff command) by the .TH format macro, .P format macro, and .RS format macro, and restored by the .RE format macro. The default unit for Indent is ens.

.I [Text]
Makes text italic.

The Text variable represent up to six words; use " " (double quotation marks) to include character spaces in a word. If the variable is empty, this treatment is applied to the next input text line that contains text to be printed. For example, use the .I format macro to italicize an entire line, or use the .SM and .B format macros to produce an entire line of small-bold text. By default, hyphenation is turned off for the nroff command, but remains on for the troff command.

.IP [Tag] [Indent]
Same as the .TP Indent macro with the Tag variable; if the value of the Tag variable is NULL, begin indented paragraph. This macro is often used to get an indented paragraph without a tag.

If the Indent variable is omitted, the previous Indent value is used. This value is set to its default (5 ens for the nroff command and 7.2 ens for the troff command) by the .TH format macro, .P format macro, and .RS format macro, and restored by the .RE format macro. The default unit for Indent is ens.

.P
Begins paragraph with normal font, point size, and indent. The .PP macro is a synonym for the mm macro package .P macro.

.PD [Number]
Sets inter-paragraph distance the number of vertical spaces specified by the Number parameter. The default Number variable value is 0.4v for the troff command and 1v for the nroff command.

.PM [Indicator]
Sets proprietary marking as follows:
Indicator Marking
P PRIVATE
N NOTICE
No Indicator specified Turns off proprietary marking.

.RE [Number]
Ends relative indent (.RS) at indent level position specified by the Number variable. If the Number variable value is omitted, return to the most recent lower indent level.

.RI Character1Character2...
Concatenates the Roman Character1 with the italic Character2; alternate these two fonts up to six sets of Character1Character2. Similar macros alternate between any two of Roman, italic, and bold: the .IR, .RB, .BR, .IB, and .BI macros.

.RS [Indent]
Increases relative indent (initially zero). Indent all output an extra number of units from the left margin as specified by the Indent variable.

If the Indent variable is omitted, the previous Indent value is used. This value is set to its default (5 ens for the nroff command and 7.2 ens for the troff command) by the .TH format macro, .P format macro, and .RS format macro, and restored by the .RE format macro. The default unit for Indent is ens.

.SH [Text]
Places subhead text.

The Text variable represent up to six words; use " " (double quotation marks) to include character spaces in a word. If the variable is empty, this treatment is applied to the next input text line that contains text to be printed. For example, use the .I format macro to italicize an entire line, or use the .SM and .B format macros to produce an entire line of small-bold text. By default, hyphenation is turned off for the nroff command, but remains on for the troff command.

.SM [Text]
Makes text one point smaller than default point size.

The Text variable represent up to six words; use " " (double quotation marks) to include character spaces in a word. If the variable is empty, this treatment is applied to the next input text line that contains text to be printed. For example, use the .I format macro to italicize an entire line, or use the .SM and .B format macros to produce an entire line of small-bold text. By default, hyphenation is turned off for the nroff command, but remains on for the troff command.

.SS [Text]
Places sub-subhead text.

The Text variable represent up to six words; use " " (double quotation marks) to include character spaces in a word. If the variable is empty, this treatment is applied to the next input text line that contains text to be printed. For example, use the .I format macro to italicize an entire line, or use the .SM and .B format macros to produce an entire line of small-bold text. By default, hyphenation is turned off for the nroff command, but remains on for the troff command.

.TH [Title][Section][Commentary][Name]
Sets the title and entry heading. This macro calls the .DT format macro.
Variable Marking
Title Title
Section Section number
Commentary Extra commentary
Name New manual name.

Note: If the .TH format macro values contain character spaces that are not enclosed in " " (double quotation marks), irregular dots are displayed on the output.

.TP [Indent]
Begins indented paragraph with hanging tag. The next input line that contains text is the tag. If the tag does not fit, it is printed on a separate line.

If the Indent variable is omitted, the previous Indent value is used. This value is set to its default (5 ens for the nroff command and 7.2 ens for the troff command) by the .TH format macro, .P format macro, and .RS format macro, and restored by the .RE format macro. The default unit for Indent is ens.

Strings


\*R Adds trademark, (Reg.) for the nroff command and the registered trademark symbol for the troff command.
\*S Changes to default type size.
\*(Tm Adds trademark indicator.

Registers


IN Indent left margin relative to subheads. The default is 7.2 ens for the troff command and 5 ens for the nroff command.
LL Line length including the value specified by the IN register.
PD Current inter-paragraph distance.

Flags


-rs1 Reduces default page size of 8.5 inches by 11 inches with a 6.5-inch by 10-inch text area to a 6-inch by 9-inch page size with a 4.75-inch by 8.375-inch text area. This flag also reduces the default type size from 10-point to 9-point and the vertical line spacing from 12-point to 10-point.

Examples

  1. To process the file your.book and pipe the formatted output to the local line printer, qprt, enter:

    nroff -Tlp -man your.book | qprt -dp 
    
  2. To process the files my.book and dept.book, which contain tables, and pipe the formatted output to the local line printer, qprt, enter:

    tbl my.book dept.book | nroff -Tlp -man | col -Tlp | qprt -dp
    

    Note: Before the output is sent to qprt, it is first filtered through the col command to process reverse linefeeds used by the tbl command.

  3. To process the file group, which contains pictures, graphs, and tables, and prepare the formatted output for processing on the IBM 3816 printer, enter:

    grap group | pic | tbl | troff -Tibm3816 -man \
      | ibm3816 | qprt -dp
    

Notes:
  1. If manual pages created with the man macro package are intended for an online facility, components requiring the troff command, such as the grap or pic command, should be avoided.
  2. The grap command precedes the piccommand since it is a preprocessor to the pic command; the reverse does not format correctly.
  3. The col command is not required as a filter to the tbl command; typeset documents do not require reverse linefeeds.

me Macro Package for the nroff and troff Commands

The me package of the nroff and troff command macro definitions provides a formatting facility for technical papers in various formats. The col command may be required to postprocess nroff output in certain cases.

The macro requests are defined in the following section, in me Requests. Many nroff/troff requests can have unpredictable results in conjunction with this package. However, the following requests can be used after the first .pp request:

.bp Begins new page.
.br Breaks output line here.
.ce [Number] Centers next specified number of lines. Default is 1 (one).
.ls [Number] Sets line spacing. Text is single-spaced if Number is set to 1 (one); double-spaced if the value is set to 2.
.na Leaves right margin unjustified.
.sp [Number] Inserts the specified number of spacing lines.
.sz [+]Number Adds the specified number to point size.
.ul [Number] Underlines next specified number of lines. Default is 1 (one).

Output of the eqn, neqn, refer, and tbl commands preprocessors for equations and tables can be used as input.

me Requests

The following list contains all macros, strings, and number registers available in the me macros. Selected troff commands, registers, and functions are included.

\(space) Defines unpaddable space (troff command built-in function).
\" Comments to end of line (troff command built-in function).
\*# Indicates optional delayed text tag string.
\$Number Interpolates the value specified by the Number variable (troff command built-in function).
\n($0 Defines section depth (number register).
.$0 Started after section title printed (user-definable macro).
\n($1 Defines first section number (number register).
.$1 Started before printing depth 1 (one) section (user-definable macro).
\n($2 Defines second section number (number register).
.$2 Started before printing depth 2 section (user-definable macro).
\n($3 Defines third section number (number register).
.$3 Started before printing depth 3 section (user-definable macro).
\n($4 Defines fourth section number (number register).
.$4 Started before printing depth 4 section (user-definable macro).
\n($5 Defines fifth section number (number register).
.$5 Started before printing depth 5 section (user-definable macro).
\n($6 Defines sixth section number (number register).
.$6 Started before printing depth 6 section (user-definable macro).
.$C Called at beginning of chapter (user-definable macro).
.$H Indicates text header (user-definable macro).
\n($R Defines relative vertical spacing in displays (number register defined by default; changing is not recommended).
\n($c Defines current column header (number register).
.$c Prints chapter title (macro defined by default; changing is not recommended).
\n($d Indicates delayed text number (number register).
\n($f Indicates footnote number (number register).
.$f Prints footer (macro defined by default; changing is not recommended).
.$h Prints header (macro defined by default; changing is not recommended).
\n($i Defines paragraph base indent (number register).
\n($l Defines column width (number register).
\n($m Indicates number of columns in effect (number register).
\*($n Indicates section name (string).
\n($p Defines numbered paragraph number (number register).
.$p Prints section heading (macro defined by default; changing is not recommended).
\n($r Defines relative vertical spacing in text (number register defined by default; changing is not recommended).
\n($s Defines column indent (number register).
.$s Separates footnotes from text (macro defined by default; changing is not recommended).
\n% Defines current page number (number register defined by default; changing is not recommended).
\& Indicates zero-width character; useful for hiding controls (troff command built-in function).
\(XX Interpolates special character specified by the XX variable (troff command built-in function).
.(b Begins block (macro).
.(c Begins centered block (macro).
.(d Begins delayed text (macro).
.(f Begins footnote (macro).
.(l Begins list (macro).
.(q Begins quote (macro).
.(xIndex Begins indexed item in the specified index (macro).
.(z Begins floating keep (macro).
.)b Ends block (macro).
.)c Ends centered block (macro).
.)d Ends delayed text (macro).
.)f Ends footnote (macro).
.)l Ends list (macro).
.)q Ends quote (macro).
.)x Ends index entry (macro).
.)z Ends floating keep (macro).
\*String Interpolates the value specified by the String variable (troff command built-in function).
\*String1String2 Interpolates the value specified by the String1String2 variable (troff command built-in function).
\** Indicates optional footnote tag string.
.++mH Macro to define paper section. The value specified by the m variable defines the part of the paper. The m variable can have the following values:

C
Defines chapter.

A
Defines appendix.

P
Defines preliminary information, such as abstract and table of contents.

B
Defines bibliography.

RC
Defines chapters to be renumbered from page 1 (one) of each chapter.

RA
Defines appendix to be renumbered from page 1 (one).

The H parameter defines the new header. If there are any spaces in it, the entire header must be quoted. If you want the header to have the chapter number in it, use the string \\\n(ch. For example, to number appendixes A.1, A.2, ..., type: .++ RA '''\\\n(ch.%'. Each section (such as chapters and appendixes) should be preceded by the .+c request.

.+cTitle Begins chapter (or appendix, for instance, as set by the .++macro). The value specified by the Title variable is the chapter title (macro).
\*, Indicates cedilla (string).
\- Indicates minus sign (troff command built-in function).
\*- Indicates 3/4 em dash (string).
\0 Defines unpaddable digit-width space (troff command built-in function).
.1c Reverts to single-column output (macro).
.2c Begins two-column output (macro).
\*: Indicates umlaut (string).
\*< Begins subscript (string).
\*> Ends subscript (string).
.EN Ends equation. Space after equation produced by the eqn command or neqn command (macro).
.EQXY Begins equation; breaks out and adds space. The value specified by the Y variable is the equation number. The optional X variable value may be any of the following:

I
Indents equation (default).

L
Left-adjusts equation.

C
Centers equation (macro).

\L'Distance' Indicates vertical line-drawing function for the specified distance (troff command built-in function).
.PE Ends pic picture (macro).
.PF Ends pic picture with flyback (macro).
.PS Starts pic picture (macro).
.TE Ends table (macro).
.TH Ends header of table (macro).
.TS X Begins table. If the value of the X variable is H, the table has a repeated heading (macro).
\*[ Begins superscript (string).
\n(.$ Defines number of options to macro (number register defined by default; changing is not recommended).
\n(.i Indicates current indent (number register defined by default; changing is not recommended).
\n(.l Indicates current line length (number register defined by default; changing is not recommended).
\n(.s Indicates current point size (number register defined by default; changing is not recommended).
\*(4 Indicates acute accent (string).
\*(` Indicates grave accent (string).
\(4 Indicates acute accent (troff command built-in function).
\(` Indicates grave accent (troff command built-in function).
\*] Ends superscript (string).
\^ Indicates 1/12 em narrow space (troff command built-in function).
\*^ Indicates caret (string).
.acAuthorNumber Sets up for ACM-style output. The Author variable specifies the author name or names. The Number variable specifies the total number of pages. Must be used before the first initialization (macro).
.ad Sets text adjustment (macro).
.af Assigns format to register (macro).
.am Appends to macro (macro).
.ar Sets page numbers in Arabic (macro).
.as Appends to string (macro).
.b X Prints in boldface the value specified by the X variable. If the X variable is omitted, boldface text follows (macro).
.ba +Number Augments the base indent by the specified Number value. Sets the indent on regular text such as paragraphs (macro).
.bc Begins new column (macro).
.bi X Prints in bold italic the value specified by the X parameter, in no-fill mode only. If the X parameter is not used, bold italic text follows (macro).
\n(bi Displays block indent (number register).
.bl Requests blank lines, even at top of page (macro).
\n(bm Sets bottom title margin (number register).
.bp Begins page (macro).
.br Sets break; starts new line (macro).
\n(bs Displays block pre- or post-spacing (number register).
\n(bt Blocks keep threshold (number register).
.bu Begins bulleted paragraph (macro).
.bx X Prints in no-fill mode only the value specified by the X variable in box (macro).
\c Continues input (troff command built-in function).
.ce Centers lines (macro).
\n(ch Defines current chapter number (number register).
.de Defines macro (macro).
\n(df Displays font (number register).
.ds Defines string (macro).
\n(dw Defines current day of week (number register).
\*(dw Defines current day of week (string).
\n(dy Defines current day of month (number register).
\e Indicates printable version of \ (backslash) (troff command built-in function).
.ef'X'Y'Z' Sets even-page footer to the values specified by the XYZ variables (macro).
.eh'X'Y'Z' Sets even-page header to the values specified by the XYZ variables (macro).
.el Specifies the else part of an if/else conditional (macro).
.ep Ends page (macro).
\n(es Indicates equation pre- or post-space (number register).
\fFont Sets inline font change to the specified Font variable value (troff command built-in function).
\f(Fontf Sets inline font change to the specified Fontf variable value (troff command built-in function).
.fc Sets field characters (macro).
\n(ff Sets footnote font (number register).
.fi Fills output lines (macro).
\n(fi Indicates footnote indent, first line only (number register).
\n(fm Sets footer margin (number register).
.fo 'X'Y'Z' Sets footer to the values specified by the XYZ variables (macro).
\n(fp Sets footnote point size (number register).
\n(fs Sets footnote pre-space (number register).
\n(fu Sets footnote indent from right margin (number register).
\h'Distance' Sets local horizontal motion for the specified distance (troff command built-in function).
.hc Sets hyphenation character (macro).
.he 'X'Y'Z' Sets header to the values specified by the XYZ variables (macro).
.hl Draws horizontal line (macro).
\n(hm Sets header margin (number register).
.hx Suppresses headers and footers on next page (macro).
.hy Sets hyphenation mode (macro).
.i X Italicizes the value specified by the X variable. If the Xvariable is omitted, italic text follows (macro).
.ie Specifies the else part of an if/else conditional (macro).
.if Designates a conditional (macro).
\n(ii Sets indented paragraph indent (number register).
.in Indents (transient); use the .ba macro if pervasive (macro).
.ip X Y Starts indented paragraph, with hanging tag specified by the X variable. Indentation is the en value specified by the Y variable. Default is 5 (macro).
.ix Indents, no break (macro).
\l'Distance' Starts horizontal line-drawing function for the specified distance (troff command built-in function).
.lc Sets leader repetition character (macro).
.lh Interpolates local letterhead (macro).
.ll Sets line length (macro).
.lo Reads in a file of local macros of the form .*x. Must be used before initialization (macro).
.lp Begins left-justified paragraph (macro).
\*(lq Designates left quotation marks (string).
.ls Sets multi-line spacing (macro).
.m1 Sets space from top of page to header (macro).
.m2 Sets space from header to text (macro).
.m3 Sets space from text to footer (macro).
.m4 Sets space from footer to bottom of page (macro).
.mc Inserts margin character (macro).
.mk Marks vertical position (macro).
\n(mo Defines month of year (number register).
\*(mo Defines current month (string).
\nX Interpolates number register specified by the X variable value (number register).
\n(XX Interpolates number register specified by the XX variable (number register).
.n1 Sets number lines in margin (macro).
.n2 Sets number lines in margin (macro).
.na Turns off text adjustment (macro).
.neNumber Sets the specified number of lines of vertical space (macro).
.nf Leaves output lines unfilled (macro).
.nh Turns off hyphenation (macro).
.np Begins numbered paragraph (macro).
.nr Sets number register (macro).
.ns Indicates no-space mode (macro).
\*o Indicates superscript circle (such as for Norse A; string).
.of'X'Y'Z' Sets odd footer to the values specified by the XYZ variables (macro).
.oh'X'Y'Z' Sets odd header to the values specified by the XYZ variables (macro).
.pa Begins page (macro).
.pd Prints delayed text (macro).
\n(pf Indicates paragraph font (number register).
\n(pi Indicates paragraph indent (number register).
.pl Sets page length (macro).
.pn Sets next page number (macro).
.po Sets page offset (macro).
\n(po Simulates page offset (number register).
.pp Begins paragraph, first line indented (macro).
\n(pp Sets paragraph point size (number register).
\n(ps Sets paragraph pre-space (number register).
.q Indicates quoted (macro).
\*(qa For all (string).
\*qe There exists (string).
\n(qi Sets quotation indent; also shortens line (number register).
\n(qp Sets quotation point size (number register).
\n(qs Sets quotation pre- or post-space (number register).
.r Sets Roman text to follow (macro).
.rb Sets real bold font (macro).
.re Resets tabs to default values (macro).
.rm Removes macro or string (macro).
.rn Renames macro or string (macro).
.ro Sets page numbers in Roman (macro).
\*(rq Indicates right quotation marks (string).
.rr Removes register (macro).
.rs Restores register (macro).
.rt Returns to vertical position (macro).
\sSize Changes inline size to specified size (troff command built-in function).
.sc Reads in a file of special characters and diacritical marks. Must be used before initialization (macro).
\n(sf Sets section title font (number register).
.shLevelTitle Indicates section head to follow; font automatically bold. The Level variable specifies the level of section. The Title variable specifies the title of section (macro).
\n(si Sets relative base indent-per-section depth (number register).
.sk Leaves the next page blank. Only one page is remembered ahead (macro).
.smX Sets, in a smaller point size, the value specified by the X variable (macro).
.so Indicates source input file (macro).
\n(so Sets additional section title offset (number register).
.sp Indicates vertical space (macro).
\n(sp Indicates section title point size (number register).
\n(ss Indicates section prespace (number register).
.sx Changes section depth (macro).
.sz +Number Augments point size by the specified number of points (macro).
.ta Sets tab stops (macro).
.tc Sets tab repetition character (macro).
\*(td Sets today's date (string).
n(tf Indicates title font (number register).
.th Produces paper in thesis format. Must be used before initialization (macro).
.ti Indicates temporary indent, next line only (macro).
.tl Indicates 3-part title (macro).
\n(tm Sets top title margin (number register).
.tp Begins title page (macro).
\n(tp Sets title point size (number register).
.tr Translates (macro).
.u X Underlines the value specified by the X variable, even in the troff command. No-fill mode only (macro).
.uh Sets section head to follow; font automatically bold. Similar to the .sh macro, but unnumbered (macro).
.ul Underlines next line (macro).
\v'Distance' Local vertical motion for the specified distance (troff command built-in function).
\*v Inverts v for Czech e (string).
\w'String' Returns width of the specified string (troff command built-in function).
.xl Sets local line length (macro).
.xpIndex Prints the specified index (macro).
\n(xs Sets index entry prespace (number register).
\n(xu Sets index indent, from right margin (number register).
\n(yr Indicates year, last two digits only (number register).
\n(zs Sets floating keep pre- or post-space (number register).
\{ Begins conditional group (troff command built-in function).
\| 1/6 em, narrow space (troff command built-in function).
\} Ends conditional group (troff command built-in function).
\*~ Indicates tilde (string).

For further information, see the -ME Reference Manual by E. P. Allman.

mm Macro Package for the mm, mmt, nroff, and troff Commands

The mm macro package provides macros to format text in a wide variety of document forms, such as memos, letters, and reports. The manner in which you type and edit a document is essentially independent of whether the document is later formatted at a terminal or phototypeset.

The col command may be required to postprocess nroff output. See the colcommand for specific requirements.

The mm macros and additional information are summarized under the following headings:

Beginning Macros for Formal Memoranda


.ND Date Sets new date.
.TL [ChgNumber] [FileNumber] Sets title information. Text on the following line is used as the title of the document.
.AF [CompanyName] Specifies author's company name.
.AU Name [Initials] [Loc] [Dept] [Ext] [Room] [Option...] Sets author information.
.AT AuthorTitle [...] Specifies title to follow signer's name (up to nine options).
.TM [Number] Sets technical memorandum number.
.AS [ 0 | 1 | 2 ] [Indent] Starts abstract, for technical memorandum and released paper only:

0
Abstract on cover sheet and first page

1
Abstract only on cover sheet

2
Abstract only on memorandum for file cover sheet.

.AE Ends abstract.
.NS Starts notation, allowed on memorandum for file cover sheets following an .AS 2/.AE macro pair (see "Ending Macros").
.NE Ends notation, allowed on memorandum for file cover sheets following an .AS 2/.AE macro pair (see "Ending Macros").
.OK [Keyword ...] Specifies other keywords (up to nine options).
.MT [type] [title] Sets document type:

""
No type.

0
No type (internal letter).

1
Memorandum for file.

2
Programmer's notes.

3
Engineer's notes.

4
Released paper.

5
External letter.

"String"
The specified string is printed.

Title User-supplied text prefixed to page number

Business Letter Macros


.WA Starts writer's address.
.WE Ends writer's address.
.LO CN [Notation] Specifies confidential notation.
.LO RN [Notation] Specifies reference notation.
.IA Starts inside (recipient's) address.
.IE Ends inside (recipient's) address.
.LO AT [Notation] Specifies attention line.
.LO SA [Notation] Specifies salutation.
.LO SJ [Notation] Specifies subject line.
.LT [ { none BL SB FB SP} ] Specifies business letter type:

none
Blocked

BL
Blocked

SB
Semiblocked

FB
Full-Blocked

SP
Simplified.

Ending Macros (Trailing Information)


.FC [Closing] Prints formal closing.
.SG [Initials] [1] Prints signature line.
.NS [{" "0 1 2 3 4 5 6 7 8 9 10 11 12 13 String}] Starts notation:

" "
 

 
Copy to

0
Copy to

1
Copy (with attachment) to

2
Copy (without attachment) to

3
Attachment

4
Attachments

5
Enclosure

6
Enclosures

7
Under Separate Cover

8
Letter to

9
Memorandum to

10
Copy (with attachments) to

11
Copy (without attachments) to

12
Abstract Only to

13
Complete Memorandum to

String
Copy (String) to.

.NE Ends notation.
.AV Name [1] Prints approval signature.
.CS [Pgs] [Other] [Tot] [Figs] [Tbls] [Ref] Prints cover sheet.
.TX Calls user exit for table-of-contents titles.
.TY Calls user exit for table-of-contents header.
.TC [Slev] [Spacing] [Tlev] [Tab] [H1] [H2] [H3] [H4] [H5] Prints table of contents.

Paragraphs


.P [ {0 1 2} ] Starts paragraph:

0
Left-justified (default)

1
Indented

2
Indented except after .H, .LE, .DE.

Section Headings


.H {1 2 3 4 5 6 7} [HeadingText] [FootnoteMark] Specifies numbered headings.
.HU HeadingText Specifies unnumbered headings.
.HM {1 0001 A a I i}... Specifies heading mark style:

1
Arabic

0001
Arabic with leading 0s (zeros)

A
Uppercase alphabetic

a
Lowercase alphabetic

I
Uppercase Roman

i
Lowercase Roman.

.HX [Dlev] [Rlev] [HeadingText] Calls user-defined exit macro before headings.
.HY [Dlev] [Rlev] [HeadingText] Calls user-defined exit macro in the middle of headings.
.HZ [Dlev] [Rlev] [HeadingText] Calls user-defined exit macro after headings.

Lists

If the last option [1] is present in the list-start macros, there is no space between items.

.AL [ {1 A a I i} ] [TextIndent] [1] Starts automatically incremented list (1).
.BL [TextIndent] [1] Starts a bullet list.
.DL [TextIndent] [1] Starts a dash list.
.ML Mark [TextIndent] [1] Starts a list in which each list item is tagged with a specified mark. If the value of the TextIndent is NULL or omitted, it is set to [Mark - width + 1]. If the 3rd argument is specified, no blank lines separate items in the list.
.RL [TextIndent] [1] Starts a reference list.
.VL TextIndent [MarkIndent] [1] Starts a variable tag list.
.LI [Mark] [1] Starts list item; 1 means that the Mark variable value is to be prefixed to the current mark.
.LE [1] Ends list item; 1 means to output a blank line after list. The default is no blank line.
.LB TextIndent MarkIndent Pad Type [Mark] [{0 1}] [{0 1}] Begins list:

The value of the Type variable is:

 
1=. 2=) 3=() 4=[] 5=<> 6={}.

Sixth option:

0
No blank line before each list item.

Seventh option:

0
No blank line before list.
.LC [Level] Clears list status up to the Level variable value.

Displays, Tables, Equations, and Footnotes

.DS [{0 1 2 3 }] [{0 1}] [Number]

.DS [{L I C CB}] [{N F}] [Number]
Starts static display:

0 or L
 

 
No indent

1 or I
Indent from left

2 or C
Center each line

3 or CB
 

 
Center as a block

0 or N
No-fill

1 or F
Fill.

Number
Indent from right the number of spaces specified by the Number parameter.

.DF [{0 1 2 3 }] [{0 1}] [Number]

.DF [{L I C CB}] [{N F}] [Number]
Starts floating display:

0 or L
 

 
No indent

1 or I
Indent from left

2 or C
Center each line

3 or CB
 

 
Center as a block

0 or N
No-fill

1 or F
Fill.

Number
Indent from right the number of spaces specified by the Number parameter.

 

.DE
Ends display.

.FG [Title] [Override] [0 1 2]
The value of the Override variable replaces or enhances the default numbering. Specifies figure caption:

0
 

 
Override value is used as a prefix.

1
Override value becomes a suffix.

2
Replace Override value becomes a replacement.

 

.TS [H]
Starts table:

H
Multipage table.

 

.TH [N]
Must be used when specifying option H to .TS:

N
Suppresses table headers unless on top of new page.

.TE
Ends table.

.TB [Title] [Override] [0 1 2]
The value of the Override variable replaces or enhances the default numbering. Specifies table caption:

0
 

 
Override value is used as a prefix.

1
Override value becomes a suffix.

2
Replace Override value becomes a replacement.

.EX [Title] [Override] [0 1 2]
The value of the Override variable replaces or enhances the default numbering. Specifies exhibit caption:

0
 

 
Override value is used as a prefix.

1
Override value becomes a suffix.

2
Replace Override value becomes a replacement.

.EQ [Label]
Starts equation display using the specified label.

.EN
Ends equation display.

.EC [Title] [Override] [0 1 2]
The value of the Override variable replaces or enhances the default numbering. Specifies equation caption:

0
 

 
Override value is used as a prefix.

1
Override value becomes a suffix.

2
Replace Override value becomes a replacement.

.FS [Label]
Starts footnote using the specified label as an indicator. Default is numbered footnote.

.FE
Ends footnote.

.FD [{0 1 2 3 4 ... 11}] [1]
Sets footnote format:

First option:

Set up formatting style for footnote text. Default is 0 for mmt command. Default is 10 for mm command. See the following table for the value.

Second option:

Reset footnote counter on first-level heading.

.FD Arg. Hyphens Adjusted Text Indented Label Justified
0 .nh .ad Yes Left
1 .hy .ad Yes Left
2 .nh .na Yes Left
3 .hy .na Yes Left
4 .nh .ad No Left
5 .hy .ad No Left
6 .nh .na No Left
7 .hy .na No Left
8 .nh .ad Yes Right
9 .hy .ad Yes Right
10 .nh .na Yes Right
11 .hy .na Yes Right

Page Headers and Footers


.PH "'Left'Center'Right'" Specifies page header.
.OH "'Left'Center'Right'" Specifies odd-page header.
.EH "'Left'Center'Right'" Specifies even-page header.
.PF "'Left'Center'Right'" Specifies page footer.
.OF "'Left'Center'Right'" Specifies odd-page footer.
.EF "'Left'Center'Right'" Specifies even-page footer.
.BS Starts bottom-block.
.BE Ends bottom-block.
.PX Calls user exit for page-header.
.TP Calls top of page macro.

Miscellaneous Macros


.B [Option] [Prev-Font-option] Prints in bold (up to six options).
.I [Option] [Prev-Font-option] Prints in italics (up to six options); underlines with the nroff command.
.R Returns to Roman font.
.PM [Option] Sets proprietary marking. If you do not give the .PM macro an option, you turn off proprietary markings. The /usr/lib/macros/string.mm file contains some proprietary markings. This file should be edited to meet the user's needs.
.RD [Prompt] [Diversion] [String] Stops code macro. The Prompt variable should be a user-defined string without spaces. The Diversion variable allows the typed-in text to be saved. The String variable contains the first line typed following the prompt.
.RP [{0 1 }] [{0 1 2 3}] Produces reference page:

First option:

0
 

 
Resets reference counter (default).

1
Does not reset reference counter.

Second option:

0
Causes an .SK macro after (default).

1
Does not cause an .SK macro after.

2
Does not cause an .SK macro before.

3
Does not cause an .SK macro before or after.
.RS/.RF Numbers references automatically.
.WC [{N WF -WF FF -FF WD -WD FB -FB}] Controls width for footnotes and displays when using two columns:

N
 

 
Normal mode ( -WF, -FF, -WD).

WF
Footnotes always wide.

-WF
Footnotes follow page style.

FF
First footnote determines width of remaining footnotes on that page.

-FF
Footnotes follow setting of WF or -WF option.

WD
Always wide displays.

-WD
Displays follow page style.

FB
Floating display causes page break (default).

-FB
Floating display does not cause page break.
.SP [Lines] Skips lines down.
.SK [Number] Skips the specified number of pages. (The default is 1.)
.OP Breaks to an odd page.
.2C Prints output in two columns.
.1C Prints output in one column (normal line width restored).
.SA [Option] Sets right-margin justification

Options:

0
Sets default to off (default for the nroff command).

1
Sets default to on (default for the troff command).

If no option is specified, macro reverts to current default.

.SM String1 [String2] [String3] Reduces size of the String1 variable value by 1 point if the String3 variable value is omitted; otherwise, reduces size of the String2 variable value by one point.
.HC Character Sets hyphenation character to the Character variable value.
.S [PointSize] [VerticalSpacing] Sets point size and vertical spacing (the troff command only).

Defaults:

Point size = 10p

Vertical spacing = 12p

Options 1 and 2:

Number
 

New value.

+/-Number
Increment to current value.

D
Default.

C
Current value.

P
Previous value.
.VM [Top] [Bottom] Sets variable vertical margins.
.nP Starts double-line indent on paragraph.

The following macros are for alternating fonts and all take one to six options:

.IB Alternates italics (underlines for nroff) and bold.
.BI Alternates bold and italics.
.RI Alternates Roman and italics.
.IR Alternates italics (underlines for nroff) and Roman.
.RB Alternates Roman and bold.
.BR Alternates bold and Roman.

mm Registers

If an * (asterisk) follows a register name, that register can be set one of two ways: from the command line (see the example in the mm command) or before the formatter reads mm macro definitions. In the following list, the number shown in parentheses is the default value.

A * Handle preprinted forms.
Au Inhibit author information on first page (1).
C * Copy type (such as Original and Draft) (0).
Cl Contents level (2).
Cp Placement of figures, tables, equations, and exhibits (1).
D * Debug flag (0). If set to 1, the mm command continues even if it encounters a normally fatal error.
De Eject page after floating displays (0).
Df If set to 1, format register for floating displays (5).
Ds Static display pre- and post-space (1).
E * Control font of the Subject/Date/From fields (0): 0 = bold; 1 = Roman.

0
Bold (0)

1
Roman.
Ec Equation counter.
Ej Page-ejection flag for headings (0).
Eq Equation label placement (0).
Ex Exhibit counter.
Fg Figure counter.
Fs Vertical footnote separation (1).
H1...H7 Heading counters.
Hb Heading break level (after .H and .HU) (2).
Hc Heading centering level for .H and .HU (0).
Hi Heading temporary indent (after .H and .HU) (1).
Hs Heading space level (after .H and .HU) (2).
Ht Heading type:

0
Concatenated numbers (0)

1
Single numbers (0).
Hu Heading level for unnumbered heading (2).
Hy Hyphenation control:

0
No hyphenation (0)

1
Enable hyphenation.
L * Length of page (66v).
Le List of equations following table of contents (0):

0
Do not print

1
Print.
Lf List of figures following table of contents (0):

0
Do not print

1
Print.
Li List indent (5, troff command); (6, nroff command).
Ls List level down to which there is spacing between items (6).
Lt List of tables following table of contents (0):

0
Do not print

1
Print
Lx List of exhibits following table of contents (1):

0
Do not print

1
Print.
N * Numbering style (0).
Np Numbered paragraphs:

0
Unnumbered

1
Numbered (0).
O * Offset of page.
Oc Page numbering style for table of contents:

0
Lowercase Roman

1
Arabic (0).
Of Figure caption style (0).
P Page number; managed by the mm command (0). The register accepts a value of 0, or positive integers.
Pi Paragraph indent (5).
Ps Paragraph spacing (1).
Pt Paragraph type (0).
Pv PRIVATE header:

0
Do not print PRIVATE

1
On first page only
2 On all pages (0).