groff_man_style(7)

๐ŸŒธ groff_man_style(7) โ€” GNU roff man page tutorial & style guide ๐ŸŒธ

okay bestie, welcome to the Miscellaneous Information Manual entry for groff_man_style(7). this is the whole vibe guide for writing man pages with GNU man macros, and we're gonna go through it together. slay ๐Ÿ’–

๐ŸŽ€ Name ๐ŸŽ€

groff_man_style - GNU roff man page tutorial and style guide

โœจ Synopsis โœจ

no cap, it's just this:

groff -man [option ...] [file ...]
groff -m man [option ...] [file ...]

๐Ÿ’… Description ๐Ÿ’…

The GNU implementation of the man macro package is part of the groff document formatting system. It is used to compose manual pages (โ€œman pagesโ€) like the one you are reading. This document presents the macros thematically; for those needing only a quick reference, the following alphabetical quick-reference list gives each macro with references to appropriate subsections below. Experienced man authors may prefer groff_man(7). ๐Ÿ’–

hereโ€™s the macro tea, alphabetically:

  • .B โ€” Bold โ€” Font style macros
  • .BI โ€” Bold, italic alternating โ€” Font style macros
  • .BR โ€” Bold, roman alternating โ€” Font style macros
  • .EE โ€” Example end โ€” Document structure macros
  • .EX โ€” Example begin โ€” Document structure macros
  • .HP โ€” Begin hanging paragraph โ€” Paragraphing macros
  • .I โ€” Italic โ€” Font style macros
  • .IB โ€” Italic, bold alternating โ€” Font style macros
  • .IP โ€” Indented paragraph โ€” Paragraphing macros
  • .IR โ€” Italic, roman alternating โ€” Font style macros
  • .LP โ€” Begin paragraph โ€” Paragraphing macros
  • .ME โ€” Mail-to end โ€” Hyperlink macros
  • .MR โ€” Man page cross reference โ€” Hyperlink macros
  • .MT โ€” Mail-to start โ€” Hyperlink macros
  • .P โ€” Begin paragraph โ€” Paragraphing macros
  • .PP โ€” Begin paragraph โ€” Paragraphing macros
  • .RB โ€” Roman, bold alternating โ€” Font style macros
  • .RE โ€” Relative inset end โ€” Document structure macros
  • .RI โ€” Roman, italic alternating โ€” Font style macros
  • .RS โ€” Relative inset start โ€” Document structure macros
  • .SH โ€” Section heading โ€” Document structure macros
  • .SM โ€” Small โ€” Font style macros
  • .SS โ€” Subsection heading โ€” Document structure macros
  • .SY โ€” Synopsis start โ€” Synopsis macros
  • .TH โ€” Title heading โ€” Document structure macros
  • .TP โ€” Tagged paragraph โ€” Paragraphing macros
  • .TQ โ€” Supplemental paragraph tag โ€” Paragraphing macros
  • .UE โ€” URI end โ€” Hyperlink macros
  • .UR โ€” URI start โ€” Hyperlink macros
  • .YS โ€” Synopsis end โ€” Synopsis macros

We discuss other macros (AT, DT, OP, PD, SB, and UC) in subsection โ€œDeprecated featuresโ€ below. iykyk ๐Ÿ‘‘

Throughout Unix documentation, a manual entry is referred to simply as a โ€œman pageโ€, regardless of its length, without gendered implication, and irrespective of the macro package selected for its composition. periodt. ๐Ÿ’…

A man page employs the Unix line-ending convention (U+000A only). Some basic Latin characters have special meaning to roff; see subsection โ€œPortabilityโ€ below. ๐Ÿฆ‹

๐Ÿง  Fundamental concepts ๐Ÿง 

groff is a programming system for typesetting, which is why you'll see the verb โ€œto setโ€ used in the sense โ€œto typesetโ€. The formatter troff(1) collects words from the input and fills output lines with as many as can fit. Words are separated by spaces and newlines. A transition to a new output line is called a break. Breaks can occur at explicit hyphens, at the escape sequences \% or \: (see subsection โ€œPortabilityโ€ below), or at predetermined locations in a word if automatic hyphenation is enabled (see the -rHY option in section โ€œOptionsโ€ below). An output line may be supplemented with inter-sentence space, then potentially adjusted with more space to a consistent length (see the -dAD option). roff(7) details these processes. The formatter prepares output for terminals or for more capable typesetters that can change the type size and font family. โœจ

