logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

groff_mom - modern macros for document composition with GNU roff

Authors

mom was written by Peter Schaffter. PDF support was provided by Deri James. This manual page was written by Bernd Warken.

Description

mom is a macro set for groff, designed primarily to prepare documents for PDF and PostScript output. mom provides macros in two categories: typesetting and document processing. The former provide access to groff's typesetting capabilities in ways that are simpler to master than groff's requests and escape sequences. The latter 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) produce PDF documents. The documents include a PDF outline that appears in the navigation pane panel of document viewers, and may contain clickable internal and external links. Normally. groff's native PDF driver, gropdf(1), is used to generate the output. When pdfmom is given the “-Tps” option, it still produces PDF, but processing is delegated to pdfroff, which uses groff's PostScript driver, grops(1). 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 -mmom) format for the device specified with the -T option. (In this installation, ps is the default output device.) mom comes with her own comprehensive documentation in HTML. A PDF manual, “Producing PDFs with groff and mom”, discusses preparation of PDF documents with mom in detail.

Documentation Of Details

Detailsofinlineescapesequencesinalphabeticalorder\*[<colorname>] begin using an initialized colour inline \*[BCKn] move backward in a line \*[BOLDER]\*[BOLDERX] Emboldening on/off \*[BOLDER] begins emboldening type. \*[BOLDERX] turns the feature off. Both are inline escape sequences; therefore, they should not appear as separate lines, but rather be embedded in text lines, like this: Not \*[BOLDER]everything\*[BOLDERX] is as it seems. Alternatively, if you wanted the whole line emboldened, you should do \*[BOLDER]Not everything is as it seems.\*[BOLDERX] Once \*[BOLDER] is invoked, it remains in effect until turned off. Note: If you're using the document processing macros with .PRINTSTYLETYPEWRITE, mom ignores \*[BOLDER] requests. \*[BUn] move characters pairs closer together inline (related to macro .KERN) \*[COND]\*[CONDX] Pseudo-condensing on/off \*[COND] begins pseudo-condensing type. \*[CONDX] turns the feature off. Both are inline escape sequences; therefore, they should not appear as separate lines, but rather be embedded in text lines, like this: \*[COND]Noteverythingisasitseems.\*[CONDX]\*[COND] remains in effect until you turn it off with \*[CONDX]. 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 sequence. If you wish the new point size to be pseudo-condensed, simply reinvoke \*[COND] afterward. Equally, \*[COND] must be turned off before changing the condense percentage with .CONDENSE. Note: If you're using the document processing macros with .PRINTSTYLETYPEWRITE, mom ignores \*[COND] requests. \*[CONDSUP]...\*[CONDSUPX] pseudo-condensed superscript \*[DOWNn] temporarily move downward in a line \*[EN-MARK] mark initial line of a range of line numbers (for use with line numbered endnotes) \*[EXT]\*[EXTX] Pseudo-extending on/off \*[EXT] begins pseudo-extending type. \*[EXTX] turns the feature off. Both are inline escape sequences; therefore, they should not appear as separate lines, but rather be embedded in text lines, like this: \*[EXT]Noteverythingisasitseems.\*[EXTX]\*[EXT] remains in effect until you turn it off with \*[EXTX]. 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 sequence. If you wish the new point size to be pseudo-extended, simply reinvoke \*[EXT] afterward. Equally, \*[EXT] must be turned off before changing the extend percentage with .EXTEND. Note: If you are using the document processing macros with .PRINTSTYLETYPEWRITE, mom ignores \*[EXT] requests. \*[EXTSUP]...\*[EXTSUPX] pseudo extended superscript \*[FUn] move characters pairs further apart inline (related to macro .KERN) \*[FWDn] move forward in a line \*[LEADER] insert leaders at the end of a line \*[RULE] draw a full measure rule \*[SIZEn] change the point size inline (related to macro .PT_SIZE) \*[SLANT]\*[SLANTX] Pseudo italic on/off \*[SLANT] begins pseudo-italicizingtype. \*[SLANTX] turns the feature off. Both are inline escape sequences; therefore, they should not appear as separate lines, but rather be embedded in text lines, like this: Not \*[SLANT]everything\*[SLANTX] is as it seems. Alternatively, if you wanted the whole line pseudo-italicized, you'd do \*[SLANT]Not everything is as it seems.\*[SLANTX] Once \*[SLANT] is invoked, it remains in effect until turned off. Note: If you're using the document processing macros with .PRINTSTYLETYPEWRITE, mom underlines pseudo-italics by default. To change this behaviour, use the special macro .SLANT_MEANS_SLANT. \*[ST<number>]...\*[ST<number>X] Mark positions of string tabs The quad direction must be LEFT or JUSTIFY (see .QUAD and .JUSTIFY) or the no-fillmode set to LEFT in order for these inlines to function properly. Please see IMPORTANT, below. String tabs need to be marked off with inline escape sequences 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. \*[ST1]De minimus\*[ST1X]non curat\*[ST2]lex\*[ST2X]. String tab1 begins at the start of the line and ends after the word time. String tab2 starts at good and ends after men. Inlineescapesequences (e.g., font or pointsizechanges, or horizontal movements, including padding) are taken into account when mom determines the position and length of stringtabs. 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 .QUADLEFT or JUSTIFY are active, the line on which the stringtabs 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 stringtab to underscore the text of a centered line with a rule. Rather than this, .CENTER\*[ST1]Alineoftext\*[ST1X]\c.EL.ST1.TAB1.PT_SIZE24.ALD3p\*[RULE].RLD3p.TQ you should do: .QUAD CENTER .PAD "#\*[ST1]A line of text\*[ST1X]#" .EL .ST 1 .TAB 1 .PT_SIZE 24 .ALD 3p \" You can't use \*[UP] or \*[DOWN] with \*[RULE]. .RLD 3p .TQ \*[SUP]...\*[SUPX] superscript \*[TB+] Inline escape for .TN (TabNext) \*[UL]...\*[ULX] invoke underlining inline (fixed width fonts only) \*[UPn] temporarily move upward in a line Detailsofmacrosinalphabeticalorder.AUTOLEAD set the linespacing relative to the point size .B_MARGIN<bottommargin> Bottom Margin 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_MARGINrequiresaunitofmeasure. Decimal fractions are allowed. To set a nominal bottom margin of 3/4 inch, enter .B_MARGIN.75i 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. .FALLBACK_FONT<fallbackfont>[ABORT|WARN] Fallback Font In the event that you pass an invalid argument to .FAMILY (i.e. a non-existent family), mom, by default, uses the fallbackfont, CourierMediumRoman (CR), in order to continue processing your file. If you'd prefer another fallbackfont, pass .FALLBACK_FONT the full family+fontname of the font you'd like. For example, if you'd rather the fallbackfont were TimesRomanMediumRoman, .FALLBACK_FONTTR would do the trick. Mom issues a warning whenever a fontstyleset with .FT does not exist, either because you haven't registered the style or because the fontstyle does not exist in the current familyset 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 fallbackfont, you can pass .FALLBACK_FONT the argument WARN, either by itself, or in conjunction with your chosen fallbackfont. Some examples of invoking .FALLBACK_FONT: .FALLBACK_FONTWARNmom will issue a warning whenever you try to access a non-existent font but will continue processing your file with the default fallbackfont, CourierMediumRoman. .FALLBACK_FONTTRWARNmom will issue a warning whenever you try to access a non-existent font but will continue processing your file with a fallbackfont of TimesRomanMediumRoman; additionally, TR will be the fallbackfont whenever you try to access a family that does not exist. .FALLBACK_FONTTRABORTmom will abort whenever you try to access a non-existent font, and will use the fallbackfontTR whenever you try to access a family that does not exist. If, for some reason, you want to revert to ABORT, just enter ".FALLBACK_FONTABORT" and mom will once again abort on fonterrors. .FAM<family> Type Family, alias of .FAMILY.FAMILY<family> Type Family, alias of .FAM.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: A=AvantGardeBM=BookmanH=HelveticaHN=HelveticaNarrowN=NewCenturySchoolbookP=PalatinoT=TimesRomanZCM=ZapfChancery The argument you pass to .FAMILY is the identifier at left, above. For example, if you want Helvetica, enter .FAMILYH 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 .FAMILYforfamily, and .FTforfont, except where doing so is genuinely inconvenient. ZCM, for example, only exists in one style: Italic (I). Therefore, .FTZCMI makes more sense than setting the family to ZCM, then setting the font to I. Additional note: If you are running a groff version prior to 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 groff 1.19.2 or later, when you invoke the .FAMILY macro, momremembers 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: .FAMILYBM\"Bookmanfamily.FTI\"MediumItalic<sometext>\"BookmanMediumItalic.FAMILYH\"Helveticafamily<moretext>\"HelveticaMediumItalic However, if the font style does not exist in the new family, mom will set all subsequent type in the fallback font (by default, CourierMediumRoman) until she encounters a .FT request that's valid for the family. For example, assuming you don't have the font MediumCondensedRoman (mom extension CD) in the Helveticafamily: .FAMILYUN\"Universfamily.FTCD\"MediumCondensed<sometext>\"UniversMediumCondensed.FAMILYH\"Helveticafamily<moretext>\"CourierMediumRoman! In the above example, you must follow .FAMILYH with a .FT request that's valid for Helvetica. Please see the Appendices, Addingfontstogroff, for information on adding fonts and families to groff,aswellasto see a list of the extensions mom provides to groff's basic R, I, B, BI styles. Suggestion: When adding familiestogroff, I recommend following the established standard for the naming families and fonts. For example, if you add the Garamond family, name the font files GARAMONDRGARAMONDIGARAMONDBGARAMONDBIGARAMONDthenbecomesavalidfamilyname you can pass to .FAMILY. (You could, of course, shorten GARAMOND to just G, or GD.) R, I, B, and BI after GARAMOND are the roman, italic, bold and bold-italic fonts respectively. .FONTR|B|BI|<anyothervalidfontstyle> Alias to .FT.FTR|B|BI|<anyothervalidfontstyle> Set font By default, groff permits .FT to take one of four possible arguments specifying the desired font: R=(Medium)RomanI=(Medium)ItalicB=Bold(Roman)BI=BoldItalic For example, if your family is Helvetica, entering .FTB will give you the Helveticaboldfont. If your family were Palatino, you'd get the Palatinoboldfont. 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 Addingfontstogroff for instructions and information.) Please also read the ADDITIONALNOTE 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 1.19.2 or later, 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). In earlier versions, 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 fontname. For example, .FTHB will set subsequent type in HelveticaBold. However, I strongly recommend keeping family and font separate except where doing so is genuinely inconvenient. For inline control of fonts, see InlineEscapes, font control. .HI[<measure>] Hanging indent — the optional argument requires a unit of measure. A hanging indent looks like this: The thousand injuries of Fortunato I had borne as best I could, but when he ventured upon insult, I vowed revenge. You who so well know the nature of my soul will not suppose, however, that I gave utterance to a threat, at length I would be avenged... The first line of text hangs outside the leftmargin. In order to use hangingindents, you must first have a leftindent active (set with either .IL or .IB). Mom will not hang text outside the leftmarginset with .L_MARGIN or outside the leftmargin 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 hangby, say, 1pica, do .IL1P.HI1P Subsequent invocations of .HI do not require you to supply a measure; mom keeps track of the last measure you gave it. Generally speaking, you should invoke .HI immediately prior to the line you want hung (i.e. without any intervening control lines). And because hangingindents 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 hangingindentsNote:mom has macros for setting lists. This recipe exists to demonstrate the use of hangingindents only. .PAGE 8.5i 11i 1i 1i 1i 1i .FAMILY T .FT R .PT_SIZE 12 .LS 14 .JUSTIFY .KERN .SS 0 .IL \w'\0\0.' .HI \w'\0\0.' 1.\0The most important point to be considered is whether the answer to the meaning of Life, the Universe, and Everything really is 42. We have no one's word on the subject except Mr. Adams's. .HI 2.\0If the answer to the meaning of Life, the Universe, and Everything is indeed 42, what impact does this have on the politics of representation? 42 is, after all not a prime number. Are we to infer that prime numbers don't deserve equal rights and equal access in the universe? .HI 3.\0If 42 is deemed non-exclusionary, how do we present it as the answer and, at the same time, forestall debate on its exclusionary implications? 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 afterward 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 (Themostimportantpoint...) 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 pdfmomfilename.mom|ps2pdf-filename.pdf to see hanging indents in action. .IB[<leftmeasure><rightmeasure>] Indent both — the optional argument requires a unit of measure .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. Awordofadvice: 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 minussign 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, .IB\w'margarine'\w'jello' left indents text by the width of the word margarine and right indents by the width of jello. 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. Additionalnote: Invoking .IB automatically turns off .IL and .IR. .IL[<measure>] Indent left — the optional argument requires a unit of measure .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 leftindent 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, .IL\w'margarine' indents text by the width of the word margarine. 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. Additionalnote: Invoking .IL automatically turns off IB. .IQ[<measure>] IQ — quit any/all indents IMPORTANTNOTE: 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. .IQCLEAR, as you'd suspect, quits and clears the values for all indent styles at once. .IR[<measure>] Indent right — the optional argument requires a unit of measure .IR indents text from the rightmargin 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 minussign 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 unitofmeasure is required. For example, .IR\w'jello' indents text by the width of the word jello. 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. Additionalnote: Invoking .IR automatically turns off IB. .L_MARGIN<leftmargin> Left Margin 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 .L_MARGIN3P or .L_MARGIN.5i If you use the macros .PAGE, .PAGEWIDTH or .PAPER without invoking .L_MARGIN (either before or afterward), mom automatically sets .L_MARGIN to 1inch. Note: .L_MARGIN behaves in a special way when you're using the document processing macros. .MCO Begin multi-column setting. .MCO (Multi-ColumnOn) is the macro you use to begin multi-columnsetting. 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. .MCR Once you've turned multi-columns on (with .MCO), .MCR, at any time, returns you to the topofyourcolumns. .MCX[<distancetoadvancebelowlongestcolumn>] Optional argument requires a unit of measure. Exit multi-columns. .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 1linespace 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 1linespace 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 .MCX6pNote: If you wish to advance a precise distance below the baseline of the longest column, use .MCX with an argument of 0 (zero; no unitofmeasure required) in conjunction with the .ALD macro, like this: .MCX0.ALD24p The above advances to precisely 24points below the baseline of the longest column. .NEWPAGE 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). .PAGE<width>[<length>[<lm>[<rm>[<tm>[<bm>]]]]] 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 .PAGE11i17i If you want to set the left margin as well, say, at 1 inch, PAGE would look like this: .PAGE11i17i1i 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: .PAGE 11i 17i 1i 1i 1.5i | | required right---+ +---top margin margin 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 .PAGE8.5i11i45p45p45p45p This sets up an 8½ by 11 inch page with margins of 45 points (5/8-inch) all around. 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 .RLD1v immediately before entering any text, or, if it's feasible, make .PAGE the last macro you invoke prior to entering text. Please read the Importantnote on page dimensions and papersize for information on ensuring groff respects your .PAGE dimensions and margins. .PAGELENGTH<lengthofprintersheet> tells mom how long your printer sheet is. It works just like .PAGEWIDTH. Therefore, to tell mom your printer sheet is 11 inches long, you enter .PAGELENGTH11i Please read the important note on page dimensions and papersize for information on ensuring groff respects your PAGELENGTH. .PAGEWIDTH<widthofprintersheet> 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 .PAGEWIDTH 8.5i Please read the Important note on page dimensions and papersize for information on ensuring groff respects your PAGEWIDTH. .PAPER<papertype> provides a convenient way to set the page dimensions for some common printer sheet sizes. The argument <papertype> can be one of: LETTER, LEGAL, STATEMENT, TABLOID, LEDGER, FOLIO, QUARTO, EXECUTIVE, 10x14, A3, A4, A5, B4, B5. .PRINTSTYLE.PT_SIZE<sizeoftypeinpoints> Point size of type, does not require a unitofmeasure. .PT_SIZE (PointSize) takes one argument: the sizeoftype in points. Unlike most other macros that establish the size or measure of something, .PT_SIZE does not require that you supply a unitofmeasure since it's a near universal convention that typesize is measured in points. Therefore, to change the typesize to, say, 11points, enter .PT_SIZE11Pointsizes may be fractional (e.g., 10.25 or 12.5). You can prepend a plus or a minussign to the argument to .PT_SIZE, in which case the pointsize will be changed by + or - the original value. For example, if the pointsize is 12, and you want 14, you can do .PT_SIZE+2 then later reset it to 12 with .PT_SIZE-2 The sizeoftype can also be changed inline. Note: It is unfortunate that the pic preprocessor has already taken the name, PS, and thus mom's macro for setting pointsizes 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 .ALIASPSPT_SIZE would allow you to set pointsizes with .PS. .R_MARGIN<rightmargin> Right Margin 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: .L_MARGIN6P.R_MARGIN6P 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., .LL17P+3p If you use the macros .PAGE, .PAGEWIDTH or PAPER without invoking .R_MARGIN afterward, mom automatically sets .R_MARGIN to 1inch. 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. .ST<tabnumber>L|R|C|J[QUAD] After stringtabs 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 tab1 to be left, enter .ST1L If you want it to be left and filled, enter .ST1LQUAD If you want it to be justified, enter .ST1J.TAB<tabnumber> After tabs have been defined (either with .TAB_SET or .ST), .TAB moves to whatever tabnumber you pass it as an argument. For example, .TAB3 moves you to tab3. Note: .TAB breaks the line preceding it and advances 1 linespace. Hence, .TAB1Alineoftextintab1..TAB2Alineoftextintab2. produces, on output Alineoftextintab1.Alineoftextintab2. If you want the tabs to line up, use .TN (“Tab Next”) or, more conveniently, the inline escape sequence \*[TB+]: .TAB 1 A line of text in tab 1.\*[TB+] A line of text in tab 2. which produces Alineoftextintab1.Alineoftextintab2. 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. Additionalnote: 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 2picas turned on, and you call a tab whose indent from the left margin is 6picas, your new distance from the leftmargin will be 6picas, 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 previoustab. To demonstrate: TAB 1 Carrots Potatoes Broccoli .TAB 2 $1.99/5 lbs $0.25/lb $0.99/bunch produces, on output Carrots Potatoes Broccoli $1.99/5 lbs $0.25/lb $0.99/bunch .TB<tabnumber> Alias to .TAB.TI[<measure>] Temporary left indent — the optional argument requires a unitofmeasure 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 temporaryindent.) 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 .TI2m Subsequent invocations of .TI do not require you to supply a measure; mom keeps track of the last measure you gave it. Because temporaryindents 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 ".TI2P" is exactly 2picas. .TI1PThebeginningofaparagraph....TI2PThebeginningofanotherparagraph....TN Tab Next Inline escape \*[TB+]TN moves over to the nexttab in numeric sequence (tabn+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 sequence. Conversely, if you did give a QUAD argument to .TAB_SET or ST, the \cmustnotbeused. 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 .TAB 1 Some text\c .TN Some more text\c .TN .TN Yet more text The above example, assuming tabs numbered from 1 to 4, should be entered .TAB 1 Some text\c .TN Some more text\c .TN \&\c .TN Yet more text \& is a zero-width, non-printing character that groff recognizes as valid input, hence meets the requirement for input text following .TN. .TQTQ takes you out of whatever tab you were in, advances 1linespace, and restores the leftmargin, linelength, quaddirection and fillmode that were in effect prior to invoking any tabs. .T_MARGIN<topmargin> Top margin 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 .T_MARGIN2.5c.T_MARGIN calculates the vertical position of the first line of type on a page by treating the top edge of the printer sheet as a baseline. Therefore, .T_MARGIN1.5i puts the baseline of the first line of type 1½ inches beneath the top of the page. 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: .NEWPAGE.T_MARGIN6P<text>

