mom provides two categories of macros: macros for typesetting, and macros for document processing. The typesetting macros provide access to groff's typesetting capabilities in ways that are simpler to master than groff's primitives. The document processing macros provide highly customizable markup tags that allow the user to design and output professional-looking documents with a minimum of typesetting intervention.
Files processed with pdfmom(1) with or without the -Tps option, produce PDF documents. The documents include a PDF outline that appears in the 'Contents' panel of document viewers, and may contain clickable internal and external links.
When -Tps is absent, groff's native PDF driver, gropdf, is used to generate the output. When given, the output is still PDF, but processing is passed over to pdfroff, which uses groff's PostScript driver, grops. Not all PDF features are available when -Tps is given; its primary use is to allow processing of files with embedded PostScript images.
Files processed with groff -mom (or -m mom) produce PostScript output by default.
mom comes with her own very complete documentation in HTML format. A separate PDF manual, Producing PDFs with groff and mom, covers full mom or PDF usage.
The logical order of mom macros and mom escape sequences is very well documented in
That document is quite good for beginners, but other users should be happy to have some documentation in reference style.
So we restrict this part to the alphabetical order of macros and escape sequences. But, so far, we took all documentation details from the toc.html file, just in a more useful alphabetical order. So this part of the man-page is nothing new, but only a logical arrangement.
\*[BOLDER] begins emboldening type. \*[BOLDERX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
Alternatively, if you wanted the whole line emboldened, you should do
Note: If you're using the document processing macros with .PRINTSTYLE TYPEWRITE, mom ignores \*[BOLDER] requests.
\*[COND] begins pseudo-condensing type. \*[CONDX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
IMPORTANT: You must turn \*[COND] off before making any changes to the point size of your type, either via the .PT_SIZE macro or with the \s inline escape. If you wish the new point size to be pseudo-condensed, simply reinvoke \*[COND] afterwards. Equally, \*[COND] must be turned off before changing the condense percentage with .CONDENSE.
Note: If you're using the document processing macros with .PRINTSTYLE TYPEWRITE, mom ignores \*[COND] requests.
\*[EXT] begins pseudo-extending type. \*[EXTX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
IMPORTANT: You must turn \*[EXT] off before making any changes to the point size of your type, either via the .PT_SIZE macro or with the \s inline escape. If you wish the new point size to be pseudo-extended, simply reinvoke \*[EXT] afterwards. Equally, \*[EXT] must be turned off before changing the extend percentage with .EXTEND.
Note: If you are using the document processing macros with .PRINTSTYLE TYPEWRITE, mom ignores \*[EXT] requests.
\*[SLANT] begins pseudo-italicizing type. \*[SLANTX] turns the feature off. Both are inline escapes, therefore they should not appear as separate lines, but rather be embedded in text lines, like this:
Alternatively, if you wanted the whole line pseudo-italicized, you'd do
Once \*[SLANT] is invoked, it remains in effect until turned off.
Note: If you're using the document processing macros with .PRINTSTYLE TYPEWRITE, mom underlines pseudo-italics by default. To change this behaviour, use the special macro .SLANT_MEANS_SLANT.
The quad direction must be LEFT or JUSTIFY (see .QUAD and .JUSTIFY) or the no-fill mode set to LEFT in order for these inlines to function properly. Please see IMPORTANT, below.
String tabs need to be marked off with inline escapes before being set up with the .ST macro. Any input line may contain string tab markers. <number>, above, means the numeric identifier of the tab.
The following shows a sample input line with string tab markers.
String tab 1 begins at the start of the line and ends after the word time. String tab 2 starts at good and ends after men. Inline escapes (e.g. font or point size changes, or horizontal movements, including padding) are taken into account when mom determines the position and length of string tabs.
Up to nineteen string tabs may be marked (not necessarily all on the same line, of course), and they must be numbered between 1 and 19.
Once string tabs have been marked in input lines, they have to be set with .ST, after which they may be called, by number, with .TAB.
Note: Lines with string tabs marked off in them are normal input lines, i.e. they get printed, just like any input line. If you want to set up string tabs without the line printing, use the .SILENT macro.
IMPORTANT: Owing to the way groff processes input lines and turns them into output lines, it is not possible for mom to guess the correct starting position of string tabs marked off in lines that are centered or set flush right.
Equally, she cannot guess the starting position if a line is fully justified and broken with .SPREAD.
In other words, in order to use string tabs, LEFT must be active, or, if .QUAD LEFT or JUSTIFY are active, the line on which the string tabs are marked must be broken manually with .BR (but not .SPREAD).
To circumvent this behaviour, I recommend using the PAD to set up string tabs in centered or flush right lines. Say, for example, you want to use a string tab to underscore the text of a centered line with a rule. Rather than this,
Requires a unit of measure
.B_MARGIN sets a nominal position at the bottom of the page beyond which you don't want your type to go. When the bottom margin is reached, mom starts a new page. .B_MARGIN requires a unit of measure. Decimal fractions are allowed. To set a nominal bottom margin of 3/4 inch, enter
Obviously, if you haven't spaced the type on your pages so that the last lines fall perfectly at the bottom margin, the margin will vary from page to page. Usually, but not always, the last line of type that fits on a page before the bottom margin causes mom to start a new page.
Occasionally, owing to a peculiarity in groff, an extra line will fall below the nominal bottom margin. If you're using the document processing macros, this is unlikely to happen; the document processing macros are very hard-nosed about aligning bottom margins.
Note: The meaning of .B_MARGIN is slightly different when you're using the document processing macros.
In the event that you pass an invalid argument to .FAMILY (i.e. a non-existent family), mom, by default, uses the fallback font, Courier Medium Roman (CR), in order to continue processing your file.
If you'd prefer another fallback font, pass .FALLBACK_FONT the full family+font name of the font you'd like. For example, if you'd rather the fallback font were Times Roman Medium Roman,
Mom issues a warning whenever a font style set with .FT does not exist, either because you haven't registered the style or because the font style does not exist in the current family set with .FAMILY. By default, mom then aborts, which allows you to correct the problem.
If you'd prefer that mom not abort on non-existent fonts, but rather continue processing using a fallback font, you can pass .FALLBACK_FONT the argument WARN, either by itself, or in conjunction with your chosen fallback font.
Some examples of invoking .FALLBACK_FONT:
.FAMILY takes one argument: the name of the family you want. Groff comes with a small set of basic families, each identified by a 1-, 2- or 3-letter mnemonic. The standard families are:
The argument you pass to .FAMILY is the identifier at left, above. For example, if you want Helvetica, enter
Note: The font macro (.FT) lets you specify both the type family and the desired font with a single macro. While this saves a few keystrokes, I recommend using .FAMILY for family, and .FT for font, except where doing so is genuinely inconvenient. ZCM, for example, only exists in one style: Italic (I).
Therefore,
Additional note: If you are running a version of groff lower than 1.19.2, you must follow all .FAMILY requests with a FT request, otherwise mom will set all type up to the next .FT request in the fallback font.
If you are running a version of groff greater than or equal to 1.19.2, when you invoke the .FAMILY macro, mom remembers the font style (Roman, Italic, etc) currently in use (if the font style exists in the new family) and will continue to use the same font style in the new family. For example:
However, if the font style does not exist in the new family, mom will set all subsequent type in the fallback font (by default, Courier Medium Roman) until she encounters a .FT request that's valid for the family.
For example, assuming you don't have the font Medium Condensed Roman (mom extension CD) in the Helvetica family:
In the above example, you must follow .FAMILY H with a .FT request that's valid for Helvetica.
Please see the Appendices, Adding fonts to groff, for information on adding fonts and families to groff, as well as to see a list of the extensions mom provides to groff's basic R, I, B, BI styles.
Suggestion: When adding families to groff, I recommend following the established standard for the naming families and fonts. For example, if you add the Garamond family, name the font files
By default, groff permits .FT to take one of four possible arguments specifying the desired font:
For example, if your family is Helvetica, entering
Mom considerably extends the range of arguments you can pass to .FT, making it more convenient to add and access fonts of differing weights and shapes within the same family.
Have a look here for a list of the weight/style arguments mom allows. Be aware, though, that you must have the fonts, correctly installed and named, in order to use the arguments. (See Adding fonts to groff for instructions and information.) Please also read the ADDITIONAL NOTE found in the description of the .FAMILY macro.
How mom reacts to an invalid argument to .FT depends on which version of groff you're using. If your groff version is greater than or equal to 1.19.2, mom will issue a warning and, depending on how you've set up the fallback font, either continue processing using the fallback font, or abort (allowing you to correct the problem). If your groff version is less than 1.19.2, mom will silently continue processing, using either the fallback font or the font that was in effect prior to the invalid .FT call.
.FT will also accept, as an argument, a full family and font name.
For example,
However, I strongly recommend keeping family and font separate except where doing so is genuinely inconvenient.
For inline control of fonts, see Inline Escapes, font control.
A hanging indent looks like this:
In order to use hanging indents, you must first have a left indent active (set with either .IL or .IB). Mom will not hang text outside the left margin set with .L_MARGIN or outside the left margin of a tab.
The first time you invoke .HI, you must give it a measure. If you want the first line of a paragraph to hang by, say, 1 pica, do
Generally speaking, you should invoke .HI immediately prior to the line you want hung (i.e. without any intervening control lines). And because hanging indents affect only one line, there's no need to turn them off.
IMPORTANT: Unlike IL, IR and IB, measures given to .HI are NOT additive. Each time you pass a measure to .HI , the measure is treated literally. Recipe: A numbered list using hanging indents
Note: mom has macros for setting lists. This recipe exists to demonstrate the use of hanging indents only.
First, we invoke a left indent with a measure equal to the width of 2 figures spaces plus a period (using the \w inline escape). At this point, the left indent is active; text afterwards would normally be indented. However, we invoke a hanging indent of exactly the same width, which hangs the first line (and first line only!) to the left of the indent by the same distance (in this case, that means "out to the left margin"). Because we begin the first line with a number, a period, and a figure space, the actual text (The most important point) starts at exactly the same spot as the indented lines that follow.
Notice that subsequent invocations of .HI don't require a measure to be given.
Paste the example above into a file and preview it with
.IB allows you to set or invoke a left and a right indent at the same time.
At its first invocation, you must supply a measure for both indents; at subsequent invocations when you wish to supply a measure, both must be given again. As with .IL and .IR, the measures are added to the values previously passed to the macro. Hence, if you wish to change just one of the values, you must give an argument of zero to the other.
A word of advice: If you need to manipulate left and right indents separately, use a combination of .IL and .IR instead of .IB. You'll save yourself a lot of grief.
A minus sign may be prepended to the arguments to subtract from their current values. The \w inline escape may be used to specify text-dependent measures, in which case no unit of measure is required. For example,
Like .IL and .IR, .IB with no argument indents by its last active values. See the brief explanation of how mom handles indents for more details.
Note: Calling a tab (with .TAB <n>) automatically cancels any active indents.
Additional note: Invoking .IB automatically turns off .IL and .IR.
.IL indents text from the left margin of the page, or if you're in a tab, from the left edge of the tab Once IL is on, the left indent is applied uniformly to every subsequent line of text, even if you change the line length.
The first time you invoke .IL, you must give it a measure. Subsequent invocations with a measure add to the previous measure. A minus sign may be prepended to the argument to subtract from the current measure. The \w inline escape may be used to specify a text-dependent measure, in which case no unit of measure is required. For example,
With no argument, .IL indents by its last active value. See the brief explanation of how mom handles indents for more details.
Note: Calling a tab (with .TAB <n>) automatically cancels any active indents.
Additional note: Invoking .IL automatically turns off IB.
IMPORTANT NOTE: The original macro for quitting all indents was .IX. This usage has been deprecated in favour of IQ. .IX will continue to behave as before, but mom will issue a warning to stderr indicating that you should update your documents.
As a consequence of this change, .ILX, .IRX and .IBX may now also be invoked as .ILQ, .IRQ and .IBQ. Both forms are acceptable.
Without an argument, the macros to quit indents merely restore your original margins and line length. The measures stored in the indent macros themselves are saved so you can call them again without having to supply a measure.
If you pass these macros the optional argument CLEAR, they not only restore your original left margin and line length, but also clear any values associated with a particular indent style. The next time you need an indent of the same style, you have to supply a measure again.
.IQ CLEAR, as you'd suspect, quits and clears the values for all indent styles at once.
.IR indents text from the right margin of the page, or if you're in a tab, from the end of the tab.
The first time you invoke .IR, you must give it a measure. Subsequent invocations with a measure add to the previous indent measure. A minus sign may be prepended to the argument to subtract from the current indent measure. The \w inline escape may be used to specify a text-dependent measure, in which case no unit of measure is required. For example,
With no argument, .IR indents by its last active value. See the brief explanation of how mom handles indents for more details.
Note: Calling a tab (with .TAB <n>) automatically cancels any active indents.
Additional note: Invoking .IR automatically turns off IB.
L_MARGIN establishes the distance from the left edge of the printer sheet at which you want your type to start. It may be used any time, and remains in effect until you enter a new value.
Left indents and tabs are calculated from the value you pass to .L_MARGIN, hence it's always a good idea to invoke it before starting any serious typesetting. A unit of measure is required. Decimal fractions are allowed. Therefore, to set the left margin at 3 picas (1/2 inch), you'd enter either
If you use the macros .PAGE, .PAGEWIDTH or .PAPER without invoking .L_MARGIN (either before or afterwards), mom automatically sets .L_MARGIN to 1 inch.
Note: .L_MARGIN behaves in a special way when you're using the document processing macros.
.MCO (Multi-Column On) is the macro you use to begin multi-column setting. It marks the current baseline as the top of your columns, for use later with .MCR. See the introduction to columns for an explanation of multi-columns and some sample input.
Note: Do not confuse .MCO with the .COLUMNS macro in the document processing macros.
.MCX takes you out of any tab you were in (by silently invoking .TQ) and advances to the bottom of the longest column.
Without an argument, .MCX advances 1 linespace below the longest column.
Linespace, in this instance, is the leading in effect at the moment .MCX is invoked.
If you pass the <distance> argument to .MCX, it advances 1 linespace below the longest column (see above) PLUS the distance specified by the argument. The argument requires a unit of measure; therefore, to advance an extra 6 points below where .MCX would normally place you, you'd enter
Note: If you wish to advance a precise distance below the baseline of the longest column, use .MCX with an argument of 0 (zero; no unit of measure required) in conjunction with the .ALD macro, like this:
Whenever you want to start a new page, use .NEWPAGE, by itself with no argument. Mom will finish up processing the current page and move you to the top of a new one (subject to the top margin set with .T_MARGIN).
All arguments require a unit of measure
IMPORTANT: If you're using the document processing macros, .PAGE must come after .START. Otherwise, it should go at the top of a document, prior to any text. And remember, when you're using the document processing macros, top margin and bottom margin mean something slightly different than when you're using just the typesetting macros (see Top and bottom margins in document processing).
.PAGE lets you establish paper dimensions and page margins with a single macro. The only required argument is page width. The rest are optional, but they must appear in order and you can't skip over any. <lm>, <rm>, <tm> and <bm> refer to the left, right, top and bottom margins respectively.
Assuming your page dimensions are 11 inches by 17 inches, and that's all you want to set, enter
Now suppose you also want to set the top margin, say, at 1-1/2 inches. <tm> comes after <rm> in the optional arguments, but you can't skip over any arguments, therefore to set the top margin, you must also give a right margin. The .PAGE macro would look like this:
Clearly, .PAGE is best used when you want a convenient way to tell mom just the dimensions of your printer sheet (width and length), or when you want to tell her everything about the page (dimensions and all the margins), for example
Additionally, if you invoke .PAGE with a top margin argument, any macros you invoke after .PAGE will almost certainly move the baseline of the first line of text down by one linespace. To compensate, do
Please read the Important note on page dimensions and papersize for information on ensuring groff respects your .PAGE dimensions and margins.
Therefore, to tell mom your printer sheet is 11 inches long, you enter
The argument to .PAGEWIDTH is the width of your printer sheet.
.PAGEWIDTH requires a unit of measure. Decimal fractions are allowed. Hence, to tell mom that the width of your printer sheet is 8½ inches, you enter
Please read the Important note on page dimensions and papersize for information on ensuring groff respects your PAGEWIDTH.
.PT_SIZE (Point Size) takes one argument: the size of type in points. Unlike most other macros that establish the size or measure of something, .PT_SIZE does not require that you supply a unit of measure since it's a near universal convention that type size is measured in points. Therefore, to change the type size to, say, 11 points, enter
You can prepend a plus or a minus sign to the argument to .PT_SIZE, in which case the point size will be changed by + or - the original value. For example, if the point size is 12 , and you want 14 , you can do
Note: It is unfortunate that the pic preprocessor has already taken the name, PS, and thus mom's macro for setting point sizes can't use it. However, if you aren't using pic, you might want to alias .PT_SIZE as .PS, since there'd be no conflict. For example
Requires a unit of measure.
IMPORTANT: .R_MARGIN, if used, must come after .PAPER, .PAGEWIDTH, .L_MARGIN, and/or .PAGE (if a right margin isn't given to PAGE). The reason is that .R_MARGIN calculates line length from the overall page dimensions and the left margin.
Obviously, it can't make the calculation if it doesn't know the page width and the left margin.
.R_MARGIN establishes the amount of space you want between the end of typeset lines and the right hand edge of the printer sheet. In other words, it sets the line length. .R_MARGIN requires a unit of measure. Decimal fractions are allowed.
The line length macro (LL) can be used in place of .R_MARGIN. In either case, the last one invoked sets the line length. The choice of which to use is up to you. In some instances, you may find it easier to think of a section of type as having a right margin. In others, giving a line length may make more sense.
For example, if you're setting a page of type you know should have 6-pica margins left and right, it makes sense to enter a left and right margin, like this:
That way, you don't have to worry about calculating the line length. On the other hand, if you know the line length for a patch of type should be 17 picas and 3 points, entering the line length with LL is much easier than calculating the right margin, e.g.
If you use the macros .PAGE, .PAGEWIDTH or PAPER without invoking .R_MARGIN afterwards, mom automatically sets .R_MARGIN to 1 inch. If you set a line length after these macros (with .LL), the line length calculated by .R_MARGIN is, of course, overridden.
Note: .R_MARGIN behaves in a special way when you're using the document processing macros.
After string tabs have been marked off on an input line (see \*[ST]\*[STX]), you need to set them by giving them a direction and, optionally, the QUAD argument.
In this respect, .ST is like .TAB_SET except that you don't have to give .ST an indent or a line length (that's already taken care of, inline, by \*[ST]\*[STX]).
If you want string tab 1 to be left, enter
For example,
Note: .TAB breaks the line preceding it and advances 1 linespace. Hence,
If you want the tabs to line up, use .TN (Tab Next) or, more conveniently, the inline escape \*[TB+]:
If the text in your tabs runs to several lines, and you want the first lines of each tab to align, you must use the multi-column macros.
Additional note: Any indents in effect prior to calling a tab are automatically turned off by TAB. If you were happily zipping down the page with a left indent of 2 picas turned on, and you call a tab whose indent from the left margin is 6 picas, your new distance from the left margin will be 6 picas, not I 6 picas plus the 2 pica indent.
Tabs are not by nature columnar, which is to say that if the text inside a tab runs to several lines, calling another tab does not automatically move to the baseline of the first line in the previous tab. To demonstrate:
A temporary indent is one that applies only to the first line of text that comes after it. Its chief use is indenting the first line of paragraphs. (Mom's .PP macro, for example, uses a temporary indent.)
The first time you invoke .TI, you must give it a measure. If you want to indent the first line of a paragraph by, say, 2 ems, do
Subsequent invocations of .TI do not require you to supply a measure; mom keeps track of the last measure you gave it.
Because temporary indents are temporary, there's no need to turn them off.
IMPORTANT: Unlike .IL, .IR and IB, measures given to .TI are NOT additive. In the following example, the second .TI 2P is exactly 2 picas.
Inline escape \*[TB+]
TN moves over to the next tab in numeric sequence (tab n+1) without advancing on the page. See the NOTE in the description of the .TAB macro for an example of how TN works.
In tabs that aren't given the QUAD argument when they're set up with .TAB_SET or ST, you must terminate the line preceding .TN with the \c inline escape. Conversely, if you did give a QUAD argument to .TAB_SET or ST, the \c must not be used.
If you find remembering whether to put in the \c bothersome, you may prefer to use the inline escape alternative to .TN, \*[TB+], which works consistently regardless of the fill mode.
Note: You must put text in the input line immediately after .TN. Stacking of .TN's is not allowed. In other words, you cannot do
Requires a unit of measure
.T_MARGIN establishes the distance from the top of the printer sheet at which you want your type to start. It requires a unit of measure, and decimal fractions are allowed. To set a top margin of 2½ centimetres, you'd enter
Note: .T_MARGIN means something slightly different when you're using the document processing macros. See Top and bottom margins in document processing for an explanation.
IMPORTANT: .T_MARGIN does two things: it establishes the top margin for pages that come after it and it moves to that position on the current page. Therefore, .T_MARGIN should only be used at the top of a file (prior to entering text) or after NEWPAGE, like this:
This file is part of groff, a free software project.
You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the "Free Software Foundation", either version 3 of the License, or (at your option) any later version.
You should have received a copy of the GNU General Public License along with groff, see the files COPYING and LICENSE in the top directory of the groff Text source package.
Or read the manpage gpl(1). You can also visit <http://www.gnu.org/licenses/>.
PDF support was provided by Deri James
The alphabetical documentation of macros and escape seqauences in this man-page were written by the mom team.