groff_ms - GNU roff manuscript macro package for formatting documents
groff -ms |
[option ...] [input-file ...] ms [option ...] [input-file ...] DESCRIPTIONThis manual page describes the GNU version of the ms macros, part of the groff typesetting system. The ms macros are mostly compatible with the documented behavior of the 4.3 BSD Unix ms macros (see Differences from troff ms below for details). The ms macros are suitable for reports, letters, books, and technical documentation. USAGEThe ms
macro package expects files to have a certain amount of
structure. The simplest documents can begin with a paragraph
macro and consist of text separated by paragraph macros or
even blank lines. Longer documents have a structure as
follows: If you use the RP (report) macro at the beginning of the document, groff prints the cover page information on its own page; otherwise it prints the information on the first page with your document text immediately following. Other document formats found in AT&T troff are specific to AT&T or Berkeley, and are not supported in groff ms. Format and layout By setting number registers, you can change your document’s margins, spacing, headers and footers, footnotes, and the base point size for the text. See Document control registers below for more details. Cover page A cover page consists of a title, and optionally the author’s name and institution, an abstract, and the date. See Cover page macros below for more details.
Table of contents Longer documents usually include a table of contents, which you can add by placing the TC macro at the end of your document. Document
control registers Margin settings Text settings Paragraph settings Footnote settings Other settings Cover page
macros Specifies the report format for your document. The report format creates a separate cover page. With no RP macro, groff prints a subset of the cover page on page 1 of your document. If you use the optional no argument, groff prints a title page but does not repeat any of the title page information (title, author, abstract, etc.) on page 1 of the document.
.DA [xxx] (optional) Print the current date, or the arguments to the macro if any, on the title page (if specified) and in the footers. This is the default for nroff. .ND [xxx] (optional) Print the current date, or the arguments to the macro if any, on the title page (if specified) but not in the footers. This is the default for troff.
.AB [no] Begins the abstract. The default is to print the word ABSTRACT, centered and in italics, above the text of the abstract. The option no suppresses this heading.
Paragraphs
The QP macro indents all text at both left and right margins by the amount of the register QI. The effect is reminiscent of the HTML <BLOCKQUOTE> tag. The next paragraph or heading returns the margins to normal. QP inserts the vertical space specified in register PD as inter-paragraph spacing. A paragraph bracketed between the macros QS and QE has the same appearance as a paragraph started with QP and a following paragraph started with LP. Both QS and QE insert the inter-paragraph spacing specified in PD and the text is indented on both sides by the amount of register QI. The text between QS and QE can be split into further paragraphs by using .LP or .PP. The XP macro produces an “exdented” paragraph; that is, one with a hanging indent. The first line of the paragraph begins at the left margin, and subsequent lines are indented (the opposite of PP). For each of the above paragraph types, and also for any list entry introduced by the IP macro (described later), the document control register PORPHANS, sets the minimum number of lines which must be printed, after the start of the paragraph, and before any page break occurs. If there is insufficient space remaining on the current page to accommodate this number of lines, then a page break is forced before the first line of the paragraph is printed. Similarly, when a section heading (see subsection “Headings” below) precedes any of these paragraph types, the HORPHANS document control register specifies the minimum number of lines of the paragraph which must be kept on the same page as the heading. If insufficient space remains on the current page to accommodate the heading and this number of lines of paragraph text, then a page break is forced before the heading is printed. Headings
The following heading macros are available:
If the GROWPS register is set to a value greater than the level of the heading, then the point size of the heading will be increased by PSINCR units over the text size specified by the PS register, for each level by which the heading level is less than the value of GROWPS. For example, the sequence: .nr PS 10 will cause “1. Top Level Heading” to be printed in 13pt bold text, followed by “1.1. Second Level Heading” in 11.5pt bold text, while “1.1.1. Third Level Heading”, and all more deeply nested heading levels, will remain in the 10pt bold text which is specified by the PS register. Note that the value stored in PSINCR is interpreted in groff basic units; the p scaling factor should be employed when assigning a value specified in points. The style used to represent the section number, within a numbered heading, is controlled by the SN-STYLE string; this may be set to either the SN-DOT or the SN-NO-DOT style, (described below), by aliasing SN-STYLE accordingly. By default, SN-STYLE is initialised by defining the alias .als SN-STYLE SN-DOT it may be changed to the SN-NO-DOT style, if preferred, by defining the alternative alias .als SN-STYLE SN-NO-DOT Any such change becomes effective with the first use of .NH, after the new alias is defined. After invoking .NH, the assigned heading number is available in the strings SN-DOT (as it appears in the default formatting style for numbered headings, with a terminating period following the number), and SN-NO-DOT (with this terminating period omitted). The string SN is also defined, as an alias for SN-DOT; if preferred, the user may redefine it as an alias for SN-NO-DOT, by including the initialisation: .als SN SN-NO-DOT at any time; the change becomes effective with the next use of .NH, after the new alias is defined. .SH [xx] Unnumbered subheading. The use of the optional xx argument is a GNU extension, which adjusts the point size of the unnumbered subheading to match that of a numbered heading, introduced using .NH xx with the same value of xx. For example, given the same settings for PS, GROWPS and PSINCR, as used in the preceding .NH example, the sequence: .SH 2 will print “An Unnumbered Subheading” in 11.5pt bold text. Highlighting
Sets its first argument in bold type. If you specify a second argument, groff prints it in the previous font after the bold text, with no intervening space (this allows you to set punctuation after the highlighted text without highlighting the punctuation). Similarly, it prints the third argument (if any) in the previous font before the first argument. For example, .B foo ) ( prints “(foo)”. If you give this macro no arguments, groff prints all text following in bold until the next highlighting, paragraph, or heading macro. .R [txt [post [pre]]] Sets its first argument in roman (or regular) type. It operates similarly to the B macro otherwise. .I [txt [post [pre]]] Sets its first argument in italic type. It operates similarly to the B macro otherwise. .CW [txt [post [pre]]] Sets its first argument in a constant-width face. It operates similarly to the B macro otherwise. .BI [txt [post [pre]]] Sets its first argument in bold italic type. It operates similarly to the B macro otherwise. .BX [txt] Prints its argument and draws a box around it. If you want to box a string that contains spaces, use a digit-width space (\0). .UL [txt [post]] Prints its first argument with an underline. If you specify a second argument, groff prints it in the previous font after the underlined text, with no intervening space.
\*{text\*} Print the enclosed text as a superscript. Indents
Use the RS and RE macros to start and end a section of indented text, respectively. The PI register controls the amount of indent. You can nest indented sections as deeply as needed by using multiple, nested pairs of RS and RE. Lists
The marker is usually a bullet character \(bu for unordered lists, a number (or auto-incrementing number register) for numbered lists, or a word or phrase for indented (glossary-style) lists. The width specifies the indent for the body of each list item. Once specified, the indent remains the same for all list items in the document until specified again. Tab
stops Displays and
keeps Use the DE macro to end any display type. The macros Ds and De were formerly provided as aliases for DS and DE, respectively, but they have been removed, and should no longer be used. X11 documents which actually use Ds and De always load a specific macro file from the X11 distribution (macros.t) which provides proper definitions for the two macros. To keep text together on a page, such as a paragraph that refers to a table (or list, or other item) immediately following, use the KS and KE macros. The KS macro begins a block of text to be kept on a single page, and the KE macro ends the block. You can specify a floating keep using the KF and KE macros. If the keep cannot fit on the current page, groff holds the contents of the keep and allows text following the keep (in the source file) to fill in the remainder of the current page. When the page breaks, whether by an explicit bp request or by reaching the end of the page, groff prints the floating keep at the top of the new page. This is useful for printing large graphics or tables that do not need to appear exactly where specified. The macros B1 and B2 can be used to enclose a text within a box; .B1 begins the box, and .B2 ends it. Text in the box is automatically placed in a diversion (keep). Tables,
figures, equations, and references Denote a table to be processed by the tbl preprocessor. The optional H argument instructs groff to create a running header with the information up to the TH macro. Groff prints the header at the beginning of the table; if the table runs onto another page, groff prints the header on the next page as well. .PS and .PE Denote a graphic to be processed by the pic preprocessor. You can create a pic file by hand, using the AT&T pic manual available on the Web as a reference, or by using a graphics program such as xfig. .EQ [align] and .EN Denote an equation to be processed by the eqn preprocessor. The optional align argument can be C, L, or I to center (the default), left-justify, or indent the equation, respectively. .[ and .] Denote a reference to be processed by the refer preprocessor. The GNU refer(1) manual page provides a comprehensive reference to the preprocessor and the format of the bibliographic database. Footnotes
You can specify symbolic footnotes by placing the mark character (such as \(dg for the dagger character) in the body text, followed by the text of the footnote enclosed by FS \(dg and FE macros. You can control how groff prints footnote numbers by changing the value of the FF register as follows:
You can use footnotes safely within keeps and displays, but avoid using numbered footnotes within floating keeps. You can set a second \** between a \** and its corresponding .FS; as long as each .FS occurs after the corresponding \** and the occurrences of .FS are in the same order as the corresponding occurrences of \**. Headers and
footers
.XX 'left'center'right' where XX is one of the foregoing four macros and each of left, center, and right is text of your choice. You can replace the quote (') marks with any character not appearing in the header or footer text.
Margins
Note that there is no right margin setting. The combination of page offset and line length provide the information necessary to derive the right margin. Multiple
columns
.MC [column-width [gutter-width]] Multi-column mode. If you specify no arguments, it is equivalent to the 2C macro. Otherwise, column-width is the width of each column and gutter-width is the space between columns. The MINGW number register is the default gutter width. Creating a
table of contents You can manually create a table of contents by specifying a page number as the first argument to XS. Add subsequent entries using the XA macro. For example: .XS 1 Use the PX macro to print a manually-generated table of contents without resetting the page number. If you give the argument no to either PX or TC, groff suppresses printing the title specified by the \*[TOC] string. Fractional
point sizes The following four registers accept fractional point sizes: PS, VS, FPS, and FVS. Due to backwards compatibility, the value of VS must be smaller than 40000 (this is 40.0 points). DIFFERENCES FROM troff msThe groff ms macros are a complete re-implementation, using no original AT&T code. Since they take advantage of the extended features in groff, they cannot be used with AT&T troff. Other differences include:
These emulations are sufficient to give back the 1976 Kernighan & Cherry paper Typesetting Mathematics – User’s Guide its section headings, and restore some text that had gone missing as arguments of undefined macros. No warranty express or implied is given as to how well the typographic details these produce match the original Bell Labs macros.
Strings
The \*- string produces an em dash—like this. Use \*Q and \*U to get a left and right typographer’s quote, respectively, in troff (and plain quotes in nroff). Text
Settings The point size, vertical spacing, and inter-paragraph spacing for footnotes are controlled by the number registers FPS, FVS, and FPD; at initialization these are set to \n(PS-2, \n[FPS]+2, and \n(PD/2, respectively. If any of these registers are defined before initialization, the initialization macro does not change them. The hyphenation flags (as set by the hy request) are set from the HY register; the default is 6. Improved accent marks (as originally defined in Berkeley’s ms version) are available by specifying the AM macro at the beginning of your document. You can place an accent over most characters by specifying the string defining the accent directly after the character. For example, n\*~ produces an n with a tilde over it. NAMING CONVENTIONSThe following conventions are used for names of macros, strings, and number registers. External names available to documents that use the groff ms macros contain only uppercase letters and digits. Internally the macros are divided into modules; naming conventions are as follows:
Thus the groff ms macros reserve the following names:
FILES/usr/share/groff/1.22.4/tmac/ms.tmac
(a wrapper file for s.tmac) AUTHORSThe GNU version of the ms macro package was written by James Clark and contributors. This document was (re-)written by Larry Kollar. SEE ALSOgroff(1), troff(1), tbl(1), pic(1), eqn(1), refer(1) Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner Lemberg |