Files

/usr/share/groff/1.23.0/tmac/mom.tmac is a wrapper enabling the package to be loaded with “groff-mmom”. /usr/share/groff/1.23.0/tmac/om.tmac implements the package. /usr/share/doc/groff-base/html/mom/toc.html is the entry point to the HTML documentation. /usr/share/doc/groff-base/pdf/mom-pdf.pdf is “Producing PDFs with groff and mom”, by Deri James and Peter Schaffter. /usr/share/doc/groff-base/examples/mom/*.mom are examples of mom usage.

Name

groff_mom - modern macros for document composition with GNU roff

Reference

Escapesequences\*[<colorname>] begin using an initialized colour inline \*[BCKn] move backward in a line \*[BOLDER] invoke pseudo bold inline (related to macro .SETBOLDER) \*[BOLDERX] off pseudo bold inline (related to macro .SETBOLDER) \*[BUn] move characters pairs closer together inline (related to macro .KERN) \*[COND] invoke pseudo condensing inline (related to macro .CONDENSE) \*[CONDX] off pseudo condensing inline (related to macro .CONDENSE) \*[CONDSUP]...\*[CONDSUPX] pseudo-condensed superscript \*[DOWNn] temporarily move downward in a line \*[EN-MARK] mark initial line of a range of line numbers (for use with line numbered endnotes) \*[EXT] invoke pseudo extending inline (related to macro .EXTEND) \*[EXTX] off pseudo condensing inline (related to macro .EXTEND) \*[EXTSUP]...\*[EXTSUPX] pseudo extended superscript \*[FUn] move characters pairs further apart inline (related to macro .KERN) \*[FWDn] move forward in a line \*[LEADER] insert leaders at the end of a line \*[RULE] draw a full measure rule \*[SIZEn] change the point size inline (related to macro .PT_SIZE) \*[SLANT] invoke pseudo italic inline (related to macro .SETSLANT) \*[SLANTX] off pseudo italic inline (related to macro .SETSLANT) \*[ST<n>]...\*[ST<n>X] string tabs (mark tab positions inline) \*[SUP]...\*[SUPX] superscript \*[TB+] inline escape for .TN (TabNext) \*[UL]...\*[ULX] invoke underlining inline (fixed width fonts only) \*[UPn] temporarily move upward in a line Macros.AUTOLEAD set the linespacing relative to the point size .B_MARGIN set a bottom margin .BR break a justified line .CENTER set line-by-line quad centre .CONDENSE set the amount to pseudo condense .EL break a line without advancing on the page .EXTEND set the amount to pseudo extend .FALLBACK_FONT establish a fallback font (for missing fonts) .FAM alias to .FAMILY.FAMILY<family> set the familytype.FT set the font style (roman, italic, etc.) .HI[<measure>] hanging indent .HY automatic hyphenation on/off .HY_SET set automatic hyphenation parameters .IB[<leftmeasure><rightmeasure>] indent both .IBX[CLEAR] exit indent both .IL[<measure>] indent left .ILX[CLEAR] exit indent left .IQ[CLEAR] quit any/all indents .IR[<measure>] indent right .IRX[CLEAR] exit indent right .JUSTIFY justify text to both margins .KERN automatic character pair kerning on/off .L_MARGIN set a left margin (page offset) .LEFT set line-by-line quad left .LL set a line length .LS set a linespacing (leading) .PAGE set explicit page dimensions and margins .PAGEWIDTH set a custom page width .PAGELENGTH set a custom page length .PAPER<paper_type> set common paper sizes (letter, A4, etc) .PT_SIZE set the point size .QUAD "justify" text left, centre, or right .R_MARGIN set a right margin .RIGHT set line-by-line quad right .SETBOLDER set the amount of emboldening .SETSLANT set the degree of slant .SPREAD force justify a line .SS set the sentence space size .T_MARGIN set a top margin .TI[<measure>] temporary left indent .WS set the minimum word space size

See Also

/usr/share/doc/groff-base/html/mom/toc.html entry point to the HTML documentation ⟨http://www.schaffter.ca/mom/momdoc/toc.html⟩ HTML documentation online ⟨http://www.schaffter.ca/mom/⟩ the mom macros homepage Groff:TheGNUImplementationoftroff, by Trent A. Fisher and Werner Lemberg, is the primary groff manual. You can browse it interactively with “info groff”. pdfmom(1), groff(1), troff(1) groff 1.23.0 3 June 2025 groff_mom(7)

Synopsis

groff-mom [option ...] [file ...] groff-mmom [option ...] [file ...]

See Also