Using Ms PDF
Using Ms PDF
M. E. Lesk
Bell Laboratories
Murray Hill, New Jersey 07974
ABSTRACT
M
M.. E
E.. L
Leesskk
Bell Laboratories
Murray Hill, New Jersey 07974
Introduction. This memorandum describes a package of commands to produce papers using the
troff and nroff formatting programs on the UNIX system. As with other roff -derived programs, text is
prepared interspersed with formatting commands. However, this package, which itself is written in troff
commands, provides higher-level commands than those provided with the basic troff program. The
commands available in this package are listed in Appendix A.
T
Teexxtt.. Type normally, except that instead of indenting for paragraphs, place a line reading ‘‘.PP’’
before each paragraph. This will produce indenting and extra space.
Alternatively, the command .LP that was used here will produce a left-aligned (block) paragraph. The
paragraph spacing can be changed: see below under ‘‘Registers.’’
B
Beeggiinnnniinngg.. For a document with a paper-type cover sheet, the input should start as follows:
[optional overall format .RP – see below]
.TL
Title of document (one or more lines)
.AU
Author(s) (may also be several lines)
.AI
Author’s institution(s)
.AB
Abstract; to be placed on the cover sheet of a paper.
Line length is 5/6 of normal; use .ll here to change.
.AE (abstract end)
text ... (begins with .PP, which see)
To omit some of the standard headings (e.g. no abstract, or no author’s institution) just omit the
corresponding fields and command lines. The word ABSTRACT can be suppressed by writing ‘‘.AB no’’
for ‘‘.AB’’. Several interspersed .AU and .AI lines can be used for multiple authors. The headings are
not compulsory: beginning with a .PP command is perfectly OK and will just start printing an ordinary
paragraph. W Waarrnniinngg:: You can’t just begin a document with a line of text. Some – ms command must
precede any text input. When in doubt, use .LP to get proper initialization, although any of the com-
mands .PP, .LP, .TL, .SH, .NH is good enough. Figure 1 shows the legal arrangement of commands at
the start of a document.
C
Coovveerr SShheeeettss aanndd F
Fiirrsstt P
Paaggeess.. The first line of a document signals the general format of the first
page. In particular, if it is ".RP" a cover sheet with title and abstract is prepared. The default format is
useful for scanning drafts.
In general – ms is arranged so that only one form of a document need be stored, containing all
information; the first command gives the format, and unnecessary items for that format are ignored.
Warning: don’t put extraneous material between the .TL and .AE commands. Processing of the
titling items is special, and other data placed in them may not behave as you expect. Don’t forget that
some – ms command must precede any input text.
P
Paaggee hheeaaddiinnggss.. The – ms macros, by default, will print a page heading containing a page number
(if greater than 1). A default page footer is provided only in nnrrooffff , where the date is used. The user
-2-
can make minor adjustments to the page headings/footings by redefining the strings LH, CH, and RH
which are the left, center and right portions of the page headings, respectively; and the strings LF, CF,
and RF, which are the left, center and right portions of the page footer. For more complex formats, the
user can redefine the macros PT and BT, which are invoked respectively at the top and bottom of each
page. The margins (taken from registers HM and FM for the top and bottom margin respectively) are
normally 1 inch; the page header/footer are in the middle of that space. The user who redefines these
macros should be careful not to change parameters such as point size or font without resetting them to
default values.
M
Muullttii--ccoolluum
mnn ffoorrm
maattss.. If you place the The .NH command also supports more
command ‘‘.2C’’ in your document, the docu- complex numbering schemes. If a numerical
ment will be printed in double column format argument is given, it is taken to be a ‘‘level’’
beginning at that point. This feature is not too number and an appropriate sub-section number
useful in computer terminal output, but is often is generated. Larger level numbers indicate
desirable on the typesetter. The command deeper sub-sections, as in this example:
‘‘.1C’’ will go back to one-column format and
.NH
also skip to a new page. The ‘‘.2C’’ command
Erie-Lackawanna
is actually a special case of the command
.NH 2
.MC [column width [gutter width]] Morris and Essex Division
.NH 3
which makes multiple columns with the
Gladstone Branch
specified column and gutter width; as many
.NH 3
columns as will fit across the page are used.
Montclair Branch
Thus triple, quadruple, ... column pages can be
.NH 2
printed. Whenever the number of columns is
Boonton Line
changed (except going from full width to some
larger number of columns) a new page is started. generates:
H
Heeaaddiinnggss.. To produce a special heading,
there are two commands. If you type 2. Erie-Lackawanna
References
[1] B. W. Kernighan and L. L. Cherry,
Typesetting Mathematics — Users Guide
(2nd edition), Bell Laboratories Comput-
ing Science Report no. 17.
[2] M. E. Lesk, Tbl — A Program to Format
Tables, Bell Laboratories Computing Sci-
ence Report no. 45.
[3] B. W. Kernighan, A Troff Tutorial, Bell
Laboratories, 1976.
[4] J. F. Ossanna, Nroff /Troff Reference
Manual, Bell Laboratories Computing Sci-
ence Report no. 51.
[5] K. Thompson and D. M. Ritchie, UNIX
Programmer’s Manual, Bell Laboratories,
1978.
-7-
Appendix A
List of Commands
1C Return to single column format. LG Increase type size.
2C Start double column format. LP Left aligned block paragraph.
AB Begin abstract.
AE End abstract.
AI Specify author’s institution.
AU Specify author. ND Change or cancel date.
B Begin boldface. NH Specify numbered heading.
DA Provide the date on each page. NL Return to normal type size.
DE End display. PP Begin paragraph.
DS Start display (also CD, LD, ID).
EN End equation. R Return to regular font (usually Roman).
EQ Begin equation. RE End one level of relative indenting.
FE End footnote. RP Use released paper format.
FS Begin footnote. RS Relative indent increased one level.
SG Insert signature line.
I Begin italics. SH Specify section heading.
SM Change to smaller type size.
IP Begin indented paragraph. TL Specify title.
KE Release keep.
KF Begin floating keep. UL Underline one word.
KS Start keep.
Register Names
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
RP
TL
AU
AI
AB
AE
NH, SH
PP, LP
text ...
Figure 1