A roff document can contain control lines, which start with a dot (.) or neutral apostrophe ('). All other input lines are text lines to be formatted. A macro collects control and/or text lines to ease document composition. man is a macro package. To call a macro, put its name after a dot on a control line. Some macros interpret arguments, words that follow its name. A newline, unless escaped (see subsection โ€œPortabilityโ€ below), marks the end of the macro call. A control line with no macro name on it is called an empty request; it does nothing.

We describe below several man macros that plant one-line input traps: the next input line that directly produces formatted output is treated specially. For man documents that follow the advice in section โ€œPortabilityโ€ below, this means that control lines using the empty request and uncommented input lines ending with an escaped newline do not spring the trap; anything else does (but see the TP macro description). ๐Ÿ˜ญ

๐Ÿงš Macro reference preliminaries ๐Ÿงš

A tagged paragraph describes each macro. We present coupled pairs together, as with EX and EE. Square brackets surround optional macro arguments. If a macro accepts multiple arguments, those containing space characters must be double-quoted to be interpreted correctly. If you require an empty macro argument, specify it as a pair of neutral double quotes (""). See section โ€œNotesโ€ below for examples of cases where better alternatives to empty arguments in macro calls are available. Most macro arguments are formatted as text in the output; exceptions are noted. We identify some macros as extensions to the set originally implemented. They are not supported everywhere; see subsection โ€œUse of extensionsโ€ below. ๐Ÿซถ

๐ŸŒˆ Document structure macros ๐ŸŒˆ

Document structure macros organize a man page's content. All of them break the output line. TH (title heading) identifies the document as a man page and configures the page headers and footers. Section headings (SH), one of which is mandatory and many of which are conventionally expected, facilitate location of material by the reader and aid the man page writer to discuss all essential aspects of the topics presented. Subsection headings (SS) are optional and permit sections that grow long to develop in a controlled way. Many technical discussions benefit from examples; lengthy ones, especially those reflecting multiple lines of input to or output from the system, are usefully bracketed by EX and EE. When none of the foregoing meets a structural demand, use RS/RE to inset a region within a (sub)section. ๐Ÿฆ‹

Break the page, reset the page number to 1 (unless the -rC1 option is given), and use the arguments to populate the page header and footer. roff systems refer to these collectively as โ€œtitlesโ€. Together, identifier and the section of the manual to which it belongs can uniquely identify a man document on the system. This use of โ€œsectionโ€ has nothing to do with the section headings otherwise discussed on this page; it arises from the organizational scheme of printed and bound Unix manuals. See man(1) or intro(1) for the manual sectioning applicable to your system. identifier and section are positioned at the left and right in the header; the latter is set after the former, in parentheses and without space. footer-middle is centered in the footer. By default, footer-inside is positioned at the bottom left. Use of the double-sided layout option -rD1 places footer-inside at the bottom left on recto (odd-numbered) pages, and the bottom right on verso (even-numbered) pages. By default, the outside footer is the page number. Use of the continuous-rendering option -rcR=1 replaces it with identifier and section, as in the header. header-middle is centered in the header. If section is an integer between 1 and 9 (inclusive), there is no need to specify header-middle; an.tmac supplies text for it. If identifier or footer-inside would overrun the space available in the header and/or footer, this package may abbreviate them with ellipses (...). groff man suppresses headers and footers in HTML output.

A valid man document calls TH only once, early in the file, prior to any other macro calls. By convention, footer-middle is the date of the most recent modification to the source document, in ISO 8601 format (YYYY-MM-DD), and footer-inside is the name and version or release of the project providing it.

.SH [heading-text]

Set heading-text as a section heading. Given no argument, SH plants a one-line input trap; text on the next line becomes heading-text. The heading text is set in bold (or the font specified by the string HF), and, on typesetters, slightly larger than the base type size. If the heading font \*[HF] is bold, use of an italic style in heading-text is mapped to the bold-italic style if available in the font family. The inset level is reset to 1; see subsection โ€œHorizontal and vertical spacingโ€ below. Text lines after the call are set as an ordinary paragraph (P).

The content of heading-text and ordering of sections follows a set of common practices, as does much of the layout of material within sections. For example, a section called โ€œNameโ€ or โ€œNAMEโ€ must exist, must be the first section after the TH call, and must contain only text of the form

topic[, another-topic]... \- summary-description

for tools like makewhatis(8) or mandb(8) to index them.

.SS [subheading-text]

Set subheading-text as a subsection heading indented between a section heading and an ordinary paragraph (P). Given no argument, SS plants a one-line input trap; text on the next line becomes subheading-text. The subheading text is set in bold (or the font specified by the string HF). If the heading font \*[HF] is bold, use of an italic style in subheading-text is mapped to the bold-italic style if available in the font family. The inset level is reset to 1; see subsection โ€œHorizontal and vertical spacingโ€ below. Text lines after the call are set as an ordinary paragraph (P).

.EX and .EE โ€” begin and end example

Begin and end example. After EX, filling is disabled (and, on typesetters, a monospaced font family is selected). Calling EE enables filling (and restores the previous family).

Okay so, example regions are lowkey perfect for formatting code, shell sessions, and text file contents. But bestie, an example region is not a โ€œliteral modeโ€ of any sort: special character escape sequences must still be used to produce correct glyphs for ', -, \, ^, `, and ~ (peep subsection โ€œPortabilityโ€ below). Sentence endings are still detected and supplemental inter-sentence space applied. If the amount of supplemental inter-sentence spacing is altered, the rendering of, for instance, regular expressions using . or ? followed by multiple spaces can change. Use the dummy character escape sequence \& before the spaces.

Ninth Edition Unix introduced the EX and EE extensions. Documenter's Workbench (DWB), Heirloom Doctools, and Plan 9 troffs, and mandoc (since 1.12.2) support them. Solaris troff does not.

  • .RS [inset-amount] โ€” start a new relative inset. man saves any current inset amount and moves right by: inset-amount, if specified; the indentation amount of the preceding IP, TP, or HP macro call if no (sub-)sectioning or ordinary paragraphing macro has intervened; or the amount of the IN register. RS calls can nest; each increments by 1 the level used by RE. The level prior to any RS call is 1.
  • .RE [inset-level] โ€” end a relative inset, reducing it to that of inset-level (or by 1 if not specified) and restoring the corresponding inset amount.

โœจ Paragraphing macros โœจ

These macros break the output line. An ordinary paragraph (P) like this one indents all output lines by the same amount. A hanging paragraph (HP) is a cosmetic variant of P with a hanging indent. Definition lists frequently occur in man pages; these can be set as tagged paragraphs, which have one (TP) or more (TQ) leading tags followed by a paragraph that has an additional indentation. The indented paragraph (IP) macro can continue the indented content of a narrative started with TP, or present an itemized or ordered list. If a paragraphing macro has been called since SH or SS, all except TQ follow the break with vertical space (in an amount configured by the deprecated PD macro); see subsection โ€œHorizontal and vertical spacingโ€ below. Except for TQ, these macros reset the type size, hyphenation, and adjustment to (configured) defaults, and the font style to roman.

  • .P, .LP, .PP โ€” begin a new paragraph; these macros are synonymous. Any indentation from use of IP, TP, or HP is cleared. The inset amount, as affected by RS and RE, is not.
  • .HP [indentation] โ€” set a paragraph with a hanging indentation. Text on output lines after the first is indented by indentation, if specified, and by the amount of the IN register otherwise.
Caution, bestie: a hanging indentation cannot be expressed naturally in (pure) HTML, a hanging paragraph is not distinguishable from an ordinary one if it formats on only one output line, and non-roff-based man page interpreters may treat HP as an ordinary paragraph anyway. Thus, information or distinctions you mean to express with indentation may be lost. ๐Ÿ˜ญ
  • .TP [indentation] โ€” set an indented paragraph with a leading unindented tag. The macro plants a one-line input trap that honors the \c escape sequence; text on the next line becomes the tag, set without indentation. Text on subsequent lines is indented by indentation, if specified, and by the amount of the IN register otherwise. If the tag, plus the โ€œtag spacingโ€ stored in the TS register (see section โ€œOptionsโ€ below) is wider than the indentation, the package breaks the line after the tag.

The line containing the tag can include a macro call, for instance to set the tag in bold with B. TP was used to write the first paragraph of this description of TP, and IP the subsequent one.

  • .TQ โ€” set an additional tag for a paragraph tagged with TP, planting a one-line input trap as with TP.

TQ is a GNU extension supported by Heirloom Doctools troff (since Git snapshot 151218) and mandoc (since 1.14.5) but not by DWB, Plan 9, or Solaris troffs.

The description of P, LP, and PP above was written using TP and TQ.

  • .IP [mark [indentation]] โ€” set an indented paragraph with an optional mark. Arguments, if present, are handled as with TP, except that the mark argument to IP cannot include a macro call, and the tag separation amount stored in the TS register is not enforced.

Two convenient uses for IP are:

  1. to start a new paragraph with the same indentation as an immediately preceding IP or TP paragraph, if no indentation argument is given; and
  2. to set a paragraph with a short mark that is not semantically important, such as a bullet (โ€ข)โ€”obtained with the \[bu] special character escape sequenceโ€”or list enumerator, as seen in this very paragraph.

โœจ Synopsis macros โœจ

Use SY and YS to summarize syntax using familiar Unix conventions. Heirloom Doctools troff (since Git snapshot 151218) and mandoc (since 1.14.5) support these GNU extensions; DWB, Plan 9, and Solaris troffs do not.

  • .SY keyword [suffix] โ€” begin synopsis. Adjustment and automatic hyphenation are disabled. If SY has already been called without a corresponding YS, a break is performed. keyword and any suffix are set in bold. When suffix is present, the package sets the next word after it without intervening space. If a break is required in subsequent text (up to a paragraphing, sectioning, or YS macro call), lines after the first are indented. Unless the previous synopsis's indentation is reused (see YS below), output lines after the first indent by the width of the pending output line up to the end of keyword plus a space, if keyword is the only argument, and up to the end of suffix otherwise.
  • .YS [reuse-indentation] โ€” end synopsis, breaking the line and restoring indentation, adjustment, and hyphenation to their previous states. If an argument is given, the indentation corresponding to the previous SY call is reused by the next SY call instead of being computed.

Interleave multiple SY/YS blocks with paragraphing macros to distinguish differing modes of operation of a complex command like tar(1). Omit the paragraphing macro to indicate synonymous ways of invoking a particular mode of operation. Paragraphing macros can similarly manage grouping of function synopses.

groff's own command-line interface illustrates most specimens of synopsis syntax one may encounter.

.SY groff
.RB [ \-abcCeEgGijklNpRsStUVXzZ ]
.RB [ \-d\~\c
.IR ctext ]
.RB [ \-d\~\c
.IB string =\c
.IR text ]
.RB [ \-D\~\c
.IR fallback-encoding ]
(and so on similarly)
.RI [ file\~ .\|.\|.]
.YS
.
.
.P
.SY groff
.B \-h
.YS
.
.SY groff
.B \-\-help
.YS
.
.
.P
.SY groff
.B \-v
.RI [ option\~ .\|.\|.\&]
.RI [ file\~ .\|.\|.]
.YS
.
.SY groff
.B \-\-version
.RI [ option\~ .\|.\|.\&]
.RI [ file\~ .\|.\|.]
.YS

Given the foregoing input, groff man produces the following output.

groff [-abcCeEgGijklNpRsStUVXzZ] [-d ctext] [-d string=text]
      [-D fallback-encoding] [-f font-family] [-F font-directory]
      [-I inclusion-directory] [-K input-encoding] [-L spooler-
      argument] [-m macro-package] [-M macro-directory] [-n page-
      number] [-o page-list] [-P postprocessor-argument]
      [-r cnumeric-expression] [-r register=numeric-expression]
      [-T output-device] [-w warning-category] [-W warning-
      category] [file ...]

groff -h

groff --help

groff -v [option ...] [file ...]

groff --version [option ...] [file ...]

Several features of the above example are of note. ๐Ÿ’…

  • The empty request (.), which does nothing, vertically spaces the input file for readability by the document maintainer; see subsection โ€œPortabilityโ€ below regarding blank lines.
  • Command and option names are presented in bold to cue the user that they should be input literally.
  • Option dashes are specified with the \- escape sequence; this is an important practice to make them clearly visible and to facilitate copy-and-paste from the rendered man page to a shell prompt or text file.
  • Option arguments and command operands are presented in italics (but see subsection โ€œFont style macrosโ€ below regarding terminals) to cue the user that they must be replaced with appropriate input.
  • Symbols that are neither to be typed literally nor replaced at the user's discretion appear in the roman style; brackets surround optional arguments, and an ellipsis indicates that the previous syntactic element may be repeated arbitrarily. Where whitespace separates optional arguments, a space precedes the ellipsis.
  • The non-breaking adjustable space escape sequence \~ prevents the output line from breaking within the option brackets; see subsection โ€œPortabilityโ€ below.
  • The output line continuation escape sequence \c is used with font style alternation macros to allow all three font styles to be set without (breakable) space among them; see subsection โ€œPortabilityโ€ below.
  • The dummy character escape sequence \& follows the ellipsis when further text is to follow after space on the output line, keeping its last period from being interpreted as the end of a sentence because it is followed by characters that are transparent to end-of-sentence detection, and/or a newline, which would in turn normally cause the formatter to place supplemental inter-sentence space after it. See subsection โ€œPortabilityโ€ below.

We might synopsize the standard C library function bsearch(3) as follows.

.P
.B void *\c
.SY bsearch (
.BI const\~void\~* key ,
.BI const\~void\~* base ,
.BI size_t\~ nmemb ,
.BI int\~(* compar )\c
.B (const\~void\~*, const\~void\~*));
.YS

and groff man gives you this, bestie:

void *

bsearch const void *key, const void *base, size_t nmemb,
        int (*compar)(const void *, const void *));

