groff_man(7)

okay so this is groff_man โ€” the GNU man macro package, straight out of the Miscellaneous Information Manual โ€” and she is literally the blueprint for every man page you've ever skimmed at 2am ๐Ÿซถ buckle up bestie ๐Ÿ’…

๐ŸŒธ NAME ๐ŸŒธ

  • groff_man โ€” compose manual pages with GNU roff โœจ

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

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's what composes manual pages ("man pages") โ€” like the exact one you're reading right now, meta much? This document presents the macros thematically; and for anyone who just needs a quick reference, the alphabetical list below has got you, with pointers to the right subsections ๐Ÿ’–

If you're not already an experienced groff user, lowkey go read groff_man_style(7) โ€” it's an expanded version of this document with extra explanations and advice. Heads up though: it only covers the concepts you need for man page document maintenance, not the full breadth of the groff typesetting system ๐Ÿฆ‹

Here's the whole squad, alphabetical, no cap:

  • .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

There are also some other macros (AT, DT, OP, PD, SB, and UC) โ€” we gossip about those in the subsection "Deprecated features" below ๐Ÿ‘€

And a lil terminology moment: throughout Unix documentation, a manual entry is referred to simply as a "man page", no matter how long it is, without gendered implication, and regardless of which macro package was picked to compose it ๐ŸŽ€


๐ŸŽ€ Macro reference preliminaries ๐ŸŽ€

A tagged paragraph describes each macro. We present coupled pairs together, as with EX and EE. If you need an empty macro argument, specify it as a pair of neutral double quotes (""). Most macro arguments are formatted as text in the output; exceptions are noted ๐Ÿ“Œ

๐Ÿ“š Document structure macros ๐Ÿ“š

Document structure macros organize a man page's content, and 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 โ€” help the reader find stuff and help the writer cover all the essential aspects of the topic. Subsection headings (SS) are optional and let long sections 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. And when none of the above meets a structural demand, use RS/RE to inset a region within a (sub)section ๐Ÿ’…

  • .TH โ€” identifier section [footer-middle [footer-inside [header-middle]]] โ€” 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. Together, identifier and the section of the manual it belongs to can uniquely identify a man document on the system โ€” see man(1) or intro(1) for the manual sectioning that applies to your system. identifier and section sit at the left and right in the header; the latter is set after the former, in parentheses and with no space. footer-middle is centered in the footer. By default, footer-inside is positioned at the bottom left. Using 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; using the continuous-rendering option -rcR=1 replaces it with identifier and section, like in the header. header-middle is centered in the header. If section is an integer between 1 and 9 (inclusive), you don't 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. And groff man suppresses headers and footers in HTML output, periodt.
A valid man document calls TH only once, early in the file, prior to any other macro calls. Not me letting you call it twice โ€” don't ๐Ÿ’€
  • .SH โ€” [heading-text] โ€” Set heading-text as a section heading. Given no argument, SH plants a one-line input trap; the 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 the ordering of sections follow a set of common practices, and so 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

so that tools like makewhatis(8) or mandb(8) can 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; the 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, .EE โ€” 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) ๐ŸŽ€

History moment, iykyk: 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 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 one 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) indents all output lines by the same amount. A hanging paragraph (HP) is a cosmetic variant of P with a hanging indent. Definition lists show up in man pages constantly; these can be set as tagged paragraphs, which have one (TP) or more (TQ) leading tags followed by a paragraph with 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 of them 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, read this one: 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. So information or distinctions you mean to express with indentation may be lost ๐Ÿ˜ญ

and weโ€™re back in the paragraphing macros, bestie โ€” these are the tag-and-indent girlies, and they are lowkey the backbone of every man page ๐Ÿ’…

  • .TP [indentation] โ€” Sets 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. ๐ŸŽ€
  • .TQ โ€” Sets 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. iykyk โœจ

  • .IP [mark [indentation]] โ€” Sets 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. not me thinking thatโ€™s a very specific little caveat ๐Ÿ’€

โœจ 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] โ€” Begins 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. the way this indentation math is doing the most ๐Ÿ˜ญ
  • .YS [reuse-indentation] โ€” Ends 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. slay, cleanup queen ๐Ÿงš

Man page cross references are best presented with MR. Mark email addresses with MT/ME and other sorts of URI with UR/UE. To hyperlink text, terminals and pager programs must support ECMA-48 OSC 8 escape sequences (see grotty(1)). When device support is unavailable or disabled with the U register (see section โ€œOptionsโ€ below), groff man renders these URIs between angle brackets (โŸจ โŸฉ) after the linked text. fancy link behavior, but make it terminal-friendly ๐Ÿ”ฅ

