Book HomeBook TitleSearch this book

12.4. Default Operation of Requests

nroff/troff initializes the formatting environment. For example, unless you reset the line length, nroff/troff uses 6.5 inches. Most requests can change the default environment, and those that can are listed in Table 12-1. The second column lists the initial or default value in effect before the request is used. If no initial value applies, a hyphen (–) is used. The third column shows the effect if a request's optional argument is not used. Here, a hyphen is used if the request doesn't accept an argument or if the argument is required.

Table 12-1. Requests That Affect the Default Environment

RequestInitial ValueIf No ArgumentDescription
.adJustify Justify

Adjust margins.

.afLowercase arabic

Assign a format to a register.

.amEnd call with ..

Append to a macro.

.bdOff

Embolden font.

.c2''

Set no-break control character.

.cc..

Set control character.

.ceOffCenter one line

Center lines.

.ch Turn off trap

Change trap position.

.csOff

Set constant-width spacing.

.cuOffOne line

Continuous underline/italicize.

.daEnd the diversion

Divert text and append to a macro.

.deEnd macro with ..

Define a macro.

.diEnd the diversion

Divert text to a macro.

.dtTurn off trap

Set a diversion trap.

.ec\\

Set escape character.

.eoOn

Turn off escape character.

.ev0

Previous environment

Change environment (push down).

.fcOffOff

Set field delimiter and pad character.

.fiFill

Fill lines.

.fp

1=R

2=I

3=B

4=S

Mount font (on positions 1–4).

.ftRomanPrevious font

Set font.

.hc\%\%

Set hyphenation character.

.hyMode 1 Mode 1

Set hyphenation mode.

.igEnd with ..

Suppress (ignore) text in output.

.in0Previous indent

Indent.

.itTurn off trap

Set a trap for input line counting.

.lc.None

Set leader character.

.lg

Off (nroff)

On (troff)

On

Ligature mode.

.ll6.5 inches

Previous line length

Set line length.

.lsSingle-spacePrevious mode

Set line spacing.

.lt6.5 inches

Previous title length

Set length of title.

.mcTurn off

Set the margin character.

.mkInternal

Mark vertical position.

.naAdjust

Don't adjust margins.

.neOne vertical line

Keep lines on same page if there's room.

.nfFill

Don't fill lines.

.nhOn

Turn off hyphenation.

.nmOffOff

Line-numbering mode.

.nnOne line

Don't number next N lines.

.nsSpace mode

Enable no-space mode.

.nxEnd of file

Go to a file.

.pc%Off

Set page character.

.pl11 inches11 inches

Set page length.

.pnPage 1

Set page number.

.po

0 (nroff); 26/27 inch (otroff)

1 inch (ditroff)

Previous offset

Change page offset.

.ps10

Previous point size

Set point size.

.rdRing bell

Read from the terminal.

.rtInternal

Return to marked vertical place.

.spOne vertical line

Output blank spacing.

.ss12/36 emIgnored

Set character spacing.

.svOne vertical line

Save (store) spacing.

.ta

8 en (nroff); 1/2 inch (troff)

Define tab settings.

.tc

Set tab repetition character.

.ti0Indent next line.
.tmNewline

Print a message, then continue.

.tr

Translate pairs of characters on output.

.ufItalicItalic

Set font for underlining.

.ul0One lineUnderline/italicize.
.vs

1/6 inch (nroff); 12 points (troff)

Previous value

Set vertical spacing for lines.

Comments in nroff/troff begin with \". Lines beginning with . that contain an unknown request are ignored. In general, don't put leading whitespace on your text lines. This causes a break, and nroff and troff honors the leading whitespace literally.

Note: the canonical reference for nroff/troff is Bell Labs Computing Science Technical Report #54, Troff User's Manual, by J.F. Ossanna and B.W. Kernighan. It is available in PostScript from http://cm.bell-labs.com/cm/cs/cstr/54.ps.gz. You should read it if you plan to do any serious work in nroff/troff (such as writing or modifying macro packages). This document explains the ideas of diversions, environments, fields, registers, strings, and traps.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.