Cross references like ls(1)? Yeah, those are literally best served up with MR. Mark email addresses with MT/ME and every other kind of URI with UR/UE. ๐Ÿ’–

Now, for text to actually be hyperlinked, your terminals and pager programs have to support ECMA-48 OSC 8 escape sequences (peep grotty(1)). When that device support isn't there, or somebody disabled it with the U register (see the section โ€œOptionsโ€ below), groff man just renders those URIs between angle brackets (โŸจ โŸฉ) after the linked text. Not the vibe, but it's honest. ๐Ÿซถ

MT, ME, UR, and UE are GNU extensions โ€” Heirloom Doctools troff supports them (since Git snapshot 151218), and mandoc does too (UR/UE since 1.12.3; MT/ME since 1.14.2). DWB, Plan 9 (original), and Solaris troffs? Nope, not a single one. ๐Ÿ’€ And Plan 9 from User Space's troff implements MR.

Prep your arguments to MR, MT, and UR for typesetting, because they can absolutely show up in the output. Use special character escape sequences to encode Unicode basic Latin characters where you need to โ€” especially the hyphen-minus. (See the subsection โ€œPortabilityโ€ below.) ๐Ÿ”ฅ

URIs can be so long, and rendering them can cause jarring adjustment or variations in line length, or even troff warnings when one is longer than an output line. So the rule of thumb: apply the non-printing break point escape sequences \: after each slash (or series thereof), and before each dot (or series thereof). Slay. The slash one keeps a trailing slash in a URI from getting forced onto its own output line, and the dot one helps your reader not mistake a dot at the end of a line for a period (or a bunch of dots for an ellipsis). So like:

.UR http://\:example\:.com/\:fb8afcfbaebc74e\:.cc

has several potential break points in the URI shown. โœจ Also consider adding break points before or after at signs in email addresses, and question marks, ampersands, and number signs in HTTP(S) URIs.

  • .MR topic [manual-section [trailing-text]] โ€” (since groff 1.23) Sets a man page cross reference as โ€œtopic(manual-section)โ€. If manual-section is absent, the package omits the surrounding parentheses. If trailing-text (usually punctuation) is given, it follows the closing parenthesis with no space in between. Hyphenation gets disabled while the cross reference is being set. topic is set in the font specified by the MF string. If manual-section is present, the cross reference hyperlinks to a URI of the form โ€œman:topic(manual-section)โ€.
The output driver
.MR grops 1
produces PostScript from
.I troff
output.
.
The Ghostscript program (\c
.MR gs 1 )
interprets PostScript and PDF.
  • .MT address, .ME [trailing-text] โ€” Identifies address as an RFC 6068 addr-spec for a โ€œmailto:โ€ URI, with the text between the two macro calls as the link text. An argument to ME goes after the link text with no space between. Heads up: address may not be visible in the rendered document if hyperlinks are on and your output driver supports them. If they aren't, address is set in angle brackets after the link text and before trailing-text. If hyperlinking is enabled but there's no link text, address is formatted and hyperlinked without angle brackets โ€” except when address shows up as a TP paragraph tag. ๐Ÿ™ˆ

When groff renders this to a PostScript device,

Contact
.MT fred\:.foonly@\:fubar\:.net
Fred Foonly
.ME
for more information.

it formats as โ€œContact Fred Foonly โŸจfred.foonly@fubar.netโŸฉ for more information.โ€

  • .UR uri, .UE [trailing-text] โ€” Identifies uri as an RFC 3986 URI hyperlink, with the text between the two macro calls as the link text. An argument to UE goes after the link text with no space between. uri may not be visible in the rendered document if hyperlinks are on and your output driver supports them. If they aren't, uri is set in angle brackets after the link text and before trailing-text. If hyperlinking is enabled but there's no link text, uri is formatted and hyperlinked without angle brackets โ€” except when uri appears as a TP paragraph tag. ๐Ÿ’…

When groff renders this to a PostScript device,

The GNU Project of the Free Software Foundation
hosts the
.UR https://\:www\:.gnu\:.org/\:software/\:groff/
.I groff
home page
.UE .

it formats as โ€œThe GNU Project of the Free Software Foundation hosts the groff home page โŸจhttps://www.gnu.org/software/groff/โŸฉ.โ€

Also, if a UR/UE or MT/ME pair lands in a TP tag and hyperlinking isn't available, groff man sets the link target at the beginning of the indented paragraph instead of as part of the tag โ€” unless there's no link text. ๐ŸŽ€


๐ŸŽจ Font style macros ๐ŸŽจ

Okay so here's the tea: the man macro package is lowkey limited in its font styling options โ€” you get bold (B), italic (I), and roman. That's it. Italic text may instead render underscored on terminals. SM sets text at a smaller type size, but that only visually differs from regular-sized text on typesetters. And the macros BI, BR, IB, IR, RB, and RI set their odd- and even-numbered arguments in the alternating styles their names indicate, with no space separating them. Iconic, honestly. ๐Ÿ‘‘

Because font styles are presentational and not semantic, conflicting traditions have totally arisen over which font styles to use for file or path names, environment variables, and inlined literals. iykyk. ๐Ÿ™ƒ

The default type size and family for typesetters is 10-point Times โ€” except on the X75-12 and X100-12 devices, where the type size is 12 points. The default style is roman.

  • .B [text] โ€” Set text in bold. Given no argument, B plants a one-line input trap; the text on the next line (which can be further formatted with a macro) gets set in bold.

Use bold for literal portions of syntax synopses, for command-line options in running text, and for literals that are major topics of whatever you're discussing โ€” for example, this page uses bold for macro, string, and register names. And in an EX/EE example of interactive I/O (like a shell session), set only user input in bold. ๐Ÿ’–

  • .I [text] โ€” Set text in an italic or oblique face. Given no argument, I plants a one-line input trap; the text on the next line (which can be further formatted with a macro) gets set in an italic or oblique face.

Use italics for file and path names, for environment variables, for C data types, for enumeration or preprocessor constants in C, for variant (user-replaceable) portions of syntax synopses, for the first occurrence (only) of a technical concept being introduced, for names of journals and of literary works longer than an article, and anywhere a parameter requiring replacement by the user turns up. โœจ One exception: variant text sitting in a context that's already typeset in italics, like file or path names with replaceable components. In those cases, follow the convention of mathematical typography โ€” set the file or path name in italics as usual but use roman for the variant part (see IR and RI below), and go back to italics in running roman text when you're referring to the variant material.

  • .SM [text] โ€” Set text one point smaller than the default type size on typesetters. Given no argument, SM plants a one-line input trap; the text on the next line (which can be further formatted with a macro) gets set smaller.
Note: terminals render the text at normal size instead. Do not rely on SM to communicate semantic information distinct from just using roman style at normal size โ€” it's hidden from readers using those devices. ๐Ÿ˜ญ

Now observe what is not prescribed for bold or italics above, bestie โ€” this list is giving academic:

  • elements of โ€œsynopsis languageโ€ such as ellipses and brackets around options
  • proper names and adjectives
  • titles of anything other than major works of literature
  • identifiers for standards documents or technical reports such as CSTR #54, RFC 1918, Unicode 16, or POSIX.1-2024
  • acronyms
  • and occurrences after the first of a technical term