MT, ME, UR, and UE are GNU extensions supported by Heirloom Doctools troff (since Git snapshot 151218) and mandoc (UR/UE since 1.12.3; MT/ME since 1.14.2) but not by DWB, Plan 9 (original), or Solaris troffs. Plan 9 from User Spaceโ€™s troff implements MR. the compatibility lore is deep, bestie ๐Ÿ’œ

Prepare arguments to MR, MT, and UR for typesetting; they can appear in the output. Use special character escape sequences to encode Unicode basic Latin characters where necessary, particularly the hyphen-minus. especially the hyphen-minus, do not @ me โญ

  • .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 (typically punctuation) is specified, it follows the closing parenthesis without intervening space. Hyphenation is disabled while the cross reference is 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)โ€. cross-reference icon behavior ๐Ÿ‘‘
  • .MT address / .ME [trailing-text] โ€” Identify 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 is placed after the link text without intervening space. address may not be visible in the rendered document if hyperlinks are enabled and supported by the output driver. If they are not, address is set in angle brackets after the link text and before trailing-text. If hyperlinking is enabled but there is no link text, address is formatted and hyperlinked without angle brackets, except when address appears as a TP paragraph tag. email-link queen behavior ๐ŸŽ€
  • .UR uri / .UE [trailing-text] โ€” Identify uri as an RFC 3986 URI hyperlink with the text between the two macro calls as the link text. An argument to UE is placed after the link text without intervening space. uri may not be visible in the rendered document if hyperlinks are enabled and supported by the output driver. If they are not, uri is set in angle brackets after the link text and before trailing-text. If hyperlinking is enabled but there is no link text, uri is formatted and hyperlinked without angle brackets, except when uri appears as a TP paragraph tag. URI hyperlink main character energy ๐ŸŒˆ

If a UR/UE or MT/ME pair occurs in a TP tag and hyperlinking is unavailable, groff man sets the link target at the beginning of the indented paragraph, not as part of the tag, unless there is no link text. thatโ€™s the edge case, bestie โ€” write it down ๐Ÿซถ

๐ŸŽ€ Font style macros ๐ŸŽ€

The man macro package is limited in its font styling options, offering only bold (B), italic (I), and roman. Italic text may instead render underscored on terminals. SM sets text at a smaller type size, which differs visually from regular-sized text only on typesetters. The macros BI, BR, IB, IR, RB, and RI set their odd- and even-numbered arguments as text in the alternating styles their names indicate, with no space separating them. font alternation girlies, assemble ๐Ÿ’…

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. noted, typography bestie โœจ

  • .B [text] โ€” Sets text in bold. Given no argument, B plants a one-line input trap; text on the next line, which can be further formatted with a macro, is set in bold. bold and unbothered ๐Ÿฆ‹
  • .I [text] โ€” Sets text in an italic or oblique face. Given no argument, I plants a one-line input trap; text on the next line, which can be further formatted with a macro, is set in an italic or oblique face. italic excellence ๐ŸŒธ
  • .SM [text] โ€” Sets text one point smaller than the default type size on typesetters. Given no argument, SM plants a one-line input trap; text on the next line, which can be further formatted with a macro, is set smaller. smol but valid ๐Ÿ“

Unlike the above font style macros, the font style alternation macros below set no input traps; they must be given arguments to have effect. They apply italic corrections as appropriate. no arguments, no effect โ€” she said what she said ๐Ÿ˜Œ

  • .BI bold-text italic-text ... โ€” Sets each argument in bold and italics, alternately.
  • .BR bold-text roman-text ... โ€” Sets each argument in bold and roman, alternately.
  • .IB italic-text bold-text ... โ€” Sets each argument in italics and bold, alternately.
  • .IR italic-text roman-text ... โ€” Sets each argument in italics and roman, alternately.
  • .RB roman-text bold-text ... โ€” Sets each argument in roman and bold, alternately.
  • .RI roman-text italic-text ... โ€” Sets each argument in roman and italics, alternately.

๐Ÿงš Horizontal and vertical spacing ๐Ÿงš

The package sets all text inboard of the left edge of the output medium by the amount of the page offset; see register PO in section โ€œOptionsโ€ below. Headers, footers (both set with TH), and section headings (SH) lie at the page offset. groff man indents subsection headings (SS) by the amount in the SN register. spacing lore, but make it cute ๐Ÿ’™

