image

Comparing mm and ms

If you have both ms and mm on your system, you may be interested in looking at both packages, perhaps evaluating features. In general, ms has many of the same capabilities as mm. However, it lacks some essential features, such as automatically numbered lists and table of contents generation. On the other hand, it is much easier to learn the internals of ms, and therefore easier to extend it with your own macros.

▪   Paragraphs   ▪

The basic paragraph types are block and indented.

ms mm Description
.P .LP Begin a block paragraph.
.P 1 .PP Begin a paragraph with indented first line.

In mm, the default paragraph type can be changed from block to indented by setting the number register Pt to 1 or 2. The ms macros lack this generalizing mechanism.

▪   Justification   ▪

When using the nroff formatter, mm does not justify the right margin. .SA 1 turns on justification for both formatters. .SA 0 turns it off.

The ms macros do not provide a macro for inhibiting the normal justification of paragraphs. However, the .na request can be used to do this.

▪   Displays   ▪

Displays are produced in a very similar way in both macro packages, using the DS/DE pair of macros. In mm, display are left justified; in ms, displays are indented. The options that allow you to change the placement of the display are basically the same.

The mm macros provide for static and floating displays (.DF). In ms, this is done with a separate pair of keep macros (KS/KF and KE).

In mm, you can turn on fill mode within the display and specify an indent from the right margin. This is used for quoted material and has its equivalent in ms with the QP or the QS/QE pair.

In addition, the same set of delimiter pairs for tbl, eqn, and pic are available in both packages.

▪   Formatting Lists   ▪

The mm macros have sophisticated list formatting macros that are lacking in ms. The .IP macro in ms produces the equivalent of a variable-item list in mm. In other words, you can get a numbered list by specifying the number as a label to an indented paragraph, but you cannot get an automatically numbered list.

▪   Change Font   ▪

The .B (change to bold), .I (change to italic), and .R (change to roman) macros used for changing fonts are the same. The mm macros allow up to seven arguments for alternating with the previous font, but ms is limited to two.

▪   Change Point Size   ▪

Both packages allow you to change point size. In mm, .S specifies a new point size and .SM reduces point size relative to the current size.

When you change the point size using ms macros, it is always done relative to the current point size. The .LG and .SM macros increase and decrease the current point size by 2 points. The .NL macro restores the default point size.

▪   Headers and Footers   ▪

The mm macros provide macros for specifying a delimited string that will appear left justified, centered, and right justified in a page header or footer. The .PH macro defines a page header and .PF defines a page footer. In addition, mm provides variations of these macros for specifying headers and footers for odd and even pages.

The ms macros handle this through setting individual strings. To define a string that appears left justified in a header, use:

.ds  LH   string

The other strings for the header are CH and RH; other strings for the footer are LF, CF, and RF.

▪   Section Headings   ▪

Numbered and unnumbered section headings are available in both packages. The .SH and .NH macros are used in ms. The .H and .HU macros are used in mm. The main difference is where you specify the heading string. In mm, it is the first argument on the line with the macro. In ms, it follows on the line after the macro and continues up to the first paragraph macro.

▪   Footnotes   ▪

The pair of macros used for footnotes is the same (.FS and .FE), although automatic numbering of footnotes is provided in mm. One difference is that in mm the footnote at the bottom of the page is printed in 8 points. The mm macros also provide a pair of macros (.RF and .RE) for collecting a page of references.

Get UNIX° TEXT PROCESSING now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.