Use italics for emphasis rarely, and bold almost never. Brief specimens of literal text โ€” article titles, inline examples, mentions of individual characters or short strings, and (sub)section headings in man pages โ€” are fine for quotation; see the \[lq], \[rq], \[oq], and \[cq] escape sequences in the subsection โ€œPortabilityโ€ below. ๐ŸŒธ

Unlike those font style macros up there, the font style alternation macros below set no input traps โ€” you have to give them arguments for anything to happen. They apply italic corrections as appropriate. If you need a space inside an argument, first ask yourself whether you could get the same result just as clearly with single-style macros on separate input lines. When you can't, double-quote an argument that contains embedded space characters. Setting all three different styles inside a single word is genuinely challenging โ€” it's possible with the \c and/or \f escape sequences. See the subsection โ€œPortabilityโ€ below for approaches. ๐Ÿฆ‹

  • .BI bold-text italic-text ... โ€” Set each argument in bold and italics, alternately.
.BI -r\~ register = numeric-expression
  • .BR bold-text roman-text ... โ€” Set each argument in bold and roman, alternately.
Set an ellipsis on the math axis with the GNU extension macro
.BR cdots .
  • .IB italic-text bold-text ... โ€” Set each argument in italics and bold, alternately.
In places where
.IB n th
is allowed,
  • .IR italic-text roman-text ... โ€” Set each argument in italics and roman, alternately.
Use GNU
.IR pic 's
.B figname
command to change the name of the vbox.
  • .RB roman-text bold-text ... โ€” Set each argument in roman and bold, alternately.
.I file
is
.RB \[lq] \- \[rq],
.I groff
reads the standard input stream.

like, see how .I, .RB, and .I hand off to each other mid-sentence? that's the whole bit ๐Ÿซถ it's a relay race and every macro is a runner.

  • .RI roman-text italic-text ... โ€” sets each argument in roman and italics, alternating. roman, italic, roman, italic, back and forth, forever and ever ๐Ÿ’ซ
.RI ( tpic
was a fork of AT&T
.I pic
by Tim Morgan of the University of California at Irvine

๐ŸŒธ Horizontal and vertical spacing ๐ŸŒธ

okay so spacing, bestie, this is the part where the page stops being vibes and starts being geometry ๐Ÿ“

The package sets all text inboard of the left edge of the output medium by the amount of the page offset โ€” that's register PO, more on it in the โ€œOptionsโ€ section below. Headers and footers (both of which are set with TH), plus section headings (SH), all lie at the page offset. And groff man indents subsection headings (SS) by the amount sitting in the SN register.

Ordinary paragraphs that are not inside an RS/RE inset region get inset by the amount stored in the BP register โ€” yes, โ€œOptionsโ€ section below again, go look ๐Ÿ‘€. The IN register configures the default indentation amount used by RS (as the inset-amount), IP, TP, and HP; an overriding argument is a number plus an optional scaling unit. And if you leave the scaling unit off? The man package just assumes n โ€” that's roughly the width of a letter โ€œnโ€ in the font current when the macro is called โ€” see section โ€œMeasurementsโ€ in groff(7).

An indentation specified in a call to IP, TP, or HP persists until either (1) another of these macros is called with an indentation argument, or (2) SH, SS, or P or its synonyms is called; those last ones clear the indentation entirely. gone. deleted. ๐Ÿ’€

The inset amount and the indentation are related but distinct parameters, and they share the same defaults. The former is manipulated by RS and RE (and by SH and SS, which reset it to the default). Indentation is controlled by the paragraphing macros (though, again, SH and SS reset it); it gets imposed by the TP, IP, and HP macros, and cancelled by P and its synonyms. There's an extensive example coming, brace yourself:

This ordinary (P) paragraph is not in a relative inset nor does it
possess an indentation.

       Now we have created a relative inset with RS and started another
       ordinary paragraph with P.  We observe that all of its lines are
       inset and indented the same; contrast with a first-line
       indentation.

       tag    This tagged paragraph, set with TP, is still within the RS
              region, but lines after the first have a supplementary
              indentation that the tag lacks.

              A paragraph like this one, set with IP, appears to the
              reader as also associated with the tag above, because IP
              re-uses the previous paragraph's indentation unless given
              an argument to change it.  Both the inset amount (RS) and
              indentation (IP) affect this paragraph.
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ This table is affected both by    โ”‚
              โ”‚ the inset amount and indentation. โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

       โ€ข      This indented paragraph is marked with a bullet,
              contrasting the inset amount and the indentation; only the
              former affects the mark, but both affect the text of the
              paragraph.

       This ordinary (P) paragraph resets the indentation, but the inset
       amount is unchanged.
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚ This table is affected only โ”‚
       โ”‚ by the inset amount.        โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Finally, we have ended the relative inset by using RE, which (because we
used only one RS/RE pair) has restored the inset amount to its initial
value.  This is an ordinary P paragraph.

look at all those little boxes lining up ๐Ÿ˜ญ that's the whole point, the visual difference between inset and indentation, chef's kiss, no notes.

โš ๏ธ Resist the temptation to mock up tabular or multi-column output with tab characters or the indentation arguments to IP, TP, RS, or HP. The result may not be comprehensible on an output device you fail to check, or which is developed in the future. Consider the table preprocessor tbl(1) instead. seriously. use tbl. it's right there ๐Ÿ“

Several macros insert vertical space: SH, SS, TP, P (and its synonyms), IP, and HP. After doing that they enable no-space mode; see groff(7). The default inter-section and inter-paragraph spacing is 1v for terminals and 0.4v for typesetters. And โ€œvโ€ here is just a unit of vertical distance โ€” 1v is the distance between adjacent text baselines. (The deprecated macro PD can change this vertical spacing, but we discourage its use, bestie, don't do it ๐Ÿ™ˆ) Between EX and EE calls, the inter-paragraph spacing is 1v no matter what the output device is.


๐ŸŽ€ Registers ๐ŸŽ€

Registers are described in the โ€œOptionsโ€ section below. And plot twist: they can be set not only on the command line but also in the site man.local file โ€” see the โ€œFilesโ€ section below. two places, same power ๐Ÿ’…


๐ŸŒˆ Strings ๐ŸŒˆ

So these are the strings defined for use in man pages. Heads up that groff man supports others for configuration of rendering parameters โ€” โ€œOptionsโ€ section below, you know the drill.

  • \*R โ€” interpolates a special character escape sequence for the โ€œregistered signโ€ glyph, \(rg, if it's available, and โ€œ(Reg.)โ€ otherwise.
  • \*S โ€” interpolates an escape sequence setting the type size to the document default.
  • \*(lq, \*(rq โ€” interpolate special character escape sequences for left and right double-quotation marks, \(lq and \(rq, respectively.
  • \*(Tm โ€” interpolates a special character escape sequence for the โ€œtrade mark signโ€ glyph, \(tm, if it's available, and โ€œ(TM)โ€ otherwise.

Now the vibe check: a contemporary man page needs none of the above. \*S is superfluous โ€” type size changes are literally invisible on terminals, and macros that change it restore its original value afterward anyway. Better alternatives exist for the rest: just use the \[rg], \[lq], \[rq], and \[tm] special character escape sequences directly. Unless you're aiming for a pathological level of portability โ€” like, say, composing a man page for consumption on simulators of 1980s Unix systems (or Solaris troff, though even it supports โ€œ(rgโ€) โ€” avoid using the above strings, fr fr โœจ


๐Ÿฆ‹ Use of extensions ๐Ÿฆ‹

To make sure your man page formats reliably across a wide variety of viewers, write it solely with the macros described in this page โ€” except for the ones identified as deprecated, which you should avoid anyway. Macros described as extensions might be unsupported by a formatter that's important to your audience. ๐Ÿ˜ฌ

That said, groff's extensions exist for a reason: they perform tasks that are otherwise difficult or tedious to achieve portably. So if you genuinely require an extension but expect your man page to be rendered on a system that doesn't support it, write a configuration test that measures a property of the system, then use m4(1), sed(1), or a similar tool to generate a .man file from a .man.in file โ€” defining page-local versions of extension macros only where necessary. You can copy extension macro definitions from groff; see an-ext.tmac in the โ€œFilesโ€ section below.

For example, we might put a line

@DEFINE_MR@

in our man document at the end of the โ€œNameโ€ section, test a system for the availability of the groff man MR macro, remove the line if the macro is present, and โ€œinlineโ€ a definition otherwise, like this (this version is slightly simplified and does not attempt to disable hyphenation when setting arguments to MR):

have_MR=$(echo .pm | troff -man 2>&1 | grep 'MR[[:space:]]')
if [ -n "$have_MR" ]
then
  sed '/@DEFINE_MR@/d' myprog.man.in > myprog.man
else
  sed 's/@DEFINE_MR@/.de MR\
.  ie \\\\n(.$=1 .I \\\\$1\
.  el .IR \\\\$1 (\\\\$2)\\\\$3\
../' myprog.man.in > myprog.man
fi

(the profusion of backslashes is because that character is an escape character in both roff and sed โ€” double duty, iconic, exhausting ๐Ÿ’€)

And if that whole method is too much trouble for you? You could always apply the radical technique of reading your man page using every formatter of interest and confirming satisfactory output from each one. Test documentation for syntactic validity and semantic correctness, just like you'd test code. yes, really. documentation is code, bestie ๐Ÿซถ


โญ Portability โญ

GNU troff expects its input to contain Unicode basic Latin code points exclusively. You can keep it in a more convenient encoding and use preconv(1) โ€” same deal as with groff(1)'s -k option โ€” to generate a basic Latin version that employs special character escape sequences to access other glyphs.

AT&T troff's man package, and those of many of its descendants, format man pages using a line length of 65 ens (character cells) on terminals, whereas groff man uses 80 ens (and mandoc(1) uses 78). Readers with low vision may also benefit from that narrower line length ๐Ÿ‘‘. So inspect your documents with

nroff -t -r LL=65n -man

to make sure their output lines don't overrun. tiny command, big kindness.

In roff systems, elemental functions called requests and escape sequences control formatting operations. A request appears on a control line. An escape sequence starts with a backslash (\) and can appear almost anywhere. However โ€” using roff requests (apart from the empty request .) risks poor rendering when a page is processed by non-roff formatters that try to interpret page sources. (Historically, this was commonly attempted for HTML conversion. ๐Ÿ™ˆ) Many of these programs don't interpret the full roff language, let alone extensions: they may be completely incapable of handling numeric expressions, control structures, or register, string, and macro definitions โ€” which causes a document's contents to be presented incomprehensibly or omitted entirely. ๐Ÿ˜ญ So if your document uses formatter requests, or escape sequences not shown below, it accepts responsibility for restoring formatter state to what the man macro package expects. your page, your problem, periodt.

Do not put blank (empty) lines in a man page source document. They can produce excessive space in the output, or less than is attempted โ€” some man(1) programs โ€œsqueezeโ€ multiple blank output lines into one. so you get chaos either way ๐ŸŒธ

The wise man author quotes multi-word section and subsection headings โ€” the SH and SS macros of man(7) implementations descended from Seventh Edition Unix supported six arguments at most. That same restriction also applied to the B, I, SM, and font style alternation macros. quote your headings, be the wise author ๐Ÿ’…

okay so same energy as with requests: restraint. chill. do not go feral with escape sequences ๐Ÿ’… but โ€” plot twist โ€” some escape sequences are literally required for correct typesetting even in man pages, and they usually don't cause any portability drama at all. Several of them render glyphs that correspond to punctuation code points in the Unicode basic Latin range (U+0020โ€“U+007F), and those code points get handled specially in roff input. so when you're documenting material that uses them as literals โ€” namely, any of the set ' - \ ^ ` ~ (apostrophe, dash or hyphen-minus, backslash, caret, grave accent, tilde) โ€” you must use the escape sequences below to render them correctly and portably. no shortcuts bestie, iykyk โœจ

  • \" โ€” the comment escape. The formatter ignores everything after the double quote all the way to the end of the input line. pro move: put whole-line comments on a control line immediately after the empty request (".").
  • \newline โ€” joins the next input line onto the current one. Except for the update of the input line counter (which is used for diagnostic messages and related purposes), a series of lines ending in backslash-newline just looks like a single input line to groff. genuinely so useful for splitting excessively long input lines so the document is easier to maintain ๐Ÿซถ
  • \% โ€” hyphenation control, babes. Where you drop this escape sequence inside a word marks a hyphenation point, supplementing groff's automatic hyphenation patterns. put it at the beginning of a word and it suppresses any hyphenation breaks within that word โ€” except the ones you spelled out yourself with \%.
  • \: โ€” inserts a non-printing break point. A word can break there, but if it does, no hyphen glyph gets written to the output. the rest of the word is subject to hyphenation as normal. you can combo \: with \% to control breaking of a file name or URI, or to permit hyphenation only after certain explicit hyphens inside a word. see subsection โ€œHyperlink macrosโ€ above for an example ๐Ÿฆ‹
    • \: is a GNU extension, also supported by Heirloom Doctools troff 050915 (September 2005), mandoc 1.13.1 (2014-08-10), and neatroff (commit 399a4936, 2014-02-17), but not by DWB, Plan 9, or Solaris troffs.
  • \~ โ€” adjustable non-breaking space โœจ use it to prevent a break inside a short phrase, or between a numerical quantity and its corresponding unit(s). like:
Before starting the motor,
set the output speed to\~1.
There are 1,024\~bytes in 1\~KiB.
CSTR\~#8 documents the B\~language.
  • \~ is a GNU extension, also supported by Heirloom Doctools troff 050915 (September 2005), mandoc 1.9.14 (2009-11-16), neatroff (commit 1c6ab0f6e, 2016-09-13), and Plan 9 from User Space troff (commit 93f8143600, 2022-08-12), but not by DWB or Solaris troffs.
  • \& โ€” the dummy character. prefix an input line with it to stop a dot or apostrophe from being interpreted as the beginning of a roff control line. also, append \& to an end-of-sentence punctuation sequence so it doesn't get recognized as such. sneaky but iconic.
  • \| โ€” thin space (one-sixth em on typesetters, zero-width on terminals), and it's a non-breaking space. used primarily in ellipses (.\|.\|.) so the dots are spaced more pleasantly on typesetters ๐ŸŽ€
  • \c โ€” ends a text line without inserting space or attempting a break. nothing on the input line after this escape sequence gets formatted. \c slays when you need three font styles in a single word, like in a command synopsis:
.RB [ \-\-stylesheet=\c
.IR name ]

\c also helps when you're changing font styles in EX/EE examples, since they are not filled:

.EX
$ \c
.B groff \-T utf8 \-Z \c
.I file \c
.B | grotty \-i
.EE

okay so normally, if filling is enabled, the formatter treats the end of a text line like a space. it checks for the end of a sentence, and may break the output line (and if it doesn't, it inserts an adjustable space). if filling is disabled, the formatter will break the output line, as in EX/EE examples. the formatter interprets the next input line as usual, recognizing control lines โ€” including macro calls (contrast with \newline).

the \f font selection escape sequence is an alternative to \c; see below. heads up though: using \c to continue a TP paragraph tag across multiple input lines renders incorrectly with groff 1.22.3, mandoc 1.14.1, older versions of these programs, and perhaps with some other formatters ๐Ÿ˜ญ

  • \e โ€” formats the roff escape character on the output; widely used in man pages to render a backslash glyph. it works reliably as long as the ec request is not used (which should never happen in man pages), and it's slightly more portable than the more explicit \[rs] (โ€œreverse solidusโ€) special character escape sequence. we love a low-effort win ๐Ÿ’œ
  • \fB, \fI, \fR, \fP โ€” switch to bold, italic, roman, or back to the previous style, respectively. you need either \f or \c when three different font styles are required in a word.
.RB [ \-\-reference\-dictionary=\fI\,name\/\fP ]

.RB [ \-\-reference\-dictionary=\c
.IR name ]

style escape sequences may be more portable than \c. as shown above, it's up to you to account for italic corrections with \/ and \, โ€” which are themselves GNU extensions โ€” if you want them and if your implementation supports them.

\fP reliably returns to the style in use immediately preceding the previous \f escape sequence only if no sectioning, paragraph, example, or style macro calls have intervened. so, you know, context matters ๐Ÿ™ˆ

as long as at most two styles are needed in a word, style macros like B and BI usually result in more readable roff source than \f escape sequences do. take the W.


several special characters are also widely portable, bestie. except for \-, \[em], and \[ga], AT&T troff did not consistently define the characters listed below โ€” but its descendants, like DWB, Plan 9, or Solaris troff, can be made to support them by defining them in font description files, making them aliases of existing glyphs if necessary; see groff_font(5). groff's extended notation for special characters, \[xx], is also supported by mandoc(1), Heirloom Doctools troff, and neatroff, but not DWB, Plan 9, or Solaris troffs. the more you know ๐ŸŒˆ

  • \- โ€” minus sign. \- produces the basic Latin hyphen-minus (U+002D), used when specifying Unix command-line options and frequently used in file names. - is a hyphen in roff; some output devices format it as U+2010 (hyphen).
  • \[aq] โ€” basic Latin neutral apostrophe. some output devices format ' as a right single quotation mark.
  • \[oq], \[cq] โ€” opening (left) and closing (right) single quotation marks. use these for paired directional single quotes, โ€˜like thisโ€™.
  • \[dq] โ€” basic Latin quotation mark (double quote). use it in macro calls to work around the interpretation of " as an argument delimiter:
.TP
.BI "split \[dq]" text \[dq]
  • \[lq], \[rq] โ€” left and right double quotation marks. use these for paired directional double quotes, โ€œlike thisโ€.
  • \[em] โ€” em dash. use it for an interruptionโ€”such as this oneโ€”in a sentence.
  • \[en] โ€” en dash. use it to separate the ends of a range, as between numbers; for example, โ€œthe digits 1โ€“9โ€.
  • \[ga] โ€” basic Latin grave accent. some output devices format ` as a left single quotation mark.
  • \[ha] โ€” basic Latin circumflex accent (โ€œhatโ€). some output devices format ^ as U+02C6 (modifier letter circumflex accent).
  • \[rs] โ€” reverse solidus (backslash). the backslash is the default escape character in the roff language, so it doesn't represent itself in output. also see \e above.
  • \[ti] โ€” basic Latin tilde. some output devices format ~ as U+02DC (small tilde).
for maximum portability, avoid escape sequences (including special characters) not listed above. fr fr, that's the entire assignment ๐ŸŽ€

๐Ÿช HOOKS ๐Ÿช

two macros, both GNU extensions, get called internally by the groff man package to format page headers and footers, and they can be redefined by the administrator in a site's man.local file (see section โ€œFilesโ€ below). The presentation of TH above describes the default headers and footers. because these macros are hooks for groff man internals, man pages have no reason to call them. such hook definitions typically consist of sp and tl requests. PT furthermore has the responsibility of emitting a PDF bookmark after writing the first page header in a document. consult the existing implementations in an.tmac when drafting replacements, okay? ๐Ÿ‘‘

  • .BT โ€” set the page footer text (โ€œbottom trapโ€).
  • .PT โ€” set the page header text (โ€œpage trapโ€).

to remove a page header or footer entirely, define the appropriate macro as empty rather than deleting it. don't ghost the macro, just give it nothing to say ๐Ÿ’€

๐Ÿ’€ DEPRECATED FEATURES ๐Ÿ’€

using any of the following in man pages for public distribution? discouraged. we're side-eyeing ๐Ÿ‘€

  • .AT [system [release]] โ€” alter the footer for use with legacy AT&T man pages, overriding any definition of the footer-inside argument to TH. this macro exists only to render man pages from historical systems.

the inside footer is populated per the value of system.

  • 3 โ€” 7th edition (default)
  • 4 โ€” System III
  • 5 โ€” System V

the optional release argument specifies the release number, as in โ€œSystem V Release 3โ€.

  • .DT โ€” reset tab stops to the default (every 0.5i [inches]).

use of this presentation-oriented macro is deprecated. it translates poorly to HTML, under which exact space control and tabulation are not readily available. thus, information or distinctions that you use tab stops to express are likely to be lost ๐Ÿ˜ญ. and if you feel tempted to change the tab stops such that calling this macro later to restore them is desirable? consider composing a table using tbl(1) instead. main character solution, honestly ๐Ÿซถ

  • .OP option-name [option-argument] โ€” okay so this one marks an optional command parameter called option-name, and it's set in bold. If the option takes an argument, write option-argument as a noun, abbreviation, or hyphenated noun phrase. If it's present, option-argument gets a space before it and is set in italics. Square brackets in roman surround both arguments. ๐Ÿ’…

The way that this quasi-semantic macro is an extension whose name originated in DWB troff? It's deprecated, bestie โ€” groff's interface differs. Neither can easily be used to annotate options that take optional arguments or options whose arguments have internal structure (like a mixture of literal and variable components). One could work around these limitations with font selection escape sequences, but font style alternation macros are preferable: they're more flexible and they perform italic corrections on typesetters. โœจ

  • .PD [vertical-space] โ€” configures the amount of vertical space between paragraphs or (sub)sections. The optional vertical-space argument says the amount; the default scaling unit is v. With no argument, inter-paragraph spacing resets to its default value โ€” peep subsection โ€œHorizontal and vertical spacingโ€ above. ๐Ÿ˜Œ

This presentation-oriented macro is deprecated. It translates poorly to HTML, where exact control of inter-paragraph spacing is not readily available. So any information or distinctions you use PD to express are likely to be lost. ๐Ÿ˜ญ

  • .SB [text] โ€” sets text in bold and, on typesetters, one point smaller than the default type size. Given no argument, SB plants a one-line input trap; the text on the next line (which can be further formatted with a macro) is set smaller and in bold. This macro is deprecated โ€” it's an extension originating in SunOS 4.0 troff. SM without an argument, followed immediately by โ€œB textโ€, produces the same output more portably. The macros' order is interchangeable; put text with the latter. ๐Ÿ‘‘

Note: terminals render text in bold at the normal size instead. Do not rely on SB to communicate semantic information distinct from using bold style at normal size โ€” it's hidden from readers using such devices. ๐Ÿซถ

  • .UC [version] โ€” alters the footer for legacy BSD man pages, overriding any definition of the footer-inside argument to TH. This macro exists only to render man pages from historical systems. The inside footer is populated per the value of version:
    • 3 โ€” 3rd Berkeley Distribution (default)
    • 4 โ€” 4th Berkeley Distribution
    • 5 โ€” 4.2 Berkeley Distribution
    • 6 โ€” 4.3 Berkeley Distribution
    • 7 โ€” 4.4 Berkeley Distribution

๐Ÿ•ฐ๏ธ History ๐Ÿ•ฐ๏ธ

M. Douglas McIlroy designed, implemented, and documented the AT&T man macros for Unix Version 7 (1979) and employed them to edit Volume 1 of its Programmer's Manual, a compilation of all man pages supplied by the system. The package supported the macros listed in this page not described as extensions, except P and the deprecated AT and UC. It documented no registers and defined only R and S strings. ๐Ÿ’–

UC appeared in 3BSD (1980). Unix System III (1980) introduced P and exposed the registers IN and LL, which had been internal to Seventh Edition Unix man. PWB/Unix 2.0 (1980) added the Tm string. 4BSD (1980) added lq and rq strings. SunOS 2.0 (1985) recognized C, D, P, and X registers. 4.3BSD (1986) added AT and P. Ninth Edition Unix (1986) introduced EX and EE. SunOS 4.0 (1988) added SB. Unix System V (1988) incorporated the lq and rq strings. ๐Ÿฆ‹

Except for EX/EE, James Clark implemented the foregoing features in early versions of groff. Later, groff 1.20 (2009) resurrected EX/EE and originated SY/YS, TQ, MT/ME, and UR/UE. Plan 9 from User Space's troff introduced MR in 2020, and incorporated the lq and rq strings in 2025. โœจ


โœจ OPTIONS โœจ

The following groff options set registers (with -r) and strings (with -d) recognized and used by the man macro package. To ensure rendering consistent with output device capabilities and reader preferences, man pages should never manipulate them. ๐Ÿšซ

  • -dAD=adjustment-mode โ€” set line adjustment to adjustment-mode, which is typically โ€œbโ€ for adjustment to both margins (the default), or โ€œlโ€ for left alignment (ragged right margin). Any valid argument to groff's โ€œadโ€ request may be used. See groff(7) for less-common choices. ๐ŸŒˆ
  • -rBP=base-paragraph-inset โ€” set the inset amount for ordinary paragraphs not within an RS/RE inset. The default is 5n. ๐ŸŽ€
  • -rcR=1 โ€” enable continuous rendering. Output is not paginated; instead, one (potentially very long) page is produced. This is the default for terminal and HTML devices. Use -rcR=0 to disable it on terminals; on HTML devices, it cannot be disabled. ๐Ÿ˜ฎโ€๐Ÿ’จ
  • -rC1 โ€” number output pages consecutively, in strictly increasing sequence, rather than resetting the page number to 1 (or the value of register P) with each new man document. ๐Ÿ”ข
  • -rCHECKSTYLE=n โ€” report problems with usage of this macro package exhibited by the input at verbosity level n, where n is an integer in the range 0โ€“3, inclusive; 0 disables the messages and is the default. This feature is a development and debugging aid for man page maintainers; the problems diagnosed, and range and meanings of the supported levels, are subject to change. ๐Ÿ‘€
  • -rCS=1 โ€” set section headings (the argument(s) to SH) in full capitals. This transformation is off by default because it discards lettercase distinctions. ๐Ÿ” 
  • -rCT=1 โ€” set the man page identifier (the first argument to TH) in full capitals in headers and footers. This transformation is off by default because it discards lettercase distinctions. ๐Ÿ”ก
  • -rD1 โ€” enable double-sided layout, formatting footers for even and odd pages differently; see the description of TH in subsection โ€œDocument structure macrosโ€ above. ๐Ÿ“–
  • -rFT=footer-distance โ€” set the distance of the footer relative to the bottom of the page to footer-distance; this amount is always negative. At one half-inch above this location, the page text is broken before writing the footer. Ignored if continuous rendering is enabled. The default is -0.5i - 1v. ๐Ÿ“
  • -dHF=heading-font โ€” select the font used for section and subsection headings; the default is โ€œBโ€ (bold style of the default family). Any valid argument to groff's โ€œftโ€ request may be used. See groff(7). ๐Ÿ–‹๏ธ
  • -rHY=0 โ€” disable automatic hyphenation. Normally, it is enabled (1). The hyphenation mode is determined by the groff locale; see section โ€œLocalizationโ€œ of groff(7). โœ‚๏ธ
  • -rIN=standard-indentation โ€” set the default indentation amount used by IP, TP, and HP, and the inset amount used by RS. The default is 7n on terminals and 7.2n on typesetters. Use only integer multiples of unit โ€œnโ€ on terminals for consistent indentation. ๐Ÿ“
  • -rLL=line-length โ€” set line length; the default is 80n on terminals and 6.5i on typesetters. ๐Ÿ“
  • -rLT=title-length โ€” set the line length for titles. (โ€œTitlesโ€ is the roff term for headers and footers.) By default, it is set to the line length (see -rLL above). ๐Ÿท๏ธ
  • -dMF=man-page-topic-font โ€” select the font used for man page identifiers in TH calls and topics named in MR calls; the default is โ€œIโ€ (italic style of the default family). Any valid argument to groff's โ€œftโ€ request may be used. If the MF string ends in โ€œIโ€, the package assumes it to be an oblique typeface, and applies italic corrections before and after man page topics and identifiers. ๐Ÿ’…
  • -rPn โ€” start enumeration of pages at n. The default is 1. ๐Ÿ”ข
  • -rPO=page-offset โ€” set page offset; the default is 0 on terminals and 1i on typesetters. ๐Ÿ“
  • -rStype-size โ€” use type-size for the document's body text; acceptable values are 10, 11, or 12 points. See subsection โ€œFont style macrosโ€ above for the default. ๐Ÿ”ค
  • -rSN=subsection-indentation โ€” set indentation of subsection headings to subsection-indentation. The default is 3n. ๐Ÿ“
  • -rTS=separation โ€” require the given separation between a TP paragraph's tag and its body. The default is 2n. โ†”๏ธ
  • -rU0 โ€” disable generation of URI hyperlinks in output drivers capable of them, making the arguments to MT and UR calls visible as formatted text. grohtml(1), gropdf(1), and grotty(1) enable hyperlinks by default (the last only if not in its legacy output mode). ๐Ÿ”—
  • -rXp โ€” number successors of page p as pa, pb, pc, and so forth. The register tracking the suffixed page letter uses format โ€œaโ€ (see the โ€œafโ€ request in groff(7)). For example, the option -rX2 produces the following page numbers: 1, 2, 2a, 2b, ..., 2aa, 2ab, and so on. ๐Ÿ”ค

๐Ÿ“ FILES ๐Ÿ“

Okay bestie, hereโ€™s the file map โ€” the actual locations of the man macro machinery and the little side quests each file handles. Keep these paths exactly as written, no cap. ๐Ÿ’–

  • /usr/share/groff/1.24.2/tmac/an.tmac โ€” Most man macros are defined in this file. It also loads extensions from an-ext.tmac (see below).
  • /usr/share/groff/1.24.2/tmac/andoc.tmac โ€” This brief groff program detects whether the man or mdoc macro package is used by a document and loads the correct macro definitions, taking advantage of the fact that pages using them must call TH or Dd, respectively, before any other macros. A man program or a user typing, for example, groff -mandoc page.1, need not know which package the file page.1 uses. Multiple man pages, in either format, can be handled; andoc reloads each macro package as necessary. Page-local redefinitions of names used by the man or mdoc packages prior to TH or Dd calls are โ€œclobberedโ€ by the reloading process. If you want to provide your own definition of an extension macro to ensure its availability, the an-ext.tmac entry below offers advice.
  • /usr/share/groff/1.24.2/tmac/an-ext.tmac โ€” Definitions of macros described above as extensions (and not deprecated) are contained in this file; in some cases, they are simpler versions of definitions appearing in an.tmac, and are ignored if the formatter is GNU troff. They are written to be compatible with AT&T troff and permissively licensedโ€”not copylefted. To reduce the risk of name space collisions, string and register names begin only with โ€œmโ€. We encourage man page authors who are concerned about portability to legacy Unix systems to copy these definitions into their pages, and maintainers of troff implementations or work-alike systems that format man pages to re-use them. To ensure reliable rendering, define them after your page calls TH; see the discussion of andoc.tmac above. Further, it is wise to define such page-local macros (if at all) after the โ€œNameโ€ section to accommodate timid makewhatis(8) or mandb(8) implementations that easily give up scanning for indexing material.
  • /usr/share/groff/1.24.2/tmac/man.tmac โ€” is a wrapper enabling the package to be loaded with the option โ€œ-m manโ€.
  • /usr/share/groff/1.24.2/tmac/mandoc.tmac โ€” is a wrapper enabling andoc.tmac to be loaded with the option โ€œ-m mandocโ€.
  • /usr/share/groff/site-tmac/man.local โ€” Put site-local changes and customizations into this file.

Hereโ€™s the example config theyโ€™re talking about โ€” copy it exactly, bestie:

.\" Put only one space after the end of a sentence.
.ss 12 0 \" See groff(7).
.\" Keep pages narrow even on wide terminals.
.if n .if \n[LL]>80n .nr LL 80n

On multi-user systems, it is more considerate to users whose preferences may differ from the administrator's to be less aggressive with such settings, or to permit their override with a user-specific man.local file. Place the requests below at the end of the site-local file to manifest courtesy.

.soquiet \V[XDG_CONFIG_HOME]/man.local
.soquiet \V[HOME]/.man.local
However, a security-sandboxed man(1) program may lack permission to open such files. ๐Ÿซถ

๐Ÿ—’๏ธ NOTES ๐Ÿ—’๏ธ

Some tips on composing and troubleshooting your man pages follow. Literally so useful, iykyk. โœจ

  • What's the difference between a man page topic and identifier?

A single man page may document several related but distinct topics. For example, printf(3) and fprintf(3) are often presented together. Moreover, multiple programming languages have functions named โ€œprintfโ€, and may document these in a man page. The identifier is intended to (with the section) uniquely identify a page on the system; it may furthermore correspond closely to the file name of the document.

The man(1) librarian makes access to man pages convenient by resolving topics to man page identifiers. Thus, you can type man fprintf, and other pages can refer to it, without knowing whether the installed document uses โ€œprintfโ€, โ€œfprintfโ€, or even โ€œc_printfโ€ as its identifier.

  • Some ASCII characters look funny or copy and paste wrong.

On devices with large glyph repertoires, like UTF-8-capable terminals and PDF, GNU troff, like AT&T troff before it, maps several keycaps to code points outside the Unicode basic Latin range (historically โ€œASCIIโ€) because that usually results in better typography in the general case. When documenting GNU/Linux command or C language syntax, however, this translation is sometimes not desirable.

To get a โ€œliteralโ€... ...should be input.

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
                    '   \[aq]
                    -   \-
                    \   \[rs]
                    ^   \[ha]
                    `   \[ga]
                    ~   \[ti]
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

If a neutral double quote (") is needed in a macro argument, you can use \[dq] to get it. Do not use \[aq] for an ordinary apostrophe (as in โ€œcan'tโ€) or \- for an ordinary hyphen (as in โ€œword-alignedโ€).

  • Do I ever need to use an empty macro argument ("")?

Probably not. When this seems necessary, often a shorter or clearer alternative is available.

Instead of...               ...should be considered.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.TP ""                         .TP
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.BI "" italic-text bold-text   .IB italic-text bold-text
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.TH foo 1 "" "foo 1.2.3"       .TH foo 1 yyyy-mm-dd "foo 1.2.3"
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.IP "" 4n                      .IP
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.IP "" 4n                      .RS 4n
paragraph                      .P
...                            paragraph
...                            .RE
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.B one two "" three            .B one two three
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

In the title heading (TH), the date of the page's last revision is more important than packaging information; it should not be omitted. Ideally, a page maintainer keeps both up to date.

IP is sometimes ill-understood and misused, especially when no mark argument is suppliedโ€”an indentation argument is not required. By setting an explicit indentation, you may be overriding the reader's preference as set with the -rIN option. If your page renders adequately without one, use the simpler form. If you need to indent multiple (unmarked) paragraphs, consider setting an inset region with RS and RE instead.

In the last example, the empty argument does have a subtly different effect than its suggested replacement: the empty argument causes an additional space character to be interpolated between the arguments โ€œtwoโ€ and โ€œthreeโ€โ€”but it is a regular breaking space, so it can be discarded at the end of an output line. It is better not to be subtle, particularly with space, which can be overlooked in source and rendered forms.

  • RS doesn't indent relative to my indented paragraph.

The RS macro determines the inset amount, the position at which an ordinary paragraph (P and its synonyms) is set; the value of the IN register determines its default amount. This register also determines the default indentation used by IP, TP, and HP. To create an inset relative to an indented paragraph, call RS repeatedly until an acceptable indentation is achieved, or give RS an indentation argument that is at least as much as the paragraph's indentation amount relative to an adjacent ordinary (P) paragraph.

Another approach to tagged paragraphs places an RS call immediately after the tag; this also forces a break regardless of the tag's width, which some authors prefer. Follow-up paragraphs under the tag can then be set with P instead of IP. Remember to use RE to end the indented region before starting the next tagged paragraph (at the appropriate nesting level).

  • RE doesn't move the inset back to the expected level.

RE takes an inset level as an argument, unlike RS's inset amount. โ€œ.RE 1โ€ goes to the level before any RS macros were called, RE 2 goes to the level of the first RS call you made, and so forth. If you desire symmetry in your macro calls, simply issue one RE without an argument for each RS that precedes it.

The SH and SS sectioning macros clear relative insets; RE calls have no effect until RS is used again.

  • Do I need to keep typing the indentation in a series of IP calls?

Not if you don't want to change it. Review subsection โ€œHorizontal and vertical spacingโ€ above.

Instead of...     ...should be considered.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
.IP \[bu] 4n        .IP \[bu] 4n
paragraph           paragraph
.IP \[bu] 4n        .IP \[bu]
another-paragraph   another-paragraph
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  • Why doesn't the package provide a string to insert an ellipsis?

Okay so picking up right where we left off: examples of ellipsis usage are literally shown above, in subsection โ€œSynopsis macrosโ€. The idiomatic roff ellipsis is three dots (periods) with thin space escape sequences \| internally separating them. But because dots both begin control lines and are candidate end-of-sentence characters, sometimes you gotta prefix and/or suffix an ellipsis with the dummy character escape sequence \&.

That fact stands even if a string is defined to contain the sequence. And further? If the string ends with \&, end-of-sentence detection gets defeated when you use that string at the end of an actual sentence. (Ending a sentence with an ellipsis is often poor style, but not always.) So a hypothetical string EL that contained an ellipsis, but not the trailing dummy character \&, would then need to be suffixed with the latter when itโ€™s not ending a sentence.

             Instead of...              ...do this.
         โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
         .ds EL \&.\|.\|.         Arguments are
         Arguments are            .IR src-file\~ .\|.\|.\&
         .IR src-file\~ \*(EL\&   .IR dest-dir .
         .IR dest-dir .
         โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

The first column is practicing a false economy, ngl: the savings in typing are offset by the cost of obscuring even the suggestion of an ellipsis to a casual reader of the source document, plus reduced portability to non-roff man page formatters that cannot handle string definitions.

Unicode defines an ellipsis code point, and some fonts have an ellipsis glyph, which some man pages have accessed non-portably with the font-dependent \N escape sequence. We discourage their use; on terminals, they may crowd the dots into a half-width character cell, and they do not render at all if the output device lacks the glyph. In synopses, missing ellipses can mislead the reader. Dots and space are universally supported, bestie. Periodt.

  • When and how should I use quotation marks?

As noted above in subsection โ€œFont style macrosโ€, apply quotation marks to โ€œbrief specimens of literal text, such as article titles, inline examples, mentions of individual characters or short strings, and (sub)section headings in man pagesโ€. Multi-word literals, like Unix commands with arguments, when set inline (as opposed to displayed between EX and EE), should be quoted to ensure that the boundaries of the literal are clear even when the material is stripped of font styling by, for example, copy-and-paste operations.

groff, Heirloom Doctools troff, neatroff, and mandoc support all of the special characters \[oq], \[cq], \[lq], \[rq], \[aq], and \[dq] described in subsection โ€œPortabilityโ€ above. DWB, Plan 9, and Solaris troffs do not. Interpolating the strings \*(lq and \*(rq portably yields directional double quotation marks, if available, in all these formatters (though neatroff does not supply a man macro package), but they cannot reliably be used in macro arguments.

Obtaining directional single quotation marks is more of a challenge, lowkey. Historically, man pages used ` and ', which troff rendered on typesetters as โ€˜ and โ€™, exclusively for them. However, in recent years, some distributors of groff have chosen to override the meanings of these characters in man pages, remapping them to their Unicode Basic Latin code points. Unfortunately, ` and ' are the only reliable means of obtaining directional single quotation marks in AT&T troff; in that implementation, often no special character escape sequences exist to obtain them. Further, AT&T troff's special character identifiers, like its font names, were device-specific.

To achieve quotation portably in man pages rendered both by AT&T and more modern troffs, consider adding a preamble to your page after the TH call as follows.

     .ie \n(.g \{\
     .  ds oq \[oq]\"
     .  ds cq \[cq]\"
     .\}
     .el \{\
     .  ds oq `\"
     .  ds cq '\"
     .\}

You must then use the \* escape sequence to interpolate the quotation mark strings.

     The command
     .RB \*(oq "while !\& git pull; do sleep 10; done" \*(cq
     retries an update from the repository until it succeeds.

If this procedure seems complex, petition your distributor to revert their remapping of the ` and ' characters. Iconic problem-solving energy. ๐Ÿ’…

  • Escape sequences of the form \[xx] don't format correctly.

The \[xx] special character escape sequence is a GNU troff extension also supported by mandoc, Heirloom Doctools troff, and neatroff. DWB, Plan 9, and Solaris troffs don't implement it. If your man page requires portability to these formatters, spell such escape sequences as \(xx; no closing parenthesis is used. xx must be exactly two characters; groff_char(7) lists portable special character identifiers.


๐Ÿ’– Authors ๐Ÿ’–

Okay, credit where credit is due, bestie. James Clark wrote the initial GNU implementation of the man macro package. Later, Werner Lemberg supplied the S, LT, and cR registers โ€” the last one being a 4.3BSD-Reno mdoc(7) feature. Larry Kollar added the FT, HY, and SN registers; the HF string; and the PT and BT macros in groff 1.19 (2003). Lemberg and Eric S. Raymond contributed EX/EE, MT/ME, UR/UE, TQ, and an early version of the SY/YS macros to groff 1.20 (2009). G. Branden Robinson implemented the AD and MF strings; CS, CT, and U registers; and the MR macro for groff 1.23 (2023), and the BP, PO, and TS registers and a revised implementation of the SY/YS macros for groff 1.24 (2026).

And the doc itself? Susan G. Kleinmann wrote the initial version of this document for the Debian GNU/Linux system. Lemberg imported it to groff. He and Robinson revised and updated it. Raymond and Robinson documented the extension macros. Raymond also originated the portability section, to which Ingo Schwarze contributed most of the material on escape sequences.


๐ŸŒˆ See also ๐ŸŒˆ

tbl(1), eqn(1), and refer(1) are preprocessors used with man pages. man(1) describes the man page librarian on your system. groff_mdoc(7) details the groff version of BSD's alternative macro package for man pages.

Also: groff_man(7), groff(7), groff_char(7).


๐Ÿ’– That's the whole page, bestie! This slice of wisdom is from groff 1.24.2, dated 2026-10-01, and the page is groff_man_style(7). Go forth and format responsibly! ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from