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 documents type (font and size), margins, spacing, headers and footers, and footnotes. See "Document control registers" below for more details.
A cover page consists of a title, and optionally the authors name and institution, an abstract, and the date. See "Cover page macros" below for more details.
Following the cover page is your document. It consists of paragraphs, headings, and lists.
"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.
Numbered heading. The argument xx is either a numeric argument to indicate the level of the heading, or S xx xx "..." to set the section number explicitly. If you specify heading levels out of sequence, such as invoking ".NH 3" after ".NH 1", groff prints a warning on standard error.
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 ) (
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.
Prints its argument and draws a box around it. If you want to box a string that contains spaces, use a digit-width space ([rs]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.
Prints all text following in larger type (2~points larger than the current point size) until the next font size, highlighting, paragraph, or heading macro. You can specify this macro multiple times to enlarge the point size as needed.
Prints all text following in smaller type (2~points smaller than the current point size) until the next type size, highlighting, paragraph, or heading macro. You can specify this macro multiple times to reduce the point size as needed.
Prints all text following in the normal point size (that is, the value of the PS register).
Block-centered (left-justified, longest line centered).
Use the DE macro to end any display type.
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.
Denotes 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
Denotes 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
Denotes 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.
.[" and ".]
Denotes 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.
Prints the footnote number as a superscript; indents the footnote (default).
Prints the number followed by a period (like~1.) and indents the footnote.
Like~1, without an indent.
Like~1, but prints the footnote number as a hanging paragraph.
You can use footnotes safely within keeps and displays, but avoid using numbered footnotes within floating keeps. You can set a second [rs]** between a [rs]** and its corresponding .FS; as long as each .FS occurs after the corresponding [rs]** and the occurrences of .FS are in the same order as the corresponding occurrences of [rs]**.
Use the strings LH, CH, and RH to set the left, center, and right headers; use LF, CF, and RF to set the left, center, and right footers. This works best for documents that do not distinguish between odd and even pages.
Use the OH and EH macros to define headers for the odd and even pages; and OF and EF macros to define footers for the odd and even pages. This is more flexible than defining the individual strings. The syntax for these macros is as follows:
You can replace the quote () marks with any character not appearing in the header or footer text.
Multi-column mode. If you specify no arguments, it is equivalent to the 2C macro. Otherwise, width is the width of each column and gutter is the space between columns. The MINGW number register is the default gutter width.
The internals of "groff ms" differ from the internals of Unix ms. Documents that depend upon implementation details of Unix ms may not format properly with "groff ms".
The error-handling policy of "groff ms" is to detect and report errors, rather than silently to ignore them.
Bell Labs localisms are not implemented.
Berkeley localisms, in particular the TM and CT macros, are not implemented.
"Groff ms" does not work in compatibility mode (e.g. with the -C option).
There is no support for typewriter-like devices.
"Groff ms" does not provide cut marks.
Multiple line spacing is not supported (use a larger vertical spacing instead).
Some Unix ms documentation says that the CW and GW number registers can be used to control the column width and gutter width respectively. These number registers are not used in groff ms.
Macros that cause a reset (paragraphs, headings, etc.) may change the indent. Macros that change the indent do not increment or decrement the indent, but rather set it absolutely. This can cause problems for documents that define additional macros of their own. The solution is to use not the in request but instead the RS and RE macros.
The number register GS is set to~1 by the "groff ms" macros, but is not used by the Unix ms macros. Documents that need to determine whether they are being formatted with Unix ms or "groff ms" should use this number register.