A Revised Version of _ms

Bill Tuthill

Computing Services
University of California
Berkeley, CA 94720

      The _ms macros have been slightly revised and rearranged for the Berkeley Unix distribution. Because of the rearrangement, the new macros can be read by the computer in about half the time required by the previous version of _ms. This means that output will begin to appear between ten seconds and several minutes more quickly, depending on the system load. On long files, however, the savings in total time are not substantial. The old version of _ms is still available as _mos.

      Several bugs in _ms have been fixed, including a bad problem with the .1C macro, minor difficulties with boxed text, a break induced by .EQ before initialization, the failure to set tab stops in displays, and several bothersome errors in the refer macros. Macros used only at Bell Laboratories have been removed. There are a few extensions to previous _ms macros, and a number of new macros, but all the documented _ms macros still work exactly as they did before, and have the same names as before. Output produced with _ms should look like output produced with _mos.

      One important new feature is automatically numbered footnotes. Footnote numbers are printed by means of a pre-defined string (\**), which you invoke separately from .FS and .FE. Each time it is used, this string increases the footnote number by one, whether or not you use .FS and .FE in your text. Footnote numbers will be superscripted on the phototypesetter and on daisy-wheel terminals, but on low-resolution devices (such as the lpr and a crt), they will be bracketed. If you use \** to indicate numbered footnotes, then the .FS macro will automatically include the footnote number at the bottom of the page. This footnote, for example, was produced as follows:[note 1]

This footnote, for example, was produced as follows:\**
If you are using \** to number footnotes, but want a particular footnote to be marked with an asterisk or a dagger, then give that mark as the first argument to .FS: **
then give that mark as the first argument to .FS: \(dg
.FS   \(dg
Footnote numbering will be temporarily suspended, because the \** string is not used. Instead of a dagger, you could use an asterisk * or double dagger ***, represented as \(dd.

      Another new feature is a macro for printing theses according to Berkeley standards. This macro is called .TM, which stands for thesis mode. (It is much like the .th macro in _me.) It will put page numbers in the upper right-hand corner; number the first page; suppress the date; and doublespace everything except quotes, displays, and keeps. Use it at the top of each file making up your thesis. Calling .TM defines the .CT macro for chapter titles, which skips to a new page and moves the pagenumber to the center footer. The .P1 (P one) macro can be used even without thesis mode to print the header on page 1, which is suppressed except in thesis mode. If you want roman numeral page numbering, use an ``.af PN i'' request.

      There is a new macro especially for bibliography entries, called .XP, which stands for exdented paragraph. It will exdent the first line of the paragraph by \n(PI units, usually 5n (the same as the indent for the first line of a .PP). Most bibliographies are printed this way. Here are some examples of exdented paragraphs: Lumley, Lyle S., Sex in Crustaceans: Shell Fish Habits, Harbinger Press, Tampa Bay and San Diego, October 1979. 243 pages. The pioneering work in this field. Leffadinger, Harry A., ``Mollusk Mating Season: 52 Weeks, or All Year?'' in Acta Biologica, vol. 42, no. 11, November 1980. A provocative thesis, but the conclusions are wrong.

Of course, you will have to take care of italicizing the book title and journal, and quoting the title of the journal article. Indentation or exdentation can be changed by setting the value of number register PI.

      If you need to produce endnotes rather than footnotes, put the references in a file of their own. This is similar to what you would do if you were typing the paper on a conventional typewriter. Note that you can use automatic footnote numbering without actually having .FS and .FE pairs in your text. If you place footnotes in a separate file, you can use .IP macros with \** as a hanging tag; this will give you numbers at the left-hand margin. With some styles of endnotes, you would want to use .PP rather then .IP macros, and specify \** before the reference begins.

      There are four new macros to help produce a table of contents. Table of contents entries must be enclosed in .XS and .XE pairs, with optional .XA macros for additional entries; arguments to .XS and .XA specify the page number, to be printed at the right. A final .PX macro prints out the table of contents. Here is a sample of typical input and output text:

.XS  ii
.XA  1
Chapter 1: Review of the Literature
.XA  23
Chapter 2: Experimental Evidence
 Table of Contents  

Introduction  	ii
Chapter 1: Review of the Literature 	1
Chapter 2: Experimental Evidence 	23
The .XS and .XE pairs may also be used in the text, after a section header for instance, in which case page numbers are supplied automatically. However, most documents that require a table of contents are too long to produce in one run, which is necessary if this method is to work. It is recommended that you do a table of contents after finishing your document. To print out the table of contents, use the .PX macro; if you forget it, nothing will happen.

      As an aid in producing text that will format correctly with both nroff and troff, there are some new string definitions that define quotation marks and dashes for each of these two formatting programs. The \*_ string will yield two hyphens in nroff, but in troff it will produce an em dash-- like this one. The \*Q and \*U strings will produce `` and '' in troff, but " in nroff. (In typesetting, the double quote is traditionally considered bad form.)

      There are now a large number of optional foreign accent marks defined by the _ms macros. All the accent marks available in _mos are present, and they all work just as they always did. However, there are better definitions available by placing .AM at the beginning of your document. Unlike the _mos accent marks, the accent strings should come after the letter being accented. Here is a list of the diacritical marks, with examples of what they look like.

name of accent	input   	output
acute accent	e\*'	e
grave accent	e\*`	e
circumflex	o\*^	o
cedilla 	c\*,	c
tilde   	n\*~	n
question	\*? 	
exclamation	\*! 	
umlaut  	u\*:	u
digraph s	\*8 	
hacek	c\*v	c
macron  	a\*_	a
underdot	s\*.	s
o-slash 	o\*/	o
angstrom	a\*o	a
yogh     	kni\*3t 	knit
Thorn   	\*(Th	
thorn   	\*(th	
Eth     	\*(D-	
eth     	\*(d-	
hooked o	\*q 	
ae ligature	\*(ae	
AE ligature	\*(Ae	
oe ligature	\*(oe	
OE ligature	\*(Oe	
If you want to use these new diacritical marks, don't forget the .AM at the top of your file. Without it, some will not print at all, and others will be placed on the wrong letter.

      It is also possible to produce custom headers and footers that are different on even and odd pages. The .OH and .EH macros define odd and even headers, while .OF and .EF define odd and even footers. Arguments to these four macros are specified as with .tl. This document was produced with:

.OH  '\fIThe  -mx  Macros''Page  %\fP'
.EH  '\fIPage  %''The  -mx  Macros\fP'
Note that it would be a error to have an apostrophe in the header text; if you need one, you will have to use a different delimiter around the left, center, and right portions of the title. You can use any character as a delimiter, provided it doesn't appear elsewhere in the argument to .OH, .EH, .OF, or EF.

      The _ms macros work in conjunction with the tbl, eqn, and refer preprocessors. Macros to deal with these items are read in only as needed, as are the thesis macros (.TM), the special accent mark definitions (.AM), table of contents macros (.XS and .XE), and macros to format the optional cover page. The code for the _ms package lives in /usr/lib/tmac/tmac.s, and sourced files reside in the directory /usr/ucb/lib/ms.

March 14, 1997

Table of Contents