1groff_mom(7) Miscellaneous Information Manual groff_mom(7)
2
3
4
6 groff_mom - modern macros for document composition with GNU roff
7
9 groff -mom [option ...] [file ...]
10 groff -m mom [option ...] [file ...]
11
13 mom is a macro set for groff, designed primarily to prepare documents
14 for PDF and PostScript output. mom provides macros in two categories:
15 typesetting and document processing. The former provide access to
16 groff's typesetting capabilities in ways that are simpler to master
17 than groff's requests and escape sequences. The latter provide highly
18 customizable markup tags that allow the user to design and output pro‐
19 fessional-looking documents with a minimum of typesetting intervention.
20
21 Files processed with pdfmom(1) produce PDF documents. The documents
22 include a PDF outline that appears in the navigation pane panel of doc‐
23 ument viewers, and may contain clickable internal and external links.
24
25 Normally. groff's native PDF driver, gropdf(1), is used to generate
26 the output. When pdfmom is given the “-T ps” option, it still produces
27 PDF, but processing is delegated to pdfroff, which uses groff's Post‐
28 Script driver, grops(1). Not all PDF features are available when -T ps
29 is given; its primary use is to allow processing of files with embedded
30 PostScript images.
31
32 Files processed with groff -mom (or -m mom) format for the device spec‐
33 ified with the -T option. (In this installation, ps is the default
34 output device.)
35
36 mom comes with her own comprehensive documentation in HTML. A PDF man‐
37 ual, “Producing PDFs with groff and mom”, discusses preparation of PDF
38 documents with mom in detail.
39
41 /usr/share/groff/1.23.0/tmac/mom.tmac
42 is a wrapper enabling the package to be loaded with “groff -m
43 mom”.
44
45 /usr/share/groff/1.23.0/tmac/om.tmac
46 implements the package.
47
48 /usr/share/doc/groff/html/mom/toc.html
49 is the entry point to the HTML documentation.
50
51 /usr/share/doc/groff/pdf/mom-pdf.pdf
52 is “Producing PDFs with groff and mom”, by Deri James and Peter
53 Schaffter.
54
55 /usr/share/doc/groff/examples/mom/*.mom
56 are examples of mom usage.
57
59 Escape sequences
60 \*[<colorname>]
61 begin using an initialized colour inline
62
63 \*[BCK n]
64 move backward in a line
65
66 \*[BOLDER]
67 invoke pseudo bold inline (related to macro .SETBOLDER)
68
69 \*[BOLDERX]
70 off pseudo bold inline (related to macro .SETBOLDER)
71
72 \*[BU n]
73 move characters pairs closer together inline (related to macro
74 .KERN)
75
76 \*[COND]
77 invoke pseudo condensing inline (related to macro .CONDENSE)
78
79 \*[CONDX]
80 off pseudo condensing inline (related to macro .CONDENSE)
81
82 \*[CONDSUP]...\*[CONDSUPX]
83 pseudo-condensed superscript
84
85 \*[DOWN n]
86 temporarily move downward in a line
87
88 \*[EN-MARK]
89 mark initial line of a range of line numbers (for use with line
90 numbered endnotes)
91
92 \*[EXT]
93 invoke pseudo extending inline (related to macro .EXTEND)
94
95 \*[EXTX]
96 off pseudo condensing inline (related to macro .EXTEND)
97
98 \*[EXTSUP]...\*[EXTSUPX]
99 pseudo extended superscript
100
101 \*[FU n]
102 move characters pairs further apart inline (related to macro
103 .KERN)
104
105 \*[FWD n]
106 move forward in a line
107
108 \*[LEADER]
109 insert leaders at the end of a line
110
111 \*[RULE]
112 draw a full measure rule
113
114 \*[SIZE n]
115 change the point size inline (related to macro .PT_SIZE)
116
117 \*[SLANT]
118 invoke pseudo italic inline (related to macro .SETSLANT)
119
120 \*[SLANTX]
121 off pseudo italic inline (related to macro .SETSLANT)
122
123 \*[ST<n>]...\*[ST<n>X]
124 string tabs (mark tab positions inline)
125
126 \*[SUP]...\*[SUPX]
127 superscript
128
129 \*[TB+]
130 inline escape for .TN (Tab Next)
131
132 \*[UL]...\*[ULX]
133 invoke underlining inline (fixed width fonts only)
134
135 \*[UP n]
136 temporarily move upward in a line
137
138 Macros
139 .AUTOLEAD
140 set the linespacing relative to the point size
141
142 .B_MARGIN
143 set a bottom margin
144
145 .BR break a justified line
146
147 .CENTER
148 set line-by-line quad centre
149
150 .CONDENSE
151 set the amount to pseudo condense
152
153 .EL break a line without advancing on the page
154
155 .EXTEND
156 set the amount to pseudo extend
157
158 .FALLBACK_FONT
159 establish a fallback font (for missing fonts)
160
161 .FAM alias to .FAMILY
162
163 .FAMILY <family>
164 set the family type
165
166 .FT set the font style (roman, italic, etc.)
167
168 .HI [ <measure> ]
169 hanging indent
170
171 .HY automatic hyphenation on/off
172
173 .HY_SET
174 set automatic hyphenation parameters
175
176 .IB [ <left measure> <right measure> ]
177 indent both
178
179 .IBX [ CLEAR ]
180 exit indent both
181
182 .IL [ <measure> ]
183 indent left
184
185 .ILX [ CLEAR ]
186 exit indent left
187
188 .IQ [ CLEAR ]
189 quit any/all indents
190
191 .IR [ <measure> ]
192 indent right
193
194 .IRX [ CLEAR ]
195 exit indent right
196
197 .JUSTIFY
198 justify text to both margins
199
200 .KERN automatic character pair kerning on/off
201
202 .L_MARGIN
203 set a left margin (page offset)
204
205 .LEFT set line-by-line quad left
206
207 .LL set a line length
208
209 .LS set a linespacing (leading)
210
211 .PAGE set explicit page dimensions and margins
212
213 .PAGEWIDTH
214 set a custom page width
215
216 .PAGELENGTH
217 set a custom page length
218
219 .PAPER <paper_type>
220 set common paper sizes (letter, A4, etc)
221
222 .PT_SIZE
223 set the point size
224
225 .QUAD "justify" text left, centre, or right
226
227 .R_MARGIN
228 set a right margin
229
230 .RIGHT set line-by-line quad right
231
232 .SETBOLDER
233 set the amount of emboldening
234
235 .SETSLANT
236 set the degree of slant
237
238 .SPREAD
239 force justify a line
240
241 .SS set the sentence space size
242
243 .T_MARGIN
244 set a top margin
245
246 .TI [ <measure> ]
247 temporary left indent
248
249 .WS set the minimum word space size
250
252 Details of inline escape sequences in alphabetical order
253 \*[<colorname>]
254 begin using an initialized colour inline
255
256 \*[BCK n]
257 move backward in a line
258
259 \*[BOLDER]
260 \*[BOLDERX]
261 Emboldening on/off
262
263 \*[BOLDER] begins emboldening type. \*[BOLDERX] turns the fea‐
264 ture off. Both are inline escape sequences; therefore, they
265 should not appear as separate lines, but rather be embedded in
266 text lines, like this:
267 Not \*[BOLDER]everything\*[BOLDERX] is as it seems.
268
269 Alternatively, if you wanted the whole line emboldened, you
270 should do
271 \*[BOLDER]Not everything is as it seems.\*[BOLDERX]
272 Once \*[BOLDER] is invoked, it remains in effect until turned
273 off.
274
275 Note: If you're using the document processing macros with
276 .PRINTSTYLE TYPEWRITE, mom ignores \*[BOLDER] requests.
277
278 \*[BU n]
279 move characters pairs closer together inline (related to macro
280 .KERN)
281
282 \*[COND]
283 \*[CONDX]
284 Pseudo-condensing on/off
285
286 \*[COND] begins pseudo-condensing type. \*[CONDX] turns the
287 feature off. Both are inline escape sequences; therefore, they
288 should not appear as separate lines, but rather be embedded in
289 text lines, like this:
290 \*[COND]Not everything is as it seems.\*[CONDX]
291 \*[COND] remains in effect until you turn it off with \*[CONDX].
292
293 IMPORTANT: You must turn \*[COND] off before making any changes
294 to the point size of your type, either via the .PT_SIZE macro or
295 with the \s inline escape sequence. If you wish the new point
296 size to be pseudo-condensed, simply reinvoke \*[COND] afterward.
297 Equally, \*[COND] must be turned off before changing the con‐
298 dense percentage with .CONDENSE.
299
300 Note: If you're using the document processing macros with
301 .PRINTSTYLE TYPEWRITE, mom ignores \*[COND] requests.
302
303 \*[CONDSUP]...\*[CONDSUPX]
304 pseudo-condensed superscript
305
306 \*[DOWN n]
307 temporarily move downward in a line
308
309 \*[EN-MARK]
310 mark initial line of a range of line numbers (for use with line
311 numbered endnotes)
312
313 \*[EXT]
314 \*[EXTX]
315 Pseudo-extending on/off
316
317 \*[EXT] begins pseudo-extending type. \*[EXTX] turns the fea‐
318 ture off. Both are inline escape sequences; therefore, they
319 should not appear as separate lines, but rather be embedded in
320 text lines, like this:
321 \*[EXT]Not everything is as it seems.\*[EXTX]
322 \*[EXT] remains in effect until you turn it off with \*[EXTX].
323
324 IMPORTANT: You must turn \*[EXT] off before making any changes
325 to the point size of your type, either via the .PT_SIZE macro or
326 with the \s inline escape sequence. If you wish the new point
327 size to be pseudo-extended, simply reinvoke \*[EXT] afterward.
328 Equally, \*[EXT] must be turned off before changing the extend
329 percentage with .EXTEND.
330
331 Note: If you are using the document processing macros with
332 .PRINTSTYLE TYPEWRITE, mom ignores \*[EXT] requests.
333
334 \*[EXTSUP]...\*[EXTSUPX]
335 pseudo extended superscript
336
337 \*[FU n]
338 move characters pairs further apart inline (related to macro
339 .KERN)
340
341 \*[FWD n]
342 move forward in a line
343
344 \*[LEADER]
345 insert leaders at the end of a line
346
347 \*[RULE]
348 draw a full measure rule
349
350 \*[SIZE n]
351 change the point size inline (related to macro .PT_SIZE)
352
353 \*[SLANT]
354 \*[SLANTX]
355 Pseudo italic on/off
356
357 \*[SLANT] begins pseudo-italicizing type. \*[SLANTX] turns the
358 feature off. Both are inline escape sequences; therefore, they
359 should not appear as separate lines, but rather be embedded in
360 text lines, like this:
361 Not \*[SLANT]everything\*[SLANTX] is as it seems.
362
363 Alternatively, if you wanted the whole line pseudo-italicized,
364 you'd do
365 \*[SLANT]Not everything is as it seems.\*[SLANTX]
366
367 Once \*[SLANT] is invoked, it remains in effect until turned
368 off.
369
370 Note: If you're using the document processing macros with
371 .PRINTSTYLE TYPEWRITE, mom underlines pseudo-italics by default.
372 To change this behaviour, use the special macro
373 .SLANT_MEANS_SLANT.
374
375 \*[ST<number>]...\*[ST<number>X]
376 Mark positions of string tabs
377
378 The quad direction must be LEFT or JUSTIFY (see .QUAD and
379 .JUSTIFY) or the no-fill mode set to LEFT in order for these in‐
380 lines to function properly. Please see IMPORTANT, below.
381
382 String tabs need to be marked off with inline escape sequences
383 before being set up with the .ST macro. Any input line may con‐
384 tain string tab markers. <number>, above, means the numeric
385 identifier of the tab.
386
387 The following shows a sample input line with string tab markers.
388 \*[ST1]De minimus\*[ST1X]non curat\*[ST2]lex\*[ST2X].
389
390 String tab 1 begins at the start of the line and ends after the
391 word time. String tab 2 starts at good and ends after men. In‐
392 line escape sequences (e.g., font or point size changes, or hor‐
393 izontal movements, including padding) are taken into account
394 when mom determines the position and length of string tabs.
395
396 Up to nineteen string tabs may be marked (not necessarily all on
397 the same line, of course), and they must be numbered between 1
398 and 19.
399
400 Once string tabs have been marked in input lines, they have to
401 be set with .ST, after which they may be called, by number, with
402 .TAB.
403
404 Note: Lines with string tabs marked off in them are normal input
405 lines, i.e. they get printed, just like any input line. If you
406 want to set up string tabs without the line printing, use the
407 .SILENT macro.
408
409 IMPORTANT: Owing to the way groff processes input lines and
410 turns them into output lines, it is not possible for mom to
411 guess the correct starting position of string tabs marked off in
412 lines that are centered or set flush right.
413
414 Equally, she cannot guess the starting position if a line is
415 fully justified and broken with .SPREAD.
416
417 In other words, in order to use string tabs, LEFT must be ac‐
418 tive, or, if .QUAD LEFT or JUSTIFY are active, the line on which
419 the string tabs are marked must be broken manually with .BR (but
420 not .SPREAD).
421
422 To circumvent this behaviour, I recommend using the PAD to set
423 up string tabs in centered or flush right lines. Say, for exam‐
424 ple, you want to use a string tab to underscore the text of a
425 centered line with a rule. Rather than this,
426 .CENTER
427 \*[ST1]A line of text\*[ST1X]\c
428 .EL
429 .ST 1
430 .TAB 1
431 .PT_SIZE 24
432 .ALD 3p
433 \*[RULE]
434 .RLD 3p
435 .TQ
436 you should do:
437 .QUAD CENTER
438 .PAD "#\*[ST1]A line of text\*[ST1X]#"
439 .EL
440 .ST 1
441 .TAB 1
442 .PT_SIZE 24
443 .ALD 3p
444 \" You can't use \*[UP] or \*[DOWN] with \*[RULE].
445 .RLD 3p
446 .TQ
447
448 \*[SUP]...\*[SUPX]
449 superscript
450
451 \*[TB+]
452 Inline escape for .TN (Tab Next)
453
454 \*[UL]...\*[ULX]
455 invoke underlining inline (fixed width fonts only)
456
457 \*[UP n]
458 temporarily move upward in a line
459
460 Details of macros in alphabetical order
461 .AUTOLEAD
462 set the linespacing relative to the point size
463
464 .B_MARGIN <bottom margin>
465 Bottom Margin
466
467 Requires a unit of measure
468
469 .B_MARGIN sets a nominal position at the bottom of the page be‐
470 yond which you don't want your type to go. When the bottom mar‐
471 gin is reached, mom starts a new page. .B_MARGIN requires a
472 unit of measure. Decimal fractions are allowed. To set a nomi‐
473 nal bottom margin of 3/4 inch, enter
474 .B_MARGIN .75i
475
476 Obviously, if you haven't spaced the type on your pages so that
477 the last lines fall perfectly at the bottom margin, the margin
478 will vary from page to page. Usually, but not always, the last
479 line of type that fits on a page before the bottom margin causes
480 mom to start a new page.
481
482 Occasionally, owing to a peculiarity in groff, an extra line
483 will fall below the nominal bottom margin. If you're using the
484 document processing macros, this is unlikely to happen; the doc‐
485 ument processing macros are very hard-nosed about aligning bot‐
486 tom margins.
487
488 Note: The meaning of .B_MARGIN is slightly different when you're
489 using the document processing macros.
490
491 .FALLBACK_FONT <fallback font> [ ABORT | WARN ]
492 Fallback Font
493
494 In the event that you pass an invalid argument to .FAMILY (i.e.
495 a non-existent family), mom, by default, uses the fallback font,
496 Courier Medium Roman (CR), in order to continue processing your
497 file.
498
499 If you'd prefer another fallback font, pass .FALLBACK_FONT the
500 full family+font name of the font you'd like. For example, if
501 you'd rather the fallback font were Times Roman Medium Roman,
502 .FALLBACK_FONT TR
503 would do the trick.
504
505 Mom issues a warning whenever a font style set with .FT does not
506 exist, either because you haven't registered the style or be‐
507 cause the font style does not exist in the current family set
508 with .FAMILY. By default, mom then aborts, which allows you to
509 correct the problem.
510
511 If you'd prefer that mom not abort on non-existent fonts, but
512 rather continue processing using a fallback font, you can pass
513 .FALLBACK_FONT the argument WARN, either by itself, or in con‐
514 junction with your chosen fallback font.
515
516 Some examples of invoking .FALLBACK_FONT:
517
518 .FALLBACK_FONT WARN
519 mom will issue a warning whenever you try to access a
520 non-existent font but will continue processing your file
521 with the default fallback font, Courier Medium Roman.
522
523 .FALLBACK_FONT TR WARN
524 mom will issue a warning whenever you try to access a
525 non-existent font but will continue processing your file
526 with a fallback font of Times Roman Medium Roman; addi‐
527 tionally, TR will be the fallback font whenever you try
528 to access a family that does not exist.
529
530 .FALLBACK_FONT TR ABORT
531 mom will abort whenever you try to access a non-existent
532 font, and will use the fallback font TR whenever you try
533 to access a family that does not exist. If, for some
534 reason, you want to revert to ABORT, just enter
535 ".FALLBACK_FONT ABORT" and mom will once again abort on
536 font errors.
537
538 .FAM <family>
539 Type Family, alias of .FAMILY
540
541 .FAMILY <family>
542 Type Family, alias of .FAM
543
544 .FAMILY takes one argument: the name of the family you want.
545 Groff comes with a small set of basic families, each identified
546 by a 1-, 2- or 3-letter mnemonic. The standard families are:
547 A = Avant Garde
548 BM = Bookman
549 H = Helvetica
550 HN = Helvetica Narrow
551 N = New Century Schoolbook
552 P = Palatino
553 T = Times Roman
554 ZCM = Zapf Chancery
555
556 The argument you pass to .FAMILY is the identifier at left,
557 above. For example, if you want Helvetica, enter
558 .FAMILY H
559
560 Note: The font macro (.FT) lets you specify both the type family
561 and the desired font with a single macro. While this saves a
562 few keystrokes, I recommend using .FAMILY for family, and .FT
563 for font, except where doing so is genuinely inconvenient. ZCM,
564 for example, only exists in one style: Italic (I).
565
566 Therefore,
567 .FT ZCMI
568 makes more sense than setting the family to ZCM, then setting
569 the font to I.
570
571 Additional note: If you are running a groff version prior to
572 1.19.2, you must follow all .FAMILY requests with a .FT request,
573 otherwise mom will set all type up to the next .FT request in
574 the fallback font.
575
576 If you are running groff 1.19.2 or later, when you invoke the
577 .FAMILY macro, mom remembers the font style (Roman, Italic, etc)
578 currently in use (if the font style exists in the new family)
579 and will continue to use the same font style in the new family.
580 For example:
581 .FAMILY BM \" Bookman family
582 .FT I \" Medium Italic
583 <some text> \" Bookman Medium Italic
584 .FAMILY H \" Helvetica family
585 <more text> \" Helvetica Medium Italic
586
587 However, if the font style does not exist in the new family, mom
588 will set all subsequent type in the fallback font (by default,
589 Courier Medium Roman) until she encounters a .FT request that's
590 valid for the family.
591
592 For example, assuming you don't have the font Medium Condensed
593 Roman (mom extension CD) in the Helvetica family:
594 .FAMILY UN \" Univers family
595 .FT CD \" Medium Condensed
596 <some text> \" Univers Medium Condensed
597 .FAMILY H \" Helvetica family
598 <more text> \" Courier Medium Roman!
599
600 In the above example, you must follow .FAMILY H with a .FT re‐
601 quest that's valid for Helvetica.
602
603 Please see the Appendices, Adding fonts to groff, for informa‐
604 tion on adding fonts and families to groff,aswellasto see a list
605 of the extensions mom provides to groff's basic R, I, B, BI
606 styles.
607
608 Suggestion: When adding families to groff, I recommend following
609 the established standard for the naming families and fonts. For
610 example, if you add the Garamond family, name the font files
611 GARAMONDR
612 GARAMONDI
613 GARAMONDB
614 GARAMONDBI
615 GARAMOND then becomes a valid family name you can pass to .FAM‐
616 ILY. (You could, of course, shorten GARAMOND to just G, or GD.)
617 R, I, B, and BI after GARAMOND are the roman, italic, bold and
618 bold-italic fonts respectively.
619
620 .FONT R | B | BI | <any other valid font style>
621 Alias to .FT
622
623 .FT R | B | BI | <any other valid font style>
624 Set font
625
626 By default, groff permits .FT to take one of four possible argu‐
627 ments specifying the desired font:
628 R = (Medium) Roman
629 I = (Medium) Italic
630 B = Bold (Roman)
631 BI = Bold Italic
632
633 For example, if your family is Helvetica, entering
634 .FT B
635 will give you the Helvetica bold font. If your family were
636 Palatino, you'd get the Palatino bold font.
637
638 Mom considerably extends the range of arguments you can pass to
639 .FT, making it more convenient to add and access fonts of dif‐
640 fering weights and shapes within the same family.
641
642 Have a look here for a list of the weight/style arguments mom
643 allows. Be aware, though, that you must have the fonts, cor‐
644 rectly installed and named, in order to use the arguments. (See
645 Adding fonts to groff for instructions and information.) Please
646 also read the ADDITIONAL NOTE found in the description of the
647 .FAMILY macro.
648
649 How mom reacts to an invalid argument to .FT depends on which
650 version of groff you're using. If your groff version is 1.19.2
651 or later, mom will issue a warning and, depending on how you've
652 set up the fallback font, either continue processing using the
653 fallback font, or abort (allowing you to correct the problem).
654 In earlier versions, mom will silently continue processing, us‐
655 ing either the fallback font or the font that was in effect
656 prior to the invalid .FT call.
657
658 .FT will also accept, as an argument, a full family and font
659 name.
660
661 For example,
662 .FT HB
663 will set subsequent type in Helvetica Bold.
664
665 However, I strongly recommend keeping family and font separate
666 except where doing so is genuinely inconvenient.
667
668 For inline control of fonts, see Inline Escapes, font control.
669
670 .HI [ <measure> ]
671 Hanging indent — the optional argument requires a unit of mea‐
672 sure.
673
674 A hanging indent looks like this:
675 The thousand injuries of Fortunato I had borne as best I
676 could, but when he ventured upon insult, I vowed
677 revenge. You who so well know the nature of my soul
678 will not suppose, however, that I gave utterance to a
679 threat, at length I would be avenged...
680 The first line of text hangs outside the left margin.
681
682 In order to use hanging indents, you must first have a left in‐
683 dent active (set with either .IL or .IB). Mom will not hang
684 text outside the left margin set with .L_MARGIN or outside the
685 left margin of a tab.
686
687 The first time you invoke .HI, you must give it a measure. If
688 you want the first line of a paragraph to hang by, say, 1 pica,
689 do
690 .IL 1P
691 .HI 1P
692 Subsequent invocations of .HI do not require you to supply a
693 measure; mom keeps track of the last measure you gave it.
694
695 Generally speaking, you should invoke .HI immediately prior to
696 the line you want hung (i.e. without any intervening control
697 lines). And because hanging indents affect only one line,
698 there's no need to turn them off.
699
700 IMPORTANT: Unlike IL, IR and IB, measures given to .HI are NOT
701 additive. Each time you pass a measure to .HI, the measure is
702 treated literally. Recipe: A numbered list using hanging in‐
703 dents
704
705 Note: mom has macros for setting lists. This recipe exists to
706 demonstrate the use of hanging indents only.
707 .PAGE 8.5i 11i 1i 1i 1i 1i
708 .FAMILY T
709 .FT R
710 .PT_SIZE 12
711 .LS 14
712 .JUSTIFY
713 .KERN
714 .SS 0
715 .IL \w'\0\0.'
716 .HI \w'\0\0.'
717 1.\0The most important point to be considered is whether
718 the answer to the meaning of Life, the Universe, and
719 Everything really is 42. We have no one's word on the
720 subject except Mr. Adams's.
721 .HI
722 2.\0If the answer to the meaning of Life, the Universe,
723 and Everything is indeed 42, what impact does this have on
724 the politics of representation? 42 is, after all not a
725 prime number. Are we to infer that prime numbers don't
726 deserve equal rights and equal access in the universe?
727 .HI
728 3.\0If 42 is deemed non-exclusionary, how do we present
729 it as the answer and, at the same time, forestall debate
730 on its exclusionary implications?
731
732 First, we invoke a left indent with a measure equal to the width
733 of 2 figures spaces plus a period (using the \w inline escape).
734 At this point, the left indent is active; text afterward would
735 normally be indented. However, we invoke a hanging indent of
736 exactly the same width, which hangs the first line (and first
737 line only!) to the left of the indent by the same distance (in
738 this case, that means “out to the left margin”). Because we be‐
739 gin the first line with a number, a period, and a figure space,
740 the actual text (The most important point...) starts at exactly
741 the same spot as the indented lines that follow.
742
743 Notice that subsequent invocations of .HI don't require a mea‐
744 sure to be given.
745
746 Paste the example above into a file and preview it with
747 pdfmom filename.mom | ps2pdf - filename.pdf
748 to see hanging indents in action.
749
750 .IB [ <left measure> <right measure> ]
751 Indent both — the optional argument requires a unit of measure
752
753 .IB allows you to set or invoke a left and a right indent at the
754 same time.
755
756 At its first invocation, you must supply a measure for both in‐
757 dents; at subsequent invocations when you wish to supply a mea‐
758 sure, both must be given again. As with .IL and .IR, the mea‐
759 sures are added to the values previously passed to the macro.
760 Hence, if you wish to change just one of the values, you must
761 give an argument of zero to the other.
762
763 A word of advice: If you need to manipulate left and right in‐
764 dents separately, use a combination of .IL and .IR instead of
765 .IB. You'll save yourself a lot of grief.
766
767 A minus sign may be prepended to the arguments to subtract from
768 their current values. The \w inline escape may be used to spec‐
769 ify text-dependent measures, in which case no unit of measure is
770 required. For example,
771 .IB \w'margarine' \w'jello'
772 left indents text by the width of the word margarine and right
773 indents by the width of jello.
774
775 Like .IL and .IR, .IB with no argument indents by its last ac‐
776 tive values. See the brief explanation of how mom handles in‐
777 dents for more details.
778
779 Note: Calling a tab (with .TAB <n>) automatically cancels any
780 active indents.
781
782 Additional note: Invoking .IB automatically turns off .IL and
783 .IR.
784
785 .IL [ <measure> ]
786 Indent left — the optional argument requires a unit of measure
787
788 .IL indents text from the left margin of the page, or if you're
789 in a tab, from the left edge of the tab. Once IL is on, the
790 left indent is applied uniformly to every subsequent line of
791 text, even if you change the line length.
792
793 The first time you invoke .IL, you must give it a measure. Sub‐
794 sequent invocations with a measure add to the previous measure.
795 A minus sign may be prepended to the argument to subtract from
796 the current measure. The \w inline escape may be used to spec‐
797 ify a text-dependent measure, in which case no unit of measure
798 is required. For example,
799 .IL \w'margarine'
800 indents text by the width of the word margarine.
801
802 With no argument, .IL indents by its last active value. See the
803 brief explanation of how mom handles indents for more details.
804
805 Note: Calling a tab (with .TAB <n>) automatically cancels any
806 active indents.
807
808 Additional note: Invoking .IL automatically turns off IB.
809
810 .IQ [ <measure> ]
811 IQ — quit any/all indents
812
813 IMPORTANT NOTE: The original macro for quitting all indents was
814 .IX. This usage has been deprecated in favour of IQ. .IX will
815 continue to behave as before, but mom will issue a warning to
816 stderr indicating that you should update your documents.
817
818 As a consequence of this change, .ILX, .IRX and .IBX may now
819 also be invoked as .ILQ, .IRQ and .IBQ. Both forms are accept‐
820 able.
821
822 Without an argument, the macros to quit indents merely restore
823 your original margins and line length. The measures stored in
824 the indent macros themselves are saved so you can call them
825 again without having to supply a measure.
826
827 If you pass these macros the optional argument CLEAR, they not
828 only restore your original left margin and line length, but also
829 clear any values associated with a particular indent style. The
830 next time you need an indent of the same style, you have to sup‐
831 ply a measure again.
832
833 .IQ CLEAR, as you'd suspect, quits and clears the values for all
834 indent styles at once.
835
836 .IR [ <measure> ]
837 Indent right — the optional argument requires a unit of measure
838
839 .IR indents text from the right margin of the page, or if you're
840 in a tab, from the end of the tab.
841
842 The first time you invoke .IR, you must give it a measure. Sub‐
843 sequent invocations with a measure add to the previous indent
844 measure. A minus sign may be prepended to the argument to sub‐
845 tract from the current indent measure. The \w inline escape may
846 be used to specify a text-dependent measure, in which case no
847 unit of measure is required. For example,
848 .IR \w'jello'
849 indents text by the width of the word jello.
850
851 With no argument, .IR indents by its last active value. See the
852 brief explanation of how mom handles indents for more details.
853
854 Note: Calling a tab (with .TAB <n>) automatically cancels any
855 active indents.
856
857 Additional note: Invoking .IR automatically turns off IB.
858
859 .L_MARGIN <left margin>
860 Left Margin
861
862 L_MARGIN establishes the distance from the left edge of the
863 printer sheet at which you want your type to start. It may be
864 used any time, and remains in effect until you enter a new
865 value.
866
867 Left indents and tabs are calculated from the value you pass to
868 .L_MARGIN, hence it's always a good idea to invoke it before
869 starting any serious typesetting. A unit of measure is re‐
870 quired. Decimal fractions are allowed. Therefore, to set the
871 left margin at 3 picas (1/2 inch), you'd enter either
872 .L_MARGIN 3P
873 or
874 .L_MARGIN .5i
875
876 If you use the macros .PAGE, .PAGEWIDTH or .PAPER without invok‐
877 ing .L_MARGIN (either before or afterward), mom automatically
878 sets .L_MARGIN to 1 inch.
879
880 Note: .L_MARGIN behaves in a special way when you're using the
881 document processing macros.
882
883 .MCO Begin multi-column setting.
884
885 .MCO (Multi-Column On) is the macro you use to begin multi-col‐
886 umn setting. It marks the current baseline as the top of your
887 columns, for use later with .MCR. See the introduction to col‐
888 umns for an explanation of multi-columns and some sample input.
889
890 Note: Do not confuse .MCO with the .COLUMNS macro in the docu‐
891 ment processing macros.
892
893 .MCR Once you've turned multi-columns on (with .MCO), .MCR, at any
894 time, returns you to the top of your columns.
895
896 .MCX [ <distance to advance below longest column> ]
897 Optional argument requires a unit of measure.
898
899 Exit multi-columns.
900
901 .MCX takes you out of any tab you were in (by silently invoking
902 .TQ) and advances to the bottom of the longest column.
903
904 Without an argument, .MCX advances 1 linespace below the longest
905 column.
906
907 Linespace, in this instance, is the leading in effect at the mo‐
908 ment .MCX is invoked.
909
910 If you pass the <distance> argument to .MCX, it advances 1 line‐
911 space below the longest column (see above) PLUS the distance
912 specified by the argument. The argument requires a unit of mea‐
913 sure; therefore, to advance an extra 6 points below where .MCX
914 would normally place you, you'd enter
915 .MCX 6p
916
917 Note: If you wish to advance a precise distance below the base‐
918 line of the longest column, use .MCX with an argument of 0
919 (zero; no unit of measure required) in conjunction with the .ALD
920 macro, like this:
921 .MCX 0
922 .ALD 24p
923 The above advances to precisely 24 points below the baseline of
924 the longest column.
925
926 .NEWPAGE
927
928 Whenever you want to start a new page, use .NEWPAGE, by itself
929 with no argument. Mom will finish up processing the current
930 page and move you to the top of a new one (subject to the top
931 margin set with .T_MARGIN).
932
933 .PAGE <width> [ <length> [ <lm> [ <rm> [ <tm> [ <bm> ] ] ] ] ]
934
935 All arguments require a unit of measure
936
937 IMPORTANT: If you're using the document processing macros, .PAGE
938 must come after .START. Otherwise, it should go at the top of a
939 document, prior to any text. And remember, when you're using
940 the document processing macros, top margin and bottom margin
941 mean something slightly different than when you're using just
942 the typesetting macros (see Top and bottom margins in document
943 processing).
944
945 .PAGE lets you establish paper dimensions and page margins with
946 a single macro. The only required argument is page width. The
947 rest are optional, but they must appear in order and you can't
948 skip over any. <lm>, <rm>, <tm> and <bm> refer to the left,
949 right, top and bottom margins respectively.
950
951 Assuming your page dimensions are 11 inches by 17 inches, and
952 that's all you want to set, enter
953 .PAGE 11i 17i
954 If you want to set the left margin as well, say, at 1 inch, PAGE
955 would look like this:
956 .PAGE 11i 17i 1i
957
958 Now suppose you also want to set the top margin, say, at 1–1/2
959 inches. <tm> comes after <rm> in the optional arguments, but
960 you can't skip over any arguments, therefore to set the top mar‐
961 gin, you must also give a right margin. The .PAGE macro would
962 look like this:
963 .PAGE 11i 17i 1i 1i 1.5i
964 | |
965 required right---+ +---top margin
966 margin
967
968 Clearly, .PAGE is best used when you want a convenient way to
969 tell mom just the dimensions of your printer sheet (width and
970 length), or when you want to tell her everything about the page
971 (dimensions and all the margins), for example
972 .PAGE 8.5i 11i 45p 45p 45p 45p
973 This sets up an 8½ by 11 inch page with margins of 45 points
974 (5/8-inch) all around.
975
976 Additionally, if you invoke .PAGE with a top margin argument,
977 any macros you invoke after .PAGE will almost certainly move the
978 baseline of the first line of text down by one linespace. To
979 compensate, do
980 .RLD 1v
981 immediately before entering any text, or, if it's feasible, make
982 .PAGE the last macro you invoke prior to entering text.
983
984 Please read the Important note on page dimensions and papersize
985 for information on ensuring groff respects your .PAGE dimensions
986 and margins.
987
988 .PAGELENGTH <length of printer sheet>
989 tells mom how long your printer sheet is. It works just like
990 .PAGEWIDTH.
991
992 Therefore, to tell mom your printer sheet is 11 inches long, you
993 enter
994 .PAGELENGTH 11i
995 Please read the important note on page dimensions and papersize
996 for information on ensuring groff respects your PAGELENGTH.
997
998 .PAGEWIDTH <width of printer sheet>
999
1000 The argument to .PAGEWIDTH is the width of your printer sheet.
1001
1002 .PAGEWIDTH requires a unit of measure. Decimal fractions are
1003 allowed. Hence, to tell mom that the width of your printer
1004 sheet is 8½ inches, you enter
1005 .PAGEWIDTH 8.5i
1006
1007 Please read the Important note on page dimensions and papersize
1008 for information on ensuring groff respects your PAGEWIDTH.
1009
1010 .PAPER <paper type>
1011 provides a convenient way to set the page dimensions for some
1012 common printer sheet sizes. The argument <paper type> can be
1013 one of: LETTER, LEGAL, STATEMENT, TABLOID, LEDGER, FOLIO,
1014 QUARTO, EXECUTIVE, 10x14, A3, A4, A5, B4, B5.
1015
1016 .PRINTSTYLE
1017
1018 .PT_SIZE <size of type in points>
1019 Point size of type, does not require a unit of measure.
1020
1021 .PT_SIZE (Point Size) takes one argument: the size of type in
1022 points. Unlike most other macros that establish the size or
1023 measure of something, .PT_SIZE does not require that you supply
1024 a unit of measure since it's a near universal convention that
1025 type size is measured in points. Therefore, to change the type
1026 size to, say, 11 points, enter
1027 .PT_SIZE 11
1028 Point sizes may be fractional (e.g., 10.25 or 12.5).
1029
1030 You can prepend a plus or a minus sign to the argument to
1031 .PT_SIZE, in which case the point size will be changed by + or -
1032 the original value. For example, if the point size is 12, and
1033 you want 14, you can do
1034 .PT_SIZE +2
1035 then later reset it to 12 with
1036 .PT_SIZE -2
1037 The size of type can also be changed inline.
1038
1039 Note: It is unfortunate that the pic preprocessor has already
1040 taken the name, PS, and thus mom's macro for setting point sizes
1041 can't use it. However, if you aren't using pic, you might want
1042 to alias .PT_SIZE as .PS, since there'd be no conflict. For ex‐
1043 ample
1044 .ALIAS PS PT_SIZE
1045 would allow you to set point sizes with .PS.
1046
1047 .R_MARGIN <right margin>
1048 Right Margin
1049
1050 Requires a unit of measure.
1051
1052 IMPORTANT: .R_MARGIN, if used, must come after .PAPER,
1053 .PAGEWIDTH, .L_MARGIN, and/or .PAGE (if a right margin isn't
1054 given to PAGE). The reason is that .R_MARGIN calculates line
1055 length from the overall page dimensions and the left margin.
1056
1057 Obviously, it can't make the calculation if it doesn't know the
1058 page width and the left margin.
1059
1060 .R_MARGIN establishes the amount of space you want between the
1061 end of typeset lines and the right hand edge of the printer
1062 sheet. In other words, it sets the line length. .R_MARGIN re‐
1063 quires a unit of measure. Decimal fractions are allowed.
1064
1065 The line length macro (LL) can be used in place of .R_MARGIN.
1066 In either case, the last one invoked sets the line length. The
1067 choice of which to use is up to you. In some instances, you may
1068 find it easier to think of a section of type as having a right
1069 margin. In others, giving a line length may make more sense.
1070
1071 For example, if you're setting a page of type you know should
1072 have 6-pica margins left and right, it makes sense to enter a
1073 left and right margin, like this:
1074 .L_MARGIN 6P
1075 .R_MARGIN 6P
1076
1077 That way, you don't have to worry about calculating the line
1078 length. On the other hand, if you know the line length for a
1079 patch of type should be 17 picas and 3 points, entering the line
1080 length with LL is much easier than calculating the right margin,
1081 e.g.,
1082 .LL 17P+3p
1083
1084 If you use the macros .PAGE, .PAGEWIDTH or PAPER without invok‐
1085 ing .R_MARGIN afterward, mom automatically sets .R_MARGIN to 1
1086 inch. If you set a line length after these macros (with .LL),
1087 the line length calculated by .R_MARGIN is, of course, overrid‐
1088 den.
1089
1090 Note: .R_MARGIN behaves in a special way when you're using the
1091 document processing macros.
1092
1093 .ST <tab number> L | R | C | J [ QUAD ]
1094
1095 After string tabs have been marked off on an input line (see
1096 \*[ST]...\*[STX]), you need to set them by giving them a direc‐
1097 tion and, optionally, the QUAD argument.
1098
1099 In this respect, .ST is like .TAB_SET except that you don't have
1100 to give .ST an indent or a line length (that's already taken
1101 care of, inline, by \*[ST]...\*[STX]).
1102
1103 If you want string tab 1 to be left, enter
1104 .ST 1 L
1105 If you want it to be left and filled, enter
1106 .ST 1 L QUAD
1107 If you want it to be justified, enter
1108 .ST 1 J
1109
1110 .TAB <tab number>
1111 After tabs have been defined (either with .TAB_SET or .ST), .TAB
1112 moves to whatever tab number you pass it as an argument.
1113
1114 For example,
1115 .TAB 3
1116 moves you to tab 3.
1117
1118 Note: .TAB breaks the line preceding it and advances 1 line‐
1119 space. Hence,
1120 .TAB 1
1121 A line of text in tab 1.
1122 .TAB 2
1123 A line of text in tab 2.
1124 produces, on output
1125 A line of text in tab 1.
1126 A line of text in tab 2.
1127
1128 If you want the tabs to line up, use .TN (“Tab Next”) or, more
1129 conveniently, the inline escape sequence \*[TB+]:
1130 .TAB 1
1131 A line of text in tab 1.\*[TB+]
1132 A line of text in tab 2.
1133 which produces
1134 A line of text in tab 1. A line of text in tab 2.
1135
1136 If the text in your tabs runs to several lines, and you want the
1137 first lines of each tab to align, you must use the multi-column
1138 macros.
1139
1140 Additional note: Any indents in effect prior to calling a tab
1141 are automatically turned off by TAB. If you were happily zip‐
1142 ping down the page with a left indent of 2 picas turned on, and
1143 you call a tab whose indent from the left margin is 6 picas,
1144 your new distance from the left margin will be 6 picas, not I 6
1145 picas plus the 2 pica indent.
1146
1147 Tabs are not by nature columnar, which is to say that if the
1148 text inside a tab runs to several lines, calling another tab
1149 does not automatically move to the baseline of the first line in
1150 the previous tab. To demonstrate:
1151 TAB 1
1152 Carrots
1153 Potatoes
1154 Broccoli
1155 .TAB 2
1156 $1.99/5 lbs
1157 $0.25/lb
1158 $0.99/bunch
1159 produces, on output
1160 Carrots
1161 Potatoes
1162 Broccoli
1163 $1.99/5 lbs
1164 $0.25/lb
1165 $0.99/bunch
1166
1167 .TB <tab number>
1168 Alias to .TAB
1169
1170 .TI [ <measure> ]
1171 Temporary left indent — the optional argument requires a unit of
1172 measure
1173
1174 A temporary indent is one that applies only to the first line of
1175 text that comes after it. Its chief use is indenting the first
1176 line of paragraphs. (Mom's .PP macro, for example, uses a tem‐
1177 porary indent.)
1178
1179 The first time you invoke .TI, you must give it a measure. If
1180 you want to indent the first line of a paragraph by, say, 2 ems,
1181 do
1182 .TI 2m
1183
1184 Subsequent invocations of .TI do not require you to supply a
1185 measure; mom keeps track of the last measure you gave it.
1186
1187 Because temporary indents are temporary, there's no need to turn
1188 them off.
1189
1190 IMPORTANT: Unlike .IL, .IR and IB, measures given to .TI are NOT
1191 additive. In the following example, the second ".TI 2P" is ex‐
1192 actly 2 picas.
1193 .TI 1P
1194 The beginning of a paragraph...
1195 .TI 2P
1196 The beginning of another paragraph...
1197
1198 .TN Tab Next
1199
1200 Inline escape \*[TB+]
1201
1202 TN moves over to the next tab in numeric sequence (tab n+1)
1203 without advancing on the page. See the NOTE in the description
1204 of the .TAB macro for an example of how TN works.
1205
1206 In tabs that aren't given the QUAD argument when they're set up
1207 with .TAB_SET or ST, you must terminate the line preceding .TN
1208 with the \c inline escape sequence. Conversely, if you did give
1209 a QUAD argument to .TAB_SET or ST, the \c must not be used.
1210
1211 If you find remembering whether to put in the \c bothersome, you
1212 may prefer to use the inline escape alternative to .TN, \*[TB+],
1213 which works consistently regardless of the fill mode.
1214
1215 Note: You must put text in the input line immediately after .TN.
1216 Stacking of .TN's is not allowed. In other words, you cannot do
1217 .TAB 1
1218 Some text\c
1219 .TN
1220 Some more text\c
1221 .TN
1222 .TN
1223 Yet more text
1224 The above example, assuming tabs numbered from 1 to 4, should be
1225 entered
1226 .TAB 1
1227 Some text\c
1228 .TN
1229 Some more text\c
1230 .TN
1231 \&\c
1232 .TN
1233 Yet more text
1234 \& is a zero-width, non-printing character that groff recognizes
1235 as valid input, hence meets the requirement for input text fol‐
1236 lowing .TN.
1237
1238 .TQ TQ takes you out of whatever tab you were in, advances 1 line‐
1239 space, and restores the left margin, line length, quad direction
1240 and fill mode that were in effect prior to invoking any tabs.
1241
1242 .T_MARGIN <top margin>
1243 Top margin
1244
1245 Requires a unit of measure
1246
1247 .T_MARGIN establishes the distance from the top of the printer
1248 sheet at which you want your type to start. It requires a unit
1249 of measure, and decimal fractions are allowed. To set a top
1250 margin of 2½ centimetres, you'd enter
1251 .T_MARGIN 2.5c
1252 .T_MARGIN calculates the vertical position of the first line of
1253 type on a page by treating the top edge of the printer sheet as
1254 a baseline. Therefore,
1255 .T_MARGIN 1.5i
1256 puts the baseline of the first line of type 1½ inches beneath
1257 the top of the page.
1258
1259 Note: .T_MARGIN means something slightly different when you're
1260 using the document processing macros. See Top and bottom mar‐
1261 gins in document processing for an explanation.
1262
1263 IMPORTANT: .T_MARGIN does two things: it establishes the top
1264 margin for pages that come after it and it moves to that posi‐
1265 tion on the current page. Therefore, .T_MARGIN should only be
1266 used at the top of a file (prior to entering text) or after NEW‐
1267 PAGE, like this:
1268 .NEWPAGE
1269 .T_MARGIN 6P
1270 <text>
1271
1273 mom was written by Peter Schaffter ⟨peter@schaffter.ca⟩. PDF support
1274 was provided by Deri James ⟨deri@chuzzlewit.myzen.co.uk⟩. This manual
1275 page was written by Bernd Warken.
1276
1278 /usr/share/doc/groff/html/mom/toc.html
1279 entry point to the HTML documentation
1280
1281 ⟨http://www.schaffter.ca/mom/momdoc/toc.html⟩
1282 HTML documentation online
1283
1284 ⟨http://www.schaffter.ca/mom/⟩
1285 the mom macros homepage
1286
1287 Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner
1288 Lemberg, is the primary groff manual. You can browse it interactively
1289 with “info groff”.
1290
1291 pdfmom(1), groff(1), troff(1)
1292
1293
1294
1295groff 1.23.0 2 November 2023 groff_mom(7)