groff_mm(7)
โจ you're reading groff_mm(7) from the Miscellaneous Information Manual, and honestly? iconic. buckle up bestie ๐
๐ NAME ๐
groff_mm โ memorandum macros for GNU roff, and that's the whole vibe ๐ซถ
โจ SYNOPSIS โจ
groff -mm [option ...] [file ...]
groff -m mm [option ...] [file ...]
๐ฆ DESCRIPTION ๐ฆ
okay so. the mm macro package ships with the groff document formatting system, and it's literally made for composing letters, memoranda, reports, and books ๐ no cap.
call an mm macro at the beginning of a document to initialize the package. a simple mm document might use only P for paragraphing โ that's it, that's the whole setup. set numbered and unnumbered section headings with H and HU, respectively. change the style of the typeface with B, I, and R; you can alternate styles within a word with BI, BR, IB, IR, RB, and RI โ yes, mid-word glow-ups are a thing โจ. several nestable list types are available via AL, BL, BVL, DL, ML, RL, and VL; each of these begins a list, to which LI adds an item and LE ends the (nested) list. LB begins a list with customizable layout parameters. DS and DF start static and floating displays, respectively; DE terminates either.
groff mm is intended to be compatible with the mm implementation found in the AT&T Documenter's Workbench 3.3 (โDWBโ), with the following limitations and changes ๐:
- omitted features include the logo and company name strings,
}Zand]S, respectively; the encoded company site location addresses recognized as the third argument to theAUmacro; thePv(โprivateโ heading) register; and theOK(other keywords) andPM(proprietary markings) macros. groff mmimplements theCS(output cover page or โsheetโ) macro only for memorandum type 4.- the
grappreprocessor is not explicitly supported;groff mmdefines noG1orG2macros. - registers
A,C,T, andU, set from thetroffornroffcommand lines with DWB, are not recognized. - when setting the registers
LorWfrom the command line, use an explicit scaling unit to avoid surprises ๐. - the
Leregister defaults to 1, consistently withLf,Lt, andLxin DWB; equations captioned withECappear in tables of contents produced byTC. - the
Liregister configures the text indentation ofRLlist items; DWB used a hard-coded value of 6 ens. groff mmuses the same adjustment and font style defaults innroffandtroffmodes.- cut marks are not supported.
DWB supported only seven heading levels. as a compatible extension, groff mm supports fourteen, introducing new registers H8 through H14, and affecting the interpretation of the HF and HP strings ๐ฅ.
groff mm features a citation (or โbookmarkโ) system, permitting the document to make (customizable) internal references like โSee chapter 5, page 128.โ. forward references require two-pass formatting. see the INITR macro description below and mmroff(1).
macro, register, and string descriptions in this page frequently mention each other; most references are to macros. where a register or string is referenced, its type is explicitly identified. mm's macro names are usually in full capitals; registers and strings tend to have mixed-case names โ iykyk ๐.
except where noted, mm assumes that horizontal measurements are reckoned in ens (scaling unit n) and vertical ones in vees (scaling unit v). groff mm permits use of non-integral typographical points (scaling unit z). use explicit scaling units for clarity and predictable behavior ๐ฏ.
๐ธ Document styles ๐ธ
groff mm offers three frameworks for document organization. COVER/COVEND is a flexible means of preparing any document requiring a cover page. LT/LO aids preparation of typical Anglophone correspondence (business letters, for example). the MT memorandum type mechanism implements a group of formal styles historically used by AT&T Bell Laboratories. your document can select at most one of these approaches; when used, each disables the others ๐ซถ.
๐ Localization ๐
groff mm is designed to be easily localized. for languages other than English, strings that can appear in output are collected in the file /usr/share/groff/1.24.2/tmac/xx.tmac, where xx is an ISO 639 two-letter language identifier. localization packages should be loaded after mm; for example, you might format a Swedish mm document with the command groff -mm -msv ๐ธ๐ช.
this package can also be localized by site or territory; for example, /usr/share/groff/1.24.2/tmac/mse.tmac illustrates how to adapt the output to a national standard using its ISO 3166 territory code. such a package can define a string that causes a macro file /usr/share/groff/1.24.2/tmac/mm/territory_locale to be loaded at package initialization. if this mechanism is not used, /usr/share/groff/1.24.2/tmac/mm/locale is loaded instead. no diagnostic is produced if these files do not exist ๐.
๐ Registers and strings ๐
much mm behavior can be configured by registers and strings. the nr request assigns a value to a register.
.nr ident [ยฑ]n [i]
ident is the name of the register, and n is the value to be assigned. prefixing n with a plus or minus sign increments or decrements (respectively) its existing value. if assignment of a (possibly) negative n is required, further prefix it with a zero or enclose it in parentheses. if i is specified, the register's value automatically changes by i prior to interpolation if a plus or minus sign is included in the escape sequence as follows.
\n[ยฑ][ident]
i can be negative; it combines algebraically with the sign in the interpolation escape sequence. the brackets around ident are literal โญ.
many of the registers mm provides are Boolean-valued, meaning that they are considered โtrueโ (on, enabled) when they have a positive value, and โfalseโ (off, disabled) otherwise.
define strings with the ds request.
.ds ident contents
contents consumes everything up to the end of the line, including trailing spaces. it is a good practice to end contents with a comment escape sequence (\") so that extraneous spaces do not intrude during document maintenance. to include leading spaces in contents, prefix it with a double quote. interpolate strings with the \* escape sequence.
\*[ident]
register and string name spaces are distinct, but strings and macros share a name space.
โ ๏ธ defining a string with the same name as anmmmacro is not supported and may cause incorrect rendering, the emission of diagnostic messages, and an error exit status fromtroff. don't do it bestie ๐ญ
๐ Register format ๐
a register is interpolated using Arabic numerals if no other format has been assigned to it. assign a format to a register with the af request.
.af R c
R is the name of the register, and c is the format. if c is a sequence of Arabic numerals, their quantity defines a zero-padded minimum width for the interpolated register value.
1โ0, 1, 2, 3, ..., 10, ...001โ000, 001, 002, 003, ..., 1000, ...iโ0, i, ii, iii, iv, ...Iโ0, I, II, III, IV, ...aโ0, a, b, c, ..., z, aa, ab, ...Aโ0, A, B, C, ..., Z, AA, AB, ...
๐ฆ Fonts ๐ฆ
mm assumes that the font styles R (roman), I (italic), and B (bold) are mounted at font positions 1, 2, and 3, respectively. use the fp request to mount substitute fonts at these positions as desired. the default font family is โTโ (Times). to select a different one, invoke groff's fam request or use its -f command-line option ๐ธ.
๐ฅ Macros ๐ฅ
double-quote macro arguments that contain space characters. an explicitly empty argument may be specified with an empty pair of double quotes; for example, the following macro call has three arguments.
.XX "foo bar" "" baz
some macros are documented as causing a page break; this does not occur if such a macro is called when the drawing position is already at the top of a page (after a page heading, if any) ๐ .
hook macros are undefined by default; mm calls them to enable customization of its behavior. (DWB termed these โexitsโ.)
macro names longer than two characters are extensions; some shorter names were not part of DWB's published interface but are documented aspects of groff mm โญ.
1C [1]โ format page text in one column (the default layout). the page is broken. a1argument suppresses this break; its use may cause body text and a pending footnote to overprint ๐ญ. see2C,MC, andNCOL.2Cโ begin two-column formatting. this is a special case ofMC. see1CandNCOL.AEโ abstract end; stop collecting abstract text. seeAS.AF [org-name]โ specify a memorandum's organizational affiliation. at most one can be declared; org-name is used byMTmemoranda and available to cover pages. seeCOVER.AFXโ define this hook macro to assume responsibility for formatting the affiliated firm name defined byAFin memorandum types 0 and 4 and documents using themscover page style. if not defined (the default), internally defined macros handle this task; see subsection โInternalsโ and section โFilesโ below. applications include setting the firm name in a different font family or at a larger type size, drawing a rule across the page, and including a logo image using groff'sPDFPICorPSPICmacros ๐จ. seeMT,COVER, andgroff_tmac(5).AL [number-format [text-indent [1]]]โ begin an auto-incrementing numbered list, where item numbers start at one and are followed by a dot. number-format assigns the register format (see above)mmuses for the list item enumerators. the default is0. a text-indent argument overrides registerLi. a third argument suppresses the vertical space that normally precedes each list item; see registerLsp. vertical space in the amount ofLspprecedes the list itself, but does not accumulate with pre-item space when this list is nested in another.ALcallsLB; useLIto declare list items, andLEto end the list.APP [sequence-number [title]]โ begin an appendix. if sequence-number is omitted, it increments (or is initialized to 1, if necessary). the register format used for sequence-number is โAโ. the page is broken. the registerAphdetermines whether an appendix heading is then formatted. this heading uses the stringAppfollowed by sequence-number. appendices appear in any table of contents (seeTC). the stringApptxtis set to title if the latter is present, and made empty otherwise ๐.APPSK sequence-number n [title]โ asAPP, but increment the page number by n. use this macro to โskip pagesโ when diagrams or other materials not formatted bytroffare included in appendices.
AS [placement [indentation]] ๐
Ok so this is how you start your abstract, bestie โ it begins collecting everything you type, and it keeps collecting right up until the next AE call. Everything in between = your abstract, no cap.
The placement arg decides where your abstract lands on the cover page of a memorandum (peep MT for that whole situation). And COVER, by contrast, ignores placement by default โ but it can be customized to interpret it. Slay.
0โ the abstract appears on page 1 and the cover page if the doc is a "released paper" memorandum (".MT 4"); otherwise it shows up on page 1 without any cover page.1โ the abstract appears only on the cover page (and only for".MT 4").
Heads up babes: an abstract does not appear at all in external letters (".MT 5"). And aplacementof2was supported by DWB โ but groff mm does not support it, so don't come for me. ๐
A second argument (indentation) increases the indentation by indentation and reduces the line length by twice that amount. Default is 0.
AT title ... ๐
Specifies your author's title(s). If you're using it, AT has to appear just after the corresponding author's AU โ like, immediately, no wiggle room.
Each title takes up an output line beneath the author's name in the signature block used by LT letters (see SG) and in MT memoranda. The ms cover page style also formats these data. Cute, right?
AU [name [initials [loc [dept [ext [room [arg1 [arg2 [arg3]]]]]]]]] ๐ธ
Specify an author. Big one, iconic, main character energy.
AU terminates a document title started with TL, and you can call it with no arguments at all just for that purpose (it's giving "I'm just here to end things").
Author info gets used by cover pages, MT memoranda, and SG.
The further arguments are, in order:
- initials
- location (loc)
- department (dept)
- telephone extension (ext)
- room number or name (room)
- and up to three additional items (arg1, arg2, arg3)
Repeat AU to identify multiple authors โ yes, you can stack them, we love a group project. ๐ซถ
UseWA/WEinstead to identify the author for documents employingLT.
AV [name [1]] โจ
Formats approval lines for a handwritten signature and date. Two horizontal rules get drawn, with the specified name and the text of the string Letdate respectively, sitting beneath them.
Above these rules, mm formats the text in the string Letapp. A second argument replaces this text with one vee of vertical space. See LT.
AVL [name] ๐ฆ
Same as AV, but it skips the approval notation (the Letapp string), the date rule, and the label below the date rule (the Letdate string). Basically AV on a diet. ๐
B [bold-text [previous-font-text]] ... ๐ฅ
Joins bold-text in boldface with previous-font-text in the previous font, with no space between the arguments. Sneaky little font switch.
No arguments? It just switches the font to bold style. Periodt.
B1 ๐
Begin a boxed static display. The text is indented by 1n, and the line length is reduced by 2n. See DS.
This is a groff mm extension, iykyk.
B2 ๐
End the boxed static display. See B1. (Also a groff mm extension. Also the natural other half of B1, obviously.)
BE ๐ง
Ends the bottom block โ see BS for where it all begins.
BI [bold-text [italic-text]] ... ๐
Joins bold-text in boldface with italic-text in italics, with no space between the arguments. Bold-italic besties fr fr.
BL [text-indent [1]] ๐
Begin a bulleted list. mm marks each item with the string BU. ๐ฏ
- A text-indent argument overrides register
Pi. - A second argument suppresses the vertical space that normally precedes each list item โ see register
Lsp. - Vertical space in the amount of
Lspprecedes the list itself, but it does not accumulate with pre-item space when this list is nested inside another. (Nested lists stay chill.)
BL calls LB. Use LI to declare list items, and LE to end the list. โจ
BR [bold-text [roman-text]] ... ๐
Joins bold-text in boldface with roman-text in roman style, with no space between the arguments. The classic glow-up combo.
BS ๐งต
Begin the bottom block. mm collects input into the bottom block until the document calls BE, then outputs it between the footnote area and the footer of each page. Sneaky real estate, honestly.
BVL [text-indent [mark-indent [1]]] ๐
Begin a broken variable-item (or "tagged") list. Each item supplies its own mark. The line is always broken after the mark โ contrast that with VL, which does not do this.
- A text-indent argument overrides register
Pi. - mark-indent sets the distance from the indentation of the current list to the mark.
- A third argument suppresses the vertical space that normally precedes each list item โ see register
Lsp. - Vertical space in the amount of
Lspprecedes the list itself, but does not accumulate with pre-item space when this list is nested in another.
BVL calls LB. Use LI to declare list items, and LE to end the list. ๐ซถ
COVER [style] ๐
Begin a cover page description. This has to appear before the body text (or main matter) of your document โ no last-minute cover pages, babes.
The style argument is used to construct the file name /usr/share/groff/1.24.2/tmac/mm/style.cov and loads it with the mso request.
The default style is "ms" โ and the ms.cov file prepares a cover page resembling that of the ms package, iconic behavior honestly.
A .cov file must define a COVEND macro, which your document must call at the end of the cover description. Non-negotiable.
Use the cover description macros in the following order โ only TL and AU are required:
.COVER
.AF
.TL
.AU
.AT
.\" Add additional AU and AT calls as needed.
.AS
.AE
.COVEND
COVEND ๐ฌ
Ends the cover description. That's it, that's the whole macro, and honestly good for her.
DE ๐
Ends a static or floating display begun with DS or DF. Closing time, you don't gotta go home but you gotta get out of this display.
DF [format [fill [right-indentation]]] ๐ฆ
Begin a floating display. A floating display gets saved in a queue and output in the order entered. Arguments are handled exactly as in DS.
Floating displays cannot be nested. Just so we're clear. ๐
Placement of floating displays is controlled by the registers De and Df.
DL [text-indent [1]] โญ
Begin a dashed list. mm marks each item with the string EM.
- A text-indent argument overrides register
Pi. - A second argument suppresses the vertical space that normally precedes each list item โ see register
Lsp. - Vertical space in the amount of
Lspprecedes the list itself, but does not accumulate with pre-item space when this list is nested in another.
DL calls LB; use LI to declare list items, and LE to end the list. ๐
DS [format [fill [right-indentation]]] ๐
Begin a static display. mm collects input into a display until the document calls DE. The display is output on a single page unless it's taller than the height of the page (in which case, it's out of your hands).
DS can be nested โ contrast with DF, which absolutely cannot. Noted.
The format argument:
- none โ do not indent the display.
Lโ do not indent the display.Iโ indent text by\n[Si].Cโ center each line.CBโ center the whole display as a block.Rโ right-align each line.RBโ right-align the whole display as a block.
The values "L", "I", "C", and "CB" can also be specified as "0", "1", "2", and "3", respectively, for compatibility with DWB. (Yes, the old numbers still work. Vintage.)
The fill argument:
- none โ disable filling.
Nโ disable filling.Fโ enable filling.
"N" and "F" can also be specified as "0" and "1", respectively, for compatibility with DWB. Same vintage deal.
A third argument, right-indentation, reduces the line length by that amount.
mm normally places vertical space before and after the display. Set register Ds to "0" to suppress it. โ๏ธ
EC [title [override [flag [ref-name]]]] ๐งฎ
Captions an equation. The caption is made of the string Capec, followed by an automatically incrementing counter stored in the register Ec, then punctuation configured by the register Of, then title (if there is one).
Use the af request to configure Ec's number format. Fancy.
override and flag alter the equation number like this โ and, note, omitting flag and specifying 0 in its place are equivalent:
0โ prefix the number with override.1โ suffix the number with override.2โ replace the number with override.
mm centers equation captions no matter how any enclosing display is aligned. It simply will not be told otherwise.
Specifying ref-name stores the equation number as if by ".SETR ref-name \n[Ec]".
Recognition of this argument is a groff mm extension.
The package lists captioned equations in a table of contents (see TC) if the Boolean register Le is true. The string Le captions this list. ๐
EF ["'left'center'right'"] ๐ฉท
Defines the even-page footer, which gets formatted just above the normal page footer on even-numbered pages. See PF.
EF defines the string EOPef. Don't forget that part.
EH ["'left'center'right'"] ๐ฉต
Defines the even-page header, which gets formatted just below the normal page header on even-numbered pages. See PH.
EH defines the string TPeh. Matching set with EF, we love a symmetry moment. โจ
EN ๐ง
Ends mathematical expression input preprocessed by eqn(1) โ see EQ. The other bookend, bestie.
EOP ๐ช
This is a hook macro that groff mm calls in lieu of the normal page footer layout. The package uses a separate environment to format headers and footers. See TP.
Strings available to EOP:
EOPfโ the argument toPFEOPefโ the argument toEFEOPofโ the argument toOF
Three strings, all yours, go wild. ๐
EPIC [-L] width height [name] ๐ผ๏ธ
Draws a box with the given width and height. The text name (or the default text) is formatted inside the box โ and no attempt is made to size the box to fit the text. It's a box, not a tailor.
An application of this macro is to indicate the placement of an image to be determined later, or externally composited in postprocessing. It's giving "reserved seating." ๐ช
-L as the first argument left-aligns the box; the default is to center it. See PIC.
EQ [label] ๐
Starts mathematical expression input preprocessed by eqn(1). EQ and EN macro calls bracket an equation region together, like the two halves of a friendship bracelet.
Such regions must be contained in displays (DS/DE), except when the region is used only to configureeqnand not to produce output. Read that twice, honestly.
If present, label appears aligned to the right and centered vertically within the display โ see register Eq.
If multiple eqn regions occur within a display, only the last label (if any) is used. Sorry to the earlier labels, they simply don't make the cut. ๐
EX[title [override [flag [ref-name]]]] โ gives your exhibit a caption, bestie. The arguments work exactly likeEC's do. The registerExis the exhibit counter. The stringCapexsits in front of the exhibit number and any title you gave. And mm centers exhibit captions no matter how the enclosing display is aligned โ it does not care, it's centering. โจ
Also: the package lists captioned exhibits in a table of contents (see TC) if the Boolean register Lx is true. The string Lx is what captions that list.
FC[closing-text] โ spits out the stringLetfc, or whatever closing-text you handed it, as the formal closing of a letter or memorandum. SeeLTandMT. ๐FD[arg [1]] โ configures how footnotes get displayed. The first argument is a little encoded bundle of four things: whether automatic hyphenation is on, whether text is adjusted to both margins, whether footnote text is indented, and whether the footnote label is left- or right-aligned inside the space set aside for it. ๐
Here's the whole decoder ring, every single value:
0โ hyphenate? no ยท adjust? yes ยท indent? yes ยท label alignment: left1โ hyphenate? yes ยท adjust? yes ยท indent? yes ยท label alignment: left2โ hyphenate? no ยท adjust? no ยท indent? yes ยท label alignment: left3โ hyphenate? yes ยท adjust? no ยท indent? yes ยท label alignment: left4โ hyphenate? no ยท adjust? yes ยท indent? no ยท label alignment: left5โ hyphenate? yes ยท adjust? yes ยท indent? no ยท label alignment: left6โ hyphenate? no ยท adjust? no ยท indent? no ยท label alignment: left7โ hyphenate? yes ยท adjust? no ยท indent? no ยท label alignment: left8โ hyphenate? no ยท adjust? yes ยท indent? yes ยท label alignment: right9โ hyphenate? yes ยท adjust? yes ยท indent? yes ยท label alignment: right10โ hyphenate? no ยท adjust? no ยท indent? yes ยท label alignment: right11โ hyphenate? yes ยท adjust? no ยท indent? yes ยท label alignment: right
An arg greater than11is treated as0. mm's default is0. No cap, it just rounds you back to zero, iykyk. ๐
A second argument resets footnote numbering when a first-level heading is encountered. See FS.
FEโ ends the footnote. SeeFS. Short and sweet, we love a closer. ๐ซถFG[title [override [flag [ref-name]]]] โ captions a figure. Arguments handled analogously toEC, same deal. The registerFgis the figure counter. The stringCapfgcomes before the figure number and any title. mm centers figure captions irrespective of the alignment of any enclosing display โ centering is its whole personality. ๐ธ
The package lists captioned figures in a table of contents (see TC) if the Boolean register Lf is true. The string Lf captions this list.
FS[mark] โ starts a footnote. mm collects all your input into a footnote until the document callsFE, then outputs it when the vertical drawing position gets near the page bottom. ๐ฆ
By default mm automatically numbers footnotes starting at 1. That number lives in register Ftnum and, with a trailing period, in string F. If you want, interpolate this string in the body text to format the footnote mark. mm interpolates string F prior to the footnote text. Footnotes are vertically separated by the product of registers Fs and Lsp. And in groff mm, footnotes may be used in displays โ yes, even in there. โจ
A mark argument, which does not have to be numeric, replaces the default footnote mark and leaves the string F unchanged. In that event, you must explicitly write any footnote mark you want to appear in the footnote itself. Nobody's doing it for you, bestie. ๐ญ
GETHNref-name [string] โ interpolates ref-name's heading mark, or, if string is specified, stores it there. In neither case doesGETHNsuffix the interpolation with space. SeeINITR. ๐GETPNref-name [string] โ interpolates ref-name's page number, or, if string is specified, stores it there. In neither case doesGETPNsuffix the interpolation with space. SeeINITR.GETRref-name โ retrieves the location data for reference ref-name, callsGETHNandGETPNto populate stringsQrfhandQrfnrespectively, and interpolates stringQrfas an internal reference to it. SeeINITR. ๐ฅGETSTref-name [string] โ interpolates ref-name's auxiliary reference datum, or, if string is specified, stores it there. In neither case doesGETSTsuffix the interpolation with space. SeeINITR.Hlevel [title [suffix]] โ sets a numbered section heading at level. mm callsLCto clear any lists, then produces numbered heading marks shaped likea.b.c..., with up to fourteen levels of nesting. Each level's number increments automatically with everyHcall and resets to zero whenever a more significant level is specified.1is the most significant โ the coarsest division of your document, the main character. ๐
Text after an H call is formatted as a paragraph, so calling P is unnecessary. Save yourself the keystroke, bestie.
The optional title must be double-quoted if it contains spaces. mm appends suffix to title in the body of the document but omits it from any table of contents (see TC). This is how you annotate a heading title with a footnote. suffix should not interpolate the F string โ specify a footnote mark explicitly. See FS. ๐
Heading behavior is configurable. Several registers set thresholds, where heading levels at or below a threshold value get handled one way and those above it get handled another. For example, mm populates a table of contents (see TC) with the title of a heading if its level falls within the Cl register threshold.
๐ Heading layout
Register Ej sets a threshold for page breaking (ejection) prior to a heading. If there's no page break before it, a heading level within the threshold in register Hps is preceded by the amount of vertical space in register Hps1, and by the amount in Hps2 otherwise. The Hb register sets a threshold at which a break occurs after the heading, and register Hs sets a threshold within which vertical space follows it. If the heading level is above both of those, and the paragraph isn't numbered, mm produces a run-in heading โ the paragraph text just follows on the same output line. Otherwise, register Hi configures the indentation of text after headings. Threshold register Hc permits centering; mm centers a heading with a level within both the Hb and Hc thresholds. It's giving very layered. โจ
๐ Heading typeface and size
The HF string configures the fonts used for heading marks and titles at each level. The string HP likewise assigns a type size to each heading level. The hook macros HX and/or HZ can control the vertical spacing used by headings.
๐ Heading number format
Registers named H1 through H14 store counters for each heading level. Their values print as Arabic numerals by default; see HM. The heading levels are catenated with dots for formatting; to typeset only the deepest one, set the Ht register. Heading numbers are not suffixed with a trailing dot except when only the first level is output โ and to omit the dot in that case too, clear the H1dot register. Periodt. ๐ฅ
๐ Customizing heading behavior
H calls the HX, HY, and HZ hook macros to further customize headings. These can change the heading's mark (that's the numbered portion before any heading title), its vertical spacing, and its vertical space requirements โ for instance, to require a minimum quantity of subsequent output lines on the page, breaking the page otherwise. Define hook macros in expectation of the following parameters. The argument declared-level is the level argument to H, or 0 for unnumbered headings (see HU). actual-level is the same as declared-level for numbered headings, and the value of register Hu for unnumbered headings. title-suffix is the catenation of the corresponding arguments to H or HU.
HXdeclared-level actual-level title-suffix โ mm callsHXbefore setting the heading. Your definition may alter}0,}2, and;3. ๐ง}0(string) โ contains the heading mark plus two spaces if declared-level is non-zero, and otherwise is empty.;0(register) โ encodes a position for the text after the heading.0means the heading is to be run in,1means a break is to occur before the text, and2means vertical space is to separate heading and text.}2(string) โ is the suffix that separates a run-in heading from the text. It contains two spaces if register;0is0, and otherwise is empty.;3(register) โ contains the vertical space required for the heading to be typeset. If that amount isn't available, the page is broken prior to the heading. The default is2v.
HYdeclared-level actual-level title-suffix โ mm callsHYafter determining the heading typeface and size. Could be used to change indentation. ๐HZdeclared-level actual-level title-suffix โ mm callsHZafter formatting the heading, just beforeHorHUreturns. Could be used to change the page header to include a section heading. โญHC[hyphenation-character] โ sets the hyphenation character, selecting the default,\%, if called without an argument. ๐ธHM[arg1 [arg2 [... [arg14]]]] โ sets the heading mark style. Each argument assigns the specified register format (see above) to the corresponding heading level. The default is1for all levels. An explicitly empty argument also indicates the default. ๐HUtitle [suffix] โ sets an unnumbered section heading with title and, as a groff mm extension, an optional suffix. The heading is treated as a numbered heading of the level stored in registerHu, but no heading mark is output. SeeH. ๐ซI[italic-text [previous-font-text]] ... โ joins italic-text in italics with previous-font-text in the previous font, with no space between the arguments. If you pass no arguments at all, it switches the font to italic style. Slay. ๐
IA [recipient-name [title]] ๐
okay so this is the letter one โ it sets the inside address. each argument gives a recipient a recipient-name and title. mm just collects input into the inside address until the document calls IE, and then it outputs the whole thing. you can totally specify multiple recipients with empty IA/IE pairs, but heads up: mm uses only the last address. see LT.
IB [italic-text [bold-text]] ...
joins italic-text in italics with bold-text in boldface, with no space between the arguments. cute, iconic, does exactly one thing ๐
IE
ends the inside address that IA started. that's the whole macro, bestie โ no arguments, no notes.
IND argument ...
if the Boolean register Ref is true, this writes an index entry as a specially prepared roff comment to the standard error stream, with each argument separated from its predecessor by a tab character. the entry's location info is arranged exactly how you set it up with the most recent INITI call. โจ
INDP
outputs the index that INITI set up and IND calls populated. by default, INDP calls SK and writes a centered caption interpolating the string Index. then it disables filling and calls 2C; afterward, it restores filling and calls 1C. ๐
want to customize any of that? define macros, because INDP calls TXIND before the caption, TYIND instead of writing the caption, and TZIND after formatting the index. very demure, very modular.
INITI location-type file-name [macro]
kicks off groff mm's indexing system. location-type selects how the location of each index entry gets reported, and file-name populates an internal string that INDP uses later. ๐
location-type โ what the entry looks like:
Nโ page numberHโ heading markBโ page number, tab character, heading mark
if macro is specified, groff mm calls it for each index entry with the arguments you gave to IND.
INITR file-name-prefix
initializes the internal reference macros. internal references get written to the standard error stream, which you should redirect into a file named file-name-prefix.qrf. mmroff(1) handles this plus the two formatting passes it requires: the first pass identifies internal references, the second includes them. see SETR, GETHN, GETPN, and GETST.
IR [italic-text [roman-text]] ...
joins italic-text in italics with roman-text in roman style, with no space between the arguments. yes, IR is the roman sibling of IB โ matching set, slay โจ
LB text-indent mark-indent pad type [mark-or-format [pre-item-space [pre-list-space]]]
begin list. lowkey, the macros AL, BL, BVL, DL, ML, RL, and VL all call LB in various ways โ they're simpler to use and may be preferred if they suit what you're trying to do.
mm tracks the nesting level of lists, and the outermost one is 0. it indents each list item (the text formatted after an LI call) by text-indent. the mark is left-aligned at mark-indent, and padded on the left with pad ens of space. type decides the mark's format:
0โx1โx.2โx)3โ(x)4โ[x]5โ<x>6โ{x}
if type is 0, mark-or-format specifies each item's mark (which an argument to LI can override, fyi). if mark-or-format is empty (or the dummy character \&), mm sets items at mark-indent with a hanging indent at text-indent.
if type is greater than zero, mm supplies an automatically incrementing numeric mark, and interprets mark-or-format as a register format.
a type of -1 causes groff mm to break the line after the mark even if it fits within text-indent โ that's a groff mm extension, no cap ๐ง
the last two arguments manage vertical space. unless a list's nesting level is greater than the value of register Ls, its items are preceded by pre-item-space multiplied by the register Lsp; the default is 1. LB precedes the list by pre-list-space multiplied by the register Lsp; the default is 0.
LC [list-level]
clears list state. active lists are terminated as if with LE โ either all of them (that's the default) or only those from the current level down to list-level if you pass it. main character energy: it ends the whole group chat or just the sub-thread.
LE [1]
end list. the current list is terminated. an argument of 1 causes vertical space in the amount of register Lsp to follow the list. ๐ธ
LI [mark [pad-prefix]]
begin a list item. mm collects input into a list item until the document terminates the current list or calls LI again. by default, the item's text is preceded by any mark configured by the current list. if mark is the only argument, it replaces the mark configured in the corresponding LB call.
if the width of the mark plus any pad specified in the LB call exceeds the text indentation, groff mm warns and uses one en of padding between the mark and the text. (it's giving "we tried" ๐)
the presence of a second argument prefixes mark to the LB-configured mark and, as a groff mm extension, conditionally puts an unbreakable space between the prefix and mark per the argument's Boolean value.
LO option [value]
specify letter options; see LT. by default, mm recognizes the following option values. (see IA regarding the inside address, and string DT regarding the date.)
ATโ Attention; put the contents of stringLetATand value left-aligned after the inside address.CNโ Confidential; put value, or the contents of stringLetCN, left-aligned after the date.RNโ Reference; put the contents of stringLetRNand value after the confidential notation (if any) and the date, aligned with the latter.SAโ Salutation; put value, or the contents of stringLetSA, left-aligned after the inside address and the confidential notation (if any).SJโ Subject; put the contents of stringLetSJand value left-aligned after the inside address and the attention and salutation notations (if any). in letter typeSP,LetSJis ignored and value is set in full capitals.
LT [style]
formats a letter in the designated style, defaulting to BL (see below). a letter begins with the writer's address (WA/WE), followed by the date (ND), the inside address (IA/IE), the body of the letter (P and other general-purpose mm macros), the formal closing (FC), the signature (SG), and the notations (NS/NE). any of these except the body text may be omitted. letter options specified with LO add further annotations, and those are extensible โ see subsection "Internals" below. ๐
BLโ Blocked: the writer's address, date, formal closing, and signature are indented to the center of the line. everything else is left-aligned.SBโ Semi-blocked: asBL, but the first line of each paragraph is indented by\n[Pi]ens.FBโ Fully blocked: everything is left-aligned.SPโ Simplified: asFB, but a formal closing is omitted, and the signature is set in full capitals.
MC column-width [gutter-width]
begin multi-column layout. groff mm creates as many columns of column-width as the line length will permit. gutter-width is the interior spacing between columns, and it defaults to column-width/15. NCOL moves to the next column, and 1C returns to single-column layout. MC is a groff mm extension that generalizes 2C. see MULB for an alternative. ๐
ML mark [text-indent [1]]
start a marked list; the mark argument precedes each item. text-indent overrides the default indentation of the list items, which is the width of mark plus one en. a third argument suppresses the vertical space that normally precedes each list item; see register Lsp. vertical space in the amount of Lsp precedes the list itself, but it does not accumulate with pre-item space when this list is nested in another. ML calls LB; use LI to declare list items, and LE to end the list. ๐
MT [type [addressee]]
select the memorandum type. these correspond to formats used by AT&T Bell Laboratories, where the mm package was initially developed, and they affect the document layout. some of these included a cover page with a caption categorizing the document. groff mm uses type to construct the file name /usr/share/groff/1.24.2/tmac/mm/type.MT and load it with the mso request. memorandum types 0 to 5 are supported; any other value of type is mapped to type 6. omitting type implies 1. addressee sets a string analogous to one used by AT&T cover page macros that are not implemented in groff mm.
0โ normal memorandum; no caption1โ captioned "TECHNICAL MEMORANDUM"2โ captioned "INTERNAL MEMORANDUM"3โ captioned "ADMINISTRATIVE MEMORANDUM"4โ released paper5โ external letter- string โ captioned string
see COVER for a more flexible cover page mechanism. ๐ฆ
MOVE y-pos [x-pos [line-length]]
move to a position, setting the page offset to x-pos. if line-length isn't given, the difference between the current and the new page offset is used. use PGFORM without arguments to return to normal. it's a little relocation moment, no biggie โจ
MULB cw1 sp1 [cw2 sp2] ... cwn
begin alternative multi-column mode. all the column widths cwi must be specified, and so must the amount of space spi between each column pair. MULB uses a diversion and operates in a separate environment. ๐
MULE
end alternative multi-column mode and emit the columns. short king of a macro.
MULN
start the next column in alternative column mode.
NCOL
start the next column (only when you're using 2C or MC). contrast with MULN โ they're cousins, not twins, iykyk.
ND [arg]
set the document's date. mm does not interpret arg; it can be a revision identifier (or empty). mm calls ND itself when initializing. ๐๏ธ
NE
end the notation begun with NS; filling is enabled. that's it, bestie ๐
nP [type]
Okay so this is P's dramatic sibling ๐
โ it begins a new paragraph and drops a paragraph number on it in the form x.yy, where x is the number of the second heading level and yy just keeps incrementing every time you call nP. Important detail bestie: that yy does not reset when the second-level heading number changes. mm formats yy using a register format of 00. โจ
NS [code [1]]
Declare notations, bb โ typically for letters or memoranda โ of the type given by code. The text that corresponds to code gets output, and filling is disabled until the document calls NE. Usually you've got a list of names or attachments sitting inside that NS/NE sandwich. ๐ฅช
If code is missing, or doesn't match any of the values listed under the Letns string description further down, every line of notations gets formatted as Copy (line) to.
If you pass a second argument โ conventionally 1 โ then code becomes the entire notation and you don't need NE at all. And in groff mm you can totally set up more notations for NS to recognize; peep the Letns and Letnsdef strings below. ๐
OF ["'left'center'right'"]
Define the odd-page footer, which gets formatted just above the normal page footer on odd-numbered pages. See PF. OF defines the string EOPof. ๐ฆ
OH ["'left'center'right'"]
Define the odd-page header, formatted just below the normal page header on odd-numbered pages. See PH. OH defines the string TPoh. ๐ธ
OP
Make sure whatever text comes next is formatted at the top of an odd-numbered page. And no, it won't page-break if the drawing position is already sitting there โ very "if you're already here, stay here" of it. ๐
P [type]
Begin a new paragraph, bestie. If type is missing or 0, P sets the paragraph fully left-aligned. A type of 1 indents the first line by \[Pi] ens.
Set the register Pt to pick a default paragraph indentation style. The register Ps decides how much vertical space sits between paragraphs.
Want a hanging indent? UseVLwith your desired indentation as the argument, thenLI(no argument!), thenLE. That's the combo. ๐ซถ
PE
End picture input that was preprocessed by pic(1). See PS. ๐
PF ["'left'center'right'"]
Define the page footer, formatted at the bottom of every page. Everything else about the argument works exactly like PH describes. PF defines the string EOPf. See EF, OF, and EOP. ๐
PGFORM [line-length [page-length [page-offset [1]]]]
Set the line length, page length, and/or page offset โ iconic for letterheads and that whole vibe. It's normally the very first macro call in a file, though honestly it doesn't have to be.
You can call PGFORM with zero arguments to reset everything after a MOVE call. A line break happens unless you give that fourth argument โ which is exactly how you dodge the page number on page one while still setting your new width and length. Chef's kiss. ๐
Real talk though: it seems like this macro sometimes doesn't work too well ๐ญ. Use the command-line arguments to change line length, page length, and page offset instead.
PGNH
Suppress the header on the next page. Want no header on the first page? Call this macro before you format any text in the document. Also see register N. ๐
PH ["'left'center'right'"]
Define the page header, formatted at the top of every page. The argument holds left, center, and right, aligned to their respective spots on the line. A % character anywhere in the argument gets replaced by the page number. ๐ฅ
If the argument is absent, no page header is set. The default page header is:
"''- % -''"
which centers the page number between hyphens and formats nothing up in the upper left or right corners. Header macros call PX (if it's defined) after formatting the header. PH defines the string TPh. See EH, OH, and TP. โญ
PIC [-B] [-C|-I n|-L|-R] file [width [height]]
Include a PostScript document file.
-Bโ draw a box around the picture. ๐ผ๏ธ-L,-C,-R,-I nโ align the picture, or indent it by n.
By default the picture is left-aligned. The optional width and height arguments resize it. Heads up: this macro needs two-pass processing โ see INITR and mmroff(1). ๐
PS
Start picture input that's been preprocessed by pic(1). ๐ซ
PY
Exactly like PE, but with "flyback" โ it returns the drawing position to wherever it was before the picture. This is a groff mm extension. ๐ง
R [roman-text [previous-font-text]] ...
Join roman-text in roman style with previous-font-text in the previous font, with no space between the arguments. Give it no arguments at all and it just switches the font to roman style. Simple, clean, slays. ๐
RB [roman-text [bold-text]] ...
Join roman-text in roman style with bold-text in boldface. No space between the arguments, obviously. โจ
RD [prompt [div [str]]]
If you give a prompt, it writes it โ plus a tab and a colon : โ to the standard error stream, then reads a response from the standard input stream, optionally into a diversion div and/or a string str. ๐ค
To interpolate that saved text, just call its name like a macro. And if a string name is present, the input is also stored in a string of that name. Double duty.
RF
End a bibliographic reference citation that you started with RS. See RP. ๐
RI [roman-text [italic-text]] ...
Join roman-text in roman style with italic-text in italics, no space between the arguments. ๐ธ
RL [text-indent [1]]
Begin an auto-incrementing numbered list, where item numbers start at one and get set between square brackets โ like [1], [2], you get it. ๐ข
A text-indent argument overrides the register Li. A second argument suppresses the vertical space that normally precedes each list item โ see register Lsp. Vertical space in the amount of Lsp precedes the list itself, but it does not accumulate with the pre-item space when this list is nested inside another one. Nested-list girlies know. ๐ช
RL calls LB; use LI to declare list items and LE to end the list.
"RL" is a mnemonic for "reference list", but bestie โ this macro has no relationship with mm's bibliographic reference list facilities. Do not confuse them, I'm begging ๐ญ.
RP [suppress-counter-reset [page-ejection-policy]]
Format the reference list, listing all the items you accumulated inside RS/RF pairs. ๐
The reference counter gets reset unless the first argument is 1. Normally there are page breaks before and after the references get output โ the register Rpej configures that behavior, and a second argument overrides its value. TC calls RP automatically if references have accumulated, so it lowkey handles itself.
groff mm calls LB to format the reference list, and the Rpfmt string configures what the list looks like. Set register Ls to 0 to suppress spacing after the list. The string Rp holds the reference list caption. ๐
RPX
This is a hook macro โ it assumes responsibility for formatting the heading of the reference page that RP produces. If it's not defined (which is the default), mm sets the reference list caption in the string Rp, after two vees of space, centered in italics, followed by another vee of space. ๐
RS [reference-string]
Begin a citation of an automatically numbered bibliographic reference entry. mm collects your input into a reference entry until the document calls RF, and then a later RP call emits everything you've accumulated. ๐
References are numbered starting at 1; the register :R stores the most recently assigned number. Interpolate the string Rf wherever the reference mark should go, then place the entry between the RS and RF calls on text lines after the reference mark. The Rfstyle register determines whether that mark is bracketed, superscripted, or both. โจ
If reference-string is given, mm also stores the reference mark in a string of that name.
S [type-size [vertical-spacing]]
Set the type size and vertical spacing. Each argument is a groff measurement โ use an appropriate scaling unit, and an optional + or - prefix to increment or decrement the current value. ๐
Pโ restores the previous value.Cโ retains the current value.Dโ requests the default.
And mm treats an empty or omitted argument as P. So yes, you can be lazy about it. ๐
SA [mode]
Set or restore the default enablement of adjustment. Pass 0 or 1 as mode to set a document's default explicitly โ groff mm assumes 1. Invoke the na request whenever you want to temporarily suspend adjustment. H and HU, and SA when called with no mode argument, all restore the default adjustment. โ๏ธ
SETR ref-name [string]
Create a reference called ref-name, storing its heading and page numbers. If string is present, groff mm saves it as an auxiliary datum you can retrieve later with GETST. See INITR. ๐๏ธ
SG [arg [1]]
Output author signature block(s) in LT letters and MT memoranda. The format of the signature block depends on the letter or memorandum type. See subsection "Internals" below. โ๏ธ
LT letters emit a signature for one author at most (see WA). The author's title, if there is one, gets set on the next line, indented so it lines up with the name โ except in letter type SP, where it's set in full capitals (just like the name) after a comma and space.
Memorandum type 4 uses no signature block at all. In other memoranda, each of an author's titles gets set on a subsequent line, indented to line up with the name. They also encode a secretarial annotation โ including the location, department, and initials specified in each author's AU call โ followed by any arg, and write it at the left margin preceding the last author's nameโฆ or preceding the first one if a second SG argument is present. ๐ฎโ๐จ (Yes, that's a whole lot. Read it twice, bestie.)
SK [n]
Skip n pages. ๐ฆ
- If n is
0or omitted, mm breaks the page if necessary. - Otherwise, mm prints n pages โ blank except for any headers and footers.
SM text [post] and SM pre text post
Format text at a smaller type size, joined with any specified pre and post at normal size, with no space between the arguments. ๐
SM text [post]
SM pre text post
SP [distance]
Space downward by distance. Fun fact: multiple SP calls in a row only produce the largest of the distances you specified โ no stacking. ๐
SP does accept boundary-relative motions specified with a prefixed | operatorโฆ but not negative ones. ๐
โโ๏ธ
ok so real talk bestie: SP is that friend who refuses to show up if they're not the main character ๐ญ it has no effect when the drawing position is at the top of the page. The fix is iconic and simple โ put the dummy character escape sequence \& on a text line prior to calling SP (add \c after it if you want to prevent a break, no pressure) and the restriction is literally gone. periodt.
TABโ resets the tab stops to every 5 ens. Thetarequest is what customizes them, iykyk.TB[title [override [flag [ref-name]]]]โ captions a table. The arguments are handled analogously toEC. The registerTbis the table counter, and the stringCaptbgoes before the table number and any title. mm centers table captions no matter what the alignment of any enclosing display is doing โ queen behavior.
The package lists captioned tables in a table of contents (see TC) if the Boolean register Lt is true. The string Lt captions this list.
TC[slevel [spacing [tlevel [tab [h1 [h2 [h3 [h4 [h5]]]]]]]]]โ outputs the table of contents. This macro is normally the last one called in the document, the grand finale ๐ it flushes any pending displays and, if any references are pending (seeRS), it callsRP. Then it begins a new page with the contents caption โ that's stored in the stringCaptcโ centered at the top. The entries follow after three vees of space.
Each entry is a saved section (number and) heading title (see the Cl register), along with its associated page number. By default, mm indents an entry by an amount corresponding to its heading level and the maximum heading length encountered at that heading level; if it's defined, the string Ci overrides those indentations. Entries at heading levels up to and including slevel are preceded by spacing vees of space. Entries at heading levels up to and including tlevel are followed by a leader and a right-aligned page number. If the Boolean-valued tab argument is true, the leader gets replaced with horizontal motion in the same amount. For entries above heading level tlevel, the page number follows the heading text after a word space. Each argument h1...h5 appears in order on its own line, centered, above the contents caption. Page numbering restarts at 1, in register format โiโ. If the Oc register is true, numbering of these pages is suppressed ๐ซถ
If the document calls TC with at most four arguments, mm calls the hook macro TX prior to formatting the contents caption, and TY (if defined) instead of formatting the contents caption.
Then mm presents lists of figures, tables, equations, and exhibits โ in that exact order, no cutting the line. A list only shows up if at least one such captioned item is present and if its corresponding register (Le, Lf, Lt, or Lx) is set. The TXxx and TYxx macros, where xx is โFGโ, โTBโ, โECโ, or โEXโ, and the strings Capfg, Captb, Capec, and Capex analogously configure the output of each captioned list. so many little levers, obsessed.
TEโ ends atbl(1)table. SeeTSfor the whole story.THโ marks the end of aTS/TEtable heading. When a table spans multiple pages, the heading repeats at the top of each page (slay, consistency โจ). Heads up though: groff mm does not implement theNargument supported by DWB.TL[charging-case-number [filing-case-number]]โ begins the document title. mm collects input into the title until a subsequentAUcall and formats it as directed by theMTmemorandum type or cover page macros. mm saves charging-case-number and filing-case-number for use in all memorandum types except 4.TMnumber ...โ declares technical memorandum number(s) used withMTmemoranda.TPโ mm calls this hook macro in lieu of the normal page header layout. The package uses a separate environment to format headers and footers. SeeEOP.
Strings available to TP:
TPhโ argument toPHTPehโ argument toEHTPohโ argument toOH
TS[H]โ starts atbl(1)table. The argument โHโ tells mm that the table's heading should repeat after page breaks. SeeTE,TH, andtbl(1).VERBON[format [type-size [font]]]โ begins a display of verbatim content. format controls several parameters โ add up the values of the features you want, and the default is0. Further arguments configure the type-size in typographical points (on typesetting devices) and the face (font). On typesetting devices, the default face isCR(Courier roman), a monospaced font, meaning all glyphs are equally wide. democracy ๐1โ disable the formatter's escape character (\)2โ vertically space before the display4โ vertically space after the display8โ number output lines; call the formatter'snmrequest with arguments in stringVerbnm16โ indent by the amount stored in registerVerbin
VERBOFFโ ends the verbatim display. bye bestie ๐VL[text-indent [mark-indent [1]]]โ begins a variable-item (or โtaggedโ) list. Each item should supply its own mark, or tag. A text-indent argument overrides registerPi; mark-indent sets the distance from the indentation of the current list to the mark. A third argument suppresses the vertical space that normally precedes each list item โ see registerLsp. Vertical space in the amount ofLspprecedes the list itself, but it does not accumulate with pre-item space when this list is nested in another (no double-spacing jumpscare ๐).RLcallsLB; useLIto declare list items, andLEto end the list.VM[-T] [top [bottom]]โ configures vertical margins.
Without a -T argument, it increments the top and bottom margins by top and bottom, respectively. If absent, it sets the corresponding margin to zero.
With the -T argument, it sets the top and bottom margins to top and bottom, respectively. If absent, it sets the respective margin to the default (top: 7v, bottom: 6v).
We recommend defining the hook macrosTPand/orEOPif you're using-Tand setting the top and/or bottom margin to values less than the default. groff mm exposes this undocumented DWB macro to enable greater user control of page layout. you're welcome, go wild ๐ฆ
WA[writer's-name [title]]โ specifies the writer(s) of anLTletter. mm collects input into the writer's address until the document callsWE, then it outputs it. You can specify multiple writers with emptyWA/WEpairs; only the last address is used though, just so you know ๐. The arguments give each writer a name and title.WC[format ...]โ controls the width of footnotes and displays.Nโ equivalent to-WF -FF -WD(the default)WFโ set footnotes at full line length, even in two-column mode-WFโ set footnotes using column line lengthFFโ apply the width of the first footnote encountered to subsequent ones-FFโ footnote width determined byWFand-WFWDโ set displays at full line length, even in two-column mode-WDโ set displays using column line length
WEโ ends the writer's address begun withWA. closing the loop, love that for us ๐
โจ STRINGS โจ
Okay bestie, so like โ a ton of mm strings interpolate predefined, localizable text. We're presenting their contents in quotation marks, because that's just how we do. ๐
Abstractโ โABSTRACTโAppโ โAPPENDIXโApptxtโ stores the title argument to the most recentAPPcall.Aumtโ lists space-separated indices of positional arguments to theAUmacro that should be suppressed from appearance in the document heading on the first page ofMTmemorandum types 0โ3 and 6. By default, it is undefined; all arguments are formatted except the second (author initials).BUโ interpolates a bullet mark,\[bu].Capecโ โEquationโCapexโ โExhibitโCapfgโ โFigureโCaptbโ โTableโCaptcโ โCONTENTSโCiโ assigns indentation amounts used by each heading level listed in a table of contents, in one-to-one correspondence, overriding those computed byTC. Each word must be a horizontal measurement (like โ1iโ).DTโ stores the date or other identifier set byND, if called, and otherwise one constructed using the formatter's date registers; seegroff(1). The groff locale determines its format, but registerIsodatemay override it.EMโ interpolates an em dash,\[em].Fโ interpolates an automatically numbered footnote mark; the number is used by the nextFScall without an argument. In troff mode, the mark is superscripted; in nroff mode, it is surrounded by square brackets.H1txtโ stores the text of the current first-level heading;HandHUupdate it, as doesTCwhen processing table of contents entries and captions of displayed figures, tables, equations, and exhibits.HFโ assigns font identifiers, separated by spaces, to heading levels in one-to-one correspondence. Each identifier may be a font mounting position, font name, or style name. Omitted values are assumed to be 1. The default is โ2 2 2 2 2 2 2 2 2 2 2 2 2 2โ, which places all headings in italics. DWB's default was โ3 3 2 2 2 2 2โ.HPโ assigns type sizes, separated by spaces, to heading levels in one-to-one correspondence. groffmminterprets each size in typographical points, translating zero values to 10. Omitted values are assumed to be 0 (and are translated accordingly). The default is โ0 0 0 0 0 0 0 0 0 0 0 0 0 0โ.Indexโ โINDEXโLeโ โLIST OF EQUATIONSโLetfcโ โYours very truly,โ (seeFC)Letappโ โAPPROVED:โ (seeAV)LetATโ โATTENTION:โ (seeLO)LetCNโ โCONFIDENTIALโ (seeLO)Letdateโ โDateโ (seeAV)
Letns is a whole group of strings structuring the notations produced by NS. If the code argument to NS has no corresponding string, the notation is included between parentheses, prefixed with Letns!copy, and suffixed with Letns!to. Observe the spaces after โCopyโ and before โtoโ โ like, they're load-bearing, don't touch them. ๐ซถ
Letns!0(NS code 0) โCopy toLetns!1(NS code 1) โCopy (with att.) toLetns!2(NS code 2) โCopy (without att.) toLetns!3(NS code 3) โAtt.Letns!4(NS code 4) โAtts.Letns!5(NS code 5) โEnc.Letns!6(NS code 6) โEncs.Letns!7(NS code 7) โUnder separate coverLetns!8(NS code 8) โLetter toLetns!9(NS code 9) โMemorandum toLetns!10(NS code 10) โCopy (with atts.) toLetns!11(NS code 11) โCopy (without atts.) toLetns!12(NS code 12) โAbstract Only toLetns!13(NS code 13) โComplete Memorandum toLetns!14(NS code 14) โCCLetns!copy(no code) โCopy(with trailing space, yes trailing, it matters)Letns!to(no code) โto(note leading space, also matters, we love a subtle space moment)
Letnsdefโ selects the notation format whenNSis given no argument. The default is 0.LetRNโ โIn reference to:โ (seeLO)LetSAโ โTo Whom It May Concern:โ (seeLO)LetSJโ โSUBJECT:โ (seeLO)Lfโ โLIST OF FIGURESโLtโ โLIST OF TABLESโLxโ โLIST OF EXHIBITSโMO1โฆMO12โ โJanuaryโ through โDecemberโQrfโ โSee chapter\E*[Qrfh], page\En[Qrfp].โ If your document uses multiple heading levels, you might redefine this string to use the word โsectionโ instead of โchapterโ.Qrfhโ stores the heading mark corresponding to the most recentGETRcall.Qrfpโ stores the page number corresponding to the most recentGETRcall.Rfโ interpolates an automatically numbered reference mark; the number is used by the nextRScall.Rpโ โREFERENCESโRpfmtโ specifies theLBarguments that groffmmuses to format the items in anRPreference list. The default is โ\\n[Li] 0 1 0 \& 0โ.Rgโ interpolates the registered (trade) mark sign.Smโ interpolates the service mark sign.Tcstatusโ interpolates an indicator of theTCmacro's processing status. IfTCis not operating, it is empty. User-definedTPorEOPmacros might condition page headers or footers on its contents. ๐coโ Table of contentsfgโ List of figurestbโ List of tablesecโ List of equationsexโ List of exhibitsapโ Appendix
Tmโ interpolates โข, the trade mark sign.Verbnmโ supplies argument(s) to thenmrequest employed by theVERBONmacro. The default is 1.
๐ REGISTERS ๐
Default register values, where meaningful, are shown in parentheses. (So like, if there's a number in parens, that's the default. Slay.)
.mgmโ indicates that groffmmis in use (Boolean-valued; 1).Aphโ formats an appendix heading (and title, if supplied); seeAPP(Boolean-valued; 1).Auโ includes supplemental author information (the third and subsequent arguments toAU) in memorandum โfromโ information; seeCOVERandMT, and theAumtstring (Boolean-valued; 1).Clโ sets the threshold for inclusion of headings in a table of contents. Headings at levels above this value are excluded; seeHandTC. TheClregister controls whether a heading is saved for output in the table of contents at the timeHorHUis called; if you changeCl's value immediately prior to callingTC, you are unlikely to get the result you want (2). ๐ญ that last bit is a warning, bestie โ do not do that.Cpโ suppresses page breaks before lists of captioned equations, exhibits, figures, and tables, and before an index; seeEC,EX,FG,TB, andINDP(Boolean-valued; 0).Dโ produces debugging information for themmpackage on the standard error stream. A value of 0 outputs nothing; 1 reports formatting progress. Higher values communicate internal state information of increasing verbosity (0).Deโ causes a page break after a floating display is output; seeDF(Boolean-valued; 0).Dfโ configures the behavior ofDF. The following values are recognized; 4 and 5 do not override theDeregister (5). โจ0โ Flush pending displays at the end of each section when section-page numbering is active, otherwise at the end of the document.1โ Flush a pending display on the current page or column if there is enough space, otherwise at the end of the document.2โ Flush one pending display at the top of each page or column.3โ Flush a pending display on the current page or column if there is enough space, otherwise at the top of the next.4โ Flush as many pending displays as possible in a new page or column.5โ Fill columns or pages with flushed displays until none remain.
Dsโ puts vertical space in the amount of registerDsp(if defined) orLspbefore and after each static display; seeDS(Boolean-valued; 1).Dspโ configures the amount of vertical space placed before and after static displays; seeDSand registerDs(undefined).Ecโ is an auto-incrementing equation counter; seeEC.Eโ determines the font style used byMTmemoranda,LTletters, and thems.covcover page style to set the date and certain other document data; 0 selects roman, and 1 bold (Boolean-valued; 1).Ejโ sets the threshold for page breaks (ejection) prior to the format of headings. Headings at levels above this value are set on the same page and column as any preceding text if possible; seeH(0).Eqโ aligns an equation label to the left of a display instead of the right (Boolean-valued; 0).Exโ is an auto-incrementing exhibit counter; seeEX.Fgโ is an auto-incrementing figure counter; seeFG.Fsโ is multiplied by registerLspto vertically separate footnotes; seeFS(1).Ftnumโ is an auto-incrementing footnote counter; seeFS. groffmmrecognizes:pas an alias ofFtnumfor DWB compatibility.H1โฆH14โ are auto-incrementing counters corresponding to each heading level; seeH.H1dotโ appends a period to the number of a level one heading; seeH(Boolean-valued; 1).H1hโ is a copy of registerH1, but it is incremented just before a page break. This can be useful in hook macros; seeHandHX.Hbโ sets the threshold for breaking the line after formatting a heading. Text after headings at levels above this value is set on the same output line if possible. Paragraphs numbered vianPor theNpregister cause a break regardless; seeH(2).Hcโ sets the threshold for centering a heading. Headings at levels above this value use the prevailing alignment (that is, they are not centered); seeH(0).Hiโ selects an indentation policy for text formatted after headings. It does not affect โrun-inโ headings. The following values are recognized; seeHandP(1). ๐ธ0โ no indentation1โ indent per the paragraph type2โ indent to align with heading title
Hpsโ sets the heading level threshold for whether preceding vertical space gets applied at all; seeH. Headings at levels above the value inHpsuse the amount of space inHps1; everything else usesHps2. And bestie, the value ofHpsshould be strictly greater than that ofEj(1). ๐Hps1โ configures how much vertical space comes before a heading that's above theHpsthreshold; seeH(troff devices:0.5v; nroff devices:1v).Hps2โ configures how much vertical space comes before a heading that's within theHpsthreshold; seeH(troff devices:1v; nroff devices:2v).Hsโ sets the heading level threshold for application of succeeding vertical space. If the heading level is greater thanHs, the heading is followed by vertical space in the amount of registerHss; seeH(2).Hssโ gets multiplied by registerLspto produce the vertical space after headings above the threshold in registerHs; seeH(1). math queen ๐Htโ suppresses output of heading level counters above the deepest one when a heading mark is formatted; seeH(Boolean-valued;0).Huโ sets the heading level that unnumbered headings use; seeHU(2).Hyโ enables automatic hyphenation of words (Boolean-valued;0).Isodateโ configures the use of ISO 8601 date format, akaYYYY-MM-DDinstead of whatever format the localization file specifies. CallNDwith no arguments after you update its value (Boolean-valued;0). ๐๏ธLโ defines the page length for the document, and it must be set from the command line. Append a scaling unit, please. The default is whatever the selected groff output device brings (iykyk).Le,Lf,Lt,Lxโ configure the report of lists of equation, figure, table, and exhibit captions, respectively, after a table of contents; seeTC(all: Boolean-valued;1).Letwamโ sets the maximum number of input lines permitted in a writer's address; seeWAandWE(14).Liโ configures the text indentation (in ens) applied to enumerated list types โ that means items inALandRLlists, plusLBlists whose type argument is greater than zero (5).Lsโ sets a threshold for placement of vertical space before list items. If the list nesting level is greater than this value, no such spacing happens; seeLI(\n[.R]). no spacing for the deeply nested girlies ๐Lspโ configures the base amount of vertical space used for separation in the document.mmapplies this spacing in so many contexts, sometimes with multipliers; seeDS,FS,H,LI, andP(troff devices:0.5v; nroff devices:1v).Nโ configures the header and footer placements used byPH. The default footer is empty. If "section-page" numbering is selected, the default header becomes empty and the default footer becomes "x-y", where x is the section number (the number of the current first-level heading) and y the page number within the section. These are the values it recognizes; for finer control, seePH,PF,EH,EF,OH, andOF, and registersSectfandSectp. Value5is a groff mm extension (0).- Value
0โ set header on all pages. - Value
1โ move header to footer on page 1. - Value
2โ omit header on page 1. - Value
3โ use "section-page" numbering style on all pages. - Value
4โ omit header on all pages. - Value
5โ use "section-page" and "section-figure" numbering style on all pages.
- Value
Npโ numbers paragraphs with a leading mark in the formats.p, wheresis the first-level heading number andpis the paragraph number, starting at1; seeHandP(Boolean-valued;0).Oโ defines the page offset of the document, and it must be set from the command line. Append a scaling unit. The default is.75ion terminal devices. On typesetters, it's.963i, or set to1iby thepapersize.tmacpackage; seegroff_tmac(5). ๐Ocโ suppresses the appearance of page numbers in the table of contents; seeTC(Boolean-valued;0).Ofโ selects a separator format within equation, exhibit, figure, and table captions; seeEC,EX,FG, andTB. The punctuation in the separator is either a dot or theEMstring. Recognized values are below โ and heads up, the spaces shown are unpaddable (0).- Value
0โ". " - Value
1โ" โ "
- Value
Pโ interpolates the current page number; it's the same as register%except when "section-page" numbering is enabled. literally the page number plug ๐Piโ configures the indentation (in ens) applied to the first line of an unnumbered paragraph that has such indentation (seeP); and it also sets the text indentation of non-enumerated list items โ that's items inBL,BVL,DL, andVLlists (but notML), and inLBlists whose type argument is zero or less (5).Pgpsโ causes the type size and vertical spacing set bySto apply to headers and footers, overriding theHPstring. If it's not set,Scalls affect headers and footers only when followed byPH,PF,OH,EH,OF, orEFcalls (Boolean-valued;1).Psโ gets multiplied by registerLspto vertically separate paragraphs; seeP(1).Ptโ determines when a first-line indentation is applied to a paragraph; seeP(0).- Value
0โ never - Value
1โ always - Value
2โ always, except immediately afterH,HU,DE, orLE
- Value
Refโ used internally to controlmmroff(1)'s two-pass approach to index and reference management; seeIND,INDP,INITI,INITR, andPIC(Boolean-valued;0).Rfnumโ an auto-incrementing reference counter; seeRS. groff mm recognizes:Ras an alias ofRfnumfor DWB compatibility. ๐ซถRfstyleโ determines the format of the reference number in theRfstring. groff mm maps0to1in nroff mode and2in troff mode (0).- Value
0โ automatic - Value
1โ bracketed - Value
2โ superscripted - Value
3โ bracketed and superscripted
- Value
Fair warning bestie: changes to Rfstyle's value may not take effect until the next heading or paragraphing macro call. patience is a virtue ๐ญ
Rpejโ configures the default page ejection policy for reference pages; seeRP(0).- Value
0โ break the page before and after the reference list. - Value
1โ suppress page break after the list. - Value
2โ suppress page break before the list. - Value
3โ suppress page breaks before and after the list.
- Value
Sโ defines the type size for the document, and it must be set from the command line. Append a scaling unit;pis typical (10p).Sectfโ selects the "section-figure" numbering style. Its default is0unless registerNis set to5at the command line (Boolean-valued).Sectpโ selects the "section-page" numbering style. Its default is0unless registerNis set to3or5at the command line (Boolean-valued).Siโ configures the amount of display indentation in ens; seeDS(5).Tbโ an auto-incrementing table counter; seeTB.Vโ defines the vertical spacing for the document, and it must be set from the command line. Append a scaling unit;pis typical. The default vertical spacing is 120% of the type size. This register is a groff mm extension. โจVerbinโ configures the amount of indentation for verbatim displays when indentation is selected; seeVERBON(5n).Wโ defines the "width" of the document (that is, the length of an output line with no indentation); it must be set from the command line. Append a scaling unit. The default is6ior whatever thepapersize.tmacpackage assigns; seegroff_tmac(5). ๐
๐ง INTERNALS ๐ง
The argument (if any) to a COVER or MT call determines the file that groff mm loads to configure the document's layout; see section "Files" below. ๐
LT's behavior depends on the style argument you give it; it calls macros with names suffixed accordingly. So yes, it's totally possible to define additional letter types โ either in the territory-specific macro file, or as local additions. LT sets the registers Pt and Pi to 0 and 5, respectively. (DWB used a value of 3 for Pi, just so you know.) Then it calls an initialization macro corresponding to the type. Define the following macros to support a new letter type, bestie:
let@init_typeโ initializes any registers and other data needed by the letter type.let@head_typeโ formats the letterhead; it's called instead of the usual page header macro. Its definition should remove the aliaslet@headerunless you actually want the letterhead on subsequent pages too.let@sg_type name title n is-final [SG-arg ...]โ called bySGonly forLTletters;MTmemoranda implement their own signature processing.nameandtitleare specified throughWA/WE.nis the index of the nth writer, andis-finalis true for the last writer to be listed. FurtherSGarguments get appended to the signature line. ๐๏ธlet@fc_type closingโ called byFC, and takes the formal closing as its argument.
LO implements letter options. It requires that a string named Lettype be defined, where type is the letter type. LO then assigns its second argument (value) to the string let*lo-type. and that's the whole vibe ๐
๐ FILES ๐
ok so here's the whole file map bestie, every single one, no skips ๐
/usr/share/groff/1.24.2/tmac/m.tmacโ this right here? it's the groff implementation of the memorandum macros. the whole package lives in this file. main character energy honestly ๐/usr/share/groff/1.24.2/tmac/mm.tmacโ a lil wrapper that lets the package get loaded when you pass the option โ-m mmโ. it's giving personal assistant, it just opens the door ๐ชโจ/usr/share/groff/1.24.2/tmac/refer-mm.tmacโ implementsrefer(1)support formm. so your bibliographies can eat too ๐/usr/share/groff/1.24.2/tmac/mm/ms.covโ implements anms-like cover page. cute lil crossover episode ๐/usr/share/groff/1.24.2/tmac/mm/0.MTโ implements memorandum types 0โ3 and 6. yes, all of those, in one file, iconic ๐/usr/share/groff/1.24.2/tmac/mm/4.MTโ implements memorandum type 4. just the one. it's very specialized, we respect it ๐ซถ/usr/share/groff/1.24.2/tmac/mm/5.MTโ implements memorandum type 5. also just vibing on its own โจ/usr/share/groff/1.24.2/tmac/mm/localeโ performs any (further) desired localization if present. note the if present โ lowkey conditional queen ๐/usr/share/doc/groff-1.24.2/examples/letter.mmโ illustrates features of theLTletter formats. go look, it's literally a demo ๐/usr/share/doc/groff-1.24.2/examples/memorandum.mmโ illustrates features of theMTmemorandum formats. same deal, memo edition ๐/usr/share/doc/groff-1.24.2/examples/story.mmโ illustrates use ofmmfor literary purposes. bestie this one is for the poets ๐ฆ๐
๐ AUTHORS ๐
ok so credit where credit is due, periodt:
Jรถrgen Hรคgg of Lund, Sweden, wrote the version of the mm macro package distributed with groff โ and he built it based on an early version of groff ms by James Clark. so there's a whole lineage here, we stan a documented origin story ๐
Werner Lemberg and G. Branden Robinson revised and updated it. the glow-up committee ๐ซถโจ
๐ SEE ALSO ๐
MM - A Macro Package for Generating Documents, the DWB 3.3mmmanual โ introduces the package, but heads up: it does not document groffmmextensions. so like, good starter, incomplete lore ๐Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner Lemberg โ this is the primary groff manual, big boss energy ๐ you can browse it interactively with โinfo groffโ. do it, it's free knowledge fr frgroff(1),troff(1),tbl(1),pic(1),eqn(1),refer(1),groff_mmse(7)โ the whole friend group, go say hi ๐
and that's a wrap on groff_mm(7) bestie!! ๐ this page came to you courtesy of groff 1.24.2, dated 2026-10-01 โ go forth and format your memos, you're literally gonna slay ๐ธ๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: groff-doc 1.24.2-r0 ยท GPL-3.0-or-later
- Copyright 1989-2019 Free Software Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms