An explicit ``.NH 0'' will reset the numbering of level 1
to one, as here:
.NH 0
Penn Central
1. Penn Central
Indented paragraphs.
(Paragraphs with hanging numbers, e.g. references.)
The sequence
.IP [1]
Text for first paragraph, typed
normally for as long as you would
like on as many lines as needed.
.IP [2]
Text for second paragraph, ...
produces
A series of indented paragraphs may be followed by an ordinary paragraph beginning with .PP or .LP, depending on whether you wish indenting or not. The command .LP was used here.
More sophisticated uses of .IP are also possible.
If the label is omitted, for example, a plain block indent
is produced.
.IP
This material will
just be turned into a
block indent suitable for quotations or
such matter.
.LP
will produce
If a non-standard amount of indenting is required,
it may be specified after the label (in character positions)
and will remain in effect until the next .PP or .LP.
Thus, the general form of the .IP command
contains two additional fields: the label and the indenting
length. For example,
.IP first: 9
Notice the longer label, requiring larger
indenting for these paragraphs.
.IP second:
And so forth.
.LP
produces this:
It is also possible to produce multiple nested indents;
the command .RS indicates that the next .IP starts from the
current indentation level.
Each .RE will eat up one level of indenting
so you should balance .RS and .RE commands.
The .RS command should be thought of as ``move right'' and
the .RE command as ``move left''.
As an example
.IP 1.
Bell Laboratories
.RS
.IP 1.1
Murray Hill
.IP 1.2
Holmdel
.IP 1.3
Whippany
.RS
.IP 1.3.1
Madison
.RE
.IP 1.4
Chester
.RE
.LP
will result in
All of these variations on .LP leave the right margin untouched. Sometimes, for purposes such as setting off a quotation, a paragraph indented on both right and left is required.
A single paragraph like this is obtained by preceding it with .QP. More complicated material (several paragraphs) should be bracketed with .QS and .QE.
Emphasis.
To get
italics
(on the typesetter) or underlining (on the terminal)
say
.I
as much text as you want
can be typed here
.R
as was done for
these three words.
The .R command restores the normal (usually Roman) font.
If only one word is to be italicized, it
may be just given on the line with the .I command,
A few size changes can be specified similarly with the commands .LG (make larger), .SM (make smaller), and .NL (return to normal size). The size change is two points; the commands may be repeated for increased effect (here one .NL canceled two .SM commands).
If actual as opposed to italicizing is required on the typesetter, the command
Footnotes. Material placed between lines with the commands .FS (footnote) and .FE (footnote end) will be collected, remembered, and finally placed at the bottom of the current page*. By default, footnotes are 11/12th the length of normal text, but this can be changed using the FL register (see below).
Displays and Tables.
To prepare displays of lines, such as tables, in which
the lines should not be re-arranged,
enclose them in the commands .DS and .DE
.DS
table lines, like the
examples here, are placed
between .DS and .DE
.DE
By default, lines between .DS and .DE are indented and left-adjusted.
You can also center lines, or retain the left margin.
Lines bracketed by .DS C and .DE commands are
centered (and not re-arranged); lines bracketed
by .DS L and .DE are left-adjusted, not indented, and
not re-arranged.
A plain .DS is equivalent
to .DS I, which indents and left-adjusts. Thus,
Boxing words or lines.
To draw rectangular boxes around words the command
.BX word
will print
word
as shown.
The boxes will not be neat on a terminal, and this
should not be used as a substitute for italics.
Keeping blocks together. If you wish to keep a table or other block of lines together on a page, there are ``keep - release'' commands. If a block of lines preceded by .KS and followed by .KE does not fit on the remainder of the current page, it will begin on a new page. Lines bracketed by .DS and .DE commands are automatically kept together this way. There is also a ``keep floating'' command: if the block to be kept together is preceded by .KF instead of .KS and does not fit on the current page, it will be moved down through the text until the top of the next page. Thus, no large blank space will be introduced in the document.
Nroff/Troff commands.
Among the useful commands from the basic formatting programs
are the following. They all work with both typesetter and
computer terminal output:
.bp - begin new page.
.br - ``break'', stop running text
from line to line.
.sp n - insert n blank lines.
.na - don't adjust right margins.
Date.
By default, documents produced on computer terminals have the
date at the bottom of each page; documents produced on
the typesetter don't.
To force the date, say ``.DA''. To force no date, say ``.ND''.
To lie about the date, say ``.DA July 4, 1776''
which puts the specified date at the bottom of each page.
The command
.ND May 8, 1945
in ".RP" format
places the specified date on the cover sheet and nowhere else.
Place this line before the title.
Signature line. You can obtain a signature line by placing the command .SG in the document. The authors' names will be output in place of the .SG line. An argument to .SG is used as a typing identification line, and placed after the signatures. The .SG command is ignored in released paper format.
Registers. Certain of the registers used by -ms can be altered to change default settings. They should be changed with .nr commands, as with
Register Defines Takes Default effect PS point size next para. 10 VS line spacing next para. 12 pts LL line length next para. 6'' LT title length next para. 6'' PD para. spacing next para. 0.3 VS PI para. indent next para. 5 ens FL footnote length next FS 11/12 LL CW column width next 2C 7/15 LL GW intercolumn gap next 2C 1/15 LL PO page offset next page 26/27'' HM top margin next page 1'' FM bottom margin next page 1''You may also alter the strings LH, CH, and RH which are the left, center, and right headings respectively; and similarly LF, CF, and RF which are strings in the page footer. The page number on output is taken from register PN, to permit changing its output style. For more complicated headers and footers the macros PT and BT can be redefined, as explained earlier.
Accents. To simplify typing certain foreign words, strings representing common accent marks are defined. They precede the letter over which the mark is to appear. Here are the strings:
Input Output Input Output \*'e e \*~a a \*`e e \*Ce e \*:u u \*,c c \*^e e
Use.
After your document is prepared and stored on a file,
you can print it on a terminal with the command*
nroff -ms file
and you can print it on the typesetter with the
command
troff -ms file
(many options are possible).
In each case, if your document is stored in several files,
just list all the filenames
where we have used ``file''.
If equations or tables are used,
eqn
and/or
tbl
must be invoked as preprocessors.
References and further study. If you have to do Greek or mathematics, see eqn [1] for equation setting. To aid eqn users, -ms provides definitions of .EQ and .EN which normally center the equation and set it off slightly. An argument on .EQ is taken to be an equation number and placed in the right margin near the equation. In addition, there are three special arguments to EQ: the letters C, I, and L indicate centered (default), indented, and left adjusted equations, respectively. If there is both a format argument and an equation number, give the format argument first, as in
Similarly, the macros .TS and .TE are defined to separate tables (see [2]) from text with a little space. A very long table with a heading may be broken across pages by beginning it with .TS H instead of .TS, and placing the line .TH in the table data after the heading. If the table has no heading repeated from page to page, just use the ordinary .TS and .TE macros.
To learn more about troff see [3] for a general introduction, and [4] for the full details (experts only). Information on related UNIX commands is in [5]. For jobs that do not seem well-adapted to -ms, consider other macro packages. It is often far easier to write a specific macro packages for such tasks as imitating particular journals than to try to adapt -ms.
Acknowledgment. Many thanks are due to Brian Kernighan for his help in the design and implementation of this package, and for his assistance in preparing this manual.
1CReturn to single column format. LGIncrease type size. 2CStart double column format. LPLeft aligned block paragraph. ABBegin abstract. AEEnd abstract. AISpecify author's institution. AUSpecify author. NDChange or cancel date. B Begin boldface. NHSpecify numbered heading. DAProvide the date on each page. NLReturn to normal type size. DEEnd display. PPBegin paragraph. DSStart display (also CD, LD, ID). ENEnd equation. R Return to regular font (usually Roman). EQBegin equation. REEnd one level of relative indenting. FEEnd footnote. RPUse released paper format. FSBegin footnote. RSRelative indent increased one level. SGInsert signature line. I Begin italics. SHSpecify section heading. SMChange to smaller type size. IPBegin indented paragraph. TLSpecify title. KERelease keep. KFBegin floating keep. ULUnderline one word. KSStart keep.
The following register names are used by -ms internally. Independent use of these names in one's own macros may produce incorrect output. Note that no lower case letters are used in any -ms internal name.
Number registers used in -ms : DW GW HM IQ LL NA OJ PO T. TV #T EF H1 HT IR LT NC PD PQ TB VS 1T FL H3 IK KI MM NF PF PX TD YE AV FM H4 IM L1 MN NS PI RO TN YY CW FP H5 IP LE MO OI PN ST TQ ZN
String registers used in -ms ' A5 CB DW EZ I KF MR R1 RT TL ` AB CC DY FA I1 KQ ND R2 S0 TM ^ AE CD E1 FE I2 KS NH R3 S1 TQ ~ AI CF E2 FJ I3 LB NL R4 S2 TS : AU CH E3 FK I4 LD NP R5 SG TT , B CM E4 FN I5 LG OD RC SH UL 1C BG CS E5 FO ID LP OK RE SM WB 2C BT CT EE FQ IE ME PP RF SN WH A1 C D EL FS IM MF PT RH SY WT A2 C1 DA EM FV IP MH PY RP TA XD A3 C2 DE EN FY IZ MN QF RQ TE XF A4 CA DS EQ HO KE MO R RS TH XK
This guide gives some simple examples of
document preparation on Bell Labs computers,
emphasizing the use of the -ms macro
package.
It enormously abbreviates
information in
1.tTyping Documents on UNIX and GCOS,
by M. E. Lesk;
2.tTypesetting Mathematics - User's Guide,
by B. W. Kernighan and L. L. Cherry; and
3.tTbl - A Program to Format Tables,
by M. E. Lesk.
These memos are all included in the
UNIX Programmer's Manual, Volume 2.
The new user should also have
A Tutorial Introduction to the UNIX Text Editor,
by B. W. Kernighan.
For more detailed information, read
Advanced Editing on UNIX
and
A Troff Tutorial,
by B. W. Kernighan,
and (for experts)
Nroff/Troff Reference Manual
by J. F. Ossanna.
Information on related commands is
found (for UNIX users) in
UNIX for Beginners
by B. W. Kernighan
and the
UNIX Programmer's Manual
by K. Thompson and D. M. Ritchie.
.TM 1978-5b3 99999 99999-11
.ND April 1, 1976
.TL
The Role of the Allen Wrench in Modern
Electronics
.AU "MH 2G-111" 2345
J. Q. Pencilpusher
.AU "MH 1K-222" 5432
X. Y. Hardwired
.AI
.MH
.OK
Tools
Design
.AB
This abstract should be short enough to
fit on a single page cover sheet.
It must attract the reader into sending for
the complete memorandum.
.AE
.CS 10 2 12 5 6 7
.NH
Introduction.
.PP
Now the first paragraph of actual text ...
...
Last line of text.
.SG MH-1234-JQP/XYH-unix
.NH
References ...
Commands not needed in a particular
format are ignored.
\(bs Cover Sheet for TM
______________________________
This information is for employees of Bell Laboratories. (GEI 13.9-3)
______________________________
Title-
The Role of the Allen Wrench
in Modern Electronics
Date-
April 1, 1976
TM-
1978-5b3
Other Keywords-
Tools
Design
Author Location Ext. Charging Case-
J. Q. Pencilpusher MH 2G-111 2345
Filing Case-
X. Y. Hardwired MH 1K-222 5432
This abstract should be short enough to fit
on a single page cover sheet.
It must attract the reader into sending for the
complete memorandum.
______________________________
Pages Text 10 Other 2 Total 12
No. Figures 5 No. Tables 6 No. Refs. 7 b
______________________________
E-1932-U (6-73) SEE REVERSE SIDE FOR DISTRIBUTION LIST
L
.EQ
delim $$
.EN
.RP
... (as for a TM)
.CS 10 2 12 5 6 7
.NH
Introduction
.PP
The solution to the torque handle equation
.EQ (1)
sum from 0 to inf F ( x sub i ) = G ( x )
.EN
is found with the transformation $ x = rho over
theta $ where $ rho = G prime (x) $ and $theta$
is derived ...
This abstract should be short enough to fit
on a single page cover sheet.
It must attract the reader into sending for the
complete memorandum.
April 1, 1976
L
(1)
is found with the transformation
where
and is derived from well-known principles.
L
.IM
.ND January 24, 1956
.TL
The 1956 Consent Decree
.AU
Able, Baker &
Charley, Attys.
.PP
Plaintiff, United States of America, having filed
its complaint herein on January 14, 1949; the
defendants having appeared and filed their
answer to such complaint denying the
substantive allegations thereof; and the parties,
by their attorneys, ...
\(bs
Bell Laboratories
Subject:
The 1956 Consent Decree
date:
January 24, 1956
from:
Able, Baker &
Charley, Attys.
Plaintiff, United States of America, having filed its complaint
herein on January 14, 1949; the defendants having appeared and
filed their answer to such complaint denying the substantive
allegations thereof; and the parties, by their attorneys, having
severally consented to the entry of this Final Judgment without
trial or adjudication of any issues of fact or law herein and without
this Final Judgment constituting any evidence or admission by any
party in respect of any such issues;
Now, therefore before any testimony has been taken herein, and
without trial or adjudication of any issue of fact or law herein,
and upon the consent of all parties hereto, it is hereby
Ordered, adjudged and decreed as follows:
I.
[Sherman Act]
This Court has jurisdiction of the subject matter herein and of all
the parties hereto.
The complaint states a claim upon which relief may be granted
against each of the defendants under Sections 1, 2 and 3 of the
Act of Congress of July 2, 1890, entitled ``An act to protect
trade and commerce against unlawful restraints and monopolies,''
commonly known as the Sherman Act, as amended.
II.
[Definitions]
For the purposes of this Final Judgment:
(a) ``Western'' shall mean the defendant Western Electric
Company, Incorporated.
L
Other formats possible (specify before .TL) are: .MR (``memo for record''), .MF (``memo for file''), .EG (``engineer's notes'') and .TR (Computing Science Tech. Report).
.NH .SH
Introduction. Appendix I
.PP .PP
text text text text text text
1. Introduction Appendix I
text text text text text text
5
.IP 1.
J. Pencilpusher and X. Hardwired,
.I
A New Kind of Set Screw,
.R
Proc. IEEE
.B 75
(1976), 23-255.
.IP 2.
H. Nails and R. Irons,
.I
Fasteners for Printed Circuit Boards,
.R
Proc. ASME
.B 23
(1974), 23-24.
.LP (terminates list)
1.tJ. Pencilpusher and X. Hardwired,
A New Kind of Set Screw,
Proc. IEEE
(1976), 23-255.
2.tH. Nails and R. Irons,
Fasteners for Printed Circuit Boards,
Proc. ASME
(1974), 23-24.
text text text text text text
.DS
and now
for something
completely different
.DE
text text text text text text
hoboken harrison newark roseville avenue grove street
east orange brick church orange highland avenue
mountain station south orange maplewood millburn short hills
summit new providence
and now
for something
completely different
murray hill berkeley heights
gillette stirling millington lyons basking ridge
bernardsville far hills peapack gladstone
Options: .DS L: left-adjust;
.DS C: line-by-line center; .DS B: make block, then center.
Among the most important occupants
of the workbench are the long-nosed pliers.
Without these basic tools*
.FS
* As first shown by Tiger & Leopard
(1975).
.FE
few assemblies could be completed. They may
lack the popular appeal of the sledgehammer
Among the most important occupants
of the workbench are the long-nosed
pliers.
Without these basic tools*
few assemblies could be completed.
They may lack the
popular appeal of the sledgehammer
__________
* As first shown by Tiger & Leopard (1975).
6
This is ordinary text to point out the margins of the page. .IP 1. First level item .RS .IP a) Second level. .IP b) Continued here with another second level item, but somewhat longer. .RE .IP 2. Return to previous value of the indenting at this point. .IP 3. Another line.
This is ordinary text to point out
the margins of the page.
1.tFirst level item
a)tSecond level.
b)tContinued here with another second level
item, but somewhat longer.
2.tReturn to previous value of the
indenting at this point.
3.tAnother
line.
Lines bracketed by the following commands are kept together, and will appear entirely on one page:
.KS not moved .KF may float .KE through text .KE in text
.TL
The Declaration of Independence
.2C
.PP
When in the course of human events, it becomes
necessary for one people to dissolve the political bonds
which have connected them with another, and to assume
among the powers of the earth the separate and equal station
to which the laws of Nature and of Nature's God entitle them,
a decent respect to the opinions of
A displayed equation is marked
with an equation number at the right margin
by adding an argument to the EQ line:
.EQ (1.3)
x sup 2 over a sup 2 ~=~ sqrt {p z sup 2 +qz+r}
.EN
A displayed equation is marked with an equation number
at the right margin by adding an argument to the EQ line:
x sup 2 over a sup 2
~=~ sqrt { p z sup 2 + q z + r }
.EQ I (2.2a)
bold V bar sub nu~=~left [ pile {a above b above
c } right ] + left [ matrix { col { A(11) above .
above . } col { . above . above .} col {. above .
above A(33) }} right ] cdot left [ pile { alpha
above beta above gamma } right ]
.EN
fat {roman V} bar sub nu~=~left [ pile {a above b above c}
right ] + left [ matrix { col { A(11) above .
above . } col { . above . above .} col {. above .
above A(33) }} right ] cdot left [ pile { alpha
above beta above gamma } right ]
.EQ L
F hat ( chi ) ~ mark = ~ | del V | sup 2
.EN
.EQ L
lineup =~ {left ( {partial V} over {partial x} right ) } sup 2
+ { left ( {partial V} over {partial y} right ) } sup 2
~~~~~~ lambda -> inf
.EN
F hat ( chi ) ~ mark = ~ | del V | sup 2
delim off
lineup =~ {left ( {partial V} over {partial x} right ) } sup 2
+ { left ( {partial V} over {partial y} right ) } sup 2
~~~~~~ lambda -> inf
$ a dot $, $ b dotdot$, $ xi tilde times
y vec$:
delim $$
$ a dot $, $ b dotdot$, $ xi tilde times
y vec$.
delim off
(with delim $$ on, see panel 3).
See also the equations in the second table, panel 8.
Line length
.nr LL 7i
Title length
.nr LT 7i
Point size
.nr PS 9
Vertical spacing
.nr VS 11
Column width
.nr CW 3i
Intercolumn spacing
.nr GW .5i
Margins - head and foot
.nr HM .75i
.nr FM .75i
Paragraph indent
.nr PI 2n
Paragraph spacing
.nr PD 0
Page offset
.nr PO 0.5i
Page heading
.ds CH Appendix
(center)
.ds RH 7-25-76
(right)
.ds LH Private
(left)
Page footer
.ds CF Draft
.ds LF
.ds RF similar
Page numbers
.nr % 3
8
delim off
.TS (TO indicates a tab)
allbox;
c s s
c c c
n n n.
AT&T Common Stock
YearTOPriceTODividend
1971TO41-54TO$2.60
2TO41-54TO2.70
3TO46-55TO2.87
4TO40-53TO3.24
5TO45-52TO3.40
6TO51-59TO.95*
.TE
* (first quarter only)
+--------------------+
| AT&T Common Stock |
+----+-----+---------+
|Year|Price|Dividend |
+----+-----+---------+
|1971|41-54| $2.60 |
+----+-----+---------+
| 2|41-54| 2.70 |
+----+-----+---------+
| 3|46-55| 2.87 |
+----+-----+---------+
| 4|40-53| 3.24 |
+----+-----+---------+
| 5|45-52| 3.40 |
+----+-----+---------+
| 6|51-59| .95* |
+----+-----+---------+
* (first quarter only)
The meanings of the key-letters describing
the alignment of each entry are:
c center n numerical
r right-adjust a subcolumn
l left-adjust s spanned
The global table options are
center, expand, box, doublebox, allbox,
tab (x)
and
linesize (n).
.TS (with delim $$ on, see panel 3)
doublebox, center;
c c
l l.
NameTODefinition
.sp
GammaTO$GAMMA (z) = int sub 0 sup inf \
t sup {z-1} e sup -t dt$
SineTO$sin (x) = 1 over 2i ( e sup ix - e sup -ix )$
ErrorTO$ roman erf (z) = 2 over sqrt pi \
int sub 0 sup z e sup {-t sup 2} dt$
BesselTO$ J sub 0 (z) = 1 over pi \
int sub 0 sup pi cos ( z sin theta ) d theta $
ZetaTO$ zeta (s) = \
sum from k=1 to inf k sup -s ~~( Re~s > 1)$
.TE
delim $$
+----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
| Name Definition |
| |
|Gamma $GAMMA (z) = int sub 0 sup inf t sup {z-1} e sup -t dt$ |
|Sine $sin (x) = 1 over 2i ( e sup ix - e sup -ix )$ |
|Error $ roman erf (z) = 2 over sqrt pi int sub 0 sup z e sup {-t sup 2} dt$ |
|Bessel $ J sub 0 (z) = 1 over pi int sub 0 sup pi cos ( z sin theta ) d theta $ |
|Zeta $ zeta (s) = sum from k=1 to inf k sup -s ~~( Re~s > 1)$ |
+----------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------+
Documents with just text: troff -ms files With equations only: eqn files | troff -ms With tables only: tbl files | troff -ms With both tables and equations: tbl files|eqn|troff -ms ----------------------------------