Ordinary paragraphs not within an RS/RE inset region are inset by the amount stored in the BP register; see section โ€œOptionsโ€ below. 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. If no scaling unit is given, the man package assumes โ€œnโ€. An indentation specified in a call to IP, TP, or HP persists until (1) another of these macros is called with an indentation argument, or (2) SH, SS, or P or its synonyms is called; these clear the indentation entirely. the persistence rules are giving โ€œshe remembers until she doesnโ€™tโ€ ๐Ÿ’€

Several macros insert vertical space: SH, SS, TP, P (and its synonyms), IP, and HP. They then enable no-space mode; see groff(7). The default inter-section and inter-paragraph spacing is 1v for terminals and 0.4v for typesetters. (The deprecated macro PD can change this vertical spacing, but we discourage its use.) Between EX and EE calls, the inter-paragraph spacing is 1v regardless of output device. deprecated PD? we donโ€™t know her like that ๐Ÿ™ˆ

โญ Registers โญ

Registers are described in section โ€œOptionsโ€ below. They can be set not only on the command line but in the site man.local file as well; see section โ€œFilesโ€ below. site config besties, this oneโ€™s for you ๐Ÿซถ

๐ŸŒธ Strings ๐ŸŒธ

The following strings are defined for use in man pages. None of these is necessary in a contemporary man page; see groff_man_style(7). groff man supports others for configuration of rendering parameters; see section โ€œOptionsโ€ below. vintage string behavior, but noted โœจ

  • \*R โ€” interpolates a special character escape sequence for the โ€œregistered signโ€ glyph, \(rg, if available, and โ€œ(Reg.)โ€ otherwise. registered-sign icon behavior ๐Ÿ‘‘
  • \*S โ€” interpolates an escape sequence setting the type size to the document default. size reset slay ๐Ÿ’…
  • \*(lq and \*(rq โ€” interpolate special character escape sequences for left and right double-quotation marks, \(lq and \(rq, respectively. quote marks, but make them special-character official ๐ŸŽ€
  • \*(Tm โ€” interpolates a special character escape sequence for the โ€œtrade mark signโ€ glyph, \(tm, if available, and โ€œ(TM)โ€ otherwise. trademark glamour โญ

๐Ÿฆ‹ Hooks ๐Ÿฆ‹

Two macros, both GNU extensions, are called internally by the groff man package to format page headers and footers and 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. admin-only hook girlies, not for random man pages ๐Ÿ”ฅ

  • .BT โ€” Sets the page footer text (โ€œbottom trapโ€). bottom trap icon ๐Ÿ’™
  • .PT โ€” Sets the page header text (โ€œpage trapโ€). page trap icon ๐ŸŽ€

okay so, to remove a page header or footer entirely, define the appropriate macro as empty rather than deleting it. That's the whole move. ๐Ÿ’…

๐Ÿ’€ Deprecated features ๐Ÿ’€

For man pages that are for public distribution, using any of the following is discouraged. Like, please don't โ€” they're giving legacy energy in the bad way. ๐Ÿ™ˆ

  • .AT [system [release]] โ€” Alters 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 gets populated according to 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 โ€” Resets tab stops to the default (every 0.5i). Use of this presentation-oriented macro is deprecated. It translates poorly to HTML, under which exact space control and tabulation are not readily available. So any information or distinctions you're using tab stops to express are likely to get lost. If you feel tempted to change the tab stops just so you can call this macro later to restore them, consider composing a table using tbl(1) instead. slay for tables ๐Ÿ’–
  • .OP option-name [option-argument] โ€” Indicates an optional command parameter called option-name, which is set in bold. If the option takes an argument, specify option-argument using a noun, abbreviation, or hyphenated noun phrase. If present, option-argument is preceded by a space and set in italics. Square brackets in roman surround both arguments.

Use of this quasi-semantic macro, an extension whose name originated in DWB troff, is deprecated; groff's interface differs. Neither can easily be used to annotate options that take optional arguments or options whose arguments have internal structure (such as 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 are more flexible and perform italic corrections on typesetters. iykyk โœจ

  • .PD [vertical-space] โ€” Configures the amount of vertical space between paragraphs or (sub)sections. The optional argument vertical-space specifies the amount; the default scaling unit is โ€œvโ€. Without an argument, inter-paragraph spacing resets to its default value; see subsection โ€œHorizontal and vertical spacingโ€ above.

Use of this presentation-oriented macro is deprecated. It translates poorly to HTML, under which exact control of inter-paragraph spacing is not readily available. Thus, information or distinctions that you use PD to express are likely to be lost. rip to that spacing control ๐Ÿ’€

  • .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; text on the next line, which can be further formatted with a macro, is set smaller and in bold. Use of this macro, an extension originating in SunOS 4.0 troff, is deprecated. 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. portable era ๐Ÿซถ
  • .UC [version] โ€” Alters the footer for use with 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 gets populated according to 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. history bestie ๐Ÿฆ‹

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. the timeline ate โญ

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. timeline slay ๐ŸŒˆ

๐ŸŒˆ 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. Like, hands off. ๐Ÿ™…โ€โ™€๏ธ

  • -dAD=adjustment-mode โ€” Sets 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. adjustment era โœจ
  • -rBP=base-paragraph-inset โ€” Sets the inset amount for ordinary paragraphs not within an RS/RE inset. The default is 5n. ๐ŸŽ€
  • -rcR=1 โ€” Enables 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. one long page energy ๐Ÿ˜ญ
  • -rC1 โ€” Numbers 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 โ€” Reports 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. debug bestie ๐Ÿ’…
  • -rCS=1 โ€” Sets section headings (the argument(s) to SH) in full capitals. This transformation is off by default because it discards lettercase distinctions. ALL CAPS MOMENT ๐Ÿ‘‘
  • -rCT=1 โ€” Sets 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. caps but make it header/footer ๐ŸŽ€
  • -rD1 โ€” Enables 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 โ€” Sets 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โ€. negative footer distance, iconic ๐Ÿ’œ
  • -dHF=heading-font โ€” Selects 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 โ€” Disables automatic hyphenation. Normally, it is enabled (1). The hyphenation mode is determined by the groff locale; see section โ€œLocalizationโ€ of groff(7). no surprise hyphens โœจ
  • -rIN=standard-indentation โ€” Sets 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 โ€” Sets line length; the default is 80n on terminals and 6.5i on typesetters. line length era ๐Ÿซถ
  • -rLT=title-length โ€” Sets the line length for titles. By default, it is set to the line length (see -rLL above). ๐ŸŽ€
  • -dMF=man-page-topic-font โ€” Selects 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. italic corrections, we love ๐Ÿ’œ
  • -rPn โ€” Starts enumeration of pages at n. The default is 1. ๐Ÿ”ฅ
  • -rPO=page-offset โ€” Sets page offset; the default is 0 on terminals and 1i on typesetters. ๐ŸŒˆ
  • -rStype-size โ€” Uses 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. body text glow-up โœจ
  • -rSN=subsection-indentation โ€” Sets indentation of subsection headings to subsection-indentation. The default is 3n. ๐Ÿฆ‹
  • -rTS=separation โ€” Requires the given separation between a TP paragraph's tag and its body. The default is 2n. ๐Ÿ’…
  • -rU0 โ€” Disables 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). hyperlink vibe check ๐Ÿซถ
  • -rXp โ€” Numbers 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)). suffix era ๐Ÿ“

๐Ÿ“ Files ๐Ÿ“

  • /usr/share/groff/1.24.2/tmac/an.tmac โ€” the main character of this whole situation: most man macros are defined right here. It also loads extensions from an-ext.tmac (peep the next entry, bestie).
  • /usr/share/groff/1.24.2/tmac/andoc.tmac โ€” this brief groff program detects whether a document is using the man or mdoc macro package and loads the correct macro definitions. It can do that because pages using them have to call TH or Dd, respectively, before any other macros. So a man programโ€”or you, typing, for example, groff -mandoc page.1โ€”doesn't need to 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. iykyk ๐Ÿ’…
  • /usr/share/groff/1.24.2/tmac/an-ext.tmac โ€” definitions of macros described above as extensions (and not deprecated) live in this file. In some cases they're simpler versions of definitions that appear in an.tmac, and they're ignored if the formatter is GNU troff. They're 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's 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 โ€” a wrapper enabling the package to be loaded with the option โ€œ-m manโ€.
  • /usr/share/groff/1.24.2/tmac/mandoc.tmac โ€” 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. your own little corner of the groff universe โœจ

๐Ÿ‘‘ Authors ๐Ÿ‘‘

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 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). absolute legends, every one of them ๐ŸŒˆ

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. documentation queens and kings fr fr ๐ŸŽ€

๐Ÿ”— 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.

groff_man_style(7), groff(7), groff_char(7) โ€” more reading if you're obsessed like me ๐Ÿฆ‹


That's the whole page, bestie! This iconic little number is groff_man(7) from groff 1.24.2, dated 2026-10-01. periodt ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from