1 <?xml version="1.0" encoding="utf-8"?>
3 This file is part of groff, the GNU roff type-setting system.
5 Copyright (C) 2004-2020 Free Software Foundation, Inc.
6 Written by Peter Schaffter (peter@schaffter.ca).
8 Permission is granted to copy, distribute and/or modify this document
9 under the terms of the GNU Free Documentation License, Version 1.3 or
10 any later version published by the Free Software Foundation; with no
11 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
14 A copy of the Free Documentation License is included as a file called
15 FDL in the main directory of the groff source package.
18 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
19 <html xmlns="http://www.w3.org/1999/xhtml">
22 <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
23 <title>Mom -- Graphics, floats, and preprocessor support</title>
24 <link rel="stylesheet" type="text/css" href="stylesheet.css" />
27 <body style="background-color: #f5faff;">
29 <!-- ==================================================================== -->
31 <div id="top" class="page">
33 <!-- Navigation links -->
34 <table style="width: 100%;">
36 <td><a href="toc.html">Back to Table of Contents</a></td>
37 <td style="text-align: right;"><a href="headfootpage.html#top">Next: Page headers/footers, pagination</a></td>
41 <h1 class="docs">Graphics, floats, and preprocessor support</h1>
43 <div style="width: 80%; margin: auto;">
44 <ul class="no-enumerator" style="margin-left: -1em;">
45 <li><a href="#images-intro">Inserting images and graphics</a>
47 <li><a href="#converting">Image conversion and file processing</a>
48 <ul style="margin-left: -1em">
49 <li><a href="#pdf">PDF</a></li>
50 <li><a href="#eps">EPS</a></li>
52 <li><a href="#pdf-image">The PDF_IMAGE macro</a>
53 <ul style="margin-left: -1em">
54 <li><a href="#pdf-image-frame">PDF_IMAGE_FRAME</a>—set parameters for image frames</li>
56 <li><a href="#pspic">The PSPIC macro</a></li>
58 <li><a href="#floats-intro">Floats</a>
60 <li><a href="#float">The FLOAT macro</a></li>
61 <li><a href="#float-label-caption">Labelling and captioning floats</a>
62 <ul style="margin-left: -1em">
63 <li><a href="#label">LABEL</a></li>
64 <li><a href="#caption">CAPTION</a></li>
67 <li><a href="#preprocessor-support">Preprocessor support</a>
69 <li><a href="#tbl">tbl</a>
70 <ul style="margin-left: -1em;">
71 <li><a href="#ts-te">.TS / .TH / .TE macros and arguments</a></li>
73 <li><a href="#eqn">eqn</a>
74 <ul style="margin-left: -1em;">
75 <li><a href="#eq-en">.EQ / .EN macros and arguments</a></li>
77 <li><a href="#pic">pic</a>
78 <ul style="margin-left: -1em;">
79 <li><a href="#ps-pe">.PS / .PE macros and arguments</a></li>
80 <li><a href="#pic-text-style">PIC_TEXT_STYLE</a>—set parameters for text in diagrams</li>
82 <li><a href="#grap">grap</a></li>
83 <li><a href="#refer">refer</a></li>
85 <li><a href="#captions-and-labels">Captions and labels</a>
87 <li><a href="#autolabel">AUTOLABEL</a></li>
88 <li><a href="#set-autolabel">SET_AUTOLABEL</a></li>
89 <li><a href="#caption-after-label">CAPTION_AFTER_LABEL</a></li>
90 <li><a href="#captions-labels-sources">CAPTIONS / LABELS / SOURCES</a>—set parameters for each</li>
91 <li><a href="#mla">MLA</a></li>
93 <li><a href="#lists-of">Lists of Figures, Tables, and Equations</a>
95 <li><a href="#lists-placement">Placement of Lists</a></li>
96 <li><a href="#lists-macros">Macros to generate Lists</a></li>
97 <li><a href="#formatting-lists">Formatting and style parameters for Lists</a>
98 <ul style="margin-left: -1em">
99 <li><a href="#lists-style">LISTS_STYLE</a></li>
102 <li><a href="#box-intro">Shaded backgrounds and frames (boxes)</a>
104 <li><a href="#box-intro">Introduction and description</a></li>
105 <li><a href="#box">The BOX macro</a></li>
106 <li><a href="#box-notes">Additional notes on box usage and behaviour</a>
108 <li><a href="#qbef">QUOTE, BLOCKQUOTE, EPIGRAPH, FLOAT</a></li>
109 <li><a href="#code">CODE</a></li>
110 <li><a href="#quotes">Description of boxed BLOCKQUOTEs and EPIGRAPHs</a>
111 <ul style="margin-left: -1em; list-style: disc;">
112 <li><a href="#leftover">Leftover box syndrome</a></li>
114 <li><a href="#slides">Slides</a></li>
115 <li><a href="#footnotes">Footnotes</a></li>
117 <li><a href="#page-color-intro">Page colour</a></li>
123 <div class="rule-medium"><hr/></div>
125 <h2 id="images-intro" class="docs">Inserting images and graphics</h2>
128 In order to include images in mom documents, the images must be in
129 either PDF (.pdf) or EPS (.eps) format. Each format requires its own
130 macro, but both take the same arguments, and in the same order.
134 Please note that there are differences in the way the files
135 containing PDF and EPS images must be processed, hence documents may
139 <h3 id="converting" class="docs">Image conversion and file processing</h3>
142 When your image files are not in PDF or EPS format—jpgs,
143 for example—you must convert them before including them in
144 a mom document. Any utility for converting images may used. The
145 ImageMagick suite of programmes, present on most GNU/Linux
146 systems, contains <b>convert</b>, which is simple and effective.
149 <h4 id="pdf" class="docs">PDF</h4>
152 Assuming a jpg image, conversion to PDF is done like this:
154 <span class="pre-in-pp">
155 convert <image>.jpg <image>.pdf
157 Any image type supported by <b>convert</b> may be converted this
162 Mom files containing PDF images must be processed using
163 groff’s pdf driver. Use of
164 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>
165 is strongly recommended, which natively invokes the pdf driver.
167 <span class="pre-in-pp">
168 pdfmom doc.mom > doc.pdf
172 <h4 id="eps" class="docs">EPS</h4>
175 Assuming a jpg image, conversion to EPS is done like this:
177 <span class="pre-in-pp">
178 convert <image>.jpg <image>.eps
180 Any image type supported by <b>convert</b> may be converted this
181 way. There have been reports of trouble with PostScript level 2
182 images, so don’t save your images in this format.
186 Mom files containing EPS images must be processed using
187 groff’s postscript driver. Use of
188 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>,
189 which can be told to use the postscript driver, is strongly
192 <span class="pre-in-pp">
193 pdfmom -Tps doc.mom > doc.pdf
199 <div class="macro-id-overline">
200 <h3 id="pdf-image" class= "macro-id">PDF_IMAGE</h3>
203 <div class="box-macro-args">
204 Macro: <b>PDF_IMAGE</b> \
206 <kbd class="macro-args">[ -L | -C | -R | -I <indent> ] \
208 <pdf image file> <width> <height> [ SCALE <factor> ] \
210 [ ADJUST +|-<vertical adjustment> ] [ NO_SHIM ] [ NO_FLEX ] \
214 [ CAPTION "<caption>" ] [ SHORT_CAPTION "<short caption>" ] \
216 [ LABEL "<label>" ] [ TARGET "<name>" ]</kbd>
219 • <span style="font-style: normal">
220 <kbd><indent></kbd>,
221 <kbd><width></kbd>,
222 <kbd><height></kbd></span>
224 <span style="font-style: normal">
225 <kbd><vertical adjustment></kbd></span>
227 <a href="definitions.html#unitofmeasure">unit of measure</a>
230 <div class="box-tip">
232 <span class="note">Note:</span>
233 Mom files with embedded PDF images must be processed with
234 pdfmom doc.mom > doc.pdf. Arguments may be broken
235 into several lines using the “line-continued” backslash
236 (<b>\</b>), as shown above.
242 <a href="#pspic">PSPIC</a>,
243 which it resembles, PDF_IMAGE requires that the pdf image’s
244 dimensions (the bounding box,
245 <a href="#bounding-box">see below</a>)
246 be supplied each time it’s called.
250 The first optional argument tells mom how to align the image
251 horizontally, with <kbd>-L</kbd>, <kbd>-C</kbd>, and <kbd>-R</kbd>
252 standing for left, centre and right respectively. If you need more
253 precise placement, the <kbd>-I</kbd> argument allows you to give an
254 indent from the left margin. Thus, to indent a PDF image 6
255 <a href="definitions.html#picaspoints">picas</a>
258 <span class="pre-in-pp">
259 .PDF_IMAGE -I 6P <remaining arguments>
261 If you omit the first argument, the image will be centred.
265 <kbd><pdf image></kbd> must be in PDF format, with a .pdf
266 extension. If it is not, mom will abort with a message. See
267 <a href="#pdf">here</a>
268 for instructions on converting image formats to PDF.
271 <p id="bounding-box">
272 <kbd><width></kbd> and <kbd><height></kbd> are the
273 dimensions of the image’s bounding box. The most reliable way
274 of getting the bounding box is with the utility, <strong>pdfinfo</strong>:
276 <span class="pre-in-pp">
277 pdfinfo <image.pdf> | grep "Page *size"
279 This will spit out a line that looks like this:
281 <span class="pre-in-pp">
282 Page size: width x height pts
285 <a href="definitions.html#picaspoints">points</a>,
286 therefore the unit of measure appended to <kbd><width></kbd>
287 and <kbd><height></kbd> must be <kbd>p</kbd>.
291 The remaining arguments are optional and may be entered in any
292 order, although it’s best to put <kbd>CAPTION</kbd>,
293 <kbd>SHORT_CAPTION</kbd>, and <kbd>LABEL</kbd> last.
296 <h5 class="docs" style="margin-top: 1em; text-transform: none">SCALE</h5>
299 <kbd>SCALE</kbd> allows you to scale the image by
300 <kbd><factor></kbd>. The factor is a percentage of the
301 image’s original dimensions, thus <kbd>SCALE 50</kbd>
302 scales the image to 50 percent of its original size. No percent
303 sign or unit of measure should be appended.
306 <h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5>
309 <kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower
310 (<kbd>+</kbd>) the image
311 <span style="font-style: italic">within the space allotted for it</span>
312 by the amount you specify. This is useful for achieving good
313 optical centering between surrounding blocks of type. A unit of
317 <div class="box-tip">
319 <span class="note">Tip:</span>
320 You may sometimes find that a PDF_IMAGE at the bottom of a page
321 doesn’t sit flush on the bottom margin, however attempts to lower it
322 by adding space beforehand result in it being deferred to the next
326 <p class="tip-bottom">
327 The solution is to introduce <i>negative</i> space before the image
328 so that it displays on the page, then lower it to the bottom margin
329 with PDF_IMAGE’s ADJUST argument.
333 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5>
336 <kbd>NO_SHIM</kbd> instructs mom not to apply
337 <a href="docprocessing.html#shim-vs-flex">shimming</a>
338 after an image, which she will do automatically when shimming is
339 enabled, which it is by default. Shimming ensures that running text
340 after the image falls properly on the page’s
341 <a href="definitions.html#baseline-grid">baseline grid</a>,
342 but can result in slightly unequal spacing above and below
343 (correctable with the <kbd>ADJUST</kbd> argument).
344 <kbd>NO_SHIM</kbd> is useful when you have several images on the
345 page and there are visible differences in the spacing beneath them
346 as a result of shimming. To ensure a flush bottom margin, the last
347 image on the page should be shimmed, i.e. should not be given the
348 <kbd>NO_SHIM</kbd> argument.
351 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5>
354 <kbd>NO_FLEX</kbd> instructs mom not to apply
355 <a href="docprocessing.html#shim-vs-flex">flex-spacing</a>
356 after an image, which she will do automatically when flex-spacing is
357 enabled. <kbd>NO_FLEX</kbd> is useful when you have several images
358 on the page and you want to distribute excess vertical
359 whitespace on the page amongst other flex-spacing points on the
360 page. If there are no others, the final image should be
361 flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument.
364 <h5 class="docs" style="margin-top: 1em; text-transform: none">FRAME</h5>
367 <kbd>FRAME</kbd> instructs mom to put a frame around the image.
368 Parameters for the frame are set with
369 <a href="#pdf-image-frame">PDF_IMAGE_FRAME</a>.
372 <h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5>
375 <kbd>CAPTION</kbd> allows you to give the image a caption. By
376 default, the caption appears above the image, but may be attached to
377 the label that appears beneath the image. See
378 <a href="#caption-after-label">CAPTION_AFTER_LABEL</a>
380 <a href="#captions-and-labels">Captions and labels</a>.
381 The text of the caption must be surrounded by double-quotes.
384 <h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5>
387 <kbd>SHORT_CAPTION</kbd> allows you to trim long captions for
388 inclusion in the List of Figures. The text you supply, surrounded
389 by double-quotes, is what will appear in the List.
392 <h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5>
395 <kbd>LABEL</kbd>, if given, appears beneath the image. The text you
396 supply, surrounded by double-quotes, is how the image is labelled
397 in both the document proper and the List of Figures. Mom provides
398 an auto-labelling facility for images (see
399 <a href="#autolabel">AUTOLABEL</a>),
400 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
403 <h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5>
406 <kbd>TARGET</kbd> followed by a unique name surrounded by
407 double-quotes creates a PDF target for the image so that it may be
408 linked to from other places in the file (with PDF_LINK; see
409 <a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>).
413 <b><i>Please note:</i></b> The following functionality is available
414 only with groff 1.22.4 or later.
419 <a href="#autolabel">autolabelling</a>
420 is enabled and the document is processed with
421 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>,
422 the target name can be used to generate the target’s label
423 number in running text if it is entered as a groff string, i.e. of the
424 form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you create
425 a target named “foo” for a pdf image whose autolabel
426 number would be 3, entering
428 <span class="pre-in-pp">
430 .PDF_LINK foo "Figure \*[foo]"
432 anywhere in running text would result in a pdf link that reads
433 “Figure 3”. If chapter numbers are being prefixed to
434 labels, the same string in, say, chapter 5 would produce the pdf
435 link “Figure 5.3”.
438 <div class="box-tip">
440 <span class="note">Note: Version 2.0-c change</span>
442 Mom now treats all pdf images identically to
443 <a href="#floats-intro">floats</a>,
444 which is to say that if an image doesn’t fit on the output
445 page, she will defer it to the top of the next page while continuing
447 <a href="definitions.html#running">running text</a>.
448 <kbd>ADJUST</kbd> is ignored whenever an image is the first to be
449 deferred, except when moving from column to column on the same page,
450 when the image may need to be optically adjusted. Subsequent images
451 that do not fit, if any, are output in order immediately after the
455 <p class="tip-bottom">
456 Prior to 2.0-c, it was recommended that images be wrapped inside
457 <a href="#float">FLOAT</a>,
458 but this is now no longer required, and should, in fact, be avoided.
462 <!-- -PDF_IMAGE_FRAME- -->
464 <div class="macro-id-overline">
465 <h3 id="pdf-image-frame" class= "macro-id">PDF_IMAGE_FRAME</h3>
468 <div class="box-macro-args">
469 Macro: <b>PDF_IMAGE_FRAME</b> <kbd class="macro-args"><inset amount> <rule weight> <color></kbd>
472 • <span style="font-style: normal"><kbd><inset amount></kbd></span>
474 <a href="definitions.html#unitofmeasure">unit of measure</a>;
476 <span style="font-style: normal"><kbd><rule weight></kbd></span>
477 must not have a unit of measure appended
481 PDF_IMAGE_FRAME establishes the parameters for subsequent invocations of
482 <a href="#pdf-image">PDF_IMAGE</a>
483 when the <kbd>FRAME</kbd> argument is given. Arguments must appear
484 in order, and any you wish left at the current value should be
485 entered as two adjacent double-quotes. So, for example,
487 <span class="pre-in-pp">
488 .PDF_IMAGE_FRAME "" "" blue
490 leaves the inset value and rule weight at their current value and
491 changes the frame colour to blue.
495 Frames are drawn <span class="italic">outside</span> the image at
496 its requested dimensions inclusive of scaling. Colours must be
498 <a href="color.html#xcolor">XCOLOR</a>
500 <a href="color.html#newcolor">NEWCOLOR</a>.
504 The default inset is 6 <a
505 href="definitions.html#picaspoints">points</a>, the default rule
506 weight is .5 (points), and the default colour is black.
511 <div class="macro-id-overline">
512 <h3 id="pspic" class= "macro-id">PSPIC</h3>
515 <div class="box-macro-args">
516 Macro: <b>PSPIC</b> <kbd class="macro-args">[ -L | -R | -I <n> ] <file> [ width [ height ] ]</kbd>
520 PSPIC is not actually part of mom, but rather a macro included with
521 every groff installation. <kbd>man groff_tmac</kbd> contains the
522 documentation for PSPIC, but I’ll repeat it here with a few
523 modifications for clarity.
526 <div class="examples-container">
527 <h3 id="groff-tmac" class="docs" style="margin-top: .5em;">From <span style="text-transform: none">groff_tmac</span></h3>
528 <p style="margin-top: .5em; margin-bottom: .5em;">
529 <kbd><file></kbd> is the name of the file containing the
530 image; <kbd>width</kbd> and <kbd>height</kbd> give the desired
531 width and height of the image as you wish it to appear within the
532 document. The width and height arguments may have
533 <a href="definitions.html#unitofmeasure">units of measure</a>
534 attached; the default unit of measure is <kbd>i</kbd>. PSPIC will
535 scale the graphic uniformly in the x and y directions so that
536 it is no more than <kbd>width</kbd> wide and <kbd>height</kbd>
537 high. By default, the graphic will be horizontally centred. The
538 <kbd>-L</kbd> and <kbd>-R</kbd> options cause the graphic to be
539 left-aligned and right-aligned, respectively. The <kbd>-I</kbd>
540 option causes the graphic to be indented by <kbd><n></kbd>;
541 the default unit of measure is <kbd>m</kbd>
542 (<a href="definitions.html#em">ems</a>).
547 It is not necessary to pass PSPIC the <kbd><width></kbd>
548 and <kbd><height></kbd> arguments unless you are scaling
549 the image, in which case you will most likely need the original
550 dimensions of the EPS image’s bounding box. These can be
553 <span class="pre-in-pp">
554 gs -q -dBATCH -dNOPAUSE -sDEVICE=bbox <image file>.pdf 2>&1 \
555 | grep "%%BoundingBox" | cut -d " " -f4,5
557 The two digits returned are in
558 <a href="definitions.html#picaspoints">points</a>,
560 <a href="definitions.html#unitofmeasure">unit of measure</a>
561 <kbd>p</kbd> must be appended to them.
565 Because PSPIC lacks the <kbd>ADJUST</kbd> option offered by
566 <a href="#pdf-image">PDF_IMAGE</a>
567 a certain amount of manual tweaking of the vertical placement of the
568 image will probably be required, typically by using the
569 <a href="typesetting.html#ald">ALD</a>
571 <a href="typesetting.html#rld">RLD</a>
572 macros. Wrapping the image in a
573 <a href="#float">float</a>
574 and using FLOAT’s <kbd>ADJUST</kbd> option can also be used to
575 correct optical centering.
579 Additionally, non-floated EPS images
580 will almost certainly disrupt the baseline placement of
581 <a href="definitions.html#running">running text</a>.
582 In order to get mom back on track after inserting a non-floated
583 <kbd>.PSPIC</kbd> image, insert the
584 <a href="docprocessing.html#shim">SHIM</a>
586 <a href="docprocessing.html#flex">FLEX</a>
587 macro afterwards, depending on the
588 <a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a>
589 strategy in effect, so that the bottom margin of running text falls
594 Remember that mom files with embedded EPS images must be processed
597 <span class="pre-in-pp">
598 pdfmom -Tps doc.mom > doc.pdf
602 <div class="box-tip">
604 <span class="note">Please note:</span>
605 <kbd>PSPIC</kbd> does not support
606 <a href="autolabel">autolabelling</a>,
607 labels, captions, or inclusion in the List of Figures. If you wish
609 <a href="#converting">convert your images to pdf</a>
611 <a href="#pdf-image">PDF_IMAGE</a>
612 instead, then process the file with
613 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>
614 (without the <kbd>-Tps</kbd> option).
617 <div class="rule-medium"><hr/></div>
619 <h2 id="floats-intro" class="docs">Introduction to floats</h2>
622 Non-textual insertions in a document (tables, for example) sometimes
623 do not fit on the output page of a PDF or PostScript document at
624 the place they’re inserted in the input file. It’s
625 necessary, therefore, to defer them to the next page while carrying
627 <a href="definitions.html#running">running text</a>.
631 Whenever you need this functionality, mom provides the FLOAT macro.
635 Floats are usually used for images and graphics, but can contain
636 anything you like, including text. Whatever’s in the
637 float will be kept together as a block, output immediately if
638 there’s room, or deferred to the top of the next output page
639 when there isn’t; running text continues to the bottom of the
640 previous page without interruption.
644 In the case of a float that doesn’t fit being followed by
645 one that does, both are deferred and output one after the other.
646 Note that this represents a change from versions 2.1-b_1 and earlier
647 where the second float was output in position and the first was
652 A key distinction between a float and a
653 <a href="docelement.html#quote">QUOTE</a>
655 <a href="docelement.html#blockquote">BLOCKQUOTE</a>
656 is that while a float keeps everything together and defers output if
657 necessary, quotes and blockquotes are output immediately, and may
658 start on one page and finish on the next.
662 Floats always begin in
663 <a href="definitions.html#filled">no-fill mode</a>.
664 Text entered immediately after FLOAT will be set line-for-line
666 <a href="typesetting.html#justify">JUSTIFY</a>
668 <a href="typesetting.html#quad">QUAD L|R|C</a>
669 precedes it. Alternatively, any macro that sets a quad direction
671 <a href="docelement.html#pp">PP</a>.
675 Floats always deposit a break before they begin, which means the
676 line beforehand will not be
677 <a href="definitions.html#filled">filled</a>.
678 Floats, therefore, cannot be inserted in the middle of a paragraph
679 without studying the output file and determining where to break or
680 <a href="typesetting.html#spread">spread</a>
681 the line before the float. Furthermore, if you want a float between
682 paragraphs, the float should come before <kbd>.PP</kbd>, like this:
684 <span class="pre-in-pp">
692 <span class="pre-in-pp">
700 <p id="float-spacing">
701 Floats begin on the baseline immediately below the running text
702 preceding them. No additional whitespace surrounds them, above or
703 below. Running text below a float is, however,
704 <a href="docprocessing.html#shim">shimmed</a>
706 <a href="docprocessing.html#flex">flex-spaced</a>,
708 <a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a>
709 strategy in effect. This behaviour can be disabled for individual
710 floats with <kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd>.
714 If you’d like more space around a float, you must add it
715 manually, for example with
716 <a href="typesetting.html#ald">ALD</a>
718 <a href="typesetting.html#space">SPACE</a>.
723 <div class="macro-id-overline">
724 <h3 id="float" class= "macro-id">FLOAT</h3>
727 <div class="box-macro-args">
728 Macro: <b>FLOAT</b> <kbd class="macro-args"><arguments> | <anything>
732 [ ADJUST +|-<amount> ] \
738 [ INDENT <value> ] \
748 [ TARGET "<name>" ]</kbd>
752 <div class="box-tip">
754 <span class="note">Note:</span>
755 FLOAT is intended for use with the document processing macros only.
759 <div class="box-tip">
761 <span class="note">Note:</span>
762 As a general rule, avoid consecutive floats that have no intervening
763 <a href="definitions.html#running">running text</a>.
764 Rather, wrap all the material into a single float.
768 <div class="box-tip">
770 <span class="note">Note:</span>
771 Deferred floats are output with the left indent that was in effect
772 when they were input. If you do not want this behaviour, disable
773 the indent prior to inputting the float and re-enable it afterward.
777 <div class="box-tip">
779 <span class="note">Note:</span>
780 Mom treats <b>pic</b> pre-processor directives and pdf images as
781 floats so it is not necessary to wrap them inside FLOAT unless
782 additional material is included in what is floated.
786 <p style="margin-top: -.5em">
787 To begin a float, simply invoke <kbd>.FLOAT</kbd> and follow it with
788 whatever you want the float to contain. When you’re done,
789 invoke <kbd>.FLOAT OFF</kbd> (or <kbd>OFF</kbd>,
790 <kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc).
793 <h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5>
796 The optional <kbd>ADJUST</kbd> argument tells mom to raise
797 (<kbd>+</kbd>) or lower (<kbd>-</kbd>) the float <i>within
798 the space allotted to it</i> by the specified amount.
799 <kbd><amount></kbd> must have a
800 <a href="definitions.html#unitofmeasure">unit of measure</a>
801 appended. <kbd>ADJUST</kbd> gives you precise control over
802 the vertical centering of floats, allowing you to compensate for
803 unequal spacing that may result from the automatic
804 <a href="docprocessing.html#shim">shimming</a>
806 <a href="docprocessing.html#flex">flex-spacing</a>
811 <kbd>ADJUST</kbd> is ignored for the first float deferred to
812 a following page but respected for subsequent deferred floats
813 output immediately afterwards.
816 <h5 class="docs" style="margin-top: 1em; text-transform: none">FORCE</h5>
819 The <kbd>FORCE</kbd> argument instructs mom to output the float
820 exactly where it occurs in the input file. With <kbd>FORCE</kbd>,
821 mom immediately breaks to a new page to output the float if it does
822 not fit on the current page. While this is somewhat contrary to the
823 notion of floats (i.e. that running text should continue to fill the
824 page), there are circumstances where it may be desirable.
828 If you need to force a page break after completion of a float that
829 has been deferred to a subsequent page, insert <kbd>\!.bp</kbd>
830 immediately before terminating the float.
833 <h5 class="docs" style="margin-top: 1em; text-transform: none">SPAN</h5>
836 The <kbd>SPAN</kbd> argument tells mom that a float, if deferred,
837 may carry onto multiple pages. Please note that <kbd>SPAN</kbd> may
838 not be used for floats containing a boxed table; mom will abort with
839 a warning should this occur. Unboxed tables, on the other hand, are
840 acceptable within floats that are given the <kbd>SPAN</kbd> argument.
843 <h5 class="docs" style="margin-top: 1em; text-transform: none">INDENT</h5>
846 <kbd>INDENT</kbd> allows you to indent a float from the left margin
847 by a specified value. The value must have a
848 (<a href="definitions.html#unitofmeasure">unit of measure</a>
852 <h5 class="docs" style="margin-top: 1em; text-transform: none">CENTER</h5>
855 <kbd>CENTER</kbd> instructs mom to center a float if it is not
856 already centered by default.
859 <h5 class="docs" style="margin-top: 1em; text-transform: none">RIGHT</h5>
862 <kbd>RIGHT</kbd> instructs mom to place a float at the right of the
863 page; the longest line in the float will be flush with the
864 page’s right margin.
867 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5>
870 <kbd>NO_SHIM</kbd> instructs mom not to apply
871 <a href="docprocessing.html#shim-vs-flex">shimming</a>
872 after a float, which she will do automatically when shimming is
873 enabled, which it is by default. Shimming ensures that running text
874 after the float falls properly on the page’s
875 <a href="definitions.html#baseline-grid">baseline grid</a>,
876 but can result in slightly unequal spacing above and below
877 (correctable with the <kbd>ADJUST</kbd> argument).
878 <kbd>NO_SHIM</kbd> is useful when you have several floats on the
879 page and there are visible differences in the spacing beneath them
880 as a result of shimming. To ensure a flush bottom margin, the last
881 float on the page should be shimmed, i.e. should not be given the
882 <kbd>NO_SHIM</kbd> argument.
885 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5>
888 <kbd>NO_FLEX</kbd> instructs mom not to apply
889 <a href="docprocessing.html#shim-vs-flex">flex-spacing</a>
890 after a float, which she will do automatically when flex-spacing is
891 enabled. <kbd>NO_FLEX</kbd> is useful when you have several floats
892 on the page and you want to distribute excess vertical
893 whitespace on the page amongst other flex-spacing points on the
894 page. If there are no others, the final float should be
895 flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument.
898 <h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5>
901 <kbd>TARGET</kbd> followed by a unique name surrounded by
902 double-quotes creates a PDF target for the float so that it may be
903 linked to from other places in the file (with PDF_LINK; see
904 <a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>).
908 Floats cannot be autolabelled, so unlike pdf images and
909 pre-processor material, the target name cannot be used as a string
910 to generate the target’s label number in running text. Label
911 numbers for floats must be entered explicitly running text, however
912 they may be entered symbolically in the argument to
913 <a href="#label">LABEL</a>.
915 <a href="#reserved-label-strings">Reserved variables for
920 <div class="box-tip">
922 <span class="note">Note:</span>
924 <a href="definitions.html#filled">no-fill mode</a>,
925 with each input line beginning at the left margin. If this is not
926 what you want, you must specify the preferred horizontal alignment
927 <i>within the float</i> (e.g.
928 <a href="typesetting.html#lrc">CENTER</a>
930 <a href="typesetting.html#lrc">RIGHT</a>).
933 <p class="tip-bottom">
934 Furthermore, if you want text
935 <a href="definitions.html#filled">filled</a>,
937 <a href="typesetting.html#quad"><kbd>.QUAD L|R|C</kbd></a>
939 <a href="typesetting.html#justify"><kbd>.JUSTIFY</kbd></a>—again,
944 <h2 id="float-label-caption" class="docs">Labelling and captioning floats</h2>
947 Labelling and captioning of tables (<b>tbl</b>), equations
948 (<b>eq</b>), diagrams (<b>pic</b>) and pdf images
949 (<a href="#pdf-image">PDF_IMAGE</a>)
950 are handled by the macros that initiate them, regardless of whether
951 they’re wrapped inside a float. However, since a float may
952 contain any valid input, it is sometimes necessary to add a label
953 and/or caption to the float itself.
956 <div class="box-tip">
958 <span class="important">Important:</span>
959 Always use the native labelling/captioning facilities for
960 preprocessor output and pdf images rather than labelling the
961 containing float, if any.
966 The macros to label and caption floats are
967 <a href="#label">LABEL</a>
969 <a href="#caption">CAPTION</a>.
970 If a label or caption is to appear above the float, the appropriate
971 macro is entered immediately after
972 <a href="#float">FLOAT</a>.
973 If a label or caption is to appear beneath the float, the appropriate
974 macro is entered immediately before ending the float with
975 <kbd>FLOAT OFF</kbd>.
979 If a label and caption are to be joined, the <b>LABEL</b> macro is
980 used to enter both by passing the <kbd>CAPTION</kbd> argument to
985 It is impossible for mom to know the contents of a float, so
986 floats cannot be autolabelled. Each label must be entered
987 explicitly. Mom does, however, provide a way to enter both
988 chapter numbers and incrementing label numbers
989 <a href="#reserved-label-strings">symbolically</a>,
990 easing the burden of keeping the numbering scheme intact as
991 labelled floats are added to or subtracted from a document.
994 <div class="box-tip">
996 <span class="note">Tip:</span>
997 <a href="docelement.html#blockquote">QUOTE</a>
999 <a href="docelement.html#blockquote">BLOCKQUOTE</a>
1000 may also be labelled and captioned using <b>LABEL</b> and
1005 <h4 class="docs">Spacing</h4>
1008 If a float has a caption at the top, the caption is whitespaced
1009 1/4 linespace from running text and the float itself begins
1010 an additional 1/4 linespace below the caption. If the float has
1011 no corresponding label at the bottom, the float observes the
1012 bottom-spacing rules for all floats, namely that no extra space is
1014 <a href="docprocessing.html#shim">shimming</a>
1016 <a href="docprocessing.html#shim-vs-flex">flex-spacing</a>,
1018 <a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a>
1023 If a float has a label at the bottom but no caption at the top, the
1024 float begins exactly where started, i.e. with no extra whitespace
1025 between running text and the float. The label (and attached
1026 caption, if any) are whitespaced 1/4 linespace below the float,
1027 with an additional 1/4 linespace underneath <i>plus</i> shimming or
1032 Labelled/captioned quotes and blockquotes inside floats treat the
1033 labels/captions as part of the quote so the spacing above and
1034 below the whole float block is what you’d expect from quotes
1035 normally, while the spacing between the label/caption and the quote
1039 <div class="macro-id-overline">
1040 <h3 id="label" class="macro-id">LABEL</h3>
1043 <div class="box-macro-args">
1045 <kbd class="macro-args">"<label>" [ CAPTION "<caption>" ] [ SHORT_CAPTION ] \
1047 [ TO_LIST FIGURES | TABLES | EQUATIONS ]</kbd>
1051 The placement of a float’s label depends on where you put it
1056 If you want a label at the top, put <kbd>LABEL</kbd> immediately
1058 <a href="#float">FLOAT</a>
1059 and follow it with the text of the label surrounded by double-quotes:
1061 <span class="pre-in-pp">
1065 If you want a label at the bottom, put <kbd>LABEL</kbd> immediately
1066 before ending the float:
1068 <span class="pre-in-pp">
1070 <contents of float>
1076 <h3 id="reserved-label-strings" class="docs" style="text-transform: none">Reserved variables for labels</h3>
1079 Mom reserves strings you may use when entering
1080 label text after the <kbd>LABEL</kbd> argument.
1081 <kbd><span class="nobr">\*[chapter]</span></kbd> holds the current chapter
1082 or major section number. <kbd><span class="nobr">\*[fig-label]</span></kbd>,
1083 <kbd><span class="nobr">\*[tbl-label]</span></kbd>, and
1084 <kbd><span class="nobr">\*[eqn-label]</span></kbd> increment the label number of
1085 the appropriate label type by one, and are initially set to zero
1086 after each invocation of
1087 <a href="docprocessing.html#start">START</a>
1089 <a href="docprocessing.html#doctype">DOCTYPE</a>
1090 is <kbd>CHAPTER</kbd>. Thus, in every chapter requiring numbered
1091 float labels, you can enter
1093 <span class="pre-in-pp">
1094 .LABEL "Fig. \*[chapter].\*[fig-label]. TO_LIST FIGURES
1096 which, assuming the third autolabelled float of Chapter 2, will
1097 produce <kbd>Fig. 2.3.</kbd>
1101 If your <b>DOCTYPE</b> is <kbd>DEFAULT</kbd> or <kbd>NAMED</kbd>,
1102 you must reset <kbd><span class="nobr">\*[<type>-label]</span></kbd> after
1104 <a href="docprocessing.html#collate">COLLATE</a>
1107 <span class="pre-in-pp">
1108 .AUTOLABEL_<list type>
1110 before <kbd>.START</kbd>.
1115 <a href="#autolabel">autolabelling</a>
1116 is enabled, e.g. <kbd>.AUTOLABEL_IMAGES</kbd> (List
1117 of Figures) or <kbd>.AUTOLABEL_PIC</kbd> (also List of Figures),
1118 the prefix is stripped from the label when it appears in
1119 the List. Thus, if you have invoked <kbd>.AUTOLABEL_PIC</kbd>,
1121 <span class="pre-in-pp">
1123 CAPTION "Caption for label \
1128 <span class="pre-in-pp">
1129 .LABEL "Fig. \*[chapter].\*[label]." \
1130 CAPTION "Caption for label \
1133 will appear in the List of Figures as “1.1. Caption for
1137 <h3 class="docs">CAPTION</h3>
1140 If you’d like a caption attached to the label, pass
1141 <kbd>LABEL</kbd> the optional argument <kbd>CAPTION</kbd> followed
1142 by the text of the caption as a single string surrounded by
1145 <span class="pre-in-pp">
1147 <contents of float>
1148 .LABEL "Fig. 1" CAPTION "Caption for Fig. 1"
1152 <a href="#caption">CAPTION</a>
1153 macro by itself permits entering several strings, each output on
1154 a line by itself, whereas the <kbd>CAPTION</kbd> argument to
1155 <kbd>LABEL</kbd> accepts only a single string.
1158 <h3 class="docs">SHORT_CAPTION</h3>
1161 If your caption runs long and you’re including the
1162 float in a “List of ...”, (see
1163 <a href="#list-of">TO_LIST</a>, below)
1164 <kbd>SHORT_CAPTION</kbd> tells
1165 mom how you’d like the caption to appear in the List.
1168 <h3 class="docs">TO_LIST</h3>
1171 The optional argument <kbd>TO_LIST</kbd> tells mom to add the
1172 float’s label and attached caption, if present, to the specified
1173 <a href="#lists-of">list</a>,
1174 which may be one of <kbd>FIGURES</kbd>, <kbd>TABLES</kbd>, or
1175 <kbd>EQUATIONS</kbd>.
1179 If, for some reason, you want only the caption appended to the List,
1180 give <kbd>\&</kbd> as the first argument to LABEL, followed by
1181 <kbd>CAPTION “caption”</kbd>:
1183 <span class="pre-in-pp">
1189 <div class="box-tip">
1191 <span class="note">Tip:</span>
1192 <kbd>TO_LIST</kbd> can be used to handle situations where labelled
1193 floats need to go to a uniquely named “List of ...”.
1196 <p class="tip-bottom">
1197 Suppose, for example, your document contains figures (e.g.
1198 <b>pic</b> output or pdf-images) and tables, and you need a
1199 “List of Examples” for floats labelled “Example
1200 n.n”. By changing the default title string for
1201 <a href="#lists-macros">LIST_OF_EQUATIONS</a>
1202 to “List of Examples”, you may include the float in your
1203 List of Examples with
1205 <span class="pre-in-pp">
1206 .TO_FIGURES EQUATIONS
1211 <div class="macro-id-overline">
1212 <h3 id="caption" class="macro-id">CAPTION</h3>
1215 <div class="box-macro-args">
1216 Macro: <b>CAPTION</b>
1217 <kbd class="macro-args">"<caption>" \
1219 [ "<additional line>" [ "<additional line>"... ] ] \
1221 [ TO_LIST FIGURES | TABLES | EQUATIONS ]</kbd>
1225 The placement of a float’s caption depends on where you put it
1230 If you want a caption at the top, put <kbd>CAPTION</kbd> immediately
1232 <a href="#float">FLOAT</a>
1233 and follow it with the text of the caption surrounded by double-quotes:
1235 <span class="pre-in-pp">
1237 .CAPTION "Caption at top of float"
1239 <b>CAPTION</b> can take multiple string arguments, allowing for
1240 captions that run to several lines. There is a caveat: the strings
1241 are not automatically broken into individual lines. You must
1242 provide strings that include literal breaks or spaces:
1244 <span class="pre-in-pp">
1246 .CAPTION "Caption" ".BR" "at top" ".BR" "of float"
1250 <span class="pre-in-pp">
1252 .CAPTION "Caption" \
1258 If you want a caption at the bottom, put <kbd>CAPTION</kbd> immediately
1259 before ending the float:
1261 <span class="pre-in-pp">
1263 <contents of float>
1264 .CAPTION "Caption at bottom of float"
1269 <div class="box-tip">
1271 <span class="note">Note:</span>
1272 If you want a caption attached to a label, do not use
1273 <b>CAPTION</b> by itself. Rather, invoke
1274 <a href="#label"><kbd>.LABEL</kbd></a>
1275 with the <kbd>CAPTION</kbd> argument.
1279 <div class="rule-medium"><hr/></div>
1281 <h2 id="preprocessor-support" class="docs">Preprocessor support</h2>
1284 Mom offers full support for the <b>eqn</b> (equations), <b>pic</b>
1285 (diagrams), <b>grap</b> (graphs), <b>tbl</b> (tables) and
1286 <b>refer</b> (bibliographies/citations) preprocessors, including
1287 captions, labelling, autolabelling, and inclusion in the Lists of
1288 Equations, Figures, and Tables.
1292 Other than <b>refer</b>, which is discussed at length in the <a
1293 href="refer.html">Bibliographies and references</a> section, it is
1294 beyond the scope of this documentation to cover full preprocessor
1295 usage. Consult the manpages <b>eqn(1)</b>, <b>pic(1)</b>,
1296 <b>grap(1)</b> and <b>tbl(1)</b> for instructions.
1299 <div class="box-tip">
1301 <span class="note">Version 2.0-c changes</span>
1303 Preprocessor support has been revised and expanded as of version 2.0-c.
1304 Please read the following sections thoroughly and update any
1305 documents created with versions prior to 2.0-c as necessary.
1309 <h3 id="tbl" class="docs">tbl support</h3>
1312 Mom documents can include tables generated with the groff
1313 preprocessor <b>tbl</b>. If you are unfamiliar with <b>tbl</b>, I
1314 recommend downloading a copy of
1315 <a href="http://plan9.bell-labs.com/10thEdMan/tbl.pdf">Tbl - A Program to Format Tables</a>,
1316 which, in addition to providing a thorough introduction, contains
1317 some fine examples. If you use <b>tbl</b>, you must pass groff or
1318 pdfmom the <b>-t</b> flag when you process the file.
1322 Tables formatted with <kbd>tbl</kbd> begin with the macro
1323 <kbd>.TS</kbd> (<b>T</b>able <b>S</b>tart) and end with
1324 <kbd>.TE</kbd> (<b>T</b>able <b>E</b>nd). Depending on where you
1325 want your tables output in a document, you may need to wrap
1326 your <kbd>tbl</kbd> code inside a
1327 <a href="#floats-intro">float</a>,
1328 or pass the <kbd>H</kbd> argument to <kbd>.TS</kbd>.
1332 If you put <kbd>tbl</kbd> code inside a float, the table will be
1333 output immediately if it fits on the page, or deferred to the top
1334 of the next page if it doesn’t. If you prefer a table to
1335 begin where you say and span over to the next page, or if you know
1336 for certain a boxed table will run to multiple pages, simply pass the
1337 <kbd>H</kbd> argument to <kbd>.TS</kbd>, along with a corresponding
1338 <a href="#th"><kbd>TH</kbd></a>
1339 and do not wrap the table inside a float.
1342 <div class="box-tip">
1344 <span class="note">Note:</span>
1345 If you create a boxed table that will span several pages, do not
1346 wrap the table inside a float. Boxed, multipage tables and FLOAT
1347 should be considered mutually exclusive. This restriction is
1348 imposed by the <kbd>tbl</kbd> preprocessor itself, not groff or
1349 mom. Unboxed tables that span several pages, however, are
1350 acceptable within FLOAT.
1354 <h4 id="tbl-placement" class="docs">tbl placement in mom docs</h4>
1357 If you use <kbd>.TS</kbd> without the <kbd>H</kbd> argument (and
1358 therefore no <kbd>.TH</kbd>), tables that fit on the page are output
1359 in position. If there is not enough room to output the table,
1360 <kbd>tbl</kbd> will abort with message instructing you to use
1361 <kbd>.TS H/.TH</kbd>. Given that <kbd>.TS</kbd> without <kbd>H</kbd>
1362 may sometimes fail, it is advisable to begin all <b>tbl</b> blocks
1363 with <kbd>.TS H</kbd>.
1367 If you give <kbd>.TS</kbd> the <kbd>H</kbd> argument (with a
1368 corresponding <kbd>.TH</kbd>), tables will be output in position and
1369 span as many pages as necessary to complete output. A table header
1370 will be printed at the top of each page’s table output. In the
1371 event that there is not enough room to print the table header and
1372 at least one row of table data near the bottom of a page, mom will
1373 break to a new page before beginning table output, leaving a gap
1375 <a href="definitions.html#running">running text</a>.
1380 <a href="#floats-intro">floats</a>
1381 are output in position if they fit on the page. If not, they are
1382 deferred to the top of the next page without a break in running
1383 text. Boxed tables within floats may not, however, span multiple
1384 pages; mom will abort with a message should a boxed table in a float
1385 run longer than the page.
1389 Unboxed tables inside floats may span multiple pages provided the
1390 <kbd>SPAN</kbd> argument has been given to
1391 <a href="#float">FLOAT</a>.
1394 <div class="box-tip">
1396 <span class="note">Note:</span>
1397 The vertical spacing around unfloated tables may appear slightly
1398 unequal, especially if there are several tables on the page. This
1400 <a href="docprocessing.html#shim">shimming</a>
1402 <a href="docprocessing.html#flex">flex-spacing</a>
1403 that mom applies automatically after each table, depending on which
1404 <a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a>
1405 is in effect. You may
1406 disable shimming or flex-spacing with
1407 <a href="docprocessing.html#no-shim">NO_SHIM</a>
1409 <a href="docprocessing.html#no-flex">NO_FLEX</a>,
1410 or by passing the <kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd> argument
1411 to <kbd>.TS</kbd>. In either case, you will still likely want to
1412 adjust the spacing around with table with the <kbd>ADJUST</kbd>
1413 argument to <kbd>.TS</kbd>. Tables inside floats should be adjusted
1414 with the <kbd>ADJUST</kbd> argument to
1415 <a href="#float">FLOAT</a>,
1416 not the <kbd>ADJUST</kbd> argument to <kbd>.TS</kbd>.
1420 <div class="macro-id-overline">
1421 <h3 id="ts-te" class= "macro-id">.TS / .TH / .TE</h3>
1424 <div class="box-macro-args">
1425 Macro: <a href="#ts"><b>TS</b></a>
1426 <kbd class="macro-args"><br/>
1431 [ BOXED ]
1433 [ CENTER ]
1435 [ NEEDS ]
1437 [ ADJUST +|-<vertical adjustment>]</kbd>
1438 <span style="font-size: 95%">
1439 (<a href="definitions.html#unitofmeasure">unit of measure</a>
1442 <kbd class="macro-args"><br/>
1443 [ NO_SHIM ]
1445 [ NO_FLEX ]
1447 [ CAPTION "<caption>" ]
1449 [ SHORT_CAPTION "<short caption>" ]
1451 [ LABEL "<label>" ]
1453 [ TARGET "<name>" ]
1456 Macro: <a href="#th"><b>TH</b></a> <kbd class="macro-args">(optional, only if .TS H)</kbd>
1458 Macro: <a href="#te"><b>TE</b></a> <kbd class="macro-args">[ SOURCE "<text of table source>" ]</kbd>
1462 Tables to be formatted with <kbd>tbl</kbd> begin with the macro
1463 <kbd>.TS</kbd> and end with <kbd>.TE</kbd>. Global <kbd>tbl</kbd>
1464 options (“flags”), formatting, and data (per
1465 <kbd>tbl(1)</kbd>) come between the two macros.
1467 <span class="pre-in-pp">
1469 <tbl options, formatting, and data>
1472 Tables may be wrapped inside a
1473 <a href="#float-intro">float</a>,
1474 in which case, the entire table will be output on the current page
1475 if it fits, or deferred to the next page if it doesn’t.
1477 <span class="pre-in-pp">
1480 <tbl options, formatting, and data>
1486 <div class="macro-id-overline">
1487 <h4 id="ts" class="docs" style="font-size: 100%; margin-top: .5em">The .TS macro</h4>
1490 <div class="box-tip">
1492 <span class="note">Note: Version 2.0-c change</span>
1494 2.0-c introduces revisions to the handling of labels and/or
1495 captions, which, along with <kbd>NO_SHIM</kbd>, must now be given
1496 as arguments to <kbd>.TS</kbd> rather than <kbd>.TE</kbd>, as was
1497 the case formerly. Please read this section carefully if you have
1498 documents containing tables as they may need to be updated.
1502 <div class="box-important" style="margin-top: 1em">
1504 <span class="important">IMPORTANT:</span>
1505 All arguments to <b>TS</b> must appear on the same line as
1506 <kbd>.TS</kbd>. Do not attempt to break them up with the
1507 “line-continued” backslash. You may want to set your
1508 text editor to “wrap” mode in order to see all your
1509 arguments. This annoyance stems from the preprocessor mechanism
1510 itself, not groff or mom.
1515 The <b>TS</b> macro must be invoked before entering a <kbd>tbl</kbd>
1516 block. You may give as many or as few of its arguments as required,
1517 in any order, although it is advisable to put <kbd>CAPTION</kbd>,
1518 <kbd>SHORT_CAPTION</kbd>, and/or <kbd>LABEL</kbd> last.
1521 <h5 id="h" class="docs" style="margin-top: 1em; text-transform: none">H</h5>
1524 With the <b>H</b> argument, a table will span as many pages as
1525 necessary, with or without a running header. The placement of the
1527 <a href="#th"><kbd>.TH</kbd></a>,
1528 which is required whenever the <b>H</b> argument is given,
1529 determines what, if anything, goes in the header. Compare the
1531 <span class="pre-in-pp">
1537 Percent Increase .TH
1538 2002-2012 Percent Increase
1540 <tbl data> <tbl data>
1543 The first example will create a table that spans multiple
1544 pages if necessary, with a running header (“Percent
1545 Increase / 2002-2012”) for that table appearing at
1546 the top of each page until the table ends. The second example,
1547 equally, may run to several pages, but without the running header.
1549 <a href="#th"><b>TH</b></a>
1550 for an explanation of <kbd>.TH</kbd> placement.
1553 <div id="h-tip" class="box-tip">
1555 <span class="note">Tip:</span>
1556 Generally speaking, it’s a good idea to get into the habit
1557 of using <kbd>.TS H</kbd> all the time, since there are no
1558 circumstances under which it fails, whereas <kbd>.TS</kbd> without
1559 <kbd>H</kbd> will fail on tables that exceed the page length.
1563 <h5 class="docs" style="margin-top: 1em; text-transform: none">BOXED</h5>
1566 If a table is to be boxed (i.e., <kbd>tbl</kbd> is given the flags
1567 <kbd>'box'</kbd> or <kbd>'allbox'</kbd>) you must pass the argument
1568 <kbd>BOXED</kbd> to <kbd>.TS</kbd>, as in this example:
1570 <span class="pre-in-pp">
1581 <h5 class="docs" style="margin-top: 1em; text-transform: none">CENTER</h5>
1584 If a table is to be centered on the page, (i.e., <kbd>tbl</kbd> is
1585 given the <kbd>'center'</kbd> flag), you must pass the argument
1586 <kbd>CENTER</kbd> to <kbd>.TS</kbd>, as in this example, which
1587 creates a (possibly) multipage boxed table, centered on the page,
1588 with a running header.
1589 <span class="pre-in-pp">
1604 <h5 class="docs" style="margin-top: 1em; text-transform: none">NEEDS</h5>
1607 If a table is not inside a float and you pass <kbd>.TS </kbd> the
1608 <kbd>H</kbd> argument (which you should; see the tip
1609 <a href="#h-tip">here</a>),
1610 mom begins output immediately where the table occurs in the
1611 input file <i>if there is enough room on the output page for the
1612 table header plus at least one row of table data</i>. If there
1613 isn’t enough room, mom breaks to a new page before beginning
1614 the table, leaving a gap in
1615 <a href="definitions.html#running">running text</a>
1616 at the bottom of the previous page. If, for aesthetic reasons,
1617 you would prefer that mom require more than one row of table data
1618 beneath the header near the bottom of a page, you may increase the
1619 number with the <kbd>NEEDS</kbd> argument, followed by the desired
1623 <h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5>
1626 <kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower
1627 (<kbd>+</kbd>) the table
1628 <span style="font-style: italic">within the space allotted for it</span>
1629 by the amount you specify. This is useful for achieving good
1630 optical centering between surrounding blocks of type. A unit of
1631 measure is required.
1634 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5>
1637 <kbd>NO_SHIM</kbd> instructs mom not to apply
1638 <a href="docprocessing.html#shim-vs-flex">shimming</a>
1639 after a table, which she will do automatically when shimming is
1640 enabled, which it is by default. Shimming ensures that running text
1641 after the table falls properly on the page’s
1642 <a href="definitions.html#baseline-grid">baseline grid</a>,
1643 but can result in slightly unequal spacing above and below
1644 (correctable with the <kbd>ADJUST</kbd> argument).
1645 <kbd>NO_SHIM</kbd> is useful when you have several tables on the
1646 page and there are visible differences in the spacing beneath them
1647 as a result of shimming. To ensure a flush bottom margin, the last
1648 table on the page should be shimmed, i.e. should not be given the
1649 <kbd>NO_SHIM</kbd> argument.
1652 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5>
1655 <kbd>NO_FLEX</kbd> instructs mom not to apply
1656 <a href="docprocessing.html#shim-vs-flex">flex-spacing</a>
1657 after a table, which she will do automatically when flex-spacing is
1658 enabled. <kbd>NO_FLEX</kbd> is useful when you have several tables
1659 on the page and you want to distribute excess vertical
1660 whitespace on the page amongst other flex-spacing points on the
1661 page. If there are no others, the final table should be
1662 flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument.
1665 <h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5>
1668 <kbd>CAPTION</kbd> allows you to give the table a caption. By
1669 default, the caption appears above the table, but may be attached to
1670 the label that appears beneath the table. See
1671 <a href="#caption-after-label">CAPTION_AFTER_LABEL</a>
1673 <a href="#captions-and-labels">Captions and labels</a>.
1674 The text of the caption must be surrounded by double-quotes.
1678 Please note that if your table has a caption, you must invoke
1679 <kbd>TS</kbd> with the <kbd>H</kbd> flag, which also entails the use
1681 <a href="#th">TH</a>.
1684 <h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5>
1687 <kbd>SHORT_CAPTION</kbd> allows you to trim long captions for
1688 inclusion in the List of Tables. The text you supply, surrounded
1689 by double-quotes, is what will appear in the List.
1692 <h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5>
1695 <kbd>LABEL</kbd>, if given, appears beneath the table. The text you
1696 supply, surrounded by double-quotes, is how the table is labelled
1697 in both the document proper and the List of Tables. Mom provides
1698 an auto-labelling facility for tables (see
1699 <a href="#autolabel">AUTOLABEL</a>),
1700 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
1703 <h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5>
1706 <kbd>TARGET</kbd> followed by a unique name surrounded by
1707 double-quotes creates a PDF target for the table so that it may be
1708 linked to from other places in the file (with PDF_LINK; see
1709 <a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>).
1713 <b><i>Please note:</i></b> The following functionality is available
1714 only with groff 1.22.4 or later.
1719 <a href="#autolabel">autolabelling</a>
1720 is enabled and the document is processed with
1721 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>,
1722 the target name can be used to generate the target’s label
1723 number in running text if it is entered as a groff string, i.e. of
1724 the form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you
1725 create a target called “foo” for a table whose autolabel
1726 number would be 3, entering
1728 <span class="pre-in-pp">
1730 .PDF_LINK foo "Table \*[foo]"
1732 anywhere in running text would result in a pdf link that reads
1733 “Table 3”. If chapter numbers are being prefixed to
1734 labels, the same string in, say, chapter 5 would produce the pdf
1735 link “Table 5.3”.
1738 <div class="macro-id-overline">
1739 <h4 id="th" class="docs" style="font-size: 100%; margin-top: .5em">The .TH macro</h4>
1743 The <b>TH</b> macro (<b>T</b>able <b>H</b>eader), which is required
1744 when you begin a table with <kbd>.TS H</kbd>, allows you to
1745 determine what goes in a table’s running header if it spans
1746 multiple pages. Placing <kbd>.TH</kbd> under the first row of
1747 <kbd>tbl</kbd> data makes the first row the header. If placed under
1748 the second row, the first and second rows form the header, and so
1753 As there are sometimes reasons to run <kbd>.TS H</kbd> when
1754 you don’t, in fact, want a running header (e.g. when
1755 your table has a caption), you can suppress it by placing
1756 <kbd>.TH</kbd> immediately underneath your <kbd>tbl</kbd> formatting
1757 specifications, the last line of which always ends with a period
1758 (see <kbd>tbl(1)</kbd>).
1763 <kbd><a href="#h">H</a></kbd>
1764 argument to <kbd>.TS</kbd> for examples demonstrating <kbd>.TH</kbd>
1768 <div class="macro-id-overline">
1769 <h4 id="te" class="docs" style="font-size: 100%; margin-top: .5em">The .TE macro</h4>
1773 <kbd>tbl</kbd> blocks must be terminated with <kbd>.TE</kbd>,
1774 which, as of version 2.0-c, takes a single, optional argument,
1775 <kbd>SOURCE</kbd>. (Formerly, <kbd>TE</kbd> took a label/caption
1776 argument along with arguments controlling placement.) The argument
1777 is followed by the text of the table’s source, surrounded by
1778 double-quotes. The SOURCE argument may only be used if
1779 <a href="#mla">MLA</a>
1780 (Modern Language Association) style is enabled.
1783 <div class="rule-medium"><hr/></div>
1785 <h3 id="pic" class="docs">pic support</h3>
1788 Mom documents can include diagrams generated with the groff
1789 preprocessor <b>pic</b>. If you are unfamiliar with <b>pic</b>, I
1790 recommend downloading a copy of
1791 <a href="http://www.kohala.com/start/troff/gpic.raymond.ps">Making Pictures with GNU PIC</a>
1792 which provides a thorough introduction and contains many examples.
1793 If you use <b>pic</b>, you must pass groff or pdfmom the <b>-p</b>
1794 flag when you process the file.
1799 Diagrams created with <kbd>pic</kbd> begin with the macro
1800 <kbd>.PS</kbd> (<b>P</b>ic <b>S</b>tart) and end with
1801 <kbd>.PE</kbd> (<b>P</b>ic <b>E</b>nd). Everything between them is
1802 interpreted by the preprocessor as pic instructions. Please note:
1803 <i>Making Pictures with GNU PIC</i> says that <kbd>.PF</kbd> can
1804 also be used to terminate a pic diagram, but this is not supported
1809 Pic diagrams are always centered. Note that this represents a
1810 change from version 2.0-b of mom, where centering diagrams required
1811 passing <kbd>-mpic</kbd> to <b>groff</b> or
1812 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>
1813 on the command line.
1817 In addition, mom treats <b>pic</b> diagrams identically to
1818 <a href="#floats-intro">floats</a>,
1819 which is to say that if a diagram doesn’t fit on the output
1820 page, she will defer it to the top of the next page while continuing
1822 <a href="definitions.html#running">running text</a>.
1823 <kbd>ADJUST</kbd> is ignored whenever a diagram is deferred, except
1824 when moving from column to column on the same page, when the diagram
1825 may need to be optically adjusted. Subsequent diagrams that do not
1826 fit, if any, are output in order immediately after the first.
1830 Lastly, if your diagrams contain text, you may set all the type
1831 parameters for the text (family, font, size, leading) separately
1832 from the <b>pic</b> block with the macro
1833 <a href="#pic-text-style">PIC_TEXT_STYLE</a>.
1834 If you need to change the type parameters within the block
1835 on-the-fly, you must use <b>pic</b>’s native facilities for
1839 <div class="macro-id-overline">
1840 <h3 id="ps-pe" class= "macro-id">.PS / .PE</h3>
1843 <div class="box-macro-args">
1845 <kbd class="macro-args">
1847 Arguments: [ <width> <height> ]
1848 <kbd class="macro-args">
1850 [ LEFT ]</kbd>
1852 [ ADJUST +|-<vertical adjustment>]</kbd>
1853 <span style="font-size: 95%">
1854 (<a href="definitions.html#unitofmeasure">unit of measure</a>
1857 <kbd class="macro-args"><br/>
1858 [ NO_SHIM ]
1860 [ NO_FLEX ]
1862 [ CAPTION "<caption>" ]
1864 [ SHORT_CAPTION "<short caption>" ]
1866 [ LABEL "<label>" ]
1868 [ TARGET "<name>" ]
1871 Macro: <b>PE</b> <span style="font-size: 95%">(no arguments; ends
1872 the <b>pic</b> block)</span>
1875 <div class="box-important" style="margin-top: 1.5em">
1877 <span class="important">IMPORTANT:</span>
1878 All arguments to <b>PS</b> must appear on the same line as
1879 <kbd>.PS</kbd>. Do not attempt to break them up with the
1880 “line-continued” backslash. You may want to set your
1881 text editor to “wrap” mode in order to see all your
1882 arguments. This annoyance stems from the preprocessor mechanism
1883 itself, not groff or mom.
1887 <h5 class="docs" style="margin-top: 1em; text-transform: none">'width' and 'height'</h5>
1890 The <kbd>width</kbd> and <kbd>height</kbd> arguments to
1891 <kbd>.PS</kbd> are idiosyncratic owing to the preprocessor itself.
1892 Both are optional and both expect a value in inches, so neither
1893 argument should have a
1894 (<a href="definitions.html#unitofmeasure">unit of measure</a>
1899 If the <kbd>width</kbd> argument is supplied, the diagram, but
1900 not any text it contains, is scaled to the given width. If a
1901 literal width argument of <kbd>0</kbd> (zero) is given and a
1902 <kbd>height</kbd> argument is supplied, the diagram, but not any
1903 text it contains, will be scaled to the requested height. In the
1904 case of two non-zero arguments being given, only the height scaling
1908 <h5 class="docs" style="margin-top: 1em; text-transform: none">LEFT</h5>
1911 By default, pic diagrams are centred on the page. If you would
1912 prefer them to be flush left, pass <kbd>PS</kbd> the <kbd>LEFT</kbd>
1915 <h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5>
1918 <kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower
1919 (<kbd>+</kbd>) a diagram
1920 <span style="font-style: italic">within the space allotted for it</span>
1921 by the amount you specify. This is useful for achieving good
1922 optical centering between surrounding blocks of type. A unit of
1923 measure is required.
1926 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5>
1929 <kbd>NO_SHIM</kbd> instructs mom not to apply
1930 <a href="docprocessing.html#shim-vs-flex">shimming</a>
1931 after a <b>pic</b> diagram, which she will do automatically when
1932 shimming is enabled, which it is by default. Shimming ensures that
1933 running text after the diagram falls properly on the page’s
1934 <a href="definitions.html#baseline-grid">baseline grid</a>,
1935 but can result in slightly unequal spacing above and below
1936 (correctable with the <kbd>ADJUST</kbd> argument).
1937 <kbd>NO_SHIM</kbd> is useful when you have several diagrams on the
1938 page and there are visible differences in the spacing beneath them
1939 as a result of shimming. To ensure a flush bottom margin, the last
1940 diagram on the page should be shimmed, i.e. should not be given the
1941 <kbd>NO_SHIM</kbd> argument.
1944 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5>
1947 <kbd>NO_FLEX</kbd> instructs mom not to apply
1948 <a href="docprocessing.html#shim-vs-flex">flex-spacing</a>
1949 after a <b>pic</b> diagram, which she will do automatically when
1950 flex-spacing is enabled. <kbd>NO_FLEX</kbd> is useful when you
1951 have several diagrams on the page and you want to distribute excess
1952 vertical whitespace on the page amongst other flex-spacing points
1953 on the page. If there are no others, the final diagram should be
1954 flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument.
1957 <h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5>
1960 <kbd>CAPTION</kbd> allows you to give the diagram a caption. By
1961 default, the caption appears above the diagram, but may be attached to
1962 the label that appears beneath it. See
1963 <a href="#caption-after-label">CAPTION_AFTER_LABEL</a>
1965 <a href="#captions-and-labels">Captions and labels</a>.
1966 The text of the caption must be surrounded by double-quotes.
1969 <h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5>
1972 <kbd>SHORT_CAPTION</kbd> allows you to trim long captions for
1973 inclusion in the List of Figures. The text you supply, surrounded
1974 by double-quotes, is what will appear in the List.
1977 <h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5>
1980 <kbd>LABEL</kbd>, if given, appears beneath the diagram. The text you
1981 supply, surrounded by double-quotes, is how the diagram is labelled
1982 in both the document proper and the List of Figures. Mom provides
1983 an auto-labelling facility for diagrams (see
1984 <a href="#autolabel">AUTOLABEL</a>),
1985 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
1988 <h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5>
1991 <kbd>TARGET</kbd> followed by a unique name surrounded by
1992 double-quotes creates a PDF target for the diagram so that it may be
1993 linked to from other places in the file (with PDF_LINK; see
1994 <a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>).
1998 <b><i>Please note:</i></b> The following functionality is available
1999 only with groff 1.22.4 or later.
2004 <a href="#autolabel">autolabelling</a>
2005 is enabled and the document is processed with
2006 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>,
2007 the target name can be used to generate the target’s label
2008 number in running text if it is entered as a groff string, i.e. of
2009 the form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you
2010 create a target called “foo” for a diagram whose
2011 autolabel number would be 3, entering
2013 <span class="pre-in-pp">
2015 .PDF_LINK foo "Figure \*[foo]"
2017 anywhere in running text would result in a pdf link that reads
2018 “Figure 3”. If chapter numbers are being prefixed to
2019 labels, the same string in, say, chapter 5 would produce the pdf
2020 link “Figure 5.3”.
2023 <!-- PIC_TEXT_STYLE -->
2025 <div class="macro-id-overline">
2026 <h3 id="pic-text-style" class= "macro-id">PIC_TEXT_STYLE</h3>
2029 <div class="box-macro-args">
2030 Macro: <b>PIC_TEXT_STYLE</b> \
2032 <kbd class="macro-args">
2033 [ FAMILY ] "<family>" \
2035 [ FONT ] "<font>" \
2037 [ SIZE ] "+|-<size>" \
2039 [ AUTOLEAD ] "<value>"
2044 Diagrams drawn with <b>pic</b> may contain text, and groff
2045 <a href="inlines.html#intro-inlines">inline escapes</a>
2046 may be used to alter the text parameters. A problem that arises
2047 from so doing is that, in many cases, it clutters up the <b>pic</b>
2052 PIC_TEXT_STYLE lets you establish the type parameters for text
2053 inside a <b>pic</b> block all at once in cases where so doing
2054 improves the readability of your mom source files.
2058 The arguments to PIC_TEXT_STYLE behave identically to the arguments
2059 to other control macros, explained
2060 <a href="docelement.html#control-macro-args">here</a>.
2061 They may be given in any order, and you may use as many or as few as
2065 <div class="box-tip">
2067 <span class="note">Note:</span>
2068 Text within <b>pic</b> diagrams does not scale when you provide a
2069 scaling argument to <kbd>.PS</kbd>. This is a limitation of the
2070 preprocessor itself, not groff or mom.
2074 <div class="rule-medium"><hr/></div>
2076 <h3 id="grap" class="docs">grap support</h3>
2079 Grap is a <b>pic</b> preprocessor for creating graphs. Grap
2080 usage is covered in the <kbd>grap(1)</kbd> manpage. Its mom
2081 implementation is the same as for <b>pic</b> except that instead of
2082 enclosing directives between
2083 <a href="#ps-pe">.PS / .PE</a>,
2084 they are enclosed between <b>.G1/.G2</b>. If you use <b>grap</b>,
2085 you must pass groff or pdfmom the <b>-G</b> flag when you process
2091 <b>.G1</b> takes all the same arguments as
2092 <a href="#ps-pe">PS</a>
2093 with one exception: the argument <b>GRAP</b> must always be given to
2094 <b>.G1</b>. So, for example, a skeleton grap block raised 2 points
2095 and with a caption would be entered:
2097 <span class="pre-in-pp">
2098 .G1 GRAP ADJUST +2p CAPTION "Graph caption"
2099 <grap directives>
2105 <div class="rule-medium"><hr/></div>
2107 <h3 id="eqn" class="docs">eqn support</h3>
2110 Support for <b>eqn</b> is provided via extensions to the standard
2111 <kbd>.EQ/.EN</kbd> macros. <kbd>eqn</kbd> usage itself is beyond
2112 the scope of this documentation, but is covered in the manpage
2113 <kbd>eqn(1)</kbd>. You can also download a copy of Ted
2115 <a href="http://lists.gnu.org/archive/html/groff/2013-10/pdfTyBN2VWR1c.pdf">
2116 A Guide to Typesetting Mathematics Using GNU eqn
2118 which contains useful examples. If you use <b>eqn</b>, you must give groff or
2119 pdfmom the <b>-e</b> flag.
2123 <div class="macro-id-overline">
2124 <h3 id="eq-en" class= "macro-id">.EQ / .EN</h3>
2127 <div class="box-macro-args">
2128 Macro: <a href="#eq"><b>EQ</b></a>
2130 <kbd class="macro-args">Arguments:
2132 [ -L | -C | -I <indent> ]</kbd>
2133 <span style="font-size: 95%">
2134 (<a href="definitions.html#unitofmeasure">unit of measure</a>
2137 <kbd class="macro-args"><br/>
2138 [ ADJUST +|-<vertical adjustment>]</kbd>
2139 <span style="font-size: 95%">
2140 (<a href="definitions.html#unitofmeasure">unit of measure</a>
2143 <kbd class="macro-args"><br/>
2144 [ NO_SHIM ]
2146 [ NO_FLEX ]
2148 [ CAPTION "<caption>" ]
2150 [ LABEL "<label>" ]
2152 [ SHIFT_LABEL +|-<vertical adjustment> ]
2154 [ SHORT_CAPTION "<short caption>" ]
2156 [ TARGET "<name>" ]
2158 [ CONTINUED | CONT | ... ]</kbd>
2161 <div class="box-tip">
2163 <span class="note">Note: Version 2.0-c change</span>
2165 2.0-c introduces revisions to <b>EQ</b>, including the addition
2166 of a dash (<kbd>-</kbd>) to the positioning arguments
2167 (<kbd>-L</kbd>, <kbd>-C</kbd>, and <kbd>-I</kbd>) and the removal of a
2168 default value for <kbd>-I</kbd>. Other changes include passing all
2169 options to <kbd>.EQ</kbd> (including the label) such that
2170 <kbd>.EN</kbd> takes only a single, optional argument saying whether
2171 the equation is to be continued at the next invocation of
2172 <kbd>.EQ</kbd>. Please read this section carefully if you have
2173 documents containing equations as they may need to be updated.
2177 <div class="box-important" style="margin-top: 1em">
2179 <span class="important">IMPORTANT:</span>
2180 All arguments to <b>EQ</b> must appear on the same line as
2181 <kbd>.EQ</kbd>. Do not attempt to break them up with the
2182 “line-continued” backslash. You may want to set your
2183 text editor to “wrap” mode in order to see all your
2184 arguments. This annoyance stems from the preprocessor mechanism
2185 itself, not groff or mom.
2189 <div class="macro-id-overline" style="margin-top: .5em">
2190 <h4 id="eq" class="docs" style="font-size: 100%; margin-top: .5em">The .EQ macro</h4>
2194 Equations to be set with <b>eqn</b> begin with <kbd>.EQ</kbd>,
2195 followed by <b>eqn</b> code. Equations are centered by default,
2196 but may be set flush left or indented from the left margin
2197 if <kbd>-L</kbd> or <kbd>-I</kbd> are passed as arguments to
2201 <h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5>
2204 <kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower
2205 (<kbd>+</kbd>) an equation
2206 <span style="font-style: italic">within the space allotted for it</span>
2207 by the amount you specify. This is useful for achieving good
2208 optical centering between surrounding blocks of type. A unit of
2209 measure is required.
2212 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5>
2215 <kbd>NO_SHIM</kbd> instructs mom not to apply
2216 <a href="docprocessing.html#shim-vs-flex">shimming</a>
2217 after an equation, which she will do automatically when shimming is
2218 enabled, which it is by default. Shimming ensures that running text
2219 after the equation falls properly on the page’s
2220 <a href="definitions.html#baseline-grid">baseline grid</a>,
2221 but can result in slightly unequal spacing above and
2222 below (correctable with the <kbd>ADJUST</kbd> argument).
2223 <kbd>NO_SHIM</kbd> is useful when you have several equations on the
2224 page and there are visible differences in the spacing beneath them
2225 as a result of shimming. To ensure a flush bottom margin, the last
2226 equation on the page should be shimmed, i.e. should not be given the
2227 <kbd>NO_SHIM</kbd> argument.
2230 <h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5>
2233 <kbd>NO_FLEX</kbd> instructs mom not to apply
2234 <a href="docprocessing.html#shim-vs-flex">flex-spacing</a>
2235 after an equation, which she will do automatically when flex-spacing
2236 is enabled. <kbd>NO_FLEX</kbd> is useful when you have several
2237 equations on the page and you want to distribute excess vertical
2238 whitespace on the page amongst other flex-spacing points on
2239 the page. If there are no others, the final equation should be
2240 flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument.
2243 <h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5>
2246 <kbd>CAPTION</kbd> allows you to give the equation a caption.
2247 Equation captions always appear beneath the equation.
2250 <h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5>
2253 <kbd>SHORT_CAPTION</kbd> allows you to trim long captions for
2254 inclusion in the List of Equations. The text you supply, surrounded
2255 by double-quotes, is what will appear in the List.
2258 <h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5>
2261 <kbd>LABEL</kbd>, if given, appears on the same baseline as the last line of the
2262 equation, flush with the left or right margin, depending on the
2263 equation’s horizontal position. The text you supply, surrounded by
2264 double-quotes, is how
2265 the equation is labelled in both the document proper and the List of
2266 Equations. Mom provides an auto-labelling facility for equations (see
2267 <a href="#autolabel">AUTOLABEL</a>),
2268 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
2271 <h5 class="docs" style="margin-top: 1em; text-transform: none">SHIFT_LABEL</h5>
2274 <kbd>SHIFT_LABEL</kbd> allows you to raise (<kbd>-</kbd>) or lower
2275 (<kbd>+</kbd>) the equation label. It’s primary use is to
2276 center equation labels vertically on the equation rather than flush
2277 with the last line. Assuming a three-line equation,
2278 <kbd>.EQ SHIFT_LABEL -1v</kbd> would raise the label by
2279 one line, thus centering it vertically on the equation.
2282 <h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5>
2285 <kbd>TARGET</kbd> followed by a unique name surrounded by
2286 double-quotes creates a PDF target for the equation so that it may
2287 be linked to from other places in the file (with PDF_LINK; see
2288 <a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>).
2292 <b><i>Please note:</i></b> The following functionality is available
2293 only with groff 1.22.4 or later.
2298 <a href="#autolabel">autolabelling</a>
2299 is enabled and the document is processed with
2300 <a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>,
2301 the target name can be used to generate the target’s label
2302 number in running text if it is entered as a groff string, i.e. of
2303 the form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you
2304 create a target called “foo” for an equation whose
2305 autolabel number would be 3, entering
2307 <span class="pre-in-pp">
2309 .PDF_LINK foo "Equation \*[foo]"
2311 anywhere in running text would result in a pdf link that reads
2312 “Equation 3”. If chapter numbers are being prefixed to
2313 labels, the same string in, say, chapter 5 would produce the pdf
2314 link “Equation 5.3”.
2318 <div class="macro-id-overline" style="margin-top: .5em">
2319 <h4 id="en" class="docs" style="font-size: 100%; margin-top: .5em">The .EN macro</h4>
2323 A block of <b>eqn</b> code is terminated with <kbd>.EN</kbd>.
2327 If an equation needs to span multiple lines, possibly aligned
2328 with <b>eqn</b>’s <kbd>'mark'</kbd> and <kbd>'lineup'</kbd>
2329 directives, separate invocations of <kbd><span class="nobr">.EQ/.EN</span></kbd>
2330 are required for each line, and the optional argument,
2331 <kbd>CONTINUED</kbd> (or <kbd>CONT</kbd>, or <kbd>...</kbd> [three
2332 dots, an ellipsis]), must be passed to <kbd>.EN</kbd>.
2336 If <kbd>-L</kbd> or <kbd>-I</kbd> is given to the first
2337 <kbd>.EQ</kbd> of a multi-line equation, they remain in effect
2338 until an <kbd>.EN</kbd> without the <kbd>CONTINUED</kbd> argument
2343 Mom does not treat equations as floats, therefore it is possible to
2344 begin an equation on one page and terminate it on the next. If you
2345 wish to keep all lines of an equation together, you must wrap the
2346 equation, including all invocations of <kbd>.EQ/.EN</kbd>, inside
2348 <a href="#floats-intro">float</a>.
2351 <div class="rule-medium"><hr/></div>
2353 <h3 id="refer" class="docs">refer support</h3>
2356 <b>refer</b> support is covered in the section
2357 <a href="refer.html">Bibliographies and references</a>.
2360 <div class="rule-medium"><hr/></div>
2362 <h2 id="captions-and-labels" class="docs">Captions and labels</h2>
2365 <li><a href="#autolabel">AUTOLABEL</a></li>
2366 <li><a href="#caption-after-label">CAPTION_AFTER_LABEL</a></li>
2367 <li><a href="#mla">MLA</a>—MLA-style captioning and labelling</li>
2368 <li><a href="#captions-labels-sources">Set style parameters for captions, labels, and sources</a></li>
2372 Mom includes facilities for adding captions and labels to figures,
2373 tables, equations, and pdf images, including auto-labelling. If
2374 Lists of Figures, Tables, and Equations are desired, captions (if
2375 any) and labels (if any) are collected and output in the Lists with
2376 the appropriate page number.
2380 The distinction between a caption and a label is that labels are
2381 identifiers, e.g. “Fig. 1” or “Table 3”,
2382 while captions are descriptive or informative. For most types of
2383 writing, it is usual to provide both.
2387 By default, mom sets captions above figures (i.e. <b>pic</b> output and
2388 pdf images) and tables. This behaviour may be modified with the
2390 <a href="#caption-after-label">CAPTION_AFTER_LABEL</a>.
2391 Equations always have their captions set underneath. All aspects of
2392 the text style for captions may be set with the macro
2393 <a href="#captions-labels-sources">CAPTIONS</a>.
2397 Labels for tables are set underneath the table unless the
2398 <a href="#mla">MLA</a>
2399 macro has been invoked, in which case the label and caption appear
2400 above the table, per MLA style, and the source for the table, if
2401 any, appears underneath. Labels for figures are set underneath.
2402 Equation labels, by default, are set on the same baseline as the
2403 last line of the equation. Like captions, all aspects of text style
2404 for labels may be established with a single macro
2405 <a href="#labels">LABELS</a>.
2406 Furthermore, mom can autolabel figures, tables, and equations, with
2407 or without a prefixed chapter number.
2410 <div class="macro-id-overline">
2411 <h3 id="autolabel" class="macro-id">Autolabel</h3>
2414 <div class="box-macro-args">
2415 Macro: <b>AUTOLABEL_EQUATIONS</b>
2417 Macro: <b>AUTOLABEL_IMAGES</b>
2419 Macro: <b>AUTOLABEL_PIC</b>
2421 Macro: <b>AUTOLABEL_TABLES</b>
2423 <kbd class="macro-args">Arguments:
2425 [ PREFIX "<string>"] [ SUFFIX "<string>"] [ PREFIX_CHAPTER [ <n> ] ]
2430 <b>AUTOLABEL_<type></b> takes care of labelling <type> by
2431 identifying each with a separate, incrementing numeric scheme, which
2432 is also collected for output in Lists of Figures, Equations, and
2437 Autolabelling may be disabled on-the-fly by giving any argument
2438 other than <kbd>PREFIX</kbd>, <kbd>SUFFIX</kbd>, or
2439 <kbd>PREFIX_CHAPTER</kbd> to the appropriate macro. For example,
2441 <span class="pre-in-pp">
2442 .AUTOLABEL_IMAGES NO
2444 would disable autolabelling of images.
2447 <h4 class="docs" style="margin-top: -.5em">Prefixes and suffixes</h4>
2450 By default, when <b>AUTOLABEL</b> is enabled, the label numbers are
2451 prefixed, and, in the case of equations, suffixed, with strings such
2452 that they appear for tables as “Table <n>”, for
2453 <b>pic</b> diagrams and pdf images as “Fig. <n>”,
2454 and for equations as “Eq. (<n>)”.
2458 You can use <kbd>PREFIX <"string"></kbd> to change what
2459 comes before the automatic numbering. For example, if you are
2460 including musical excerpts in your document, MLA style requires that
2461 they be labelled “Ex. <n>”. Since musical
2462 excerpts are likely to be scanned images (in pdf format, don’t
2463 forget), you have to change the prefix string for pdf images:
2465 <span class="pre-in-pp">
2470 If you need a suffix after the automatic numbering, use
2471 <kbd>SUFFIX <"string"></kbd>, like this:
2473 <span class="pre-in-pp">
2478 Note from the above that both arguments, <kbd>PREFIX</kbd> and
2479 <kbd>SUFFIX</kbd>, are required should you want either. Two
2480 adjacent double-quotes leaves the string blank.
2483 <div class="box-tip">
2485 <span class="note">Note:</span>
2486 In automatically formatted
2487 <a href="#lists-macros">“Lists of ...”</a>,
2488 label number prefixes are stripped when autolabelling is enabled.
2492 <h4 class="docs" style="margin-top: -.5em">Prefixing chapter numbers</h4>
2495 If you would like mom to prefix chapter numbers to the label,
2496 pass <kbd>AUTOLABEL_<type></kbd> the argument
2497 <kbd>PREFIX_CHAPTER</kbd>.
2501 If for some reason you need to specify the chapter number,
2502 you may do so by passing the number as an argument to
2503 <kbd>PREFIX_CHAPTER</kbd>. Subsequent chapters or major sections
2504 will increment by one as expected.
2507 <div class="box-tip">
2509 <span class="note">Note:</span>
2510 For the purposes of labelling, mom treats
2511 <a href="docprocessing.html#doctype">DOCTYPE DEFAULT</a>
2512 as if it were <b>DOCTYPE CHAPTER</b>, hence, with
2513 <kbd>PREFIX_CHAPTER</kbd>, each collated <b>DEFAULT</b>
2514 doctype’s prefixed “chapter” number is
2515 incremented and the label number itself reset to “1”.
2516 If you do not supply the <kbd>PREFIX_CHAPTER</kbd> argument, the
2517 label number is <i>not</i> reset automatically. To reset it, invoke
2518 <kbd>.AUTOLABEL_<type></kbd> after each
2519 <a href="docprocessing.html#collate">COLLATE</a>.
2523 <div id="set-autolabel" class="box-macro-args" style="margin-top: .5em">
2524 Macro: <b>SET_AUTOLABEL</b> <kbd class="macro-args">FIG | TBL | PIC | EQN <n></kbd>
2528 You may sometimes need to set or reset the autolabel number for a
2529 particular type of pre-processor or for PDF images. This is likely
2530 to occur if you are using
2531 <a href="#float">FLOAT</a>
2532 in conjunction with the <kbd>TO_LIST</kbd> argument.
2536 For example, if your document has Figures (PDF images, pic diagrams)
2537 and you want your tables to be labelled as Figures as well, you have
2538 to wrap the tables inside a float and label the float manually as
2539 “Fig. n”, sending it to the List of Figures with
2540 <kbd>TO_LIST FIGURES</kbd>.
2544 Mom does not autolabel floats or assign them automatically
2545 to a list, so she doesn’t know you’ve interrupted the
2546 auto-incrementing label numbers. Use SET_AUTOLABEL get her back on
2547 track. The number you give as an argument after telling her which
2548 kind of label number to set is the one you want to appear next.
2550 <span class="pre-in-pp">
2551 .SET_AUTOLABEL FIG 6
2553 means the next autolabelled Figure will be “Fig. 6.”
2556 <div class="macro-id-overline">
2557 <h3 id="caption-after-label" class="macro-id">Captions after labels</h3>
2560 <div class="box-macro-args" style="margin-top: .5em">
2561 Macro: <b>CAPTION_AFTER_LABEL</b> <kbd class="macro-args">IMG | PIC | TBL | ALL [ <anything> ]</kbd>
2565 By default, mom sets captions above figures (<b>pic</b> output
2566 and pdf images) and tables; labels are always underneath.
2570 <kbd>.CAPTION_AFTER_LABEL</kbd>, with one of the required arguments,
2571 instructs mom to attach captions directly to the appropriate
2572 labels, beginning on the same line. Any argument after the first
2573 disables this behaviour, restoring caption placement to mom’s
2574 default. For example,
2576 <span class="pre-in-pp">
2577 .CAPTION_AFTER_LABEL ALL
2579 would enable captions after labels globally, while a subsequent
2581 <span class="pre-in-pp">
2582 .CAPTION_AFTER_LABEL IMG OFF
2584 would disable captions after labels for pdf images only.
2585 <kbd>OFF</kbd> can be anything you like (<kbd>X</kbd>,
2586 <kbd>NO</kbd>, etc).
2591 <a href="#mla">MLA</a>
2592 is enabled, there’s no need to invoke
2593 <kbd>CAPTION_AFTER_LABEL</kbd> as this is implied.
2596 <div class="box-tip">
2598 <span class="note">Note:</span>
2599 A separate invocation of <kbd>.CAPTION_AFTER_LABEL</kbd> is required
2600 for each one of the required first arguments. You cannot, for
2603 <span class="pre-in-pp">
2604 .CAPTION_AFTER_LABEL IMG TBL
2608 <span class="pre-in-pp">
2609 .CAPTION_AFTER_LABEL IMG
2610 .CAPTION_AFTER_LABEL TBL
2615 <div class="macro-id-overline">
2616 <h3 id="mla" class="macro-id">MLA-style captioning and labelling</h3>
2619 <div class="box-macro-args" style="margin-top: .5em">
2620 Macro: <b>MLA</b> <kbd class="macro-args"> [ <anything> ]</kbd>
2624 Modern Language Association style dictates that captions should
2625 always go after labels. Furthermore, labels and captions for tables
2626 should go <i>above</i> the tables, with the source for the table, if
2631 Invoking <kbd>.MLA</kbd> by itself takes care of these details. If
2632 you need to disable MLA-style captioning and labelling mid-document,
2633 <kbd>.MLA OFF</kbd> does the trick. <kbd>OFF</kbd> can be
2634 anything you like (<kbd>X</kbd>, <kbd>NO</kbd>, etc).
2637 <div class="macro-id-overline" style="margin-top: 1em">
2638 <h3 id="captions-labels-sources" class="macro-id">Style parameters for captions, labels and sources</h3>
2641 <div class="box-macro-args" style="margin-top: .5em">
2642 Macro: <b>CAPTIONS</b> <kbd class="macro-args">EQN | IMG | PIC | TBL | FLOATING | ALL</kbd>
2644 Macro: <b>LABELS</b> <kbd class="macro-args">EQN | IMG | PIC | TBL | FLOATING | ALL</kbd>
2646 Macro: <b>SOURCES</b> <kbd class="macro-args">TBL</kbd>
2648 <kbd class="macro-args">Style arguments:
2650 FAMILY <family> \
2652 FONT <font> \
2654 SIZE +|-<size> \
2656 AUTOLEAD <value> \
2658 COLOR <color> \
2660 QUAD LEFT | CENTER | RIGHT [ ON_LL ] \
2662 INDENT <indent> \
2664 ADJUST +|-<vertical adjustment>
2668 <div class="box-tip">
2670 <span class="note">Note:</span>
2671 Arguments may be broken into several lines using the
2672 “line-continued” backslash (<b>\</b>), as shown above.
2676 <div class="box-tip">
2678 <span class="note">Additional note:</span>
2679 Mom’s default style for labels, captions, and sources is
2680 the same as the style used for running text, with two exceptions:
2681 labels are set in bold, except for eqn which is roman medium, and
2682 the autolead value for all three is “2”, effectively
2683 tightening the lead. Furthermore, they are quadded left (except
2684 eqn, which is quadded right.)
2689 With the exception of <kbd>ADJUST</kbd> and <kbd>QUAD</kbd> (which
2690 requires a bit of explanation), the style arguments to <kbd>CAPTIONS</kbd>,
2691 <kbd>LABELS</kbd>, and <kbd>SOURCES</kbd> (which is only available
2692 for tables) behave identically to the
2693 <a href="docelement.html#control-macro-args">arguments to control macros</a>.
2697 The first, required argument after <kbd>CAPTIONS</kbd>,
2698 <kbd>LABELS</kbd>, or <kbd>SOURCES</kbd> indicates the preprocessor
2699 type for which you are setting the parameters. (For convenience
2700 PDF_IMAGE—argument <kbd>IMG</kbd>—is here treated as a
2701 preprocessor.) <kbd>FLOATING</kbd> sets the style for the macros
2702 <a href="#caption">CAPTION</a>
2704 <a href="#label">LABEL</a>,
2705 which are used to label floats, quotes, and blockquotes.
2709 An argument of <kbd>ALL</kbd> sets a unified style for all
2710 preprocessors, floats, quotes, and blockquotes. If the
2711 <kbd>ALL</kbd> argument is given, arguments to subsequent
2712 invocations of <kbd>CAPTIONS</kbd>, <kbd>LABELS</kbd>, or
2713 <kbd>SOURCES</kbd> overwrite only the explicitly named style
2717 <h4 class="docs">QUAD — quadding of labels, captions, and sources</h4>
2719 <h5 class="docs" style="text-transform: none">• pic, tbl, pdf images</h5>
2722 By default, figures (<b>pic</b> output and pdf images) and tables
2723 have their captions and labels set quad left. Sources (for
2724 tables) are also set quad left. Equations have their labels
2725 set quad right, and their captions centered.
2729 Regardless of the quad direction, captions, labels and sources
2730 are set on the width of the figure, table, or pdf image
2731 unless you pass the optional <kbd>ON_LL</kbd> argument to
2732 <kbd><span class="nobr">QUAD <direction></span></kbd>, in which case
2733 the prevailing document line length is used instead.
2736 <h5 class="docs" style="text-transform: none">• eqn</h5>
2739 Equations behave differently. By default, equation labels are
2740 set flush right with the page’s right margin regardless of
2741 equation positioning, which is, again by default, centered. If the
2742 equation is positioned left, the label will appear at the right
2743 margin regardless of the direction you give to <kbd>QUAD</kbd>. If
2744 the equation is indented with the
2745 <kbd><span class="nobr">-I <indent></span></kbd> option, a quad
2746 direction of <kbd>LEFT</kbd> is observed, but may overprint the last
2747 line of the equation.
2751 Note that there is no <kbd>CENTER</kbd> option for equation labels,
2752 and that captions are always quadded over the prevailing document
2756 <h5 class="docs" style="text-transform: none">• quotes and blockquotes</h5>
2759 Floating labels attached to <b>QUOTE</b>s are quadded on the
2760 prevailing document line length, and require the <kbd>INDENT</kbd>
2761 argument if you want to align them with the left and/or right edges
2766 Floating labels attached to <b>BLOCKQUOTE</b>s are always quadded on
2767 the indent and line length of the blockquote.
2770 <h5 class="docs" style="text-transform: none">• floats</h5>
2773 Floating labels and captions attached to <b>FLOAT</b>s are always
2774 quadded over the prevailing document line length, and require the
2775 <kbd>INDENT</kbd> argument if you want to align them with the left
2776 and/or right edges of the float’s contents.
2779 <h4 class="docs">INDENT</h4>
2782 The <kbd>INDENT</kbd> argument may only be used if the label
2783 or caption type is <kbd>FLOATING</kbd>, and only applies to
2784 <b>FLOAT</b>s and <b>QUOTE</b>s, not <b>BLOCKQUOTE</b>s.
2788 It is not possible for mom to know the width of a float before
2789 setting a label or caption attached to a float. She therefore sets
2790 it on the prevailing document line length. While this isn’t
2791 much of an issue when the label or caption quad is <b>CENTER</b>,
2792 you may want to adjust the horizontal positioning when the quad is
2793 <b>LEFT</b> or <b>RIGHT</b>.
2797 <kbd>INDENT</kbd>, with a numeric value to which a
2798 <a href="definitions.html#unitofmeasure">unit of measure</a>
2799 is appended, allows you to indent a floating label or caption so
2800 it lines up with the left edge of a <b>FLOAT</b> or <b>QUOTE</b>.
2801 <kbd>INDENT RIGHT</kbd> (with a value) allows you to shorten the
2802 line length to the appropriate width. If you need both a left and
2803 right indent, invoke <kbd>LABELS</kbd> or <kbd>CAPTIONS</kbd> twice,
2804 one instance containing <kbd>INDENT <indent></kbd> and
2805 the other <kbd>INDENT RIGHT <indent></kbd>.
2808 <h4 class="docs">ADJUST</h4>
2811 The <kbd>ADJUST</kbd> argument allows you to add(<kbd>+</kbd>) or
2812 subtract (<kbd>-</kbd>) vertical space between labels and captions
2813 and the output to which they are attached. The argument requires a
2814 <a href="definitions.html#unitofmeasure">unit of measure</a>.
2815 For example, if you find that table labels are a bit too close to
2818 <span class="pre-in-pp">
2819 .LABELS TBL ADJUST +3p
2821 would put three extra points of space between the bottoms of tables
2822 and the labels that appear beneath them.
2825 <h2 id="lists-of" class="docs">Lists of Figures, Tables, and Equations</h2>
2829 <a href="tables-of-contents.html">Table of Contents</a>,
2830 mom can generate Lists of Figures, Tables, and Equations. Labels
2831 and captions are collected and concatenated, and output in lists
2832 with the appropriate page number, just like a Table of Contents.
2833 Including such lists in a document is as simple as adding whichever
2836 <span class="pre-in-pp">
2841 to the end of your input file.
2845 Also like the Table of Contents, entries in the Lists’ output
2846 are clickable PDF links when a document is viewed at the screen.
2849 <h3 id="lists-placement" class="docs">Placement of Lists</h3>
2852 Lists normally appear after the Table of Contents, and continue
2853 the page numbering scheme used for it. By default, the Table of
2854 Contents begins on roman-numeral page “i”.
2858 If you are using mom’s
2859 <a href="tables-of-contents.html#auto-relocate-toc">AUTO_RELOCATE_TOC</a>
2860 feature, you have two options for placement of the Lists within the
2861 document. If you want the Lists shifted to the top of the document
2862 along with the Table of Contents, invoke the Lists macros <i>after</i>
2863 <a href="tables-of-contents.html#toc"><kbd>.TOC</kbd></a>.
2864 If you prefer to have the Lists at the end of the document, invoke
2865 the Lists macros <i>before</i> <kbd>.TOC</kbd>.
2869 Lists shifted with the Table of Contents do not appear in the Table
2870 of Contents itself, but do appear as clickable links in the PDF
2871 outline typically available in the left panel of most PDF viewers.
2872 Lists that are not shifted with the Table of Contents appear in both
2873 the Table of Contents itself and the PDF outline.
2876 <div class="macro-id-overline" style="margin-top: 1em">
2877 <h3 id="lists-macros" class="macro-id">Macros to generate Lists</h3>
2880 <div class="box-macro-args" style="margin-top: .5em">
2881 Macro: <b>LIST_OF_EQUATIONS</b>
2883 Macro: <b>LIST_OF_FIGURES</b>
2885 Macro: <b>LIST_OF_TABLES</b>
2887 <kbd class="macro-args">Arguments:
2889 [ TITLE_STRING "<string>" ] [ START_PAGENUM <page number> ]
2894 The first optional argument to the <kbd>LIST_OF_<type></kbd>
2895 macros allows you to change the title that appears at the top of the
2896 page. This is useful not only for internationalization, or to meet
2897 the requirements of various style guides, but is also useful
2898 for, say, documents containing musical examples, which, per
2899 MLA-style, should be labelled “Example ” or
2900 “Ex. ”. When it comes time to output the List of
2901 Figures (to which musical examples, usually scanned pdf images, belong),
2903 <span class="pre-in-pp">
2904 LIST_OF_FIGURES TITLE_STRING "List of Examples"
2906 ensures that the title of the List is correct.
2910 The second optional argument allows you to give a starting page
2911 number for a list in cases where mom’s pagination scheme does
2912 not provide the List with the starting page number you want.
2914 <h3 id="formatting-lists" class="docs">Formatting and style parameters for Lists</h3>
2917 Like the Table of Contents, nearly every aspect of Lists can be
2918 designed independently of a document’s overall style. By
2919 default, Lists follow the formatting and style parameters of the
2920 Table of Contents, both mom’s defaults and any changes you may
2921 have made to the Table of Contents.
2925 If you wish to make changes to any aspect of Lists formatting
2926 or styling, the macro <kbd>LISTS_STYLE</kbd> provides all the
2927 tools necessary. It is unlikely that you’ll want the
2928 formatting of the various list types to differ one from the other,
2929 so <kbd>LISTS_STYLE</kbd> applies to all Lists. In the event that
2930 you do need to change some aspect of the formatting for different
2931 list types, simply invoke <kbd>LISTS_STYLE</kbd> immediately prior
2932 to each list whose formatting needs to be changed.
2935 <div class="macro-id-overline" style="margin-top: 1em">
2936 <h3 id="lists-style" class="macro-id">Lists style</h3>
2939 <div class="box-macro-args" style="margin-top: .5em">
2940 Macro: <b>LISTS_STYLE</b> <kbd class="macro-args">
2944 FAMILY <family> \
2946 FONT <font> \
2948 PT_SIZE <size> \
2950 LEAD <leading> \
2952 TITLE_FAMILY <family> \
2954 TITLE_FONT <font> \
2956 TITLE_SIZE +|-<size> \
2958 TITLE_QUAD LEFT | CENTER | RIGHT \
2960 TOC_HEADER_UNDERSCORE default = none
2962 TITLE_COLOR <color> \
2964 PN_FAMILY <family> \
2966 PN_FONT <font> \
2968 PN_SIZE +|-<size> \
2970 EQN_PN_PADDING <placeholders> \
2972 FIG_PN_PADDING <placeholders> \
2974 TBL_PN_PADDING <placeholders> \
2976 PAGENUM_STYLE DIGIT | ROMAN | roman | ALPHA | alpha \
2978 NO_PAGINATION
2982 <div class="box-tip">
2984 <span class="note">Note:</span>
2985 Arguments may be broken into several lines using the
2986 “line-continued” backslash (<b>\</b>), as shown above.
2991 <kbd>FAMILY</kbd> is the family for the entirety of Lists pages.
2995 <kbd>FONT</kbd> is the font for the entirety of Lists pages.
2999 <kbd>PT_SIZE</kbd> is the base point size for the entirety of Lists
3004 <kbd>LEAD</kbd> is the base leading for the entirety of Lists pages.
3008 <kbd>TITLE_FAMILY</kbd> is the family for the Lists titles if you
3009 want it different from the family otherwise used for the Lists
3014 <kbd>TITLE_FONT</kbd> is the font for the Lists titles if you want
3015 it different from the font otherwise used for the Lists pages.
3019 <kbd>TITLE_SIZE</kbd> tells mom by how much to increase
3020 (<kbd>+</kbd>) or decrease (<kbd>-</kbd>) the point size of the
3021 titles relative to the overall point size of Lists pages.
3025 <kbd>TITLE_QUAD</kbd> tells mom how to position the title
3030 <kbd>TITLE_COLOR</kbd> sets the colour for the titles. The colour
3031 must be pre-initialized with
3032 <a href="color.html#newcolor">NEWCOLOR</a>
3034 <a href="color.html#xcolor">XCOLOR</a>.
3038 <kbd>PN_FAMILY</kbd> sets the family for entry pagenumbers.
3042 <kbd>PN_FONT</kbd> sets the font for entry pagenumbers.
3046 <kbd>PN_SIZE</kbd> tells mom by how much to increase (<kbd>+</kbd>)
3047 or decrease (<kbd>-</kbd>) the point size of entry pagenumbers
3048 relative to the overall point size of Lists pages.
3052 <kbd>EQN_PN_PADDING</kbd>, <kbd>FIG_PN_PADDING</kbd>, and
3053 <kbd>TBL_PN_PADDING</kbd> tells mom how many placeholders to reserve
3054 for the entry pagenumbers in their respective Lists. If, for example,
3055 a document with both tables and figures runs to over a hundred
3056 pages, but there are no tables after page 99,
3058 <span class="pre-in-pp">
3059 LISTS_STYLE FIG_PN_PADDING 3
3060 LISTS_STYLE TBL_PN_PADDING 2
3062 would prevent an unneeded, reserved placeholder from putting too
3063 much space between the leader and the entry pagenumber in the List of
3068 The padding in effect, unless you change it, is whatever was set for
3069 the Tables of Contents; mom’s default is “3”.
3073 <kbd>PAGENUM_STYLE</kbd> tells mom which pagination format to use
3074 for the page numbers of the Lists pages themselves. By default,
3075 since Lists observe what is in effect for the Table of Contents, the
3076 pagination format is “roman”. Please note that the
3077 starting page number for any of the Lists is given as an argument to
3079 <a href="#lists-of">LISTS_0F_<type></a>
3084 <kbd>NO_PAGINATION</kbd> disables pagination of Lists pages.
3087 <h2 id="box-intro" class="docs">Shaded backgrounds and frames (boxes)</h2>
3090 Mom lets you add shaded backgrounds and frames to text and other
3091 material. For convenience, she calls backgrounds and frames
3092 “boxes.” Entire passages may be boxed, or individual
3093 document elements like headings, quotes, or pre-processor output.
3094 Furthermore, boxes may be nested.
3098 Boxes start on the baseline where the boxed material would have
3099 started were it not for the box, subject to minor aesthetic
3100 corrections mom takes the liberty of making.
3104 Boxes extend from the current left margin to the current right
3105 margin, respecting any active left and/or right indents. There are
3107 <a href="docelement.html#epigraph">EPIGRAPH BLOCK</a>
3109 <a href="docelement.html#blockquote">BLOCKQUOTE</a>,
3111 <a href="#quotes">here</a>.
3115 After a box is started, active left and right indents are
3116 cleared. The box’s inset determines the new left and right
3117 margins. Indents set inside a box are relative to the inset.
3118 When a box is stopped, formerly active left and right indents
3123 Frames are drawn from the perimeter inward. The inset is
3124 relative to the inner edge of the frame.
3128 If a box (including the bottom inset) can complete on a page, it
3129 does, even if there is no further room for type. This may, on
3130 occasion, result in slight deviations from normal bottom margin
3135 Boxes span pages whenever the boxed material continues on the next
3136 page. Spanning boxes extend fully to the bottom margin of the page
3137 on which they begin, leaving a slightly larger inset at the bottom
3138 than around the other sides.
3142 When there is not enough room to set at least one line of type
3143 inside a box, mom defers starting the box until the next page,
3148 Boxed material is not
3149 <a href="docprocessing.html#shim-vs-flex">shimmed</a>
3151 <a href="docprocessing.html#shim-vs-flex">flexed</a>.
3152 If either was active prior to the box, it is restored when the box
3153 ends and mom automatically shims or flexes whatever comes next.
3156 <div class="box-tip">
3158 <span class="important">NOTE:</span>
3159 Shaded backgrounds and frames are not available when your
3160 <a href="docprocessing.html#printstyle">PRINTSTYLE</a>
3161 is <kbd>TYPEWRITE</kbd> or when
3162 <a href="docprocessing.html#columns">COLUMNS</a> are enabled.
3166 <div class="macro-id-overline">
3167 <h3 id="box" class= "macro-id">BOX</h3>
3170 <div id="box-macro" class="box-macro-args" style="margin-top: .5em">
3171 Macro: <b>BOX</b> <kbd class="macro-args"> [ <arguments> ] | <anything>
3175 [ SHADED <color> | OUTLINED <colour> ] \
3177 [ INSET <dist> ] \
3179 [ WEIGHT <wt> ] \
3181 [ ADJUST +|-<amount> ] \
3183 [ EQN | PIC | GRAP | IMG ]
3188 Without arguments, BOX begins a shaded grey background.
3189 The material inside is inset by one
3190 <a href="definitions.html#picaspoints">pica</a>.
3191 Any other type of box requires at a minimum either
3192 <kbd>SHADED</kbd> or <kbd>OUTLINED</kbd>. In the case of boxes
3193 that are to contain pdf images or pre-processor material for
3194 <a href="#eqn">eqn</a>,
3195 <a href="#pic">pic</a>,
3197 <a href="#grap">grap</a>,
3198 <kbd>IMG</kbd>, <kbd>EQN</kbd>, <kbd>PIC</kbd>, or <kbd>GRAP</kbd>
3199 must also be given. Note that
3200 <a href="#tbl">tbl</a>
3201 does not have this requirement.
3206 <a href="definitions.html#toggle">toggle macro</a>,
3207 so any argument other than one in the list completes the box
3208 (<kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc).
3212 Boxes should be started inside toggle macros like
3213 <a href="docelement.html#quote">QUOTE</a>
3215 <a href="#float">FLOAT</a>
3216 just after the macro is called, and terminated just before toggling
3217 the macro off (unless you wish the box to enclose further material).
3221 Non-toggle macros like
3222 <a href="docelement.html#heading">HEADING</a>
3224 <a href="docelement.html#pp">PP</a>
3225 require that the box be started beforehand. Boxed pre-processor
3226 material must be fully enclosed by BOX / BOX OFF, as
3227 in this recipe for a one-off boxed pic diagram:
3228 <span class="pre-in-pp">
3231 <pic commands>
3235 Arguments to BOX are not sticky. Each time you invoke BOX, you
3236 must invoke it with arguments unless you want mom’s default grey
3237 background. If all or several boxes in a document require the same
3238 arguments, create a macro at the top of the input file that calls
3239 BOX with the arguments you want, e.g.
3240 <span class="pre-in-pp">
3241 .de PINK_BOX
3243 SHADED pink \
3244 OUTLINED darkred \
3245 WEIGHT 1p \
3246 INSET 9p
3249 <kbd>.PINK_BOX</kbd> may then be used instead of <kbd>.BOX</kbd> any
3250 time you want a box with those arguments.
3253 <h3 class="docs">SHADED | OUTLINED</h3>
3256 <kbd>SHADED</kbd> or <kbd>OUTLINED</kbd> are required. Both may
3257 be given, resulting in a shaded background with a frame, and both
3258 require a colour, e.g.
3259 <span class="pre-in-pp">
3260 .BOX SHADED blue OUTLINED black
3265 <ul style="margin-top: -1em;">
3266 <li>an xcolor name</li>
3267 <li>a colour initialized with
3268 <a href="color.html#newcolor">NEWCOLOR</a>
3270 <a href="color.html#xcolor">XCOLOR</a>
3272 <li>an RGB hexadecimal string beginning with (e.g. #FF0000)</li>
3276 Note that without <kbd>SHADED</kbd>, the above would simply draw a
3280 <h3 class="docs">WEIGHT</h3>
3283 Mom’s default weight for <kbd>OUTLINED</kbd> is 1/2
3284 <a href="definitions.html#picaspoints">point</a>.
3285 If you’d like to change it, give <kbd>WEIGHT</kbd> the desired
3286 value with a unit of measure appended, typically points, e.g.
3287 <span class="pre-in-pp">
3288 .BOX OUTLINED black WEIGHT 1p
3292 <h3 class="docs">INSET</h3>
3295 Mom’s default inset for boxes is one
3296 <a href="definitions.html#picaspoints">pica</a>
3297 on all sides. If you’d like a larger or smaller inset, give
3298 <kbd>INSET</kbd> the distance you want with a unit of measure
3300 <span class="pre-in-pp">
3301 .BOX SHADED pink INSET 2m
3305 <h3 class="docs">ADJUST</h3>
3308 If you are not happy with the starting position of a box, you can
3309 change it by giving <kbd>ADJUST</kbd> the distance you want it
3310 raised (-) or lowered (+) with a unit of measure appended. For
3311 example, to lower a box three points,
3312 <span class="pre-in-pp">
3313 .BOX OUTLINED black ADJUST +3p
3316 <span class="pre-in-pp">
3317 .BOX OUTLINED black ADJUST -3p
3321 <h3 class="docs">PIC / GRAP / EQN / IMG</h3>
3324 The <kbd>PIC</kbd> argument must be given to BOX if the box contains
3326 <a href="#pic">pic</a>
3327 diagrams. Likewise, graphs made with
3328 <a href="#grap">grap</a>,
3330 <a href="#eqn">eqn</a>,
3332 <a href="#pdf-image">pdf images</a>
3333 require a corresponding <kbd>GRAP</kbd>, <kbd>EQN</kbd>, or
3334 <kbd>IMG</kbd> argument.
3338 If you’re boxing a single diagram, graph, or pdf image, wrap
3339 it in a float, like this:
3340 <span class="pre-in-pp">
3342 .BOX PIC <other parameters>
3344 <pic input>
3346 .BOX OFF
3347 .FLOAT OFF
3349 Notice that in the case of pdf images, pic, and grap, this
3350 represents a change from the norm, where the use of FLOAT may be
3351 destructive and is discouraged.
3354 <h2 id="box-notes" class="docs">Additional notes on BOX usage and behaviour</h2>
3356 <h3 id="qbef" class="docs">QUOTE, BLOCKQUOTE, EPIGRAPH, FLOAT</h3>
3359 <a href="docelement.html#quote">QUOTE</a>,
3360 <a href="docelement.html#blockquote">BLOCKQUOTE</a>,
3361 <a href="docelement.html#epigraph">EPIGRAPH</a>,
3363 <a href="images.html#float">FLOAT</a>
3364 require that boxes be started <i>after</i> they are
3365 invoked and stopped just before they are toggled off:
3366 <span class="pre-in-pp">
3368 .BOX <parameters>
3369 Text of quote
3370 .BOX OFF
3371 .QUOTE OFF
3375 <h3 id="code" class="docs">CODE</h3>
3378 If you’re boxing
3379 <a href="docelement.html#code">CODE</a>
3380 that’s wrapped inside
3381 <a href="docelement.html#quote">QUOTE</a>,
3383 <a href="docelement.html#quote-code">here</a>,
3384 set the quote indent to “0” with
3385 <span class="pre-in-pp">
3386 .QUOTE_STYLE INDENT 0
3388 so that the box’s leftmost inset is respected.
3392 Here’s a recipe for setting boxed code with an 18-point inset:
3393 <span class="pre-in-pp">
3394 .QUOTE_STYLE INDENT 0
3397 .BOX INSET 18p
3398 Hello, world.
3399 .BOX OFF
3400 .QUOTE OFF
3402 Note that CODE, wrapped inside QUOTE, does not require a corresponding CODE OFF.
3405 <h4 id="quotes" class="docs">Description of boxed BLOCKQUOTES and EPIGRAPH BLOCKS</h4>
3408 When you box a BLOCKQUOTE, or an EPIGRAPH with the <kbd>BLOCK</kbd>
3409 argument, the box is centred on the page and is only as wide as the
3410 blockquote or epigraph plus the box’s inset.
3414 QUOTE and EPIGRAPH (without the <kbd>BLOCK</kbd> argument), on the
3415 other hand, set the box fully to the left and right margins.
3418 <h4 id="leftover" class="docs">Leftover box syndrome</h4>
3421 Boxed quotes and blockquotes sometimes exhibit leftover box
3422 syndrome, where the page after a fully terminated boxed quote or
3423 blockquote begins with an empty bit of box. Equally, you may
3424 sometimes see the lower edge of a quote’s or
3425 blockquote’s box falling slightly below the page’s
3430 The solution in both situations is to use the <kbd>ADJUST</kbd>
3431 argument to raise or lower the box’s starting position.
3432 Leftover box syndrome is usually fixed by raising the box slightly.
3433 When the box runs too deep, lowering it is generally recommended,
3434 although this will result in a widowed line at the top of the next
3435 page. In either case, some experimentation is necessary.
3438 <h3 id="slides" class="docs">SLIDES</h3>
3441 On a slide with no pauses, boxes behave as they do in printed
3446 When a slide contains pauses, only the material up to the first
3447 pause is boxed. As subsequent material is revealed, the box changes
3448 location, moving down to surround each new item. This behaviour
3449 persists until the box is stopped, making it useful for highlighting
3450 material as it is revealed.
3453 <h3 id="footnotes" class="docs">Footnotes</h3>
3456 You don’t have to worry about boxes encroaching on footnotes.
3457 Mom makes sure they don’t.
3460 <h2 id="page-color-intro" class="docs">Page colour</h2>
3463 Mom lets you change the page (“paper”) colour
3464 from white to anything you like. While this has limited application
3465 in printed documents, it can be effective in
3466 <a href="docprocessing.html#slides">slide presentations</a>.
3469 <div class="macro-id-overline">
3470 <h3 id="page-color" class= "macro-id">PAGE_COLOR</h3>
3473 <div id="page-color-macro" class="box-macro-args" style="margin-top: .5em">
3474 Macro: <b>PAGE_COLOR</b> <kbd class="macro-args"> <color> | OFF | off</kbd>
3476 <p class="requires" style="font-style: normal">
3477 <i>Aliased as</i> <kbd>PAGE_COLOUR</kbd>, <kbd>SLIDE_COLOR</kbd>,
3478 <i>and</i> <kbd>SLIDE_COLOUR</kbd>.
3482 When you invoke PAGE_COLOR with a <kbd>color</kbd> argument, the
3483 current and subsequent pages turn the colour you request. If
3484 more than one instance of PAGE_COLOR appears before a page break,
3485 including <kbd>PAGE_COLOR OFF</kbd>, only the last applies.
3488 <div class="box-tip">
3490 <span class="note">Note:</span>
3492 <a href="definitions.html#toggle">toggle macros</a>,
3493 PAGE_COLOR requires the use of <kbd>OFF</kbd> or <kbd>off</kbd>
3494 to terminate it rather than an arbitrary string (<kbd>OFF</kbd>,
3495 <kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc).
3499 <div class="rule-long"><hr/></div>
3501 <!-- Navigation links -->
3502 <table style="width: 100%; margin-top: 12px;">
3504 <td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td>
3505 <td style="width: 20%; text-align: center;"><a href="#top">Top</a></td>
3506 <td style="width: 46%; text-align: right;"><a href="headfootpage.html">Next: Page headers/footers, pagination</a></td>
3512 <div class="bottom-spacer"><br/></div>