| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!-- |
| 3 |
This file is part of groff, the GNU roff type-setting system. |
| 4 |
|
| 5 |
Copyright (C) 2004-2020 Free Software Foundation, Inc. |
| 6 |
Written by Peter Schaffter ([email protected]). |
| 7 |
|
| 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 |
| 12 |
Texts. |
| 13 |
|
| 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. |
| 16 |
--> |
| 17 |
|
| 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"> |
| 20 |
|
| 21 |
<head> |
| 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" /> |
| 25 |
</head> |
| 26 |
|
| 27 |
<body style="background-color: #f5faff;"> |
| 28 |
|
| 29 |
<!-- ==================================================================== --> |
| 30 |
|
| 31 |
<div id="top" class="page"> |
| 32 |
|
| 33 |
<!-- Navigation links --> |
| 34 |
<table style="width: 100%;"> |
| 35 |
<tr> |
| 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> |
| 38 |
</tr> |
| 39 |
</table> |
| 40 |
|
| 41 |
<h1 class="docs">Graphics, floats, and preprocessor support</h1> |
| 42 |
|
| 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> |
| 46 |
<ul> |
| 47 |
<li><a href="#pdf-image">The PDF_IMAGE macro</a> |
| 48 |
<ul style="margin-left: -1em"> |
| 49 |
<li><a href="#pdf-image-frame">PDF_IMAGE_FRAME</a>—set parameters for image frames</li> |
| 50 |
</ul></li> |
| 51 |
<li><a href="#pspic">The PSPIC macro</a></li> |
| 52 |
</ul></li> |
| 53 |
<li><a href="#floats-intro">Floats</a> |
| 54 |
<ul> |
| 55 |
<li><a href="#float">The FLOAT macro</a></li> |
| 56 |
<li><a href="#float-label-caption">Labelling and captioning floats</a> |
| 57 |
<ul style="margin-left: -1em"> |
| 58 |
<li><a href="#label">LABEL</a></li> |
| 59 |
<li><a href="#caption">CAPTION</a></li> |
| 60 |
</ul></li> |
| 61 |
</ul></li> |
| 62 |
<li><a href="#preprocessor-support">Preprocessor support</a> |
| 63 |
<ul> |
| 64 |
<li><a href="#tbl">tbl</a> |
| 65 |
<ul style="margin-left: -1em;"> |
| 66 |
<li><a href="#ts-te">.TS / .TH / .TE macros and arguments</a></li> |
| 67 |
</ul></li> |
| 68 |
<li><a href="#eqn">eqn</a> |
| 69 |
<ul style="margin-left: -1em;"> |
| 70 |
<li><a href="#eq-en">.EQ / .EN macros and arguments</a></li> |
| 71 |
</ul></li> |
| 72 |
<li><a href="#pic">pic</a> |
| 73 |
<ul style="margin-left: -1em;"> |
| 74 |
<li><a href="#ps-pe">.PS / .PE macros and arguments</a></li> |
| 75 |
<li><a href="#pic-text-style">PIC_TEXT_STYLE</a>—set parameters for text in diagrams</li> |
| 76 |
</ul></li> |
| 77 |
<li><a href="#grap">grap</a></li> |
| 78 |
<li><a href="#refer">refer</a></li> |
| 79 |
</ul></li> |
| 80 |
<li><a href="#captions-and-labels">Captions and labels</a> |
| 81 |
<ul> |
| 82 |
<li><a href="#autolabel">AUTOLABEL</a></li> |
| 83 |
<li><a href="#set-autolabel">SET_AUTOLABEL</a></li> |
| 84 |
<li><a href="#caption-after-label">CAPTION_AFTER_LABEL</a></li> |
| 85 |
<li><a href="#captions-labels-sources">CAPTIONS / LABELS / SOURCES</a>—set parameters for each</li> |
| 86 |
<li><a href="#mla">MLA</a></li> |
| 87 |
</ul></li> |
| 88 |
<li><a href="#lists-of">Lists of Figures, Tables, and Equations</a> |
| 89 |
<ul> |
| 90 |
<li><a href="#lists-placement">Placement of Lists</a></li> |
| 91 |
<li><a href="#lists-macros">Macros to generate Lists</a></li> |
| 92 |
<li><a href="#formatting-lists">Formatting and style parameters for Lists</a> |
| 93 |
<ul style="margin-left: -1em"> |
| 94 |
<li><a href="#lists-style">LISTS_STYLE</a></li> |
| 95 |
</ul></li> |
| 96 |
</ul></li> |
| 97 |
<li><a href="#box-intro">Shaded backgrounds and frames (boxes)</a> |
| 98 |
<ul> |
| 99 |
<li><a href="#box-intro">Introduction and description</a></li> |
| 100 |
<li><a href="#box">The BOX macro</a></li> |
| 101 |
<li><a href="#box-notes">Additional notes on box usage and behaviour</a> |
| 102 |
<ul> |
| 103 |
<li><a href="#qbef">QUOTE, BLOCKQUOTE, EPIGRAPH, FLOAT</a></li> |
| 104 |
<li><a href="#code">CODE</a></li> |
| 105 |
<li><a href="#quotes">Description of boxed BLOCKQUOTEs and EPIGRAPHs</a> |
| 106 |
<ul style="margin-left: -1em; list-style: disc;"> |
| 107 |
<li><a href="#leftover">Leftover box syndrome</a></li> |
| 108 |
</ul></li> |
| 109 |
<li><a href="#slides">Slides</a></li> |
| 110 |
<li><a href="#footnotes">Footnotes</a></li> |
| 111 |
</ul></li> |
| 112 |
<li><a href="#page-color-intro">Page colour</a></li> |
| 113 |
</ul> |
| 114 |
</li> |
| 115 |
</ul> |
| 116 |
</div> |
| 117 |
|
| 118 |
<div class="rule-medium"><hr/></div> |
| 119 |
|
| 120 |
<h2 id="images-intro" class="docs">Inserting images and graphics</h2> |
| 121 |
|
| 122 |
<p> |
| 123 |
Mom's macro for embedding images in PDF files, PDF_IMAGE, accepts |
| 124 |
all common image formats except EPS (.eps), which requires |
| 125 |
conversion to something else (pdf, jpg, png...) for use in PDF |
| 126 |
documents. Use the <b>convert</b> utility from the imagemagick |
| 127 |
suite of tools: |
| 128 |
<br/> |
| 129 |
<span class="pre-in-pp"> |
| 130 |
convert <image>.eps <image>.pdf |
| 131 |
</span> |
| 132 |
If the output is to PostScript, no conversion is necessary and the |
| 133 |
<a href="#pspic">PSPIC</a> |
| 134 |
macro must be used rather than PDF_IMAGE. |
| 135 |
</p> |
| 136 |
|
| 137 |
<h3 id="converting" class="docs">Image conversion and file processing</h3> |
| 138 |
|
| 139 |
<p> |
| 140 |
Mom files containing images in any format other than eps must be |
| 141 |
processed using groff’s pdf driver. Use of |
| 142 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a> |
| 143 |
is strongly recommended, which natively invokes the pdf driver. |
| 144 |
<br/> |
| 145 |
<span class="pre-in-pp"> |
| 146 |
pdfmom doc.mom > doc.pdf |
| 147 |
</span> |
| 148 |
</p> |
| 149 |
|
| 150 |
<!-- -PDF_IMAGE- --> |
| 151 |
|
| 152 |
<div class="macro-id-overline"> |
| 153 |
<h3 id="pdf-image" class= "macro-id">PDF_IMAGE</h3> |
| 154 |
</div> |
| 155 |
|
| 156 |
<div class="box-macro-args"> |
| 157 |
Macro: <b>PDF_IMAGE</b> \ |
| 158 |
<br/> |
| 159 |
<kbd class="macro-args">[ -L | -C | -R | -I <indent> ] \ |
| 160 |
<br/> |
| 161 |
<image file> [ <width> <height> ] [ SCALE <factor> ] \ |
| 162 |
<br/> |
| 163 |
[ ADJUST +|-<vertical adjustment> ] [ NO_SHIM ] [ NO_FLEX ] \ |
| 164 |
<br/> |
| 165 |
[ FRAME ] \ |
| 166 |
<br/> |
| 167 |
[ CAPTION "<caption>" ] [ SHORT_CAPTION "<short caption>" ] \ |
| 168 |
<br/> |
| 169 |
[ LABEL "<label>" ] [ TARGET "<name>" ]</kbd> |
| 170 |
</div> |
| 171 |
<p class="requires"> |
| 172 |
• <span style="font-style: normal"> |
| 173 |
<kbd><indent></kbd>, |
| 174 |
<kbd><width></kbd>, |
| 175 |
<kbd><height></kbd></span> |
| 176 |
and |
| 177 |
<span style="font-style: normal"> |
| 178 |
<kbd><vertical adjustment></kbd></span> |
| 179 |
require a |
| 180 |
<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 181 |
</p> |
| 182 |
|
| 183 |
<div class="box-tip"> |
| 184 |
<p class="tip-top"> |
| 185 |
<span class="note">Note:</span> |
| 186 |
Originally created for embedding pdf images—hence the |
| 187 |
name—PDF_IMAGE accepts image files of <i>any</i> type: pdf, |
| 188 |
jpg, jp2, png, pam, gif, tiff... If output is to PostScript, |
| 189 |
image files must be converted to Encapsulated PostScript (eps) and |
| 190 |
embedded using |
| 191 |
<a href="#pspic">PSPIC</a>. |
| 192 |
<p class="tip-bottom"> |
| 193 |
<span class="note">Dependencies:</span> |
| 194 |
For image types other than pdf, imagemagick and perlmagick must be |
| 195 |
installed. |
| 196 |
</p> |
| 197 |
</div> |
| 198 |
|
| 199 |
<p> |
| 200 |
The first optional argument tells mom how to align the image |
| 201 |
horizontally, with <kbd>-L</kbd>, <kbd>-C</kbd>, and <kbd>-R</kbd> |
| 202 |
standing for left, centre and right respectively. If you need more |
| 203 |
precise placement, the <kbd>-I</kbd> argument allows you to give an |
| 204 |
indent from the left margin. Thus, to indent an image 6 |
| 205 |
<a href="definitions.html#picaspoints">picas</a> |
| 206 |
from the left margin |
| 207 |
<br/> |
| 208 |
<span class="pre-in-pp"> |
| 209 |
.PDF_IMAGE -I 6P <remaining arguments> |
| 210 |
</span> |
| 211 |
If you omit the first argument, the image will be centred. |
| 212 |
</p> |
| 213 |
|
| 214 |
<p> |
| 215 |
<kbd><image></kbd> must be in a format recognized by |
| 216 |
imagemagick and have a corresponding filename extension. If it is |
| 217 |
not, mom will abort with a message. |
| 218 |
</p> |
| 219 |
|
| 220 |
<p id="bounding-box"> |
| 221 |
<kbd><width></kbd> and <kbd><height></kbd> are the |
| 222 |
dimensions of the image’s bounding box. If you invoke |
| 223 |
pdfmom or groff in “unsafe mode” (by passing them the |
| 224 |
<kbd>-U</kbd> option), you may omit <kbd><width></kbd> and |
| 225 |
<kbd><height></kbd>. If you invoke either in safe mode (no |
| 226 |
<kbd>-U</kbd> flag), the dimensions must be supplied. They can be |
| 227 |
obtained by using the <strong>identify</strong> utility (part of the |
| 228 |
imagemagick suite of tools): |
| 229 |
<br/> |
| 230 |
<span class="pre-in-pp"> |
| 231 |
identify -verbose <image file> | grep "Geometry:" |
| 232 |
</span> |
| 233 |
This will spit out a line that looks like this: |
| 234 |
<br/> |
| 235 |
<span class="pre-in-pp"> |
| 236 |
Geometry: <width>x<height>+0+0 |
| 237 |
</span> |
| 238 |
The values for width and height are in |
| 239 |
<a href="definitions.html#picaspoints">points</a>, |
| 240 |
therefore the unit of measure appended to PDF_IMAGE's |
| 241 |
<kbd><width></kbd> and <kbd><height></kbd> arguments |
| 242 |
must be <kbd>p</kbd>. |
| 243 |
</p> |
| 244 |
|
| 245 |
<p> |
| 246 |
The remaining arguments are optional and may be entered in any |
| 247 |
order, although it’s best to put <kbd>CAPTION</kbd>, |
| 248 |
<kbd>SHORT_CAPTION</kbd>, and <kbd>LABEL</kbd> last. |
| 249 |
</p> |
| 250 |
|
| 251 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SCALE</h5> |
| 252 |
|
| 253 |
<p> |
| 254 |
<kbd>SCALE</kbd> allows you to scale the image by |
| 255 |
<kbd><factor></kbd>. The factor is a percentage of the |
| 256 |
image’s original dimensions, thus <kbd>SCALE 50</kbd> |
| 257 |
scales the image to 50 percent of its original size. No percent |
| 258 |
sign or unit of measure should be appended. |
| 259 |
</p> |
| 260 |
|
| 261 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5> |
| 262 |
|
| 263 |
<p> |
| 264 |
<kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower |
| 265 |
(<kbd>+</kbd>) the image |
| 266 |
<span style="font-style: italic">within the space allotted for it</span> |
| 267 |
by the amount you specify. This is useful for achieving good |
| 268 |
optical centering between surrounding blocks of type. A unit of |
| 269 |
measure is required. |
| 270 |
</p> |
| 271 |
|
| 272 |
<div class="box-tip"> |
| 273 |
<p class="tip-top"> |
| 274 |
<span class="note">Tip:</span> |
| 275 |
You may sometimes find that a PDF_IMAGE at the bottom of a page |
| 276 |
doesn’t sit flush on the bottom margin, however attempts to lower it |
| 277 |
by adding space beforehand result in it being deferred to the next |
| 278 |
page. |
| 279 |
</p> |
| 280 |
|
| 281 |
<p class="tip-bottom"> |
| 282 |
The solution is to introduce <i>negative</i> space before the image |
| 283 |
so that it displays on the page, then lower it to the bottom margin |
| 284 |
with PDF_IMAGE’s <kbd>ADJUST</kbd> argument. |
| 285 |
</p> |
| 286 |
</div> |
| 287 |
|
| 288 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5> |
| 289 |
|
| 290 |
<p> |
| 291 |
<kbd>NO_SHIM</kbd> instructs mom not to apply |
| 292 |
<a href="docprocessing.html#shim-vs-flex">shimming</a> |
| 293 |
after an image, which she will do automatically when shimming is |
| 294 |
enabled, which it is by default. Shimming ensures that running text |
| 295 |
after the image falls properly on the page’s |
| 296 |
<a href="definitions.html#baseline-grid">baseline grid</a>, |
| 297 |
but can result in slightly unequal spacing above and below |
| 298 |
(correctable with the <kbd>ADJUST</kbd> argument). |
| 299 |
<kbd>NO_SHIM</kbd> is useful when you have several images on the |
| 300 |
page and there are visible differences in the spacing beneath them |
| 301 |
as a result of shimming. To ensure a flush bottom margin, the last |
| 302 |
image on the page should be shimmed, i.e. should not be given the |
| 303 |
<kbd>NO_SHIM</kbd> argument. |
| 304 |
</p> |
| 305 |
|
| 306 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5> |
| 307 |
|
| 308 |
<p> |
| 309 |
<kbd>NO_FLEX</kbd> instructs mom not to apply |
| 310 |
<a href="docprocessing.html#shim-vs-flex">flex-spacing</a> |
| 311 |
after an image, which she will do automatically when flex-spacing is |
| 312 |
enabled. <kbd>NO_FLEX</kbd> is useful when you have several images |
| 313 |
on the page and you want to distribute excess vertical |
| 314 |
whitespace on the page amongst other flex-spacing points on the |
| 315 |
page. If there are no others, the final image should be |
| 316 |
flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument. |
| 317 |
</p> |
| 318 |
|
| 319 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">FRAME</h5> |
| 320 |
|
| 321 |
<p> |
| 322 |
<kbd>FRAME</kbd> instructs mom to put a frame around the image. |
| 323 |
Parameters for the frame are set with |
| 324 |
<a href="#pdf-image-frame">PDF_IMAGE_FRAME</a>. |
| 325 |
</p> |
| 326 |
|
| 327 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5> |
| 328 |
|
| 329 |
<p> |
| 330 |
<kbd>CAPTION</kbd> allows you to give the image a caption. By |
| 331 |
default, the caption appears above the image, but may be attached to |
| 332 |
the label that appears beneath the image. See |
| 333 |
<a href="#caption-after-label">CAPTION_AFTER_LABEL</a> |
| 334 |
in |
| 335 |
<a href="#captions-and-labels">Captions and labels</a>. |
| 336 |
The text of the caption must be surrounded by double-quotes. |
| 337 |
</p> |
| 338 |
|
| 339 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5> |
| 340 |
|
| 341 |
<p> |
| 342 |
<kbd>SHORT_CAPTION</kbd> allows you to trim long captions for |
| 343 |
inclusion in the List of Figures. The text you supply, surrounded |
| 344 |
by double-quotes, is what will appear in the List. |
| 345 |
</p> |
| 346 |
|
| 347 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5> |
| 348 |
|
| 349 |
<p> |
| 350 |
<kbd>LABEL</kbd>, if given, appears beneath the image. The text you |
| 351 |
supply, surrounded by double-quotes, is how the image is labelled |
| 352 |
in both the document proper and the List of Figures. Mom provides |
| 353 |
an auto-labelling facility for images (see |
| 354 |
<a href="#autolabel">AUTOLABEL</a>), |
| 355 |
which, if enabled, overrides the <kbd>LABEL</kbd> argument. |
| 356 |
</p> |
| 357 |
|
| 358 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5> |
| 359 |
|
| 360 |
<p> |
| 361 |
<kbd>TARGET</kbd> followed by a unique name surrounded by |
| 362 |
double-quotes creates a PDF target for the image so that it may be |
| 363 |
linked to from other places in the file (with PDF_LINK; see |
| 364 |
<a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>). |
| 365 |
</p> |
| 366 |
|
| 367 |
<p> |
| 368 |
<b><i>Please note:</i></b> The following functionality is available |
| 369 |
only with groff 1.22.4 or later. |
| 370 |
</p> |
| 371 |
|
| 372 |
<p> |
| 373 |
When |
| 374 |
<a href="#autolabel">autolabelling</a> |
| 375 |
is enabled and the document is processed with |
| 376 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>, |
| 377 |
the target name can be used to generate the target’s label |
| 378 |
number in running text if it is entered as a groff string, i.e. of the |
| 379 |
form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you create |
| 380 |
a target named “foo” for an image whose autolabel |
| 381 |
number would be 3, entering |
| 382 |
<br/> |
| 383 |
<span class="pre-in-pp"> |
| 384 |
See |
| 385 |
.PDF_LINK foo "Figure \*[foo]" |
| 386 |
</span> |
| 387 |
anywhere in running text would result in a pdf link that reads |
| 388 |
“Figure 3”. If chapter numbers are being prefixed to |
| 389 |
labels, the same string in, say, chapter 5 would produce the pdf |
| 390 |
link “Figure 5.3”. |
| 391 |
</p> |
| 392 |
|
| 393 |
<div class="box-tip"> |
| 394 |
<p class="tip"> |
| 395 |
<span class="note">Note: Version 2.0-c change</span> |
| 396 |
<br/> |
| 397 |
Mom treats all images embedded with PDF_IMAGE as |
| 398 |
<a href="#floats-intro">floats</a>, |
| 399 |
which is to say that if an image doesn’t fit on the output |
| 400 |
page, she will defer it to the top of the next page while continuing |
| 401 |
to process |
| 402 |
<a href="definitions.html#running">running text</a>. |
| 403 |
<kbd>ADJUST</kbd> is ignored whenever an image is the first to be |
| 404 |
deferred, except when moving from column to column on the same page, |
| 405 |
when the image may need to be optically adjusted. Subsequent images |
| 406 |
that do not fit, if any, are output in order immediately after the |
| 407 |
first. |
| 408 |
</p> |
| 409 |
|
| 410 |
</div> |
| 411 |
|
| 412 |
<!-- -PDF_IMAGE_FRAME- --> |
| 413 |
|
| 414 |
<div class="macro-id-overline"> |
| 415 |
<h3 id="pdf-image-frame" class= "macro-id">PDF_IMAGE_FRAME</h3> |
| 416 |
</div> |
| 417 |
|
| 418 |
<div class="box-macro-args"> |
| 419 |
Macro: <b>PDF_IMAGE_FRAME</b> <kbd class="macro-args"><inset amount> <rule weight> <color></kbd> |
| 420 |
</div> |
| 421 |
<p class="requires"> |
| 422 |
• <span style="font-style: normal"><kbd><inset amount></kbd></span> |
| 423 |
requires a |
| 424 |
<a href="definitions.html#unitofmeasure">unit of measure</a>; |
| 425 |
conversely, |
| 426 |
<span style="font-style: normal"><kbd><rule weight></kbd></span> |
| 427 |
must not have a unit of measure appended |
| 428 |
</p> |
| 429 |
|
| 430 |
<p> |
| 431 |
PDF_IMAGE_FRAME establishes the parameters for subsequent invocations of |
| 432 |
<a href="#pdf-image">PDF_IMAGE</a> |
| 433 |
when the <kbd>FRAME</kbd> argument is given. Arguments must appear |
| 434 |
in order, and any you wish left at the current value should be |
| 435 |
entered as two adjacent double-quotes. So, for example, |
| 436 |
<br/> |
| 437 |
<span class="pre-in-pp"> |
| 438 |
.PDF_IMAGE_FRAME "" "" blue |
| 439 |
</span> |
| 440 |
leaves the inset value and rule weight at their current value and |
| 441 |
changes the frame colour to blue. |
| 442 |
</p> |
| 443 |
|
| 444 |
<p> |
| 445 |
Frames are drawn <span class="italic">outside</span> the image at |
| 446 |
its requested dimensions inclusive of scaling. Colours must be |
| 447 |
pre-initialized with |
| 448 |
<a href="color.html#xcolor">XCOLOR</a> |
| 449 |
or |
| 450 |
<a href="color.html#newcolor">NEWCOLOR</a>. |
| 451 |
</p> |
| 452 |
|
| 453 |
<p> |
| 454 |
The default inset is 6 |
| 455 |
<a href="definitions.html#picaspoints">points</a>, |
| 456 |
the default rule weight is .5 (points), and the default colour is |
| 457 |
black. |
| 458 |
</p> |
| 459 |
|
| 460 |
<!-- -PSPIC- --> |
| 461 |
|
| 462 |
<div class="macro-id-overline"> |
| 463 |
<h3 id="pspic" class= "macro-id">PSPIC</h3> |
| 464 |
</div> |
| 465 |
|
| 466 |
<div class="box-macro-args"> |
| 467 |
Macro: <b>PSPIC</b> <kbd class="macro-args">[ -L | -R | -I <n> |
| 468 |
] <file> [ <width> [ <height> ] ]</kbd> |
| 469 |
</div> |
| 470 |
|
| 471 |
<p> |
| 472 |
Images in files destined for PostScript output must be in .eps |
| 473 |
format and require using PSPIC rather than PDF_IMAGE. |
| 474 |
</p> |
| 475 |
|
| 476 |
<p> |
| 477 |
PSPIC is not actually part of mom, but rather a macro included with |
| 478 |
every groff installation. <kbd>man groff_tmac</kbd> contains the |
| 479 |
documentation for PSPIC, but I’ll repeat it here with a few |
| 480 |
modifications for clarity. |
| 481 |
</p> |
| 482 |
|
| 483 |
<div class="examples-container"> |
| 484 |
<h3 id="groff-tmac" class="docs" style="margin-top: .5em;">From <span style="text-transform: none">groff_tmac</span></h3> |
| 485 |
<p style="margin-top: .5em; margin-bottom: .5em;"> |
| 486 |
<kbd><file></kbd> is the name of the file containing the |
| 487 |
image; <kbd><width></kbd> and <kbd><height></kbd> give |
| 488 |
the desired width and height of the image as you wish it to appear |
| 489 |
within the document. If neither a width nor a height argument is |
| 490 |
specified, the image’s natural width (as given in the file’s |
| 491 |
bounding box) or the current line length is used as the width, |
| 492 |
whichever is smaller. The width and height arguments may have |
| 493 |
<a href="definitions.html#unitofmeasure">units of measure</a> |
| 494 |
attached; the default unit of measure is <kbd>i</kbd>. PSPIC always |
| 495 |
scales the graphic uniformly in the x and y directions so that |
| 496 |
it is no more than <kbd>width</kbd> wide and <kbd>height</kbd> |
| 497 |
high. By default, the graphic will be horizontally centred. The |
| 498 |
<kbd>-L</kbd> and <kbd>-R</kbd> options cause the graphic to be |
| 499 |
left-aligned and right-aligned, respectively. The <kbd>-I</kbd> |
| 500 |
option causes the graphic to be indented by <kbd><n></kbd>; |
| 501 |
the default unit of measure is <kbd>m</kbd> |
| 502 |
(<a href="definitions.html#em">ems</a>). |
| 503 |
</p> |
| 504 |
</div> |
| 505 |
|
| 506 |
<p> |
| 507 |
It is not necessary to pass PSPIC the <kbd><width></kbd> |
| 508 |
and <kbd><height></kbd> arguments unless you are scaling |
| 509 |
the image, in which case you will most likely need the original |
| 510 |
dimensions of the EPS image’s bounding box. These can be |
| 511 |
found with |
| 512 |
<br/> |
| 513 |
<span class="pre-in-pp"> |
| 514 |
gs -q -dBATCH -dNOPAUSE -sDEVICE=bbox <image file>.pdf 2>&1 \ |
| 515 |
| grep "%%BoundingBox" | cut -d " " -f4,5 |
| 516 |
</span> |
| 517 |
The two digits returned are in |
| 518 |
<a href="definitions.html#picaspoints">points</a>, |
| 519 |
therefore the |
| 520 |
<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 521 |
<kbd>p</kbd> must be appended to them. |
| 522 |
</p> |
| 523 |
|
| 524 |
<p> |
| 525 |
Because PSPIC lacks the <kbd>ADJUST</kbd> option offered by |
| 526 |
<a href="#pdf-image">PDF_IMAGE</a> |
| 527 |
a certain amount of manual tweaking of the vertical placement of the |
| 528 |
image will probably be required, typically by using the |
| 529 |
<a href="typesetting.html#ald">ALD</a> |
| 530 |
and |
| 531 |
<a href="typesetting.html#rld">RLD</a> |
| 532 |
macros. Wrapping the image in a |
| 533 |
<a href="#float">float</a> |
| 534 |
and using FLOAT’s <kbd>ADJUST</kbd> option can also be used to |
| 535 |
correct optical centering. |
| 536 |
</p> |
| 537 |
|
| 538 |
<p> |
| 539 |
Additionally, non-floated EPS images |
| 540 |
will almost certainly disrupt the baseline placement of |
| 541 |
<a href="definitions.html#running">running text</a>. |
| 542 |
In order to get mom back on track after inserting a non-floated |
| 543 |
<kbd>.PSPIC</kbd> image, insert the |
| 544 |
<a href="docprocessing.html#shim">SHIM</a> |
| 545 |
or |
| 546 |
<a href="docprocessing.html#flex">FLEX</a> |
| 547 |
macro afterwards, depending on the |
| 548 |
<a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a> |
| 549 |
strategy in effect, so that the bottom margin of running text falls |
| 550 |
where it should. |
| 551 |
</p> |
| 552 |
|
| 553 |
<p> |
| 554 |
Remember that mom files with embedded EPS images must be processed |
| 555 |
with |
| 556 |
<br/> |
| 557 |
<span class="pre-in-pp"> |
| 558 |
pdfmom -Tps doc.mom > doc.pdf |
| 559 |
</span> |
| 560 |
</p> |
| 561 |
|
| 562 |
<div class="box-tip"> |
| 563 |
<p class="tip"> |
| 564 |
<span class="note">Please note:</span> |
| 565 |
<kbd>PSPIC</kbd> does not support |
| 566 |
<a href="autolabel">autolabelling</a>, |
| 567 |
labels, captions, or inclusion in the List of Figures. If you wish |
| 568 |
this functionality, |
| 569 |
<a href="#converting">convert your images to pdf</a> |
| 570 |
and use |
| 571 |
<a href="#pdf-image">PDF_IMAGE</a> |
| 572 |
instead, then process the file with |
| 573 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a> |
| 574 |
(without the <kbd>-Tps</kbd> option). |
| 575 |
</p> |
| 576 |
</div> |
| 577 |
<div class="rule-medium"><hr/></div> |
| 578 |
|
| 579 |
<h2 id="floats-intro" class="docs">Introduction to floats</h2> |
| 580 |
|
| 581 |
<p> |
| 582 |
Non-textual insertions in a document (tables, for example) sometimes |
| 583 |
do not fit on the output page of a PDF or PostScript document at |
| 584 |
the place they’re inserted in the input file. It’s |
| 585 |
necessary, therefore, to defer them to the next page while carrying |
| 586 |
on with |
| 587 |
<a href="definitions.html#running">running text</a>. |
| 588 |
</p> |
| 589 |
|
| 590 |
<p> |
| 591 |
Whenever you need this functionality, mom provides the FLOAT macro. |
| 592 |
</p> |
| 593 |
|
| 594 |
<p> |
| 595 |
Floats are usually used for images and graphics, but can contain |
| 596 |
anything you like, including text. Whatever’s in the |
| 597 |
float will be kept together as a block, output immediately if |
| 598 |
there’s room, or deferred to the top of the next output page |
| 599 |
when there isn’t; running text continues to the bottom of the |
| 600 |
previous page without interruption. |
| 601 |
</p> |
| 602 |
|
| 603 |
<p> |
| 604 |
In the case of a float that doesn’t fit being followed by |
| 605 |
one that does, both are deferred and output one after the other. |
| 606 |
Note that this represents a change from versions 2.1-b_1 and earlier |
| 607 |
where the second float was output in position and the first was |
| 608 |
deferred. |
| 609 |
</p> |
| 610 |
|
| 611 |
<p> |
| 612 |
A key distinction between a float and a |
| 613 |
<a href="docelement.html#quote">QUOTE</a> |
| 614 |
or |
| 615 |
<a href="docelement.html#blockquote">BLOCKQUOTE</a> |
| 616 |
is that while a float keeps everything together and defers output if |
| 617 |
necessary, quotes and blockquotes are output immediately, and may |
| 618 |
start on one page and finish on the next. |
| 619 |
</p> |
| 620 |
|
| 621 |
<p> |
| 622 |
Floats always begin in |
| 623 |
<a href="definitions.html#filled">no-fill mode</a>. |
| 624 |
Text entered immediately after FLOAT will be set line-for-line |
| 625 |
unless a |
| 626 |
<a href="typesetting.html#justify">JUSTIFY</a> |
| 627 |
or |
| 628 |
<a href="typesetting.html#quad">QUAD L|R|C</a> |
| 629 |
precedes it. Alternatively, any macro that sets a quad direction |
| 630 |
may be used, e.g. |
| 631 |
<a href="docelement.html#pp">PP</a>. |
| 632 |
</p> |
| 633 |
|
| 634 |
<p> |
| 635 |
Floats always deposit a break before they begin, which means the |
| 636 |
line beforehand will not be |
| 637 |
<a href="definitions.html#filled">filled</a>. |
| 638 |
Floats, therefore, cannot be inserted in the middle of a paragraph |
| 639 |
without studying the output file and determining where to break or |
| 640 |
<a href="typesetting.html#spread">spread</a> |
| 641 |
the line before the float. Furthermore, if you want a float between |
| 642 |
paragraphs, the float should come before <kbd>.PP</kbd>, like this: |
| 643 |
<br/> |
| 644 |
<span class="pre-in-pp"> |
| 645 |
.FLOAT |
| 646 |
... |
| 647 |
.FLOAT OFF |
| 648 |
.PP |
| 649 |
</span> |
| 650 |
not |
| 651 |
<br/> |
| 652 |
<span class="pre-in-pp"> |
| 653 |
.PP |
| 654 |
.FLOAT |
| 655 |
... |
| 656 |
.FLOAT OFF |
| 657 |
</span> |
| 658 |
</p> |
| 659 |
|
| 660 |
<p id="float-spacing"> |
| 661 |
Floats begin on the baseline immediately below the running text |
| 662 |
preceding them. No additional whitespace surrounds them, above or |
| 663 |
below. Running text below a float is, however, |
| 664 |
<a href="docprocessing.html#shim">shimmed</a> |
| 665 |
or |
| 666 |
<a href="docprocessing.html#flex">flex-spaced</a>, |
| 667 |
depending on the |
| 668 |
<a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a> |
| 669 |
strategy in effect. This behaviour can be disabled for individual |
| 670 |
floats with <kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd>. |
| 671 |
</p> |
| 672 |
|
| 673 |
<p> |
| 674 |
If you’d like more space around a float, you must add it |
| 675 |
manually, for example with |
| 676 |
<a href="typesetting.html#ald">ALD</a> |
| 677 |
or |
| 678 |
<a href="typesetting.html#space">SPACE</a>. |
| 679 |
</p> |
| 680 |
|
| 681 |
<!-- -FLOAT- --> |
| 682 |
|
| 683 |
<div class="macro-id-overline"> |
| 684 |
<h3 id="float" class= "macro-id">FLOAT</h3> |
| 685 |
</div> |
| 686 |
|
| 687 |
<div class="box-macro-args"> |
| 688 |
Macro: <b>FLOAT</b> <kbd class="macro-args"><arguments> | <anything> |
| 689 |
<br/> |
| 690 |
Arguments: |
| 691 |
<br/> |
| 692 |
[ ADJUST +|-<amount> ] \ |
| 693 |
<br/> |
| 694 |
[ FORCE ] \ |
| 695 |
<br/> |
| 696 |
[ SPAN ] \ |
| 697 |
<br/> |
| 698 |
[ INDENT <value> ] \ |
| 699 |
<br/> |
| 700 |
[ CENTER ] \ |
| 701 |
<br/> |
| 702 |
[ RIGHT ] \ |
| 703 |
<br/> |
| 704 |
[ NO_SHIM] \ |
| 705 |
<br/> |
| 706 |
[ NO_FLEX ] \ |
| 707 |
<br/> |
| 708 |
[ TARGET "<name>" ]</kbd> |
| 709 |
<br/> |
| 710 |
</div> |
| 711 |
|
| 712 |
<div class="box-tip"> |
| 713 |
<p class="tip"> |
| 714 |
<span class="note">Note:</span> |
| 715 |
FLOAT is intended for use with the document processing macros only. |
| 716 |
</p> |
| 717 |
</div> |
| 718 |
|
| 719 |
<div class="box-tip"> |
| 720 |
<p class="tip"> |
| 721 |
<span class="note">Note:</span> |
| 722 |
As a general rule, avoid consecutive floats that have no intervening |
| 723 |
<a href="definitions.html#running">running text</a>. |
| 724 |
Rather, wrap all the material into a single float. |
| 725 |
</p> |
| 726 |
</div> |
| 727 |
|
| 728 |
<div class="box-tip"> |
| 729 |
<p class="tip"> |
| 730 |
<span class="note">Note:</span> |
| 731 |
Deferred floats are output with the left indent that was in effect |
| 732 |
when they were input. If you do not want this behaviour, disable |
| 733 |
the indent prior to inputting the float and re-enable it afterward. |
| 734 |
</p> |
| 735 |
</div> |
| 736 |
|
| 737 |
<div class="box-tip"> |
| 738 |
<p class="tip"> |
| 739 |
<span class="note">Note:</span> |
| 740 |
Mom treats <b>pic</b> pre-processor directives and images embedded |
| 741 |
with |
| 742 |
<a href="#pdf-image">PDF_IMAGE</a> |
| 743 |
as floats so it is not necessary to wrap them inside FLOAT unless |
| 744 |
additional material is included in what is floated. |
| 745 |
</p> |
| 746 |
</div> |
| 747 |
|
| 748 |
<p style="margin-top: -.5em"> |
| 749 |
To begin a float, simply invoke <kbd>.FLOAT</kbd> and follow it with |
| 750 |
whatever you want the float to contain. When you’re done, |
| 751 |
invoke <kbd>.FLOAT OFF</kbd> (or <kbd>OFF</kbd>, |
| 752 |
<kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc). |
| 753 |
</p> |
| 754 |
|
| 755 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5> |
| 756 |
|
| 757 |
<p> |
| 758 |
The optional <kbd>ADJUST</kbd> argument tells mom to raise |
| 759 |
(<kbd>+</kbd>) or lower (<kbd>-</kbd>) the float <i>within |
| 760 |
the space allotted to it</i> by the specified amount. |
| 761 |
<kbd><amount></kbd> must have a |
| 762 |
<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 763 |
appended. <kbd>ADJUST</kbd> gives you precise control over |
| 764 |
the vertical centering of floats, allowing you to compensate for |
| 765 |
unequal spacing that may result from the automatic |
| 766 |
<a href="docprocessing.html#shim">shimming</a> |
| 767 |
or |
| 768 |
<a href="docprocessing.html#flex">flex-spacing</a> |
| 769 |
floats. |
| 770 |
</p> |
| 771 |
|
| 772 |
<p> |
| 773 |
<kbd>ADJUST</kbd> is ignored for the first float deferred to |
| 774 |
a following page but respected for subsequent deferred floats |
| 775 |
output immediately afterwards. |
| 776 |
</p> |
| 777 |
|
| 778 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">FORCE</h5> |
| 779 |
|
| 780 |
<p> |
| 781 |
The <kbd>FORCE</kbd> argument instructs mom to output the float |
| 782 |
exactly where it occurs in the input file. With <kbd>FORCE</kbd>, |
| 783 |
mom immediately breaks to a new page to output the float if it does |
| 784 |
not fit on the current page. While this is somewhat contrary to the |
| 785 |
notion of floats (i.e. that running text should continue to fill the |
| 786 |
page), there are circumstances where it may be desirable. |
| 787 |
</p> |
| 788 |
|
| 789 |
<p> |
| 790 |
If you need to force a page break after completion of a float that |
| 791 |
has been deferred to a subsequent page, insert <kbd>\!.bp</kbd> |
| 792 |
immediately before terminating the float. |
| 793 |
</p> |
| 794 |
|
| 795 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SPAN</h5> |
| 796 |
|
| 797 |
<p> |
| 798 |
The <kbd>SPAN</kbd> argument tells mom that a float, if deferred, |
| 799 |
may carry onto multiple pages. Please note that <kbd>SPAN</kbd> may |
| 800 |
not be used for floats containing a boxed table; mom will abort with |
| 801 |
a warning should this occur. Unboxed tables, on the other hand, are |
| 802 |
acceptable within floats that are given the <kbd>SPAN</kbd> argument. |
| 803 |
</p> |
| 804 |
|
| 805 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">INDENT</h5> |
| 806 |
|
| 807 |
<p> |
| 808 |
<kbd>INDENT</kbd> allows you to indent a float from the left margin |
| 809 |
by a specified value. The value must have a |
| 810 |
(<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 811 |
appended to it. |
| 812 |
</p> |
| 813 |
|
| 814 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">CENTER</h5> |
| 815 |
|
| 816 |
<p> |
| 817 |
<kbd>CENTER</kbd> instructs mom to center a float if it is not |
| 818 |
already centered by default. |
| 819 |
</p> |
| 820 |
|
| 821 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">RIGHT</h5> |
| 822 |
|
| 823 |
<p> |
| 824 |
<kbd>RIGHT</kbd> instructs mom to place a float at the right of the |
| 825 |
page; the longest line in the float will be flush with the |
| 826 |
page’s right margin. |
| 827 |
</p> |
| 828 |
|
| 829 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5> |
| 830 |
|
| 831 |
<p> |
| 832 |
<kbd>NO_SHIM</kbd> instructs mom not to apply |
| 833 |
<a href="docprocessing.html#shim-vs-flex">shimming</a> |
| 834 |
after a float, which she will do automatically when shimming is |
| 835 |
enabled, which it is by default. Shimming ensures that running text |
| 836 |
after the float falls properly on the page’s |
| 837 |
<a href="definitions.html#baseline-grid">baseline grid</a>, |
| 838 |
but can result in slightly unequal spacing above and below |
| 839 |
(correctable with the <kbd>ADJUST</kbd> argument). |
| 840 |
<kbd>NO_SHIM</kbd> is useful when you have several floats on the |
| 841 |
page and there are visible differences in the spacing beneath them |
| 842 |
as a result of shimming. To ensure a flush bottom margin, the last |
| 843 |
float on the page should be shimmed, i.e. should not be given the |
| 844 |
<kbd>NO_SHIM</kbd> argument. |
| 845 |
</p> |
| 846 |
|
| 847 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5> |
| 848 |
|
| 849 |
<p> |
| 850 |
<kbd>NO_FLEX</kbd> instructs mom not to apply |
| 851 |
<a href="docprocessing.html#shim-vs-flex">flex-spacing</a> |
| 852 |
after a float, which she will do automatically when flex-spacing is |
| 853 |
enabled. <kbd>NO_FLEX</kbd> is useful when you have several floats |
| 854 |
on the page and you want to distribute excess vertical |
| 855 |
whitespace on the page amongst other flex-spacing points on the |
| 856 |
page. If there are no others, the final float should be |
| 857 |
flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument. |
| 858 |
</p> |
| 859 |
|
| 860 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5> |
| 861 |
|
| 862 |
<p> |
| 863 |
<kbd>TARGET</kbd> followed by a unique name surrounded by |
| 864 |
double-quotes creates a PDF target for the float so that it may be |
| 865 |
linked to from other places in the file (with PDF_LINK; see |
| 866 |
<a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>). |
| 867 |
</p> |
| 868 |
|
| 869 |
<p> |
| 870 |
Floats cannot be autolabelled, so unlike embedded images and |
| 871 |
pre-processor material, the target name cannot be used as a string |
| 872 |
to generate the target’s label number in running text. Label |
| 873 |
numbers for floats must be entered explicitly running text, however |
| 874 |
they may be entered symbolically in the argument to |
| 875 |
<a href="#label">LABEL</a>. |
| 876 |
See |
| 877 |
<a href="#reserved-label-strings">Reserved variables for |
| 878 |
labels</a>. |
| 879 |
</p> |
| 880 |
|
| 881 |
<div class="box-tip"> |
| 882 |
<p class="tip-top"> |
| 883 |
<span class="note">Note:</span> |
| 884 |
Floats use |
| 885 |
<a href="definitions.html#filled">no-fill mode</a>, |
| 886 |
with each input line beginning at the left margin. If this is not |
| 887 |
what you want, you must specify the preferred horizontal alignment |
| 888 |
<i>within the float</i> (e.g. |
| 889 |
<a href="typesetting.html#lrc">CENTER</a> |
| 890 |
or |
| 891 |
<a href="typesetting.html#lrc">RIGHT</a>). |
| 892 |
</p> |
| 893 |
|
| 894 |
<p class="tip-bottom"> |
| 895 |
Furthermore, if you want text |
| 896 |
<a href="definitions.html#filled">filled</a>, |
| 897 |
you must specify |
| 898 |
<a href="typesetting.html#quad"><kbd>.QUAD L|R|C</kbd></a> |
| 899 |
or |
| 900 |
<a href="typesetting.html#justify"><kbd>.JUSTIFY</kbd></a>—again, |
| 901 |
within the float. |
| 902 |
</p> |
| 903 |
</div> |
| 904 |
|
| 905 |
<h2 id="float-label-caption" class="docs">Labelling and captioning floats</h2> |
| 906 |
|
| 907 |
<p> |
| 908 |
Labelling and captioning of tables (<b>tbl</b>), equations |
| 909 |
(<b>eq</b>), diagrams (<b>pic</b>) and embedded images |
| 910 |
(<a href="#pdf-image">PDF_IMAGE</a>) |
| 911 |
are handled by the macros that initiate them, regardless of whether |
| 912 |
they’re wrapped inside a float. However, since a float may |
| 913 |
contain any valid input, it is sometimes necessary to add a label |
| 914 |
and/or caption to the float itself. |
| 915 |
</p> |
| 916 |
|
| 917 |
<div class="box-tip"> |
| 918 |
<p class="tip"> |
| 919 |
<span class="important">Important:</span> |
| 920 |
Always use the native labelling/captioning facilities for |
| 921 |
preprocessor output and embedded images rather than labelling the |
| 922 |
containing float, if any. |
| 923 |
</p> |
| 924 |
</div> |
| 925 |
|
| 926 |
<p> |
| 927 |
The macros to label and caption floats are |
| 928 |
<a href="#label">LABEL</a> |
| 929 |
and |
| 930 |
<a href="#caption">CAPTION</a>. |
| 931 |
If a label or caption is to appear above the float, the appropriate |
| 932 |
macro is entered immediately after |
| 933 |
<a href="#float">FLOAT</a>. |
| 934 |
If a label or caption is to appear beneath the float, the appropriate |
| 935 |
macro is entered immediately before ending the float with |
| 936 |
<kbd>FLOAT OFF</kbd>. |
| 937 |
</p> |
| 938 |
|
| 939 |
<p> |
| 940 |
If a label and caption are to be joined, the <b>LABEL</b> macro is |
| 941 |
used to enter both by passing the <kbd>CAPTION</kbd> argument to |
| 942 |
<kbd>LABEL</kbd>. |
| 943 |
</p> |
| 944 |
|
| 945 |
<p> |
| 946 |
It is impossible for mom to know the contents of a float, so |
| 947 |
floats cannot be autolabelled. Each label must be entered |
| 948 |
explicitly. Mom does, however, provide a way to enter both |
| 949 |
chapter numbers and incrementing label numbers |
| 950 |
<a href="#reserved-label-strings">symbolically</a>, |
| 951 |
easing the burden of keeping the numbering scheme intact as |
| 952 |
labelled floats are added to or subtracted from a document. |
| 953 |
</p> |
| 954 |
|
| 955 |
<div class="box-tip"> |
| 956 |
<p class="tip"> |
| 957 |
<span class="note">Tip:</span> |
| 958 |
<a href="docelement.html#quote">QUOTE</a> |
| 959 |
and |
| 960 |
<a href="docelement.html#blockquote">BLOCKQUOTE</a> |
| 961 |
may also be labelled and captioned using <b>LABEL</b> and |
| 962 |
<b>CAPTION</b>. |
| 963 |
</p> |
| 964 |
</div> |
| 965 |
|
| 966 |
<h4 class="docs">Spacing</h4> |
| 967 |
|
| 968 |
<p> |
| 969 |
If a float has a caption at the top, the caption is whitespaced |
| 970 |
1/4 linespace from running text and the float itself begins |
| 971 |
an additional 1/4 linespace below the caption. If the float has |
| 972 |
no corresponding label at the bottom, the float observes the |
| 973 |
bottom-spacing rules for all floats, namely that no extra space is |
| 974 |
added other than |
| 975 |
<a href="docprocessing.html#shim">shimming</a> |
| 976 |
or |
| 977 |
<a href="docprocessing.html#shim-vs-flex">flex-spacing</a>, |
| 978 |
depending on the |
| 979 |
<a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a> |
| 980 |
in effect. |
| 981 |
</p> |
| 982 |
|
| 983 |
<p> |
| 984 |
If a float has a label at the bottom but no caption at the top, the |
| 985 |
float begins exactly where started, i.e. with no extra whitespace |
| 986 |
between running text and the float. The label (and attached |
| 987 |
caption, if any) are whitespaced 1/4 linespace below the float, |
| 988 |
with an additional 1/4 linespace underneath <i>plus</i> shimming or |
| 989 |
flex-spacing. |
| 990 |
</p> |
| 991 |
|
| 992 |
<p> |
| 993 |
Labelled/captioned quotes and blockquotes inside floats treat the |
| 994 |
labels/captions as part of the quote so the spacing above and |
| 995 |
below the whole float block is what you’d expect from quotes |
| 996 |
normally, while the spacing between the label/caption and the quote |
| 997 |
is 1/4 linespace. |
| 998 |
</p> |
| 999 |
|
| 1000 |
<div class="macro-id-overline"> |
| 1001 |
<h3 id="label" class="macro-id">LABEL</h3> |
| 1002 |
</div> |
| 1003 |
|
| 1004 |
<div class="box-macro-args"> |
| 1005 |
Macro: <b>LABEL</b> |
| 1006 |
<kbd class="macro-args">"<label>" [ CAPTION "<caption>" ] [ SHORT_CAPTION ] \ |
| 1007 |
<br/> |
| 1008 |
[ TO_LIST FIGURES | TABLES | EQUATIONS ]</kbd> |
| 1009 |
</div> |
| 1010 |
|
| 1011 |
<p> |
| 1012 |
The placement of a float’s label depends on where you put it |
| 1013 |
inside the float. |
| 1014 |
</p> |
| 1015 |
|
| 1016 |
<p> |
| 1017 |
If you want a label at the top, put <kbd>LABEL</kbd> immediately |
| 1018 |
underneath |
| 1019 |
<a href="#float">FLOAT</a> |
| 1020 |
and follow it with the text of the label surrounded by double-quotes: |
| 1021 |
<br/> |
| 1022 |
<span class="pre-in-pp"> |
| 1023 |
.FLOAT |
| 1024 |
.LABEL "Fig. 1" |
| 1025 |
</span> |
| 1026 |
If you want a label at the bottom, put <kbd>LABEL</kbd> immediately |
| 1027 |
before ending the float: |
| 1028 |
<br/> |
| 1029 |
<span class="pre-in-pp"> |
| 1030 |
.FLOAT |
| 1031 |
<contents of float> |
| 1032 |
.LABEL "Fig. 1" |
| 1033 |
.FLOAT OFF |
| 1034 |
</span> |
| 1035 |
</p> |
| 1036 |
|
| 1037 |
<h3 id="reserved-label-strings" class="docs" style="text-transform: none">Reserved variables for labels</h3> |
| 1038 |
|
| 1039 |
<p> |
| 1040 |
Mom reserves strings you may use when entering |
| 1041 |
label text after the <kbd>LABEL</kbd> argument. |
| 1042 |
<kbd><span class="nobr">\*[chapter]</span></kbd> holds the current chapter |
| 1043 |
or major section number. <kbd><span class="nobr">\*[fig-label]</span></kbd>, |
| 1044 |
<kbd><span class="nobr">\*[tbl-label]</span></kbd>, and |
| 1045 |
<kbd><span class="nobr">\*[eqn-label]</span></kbd> increment the label number of |
| 1046 |
the appropriate label type by one, and are initially set to zero |
| 1047 |
after each invocation of |
| 1048 |
<a href="docprocessing.html#start">START</a> |
| 1049 |
when the |
| 1050 |
<a href="docprocessing.html#doctype">DOCTYPE</a> |
| 1051 |
is <kbd>CHAPTER</kbd>. Thus, in every chapter requiring numbered |
| 1052 |
float labels, you can enter |
| 1053 |
<br/> |
| 1054 |
<span class="pre-in-pp"> |
| 1055 |
.LABEL "Fig. \*[chapter].\*[fig-label]. TO_LIST FIGURES |
| 1056 |
</span> |
| 1057 |
which, assuming the third autolabelled float of Chapter 2, will |
| 1058 |
produce <kbd>Fig. 2.3.</kbd> |
| 1059 |
</p> |
| 1060 |
|
| 1061 |
<p> |
| 1062 |
If your <b>DOCTYPE</b> is <kbd>DEFAULT</kbd> or <kbd>NAMED</kbd>, |
| 1063 |
you must reset <kbd><span class="nobr">\*[<type>-label]</span></kbd> after |
| 1064 |
each |
| 1065 |
<a href="docprocessing.html#collate">COLLATE</a> |
| 1066 |
by entering |
| 1067 |
<br/> |
| 1068 |
<span class="pre-in-pp"> |
| 1069 |
.AUTOLABEL_<list type> |
| 1070 |
</span> |
| 1071 |
before <kbd>.START</kbd>. |
| 1072 |
</p> |
| 1073 |
|
| 1074 |
<p> |
| 1075 |
If |
| 1076 |
<a href="#autolabel">autolabelling</a> |
| 1077 |
is enabled, e.g. <kbd>.AUTOLABEL_IMAGES</kbd> (List |
| 1078 |
of Figures) or <kbd>.AUTOLABEL_PIC</kbd> (also List of Figures), |
| 1079 |
the prefix is stripped from the label when it appears in |
| 1080 |
the List. Thus, if you have invoked <kbd>.AUTOLABEL_PIC</kbd>, |
| 1081 |
<br/> |
| 1082 |
<span class="pre-in-pp"> |
| 1083 |
.LABEL "Fig. 1.1." \ |
| 1084 |
CAPTION "Caption for label \ |
| 1085 |
TO_LIST FIGURES |
| 1086 |
</span> |
| 1087 |
or |
| 1088 |
<br/> |
| 1089 |
<span class="pre-in-pp"> |
| 1090 |
.LABEL "Fig. \*[chapter].\*[label]." \ |
| 1091 |
CAPTION "Caption for label \ |
| 1092 |
TO_LIST FIGURES |
| 1093 |
</span> |
| 1094 |
will appear in the List of Figures as “1.1. Caption for |
| 1095 |
label”. |
| 1096 |
</p> |
| 1097 |
|
| 1098 |
<h3 class="docs">CAPTION</h3> |
| 1099 |
|
| 1100 |
<p> |
| 1101 |
If you’d like a caption attached to the label, pass |
| 1102 |
<kbd>LABEL</kbd> the optional argument <kbd>CAPTION</kbd> followed |
| 1103 |
by the text of the caption as a single string surrounded by |
| 1104 |
double-quotes: |
| 1105 |
<br/> |
| 1106 |
<span class="pre-in-pp"> |
| 1107 |
.FLOAT |
| 1108 |
<contents of float> |
| 1109 |
.LABEL "Fig. 1" CAPTION "Caption for Fig. 1" |
| 1110 |
.FLOAT OFF |
| 1111 |
</span> |
| 1112 |
Note that the |
| 1113 |
<a href="#caption">CAPTION</a> |
| 1114 |
macro by itself permits entering several strings, each output on |
| 1115 |
a line by itself, whereas the <kbd>CAPTION</kbd> argument to |
| 1116 |
<kbd>LABEL</kbd> accepts only a single string. |
| 1117 |
</p> |
| 1118 |
|
| 1119 |
<h3 class="docs">SHORT_CAPTION</h3> |
| 1120 |
|
| 1121 |
<p> |
| 1122 |
If your caption runs long and you’re including the |
| 1123 |
float in a “List of ...”, (see |
| 1124 |
<a href="#list-of">TO_LIST</a>, below) |
| 1125 |
<kbd>SHORT_CAPTION</kbd> tells |
| 1126 |
mom how you’d like the caption to appear in the List. |
| 1127 |
</p> |
| 1128 |
|
| 1129 |
<h3 class="docs">TO_LIST</h3> |
| 1130 |
|
| 1131 |
<p> |
| 1132 |
The optional argument <kbd>TO_LIST</kbd> tells mom to add the |
| 1133 |
float’s label and attached caption, if present, to the specified |
| 1134 |
<a href="#lists-of">list</a>, |
| 1135 |
which may be one of <kbd>FIGURES</kbd>, <kbd>TABLES</kbd>, or |
| 1136 |
<kbd>EQUATIONS</kbd>. |
| 1137 |
</p> |
| 1138 |
|
| 1139 |
<p> |
| 1140 |
If, for some reason, you want only the caption appended to the List, |
| 1141 |
give <kbd>\&</kbd> as the first argument to LABEL, followed by |
| 1142 |
<kbd>CAPTION “caption”</kbd>: |
| 1143 |
<br/> |
| 1144 |
<span class="pre-in-pp"> |
| 1145 |
.LABEL \& \ |
| 1146 |
CAPTION "caption" |
| 1147 |
</span> |
| 1148 |
</p> |
| 1149 |
|
| 1150 |
<div class="box-tip"> |
| 1151 |
<p class="tip-top"> |
| 1152 |
<span class="note">Tip:</span> |
| 1153 |
<kbd>TO_LIST</kbd> can be used to handle situations where labelled |
| 1154 |
floats need to go to a uniquely named “List of ...”. |
| 1155 |
</p> |
| 1156 |
|
| 1157 |
<p class="tip-bottom"> |
| 1158 |
Suppose, for example, your document contains figures (e.g. |
| 1159 |
<b>pic</b> output or images embedded with |
| 1160 |
<a href="#pdf-image">PDF_IMAGE</a>) |
| 1161 |
and tables, and you need a “List of Examples” for floats |
| 1162 |
labelled “Example n.n”. By changing the default title |
| 1163 |
string for |
| 1164 |
<a href="#lists-macros">LIST_OF_EQUATIONS</a> |
| 1165 |
to “List of Examples”, you may include the float in your |
| 1166 |
List of Examples with |
| 1167 |
<br/> |
| 1168 |
<span class="pre-in-pp"> |
| 1169 |
.TO_FIGURES EQUATIONS |
| 1170 |
</span> |
| 1171 |
</p> |
| 1172 |
</div> |
| 1173 |
|
| 1174 |
<div class="macro-id-overline"> |
| 1175 |
<h3 id="caption" class="macro-id">CAPTION</h3> |
| 1176 |
</div> |
| 1177 |
|
| 1178 |
<div class="box-macro-args"> |
| 1179 |
Macro: <b>CAPTION</b> |
| 1180 |
<kbd class="macro-args">"<caption>" \ |
| 1181 |
<br/> |
| 1182 |
[ "<additional line>" [ "<additional line>"... ] ] \ |
| 1183 |
<br/> |
| 1184 |
[ TO_LIST FIGURES | TABLES | EQUATIONS ]</kbd> |
| 1185 |
</div> |
| 1186 |
|
| 1187 |
<p> |
| 1188 |
The placement of a float’s caption depends on where you put it |
| 1189 |
inside the float. |
| 1190 |
</p> |
| 1191 |
|
| 1192 |
<p> |
| 1193 |
If you want a caption at the top, put <kbd>CAPTION</kbd> immediately |
| 1194 |
underneath |
| 1195 |
<a href="#float">FLOAT</a> |
| 1196 |
and follow it with the text of the caption surrounded by double-quotes: |
| 1197 |
<br/> |
| 1198 |
<span class="pre-in-pp"> |
| 1199 |
.FLOAT |
| 1200 |
.CAPTION "Caption at top of float" |
| 1201 |
</span> |
| 1202 |
If you want a caption at the bottom, put <kbd>CAPTION</kbd> immediately |
| 1203 |
before ending the float: |
| 1204 |
<br/> |
| 1205 |
<span class="pre-in-pp"> |
| 1206 |
.FLOAT |
| 1207 |
<contents of float> |
| 1208 |
.CAPTION "Caption at bottom of float" |
| 1209 |
.FLOAT OFF |
| 1210 |
</span> |
| 1211 |
</p> |
| 1212 |
|
| 1213 |
<div class="box-tip"> |
| 1214 |
<p class="tip"> |
| 1215 |
<span class="note">Note:</span> |
| 1216 |
If you want a caption attached to a label, do not use |
| 1217 |
<b>CAPTION</b> by itself. Rather, invoke |
| 1218 |
<a href="#label"><kbd>.LABEL</kbd></a> |
| 1219 |
with the <kbd>CAPTION</kbd> argument. |
| 1220 |
</p> |
| 1221 |
</div> |
| 1222 |
|
| 1223 |
<div class="rule-medium"><hr/></div> |
| 1224 |
|
| 1225 |
<h2 id="preprocessor-support" class="docs">Preprocessor support</h2> |
| 1226 |
|
| 1227 |
<p> |
| 1228 |
Mom offers full support for the <b>eqn</b> (equations), <b>pic</b> |
| 1229 |
(diagrams), <b>grap</b> (graphs), <b>tbl</b> (tables) and |
| 1230 |
<b>refer</b> (bibliographies/citations) preprocessors, including |
| 1231 |
captions, labelling, autolabelling, and inclusion in the Lists of |
| 1232 |
Equations, Figures, and Tables. |
| 1233 |
</p> |
| 1234 |
|
| 1235 |
<p> |
| 1236 |
Other than <b>refer</b>, which is discussed at length in the <a |
| 1237 |
href="refer.html">Bibliographies and references</a> section, it is |
| 1238 |
beyond the scope of this documentation to cover full preprocessor |
| 1239 |
usage. Consult the manpages <b>eqn(1)</b>, <b>pic(1)</b>, |
| 1240 |
<b>grap(1)</b> and <b>tbl(1)</b> for instructions. |
| 1241 |
</p> |
| 1242 |
|
| 1243 |
<div class="box-tip"> |
| 1244 |
<p class="tip"> |
| 1245 |
<span class="note">Version 2.0-c changes</span> |
| 1246 |
<br/> |
| 1247 |
Preprocessor support has been revised and expanded as of version 2.0-c. |
| 1248 |
Please read the following sections thoroughly and update any |
| 1249 |
documents created with versions prior to 2.0-c as necessary. |
| 1250 |
</p> |
| 1251 |
</div> |
| 1252 |
|
| 1253 |
<h3 id="tbl" class="docs">tbl support</h3> |
| 1254 |
|
| 1255 |
<p> |
| 1256 |
Mom documents can include tables generated with the groff |
| 1257 |
preprocessor <b>tbl</b>. If you are unfamiliar with <b>tbl</b>, I |
| 1258 |
recommend downloading a copy of |
| 1259 |
<a href="http://plan9.bell-labs.com/10thEdMan/tbl.pdf">Tbl - A Program to Format Tables</a>, |
| 1260 |
which, in addition to providing a thorough introduction, contains |
| 1261 |
some fine examples. If you use <b>tbl</b>, you must pass groff or |
| 1262 |
pdfmom the <b>-t</b> flag when you process the file. |
| 1263 |
</p> |
| 1264 |
|
| 1265 |
<p> |
| 1266 |
Tables formatted with <kbd>tbl</kbd> begin with the macro |
| 1267 |
<kbd>.TS</kbd> (<b>T</b>able <b>S</b>tart) and end with |
| 1268 |
<kbd>.TE</kbd> (<b>T</b>able <b>E</b>nd). Depending on where you |
| 1269 |
want your tables output in a document, you may need to wrap |
| 1270 |
your <kbd>tbl</kbd> code inside a |
| 1271 |
<a href="#floats-intro">float</a>, |
| 1272 |
or pass the <kbd>H</kbd> argument to <kbd>.TS</kbd>. |
| 1273 |
</p> |
| 1274 |
|
| 1275 |
<p> |
| 1276 |
If you put <kbd>tbl</kbd> code inside a float, the table will be |
| 1277 |
output immediately if it fits on the page, or deferred to the top |
| 1278 |
of the next page if it doesn’t. If you prefer a table to |
| 1279 |
begin where you say and span over to the next page, or if you know |
| 1280 |
for certain a boxed table will run to multiple pages, simply pass the |
| 1281 |
<kbd>H</kbd> argument to <kbd>.TS</kbd>, along with a corresponding |
| 1282 |
<a href="#th"><kbd>TH</kbd></a> |
| 1283 |
and do not wrap the table inside a float. |
| 1284 |
</p> |
| 1285 |
|
| 1286 |
<div class="box-tip"> |
| 1287 |
<p class="tip"> |
| 1288 |
<span class="note">Note:</span> |
| 1289 |
If you create a boxed table that will span several pages, do not |
| 1290 |
wrap the table inside a float. Boxed, multipage tables and FLOAT |
| 1291 |
should be considered mutually exclusive. This restriction is |
| 1292 |
imposed by the <kbd>tbl</kbd> preprocessor itself, not groff or |
| 1293 |
mom. Unboxed tables that span several pages, however, are |
| 1294 |
acceptable within FLOAT. |
| 1295 |
</p> |
| 1296 |
</div> |
| 1297 |
|
| 1298 |
<h4 id="tbl-placement" class="docs">tbl placement in mom docs</h4> |
| 1299 |
|
| 1300 |
<p> |
| 1301 |
If you use <kbd>.TS</kbd> without the <kbd>H</kbd> argument (and |
| 1302 |
therefore no <kbd>.TH</kbd>), tables that fit on the page are output |
| 1303 |
in position. If there is not enough room to output the table, |
| 1304 |
<kbd>tbl</kbd> will abort with message instructing you to use |
| 1305 |
<kbd>.TS H/.TH</kbd>. Given that <kbd>.TS</kbd> without <kbd>H</kbd> |
| 1306 |
may sometimes fail, it is advisable to begin all <b>tbl</b> blocks |
| 1307 |
with <kbd>.TS H</kbd>. |
| 1308 |
</p> |
| 1309 |
|
| 1310 |
<p> |
| 1311 |
If you give <kbd>.TS</kbd> the <kbd>H</kbd> argument (with a |
| 1312 |
corresponding <kbd>.TH</kbd>), tables will be output in position and |
| 1313 |
span as many pages as necessary to complete output. A table header |
| 1314 |
will be printed at the top of each page’s table output. In the |
| 1315 |
event that there is not enough room to print the table header and |
| 1316 |
at least one row of table data near the bottom of a page, mom will |
| 1317 |
break to a new page before beginning table output, leaving a gap |
| 1318 |
in |
| 1319 |
<a href="definitions.html#running">running text</a>. |
| 1320 |
</p> |
| 1321 |
|
| 1322 |
<p> |
| 1323 |
Boxed tables inside |
| 1324 |
<a href="#floats-intro">floats</a> |
| 1325 |
are output in position if they fit on the page. If not, they are |
| 1326 |
deferred to the top of the next page without a break in running |
| 1327 |
text. Boxed tables within floats may not, however, span multiple |
| 1328 |
pages; mom will abort with a message should a boxed table in a float |
| 1329 |
run longer than the page. |
| 1330 |
</p> |
| 1331 |
|
| 1332 |
<p> |
| 1333 |
Unboxed tables inside floats may span multiple pages provided the |
| 1334 |
<kbd>SPAN</kbd> argument has been given to |
| 1335 |
<a href="#float">FLOAT</a>. |
| 1336 |
</p> |
| 1337 |
|
| 1338 |
<div class="box-tip"> |
| 1339 |
<p class="tip"> |
| 1340 |
<span class="note">Note:</span> |
| 1341 |
The vertical spacing around unfloated tables may appear slightly |
| 1342 |
unequal, especially if there are several tables on the page. This |
| 1343 |
is a result of the |
| 1344 |
<a href="docprocessing.html#shim">shimming</a> |
| 1345 |
or |
| 1346 |
<a href="docprocessing.html#flex">flex-spacing</a> |
| 1347 |
that mom applies automatically after each table, depending on which |
| 1348 |
<a href="docprocessing.html#vertical-whitespace-management">vertical whitespace management</a> |
| 1349 |
is in effect. You may |
| 1350 |
disable shimming or flex-spacing with |
| 1351 |
<a href="docprocessing.html#no-shim">NO_SHIM</a> |
| 1352 |
or |
| 1353 |
<a href="docprocessing.html#no-flex">NO_FLEX</a>, |
| 1354 |
or by passing the <kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd> argument |
| 1355 |
to <kbd>.TS</kbd>. In either case, you will still likely want to |
| 1356 |
adjust the spacing around with table with the <kbd>ADJUST</kbd> |
| 1357 |
argument to <kbd>.TS</kbd>. Tables inside floats should be adjusted |
| 1358 |
with the <kbd>ADJUST</kbd> argument to |
| 1359 |
<a href="#float">FLOAT</a>, |
| 1360 |
not the <kbd>ADJUST</kbd> argument to <kbd>.TS</kbd>. |
| 1361 |
</p> |
| 1362 |
</div> |
| 1363 |
|
| 1364 |
<div class="macro-id-overline"> |
| 1365 |
<h3 id="ts-te" class= "macro-id">.TS / .TH / .TE</h3> |
| 1366 |
</div> |
| 1367 |
|
| 1368 |
<div class="box-macro-args"> |
| 1369 |
Macro: <a href="#ts"><b>TS</b></a> |
| 1370 |
<kbd class="macro-args"><br/> |
| 1371 |
Arguments: |
| 1372 |
<br/> |
| 1373 |
[ H ] |
| 1374 |
<br/> |
| 1375 |
[ BOXED ] |
| 1376 |
<br/> |
| 1377 |
[ CENTER ] |
| 1378 |
<br/> |
| 1379 |
[ NEEDS ] |
| 1380 |
<br/> |
| 1381 |
[ ADJUST +|-<vertical adjustment>]</kbd> |
| 1382 |
<span style="font-size: 95%"> |
| 1383 |
(<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 1384 |
required) |
| 1385 |
</span> |
| 1386 |
<kbd class="macro-args"><br/> |
| 1387 |
[ NO_SHIM ] |
| 1388 |
<br/> |
| 1389 |
[ NO_FLEX ] |
| 1390 |
<br/> |
| 1391 |
[ CAPTION "<caption>" ] |
| 1392 |
<br/> |
| 1393 |
[ SHORT_CAPTION "<short caption>" ] |
| 1394 |
<br/> |
| 1395 |
[ LABEL "<label>" ] |
| 1396 |
<br/> |
| 1397 |
[ TARGET "<name>" ] |
| 1398 |
</kbd> |
| 1399 |
<br/> |
| 1400 |
Macro: <a href="#th"><b>TH</b></a> <kbd class="macro-args">(optional, only if .TS H)</kbd> |
| 1401 |
<br/> |
| 1402 |
Macro: <a href="#te"><b>TE</b></a> <kbd class="macro-args">[ SOURCE "<text of table source>" ]</kbd> |
| 1403 |
</div> |
| 1404 |
|
| 1405 |
<p> |
| 1406 |
Tables to be formatted with <kbd>tbl</kbd> begin with the macro |
| 1407 |
<kbd>.TS</kbd> and end with <kbd>.TE</kbd>. Global <kbd>tbl</kbd> |
| 1408 |
options (“flags”), formatting, and data (per |
| 1409 |
<kbd>tbl(1)</kbd>) come between the two macros. |
| 1410 |
<br/> |
| 1411 |
<span class="pre-in-pp"> |
| 1412 |
.TS |
| 1413 |
<tbl options, formatting, and data> |
| 1414 |
.TE |
| 1415 |
</span> |
| 1416 |
Tables may be wrapped inside a |
| 1417 |
<a href="#float-intro">float</a>, |
| 1418 |
in which case, the entire table will be output on the current page |
| 1419 |
if it fits, or deferred to the next page if it doesn’t. |
| 1420 |
<br/> |
| 1421 |
<span class="pre-in-pp"> |
| 1422 |
.FLOAT |
| 1423 |
.TS |
| 1424 |
<tbl options, formatting, and data> |
| 1425 |
.TE |
| 1426 |
.FLOAT OFF |
| 1427 |
</span> |
| 1428 |
</p> |
| 1429 |
|
| 1430 |
<div class="macro-id-overline"> |
| 1431 |
<h4 id="ts" class="docs" style="font-size: 100%; margin-top: .5em">The .TS macro</h4> |
| 1432 |
</div> |
| 1433 |
|
| 1434 |
<div class="box-tip"> |
| 1435 |
<p class="tip"> |
| 1436 |
<span class="note">Note: Version 2.0-c change</span> |
| 1437 |
<br/> |
| 1438 |
2.0-c introduces revisions to the handling of labels and/or |
| 1439 |
captions, which, along with <kbd>NO_SHIM</kbd>, must now be given |
| 1440 |
as arguments to <kbd>.TS</kbd> rather than <kbd>.TE</kbd>, as was |
| 1441 |
the case formerly. Please read this section carefully if you have |
| 1442 |
documents containing tables as they may need to be updated. |
| 1443 |
</p> |
| 1444 |
</div> |
| 1445 |
|
| 1446 |
<div class="box-important" style="margin-top: 1em"> |
| 1447 |
<p class="tip"> |
| 1448 |
<span class="important">IMPORTANT:</span> |
| 1449 |
All arguments to <b>TS</b> must appear on the same line as |
| 1450 |
<kbd>.TS</kbd>. Do not attempt to break them up with the |
| 1451 |
“line-continued” backslash. You may want to set your |
| 1452 |
text editor to “wrap” mode in order to see all your |
| 1453 |
arguments. This annoyance stems from the preprocessor mechanism |
| 1454 |
itself, not groff or mom. |
| 1455 |
</p> |
| 1456 |
</div> |
| 1457 |
|
| 1458 |
<p> |
| 1459 |
The <b>TS</b> macro must be invoked before entering a <kbd>tbl</kbd> |
| 1460 |
block. You may give as many or as few of its arguments as required, |
| 1461 |
in any order, although it is advisable to put <kbd>CAPTION</kbd>, |
| 1462 |
<kbd>SHORT_CAPTION</kbd>, and/or <kbd>LABEL</kbd> last. |
| 1463 |
</p> |
| 1464 |
|
| 1465 |
<h5 id="h" class="docs" style="margin-top: 1em; text-transform: none">H</h5> |
| 1466 |
|
| 1467 |
<p> |
| 1468 |
With the <b>H</b> argument, a table will span as many pages as |
| 1469 |
necessary, with or without a running header. The placement of the |
| 1470 |
corresponding |
| 1471 |
<a href="#th"><kbd>.TH</kbd></a>, |
| 1472 |
which is required whenever the <b>H</b> argument is given, |
| 1473 |
determines what, if anything, goes in the header. Compare the |
| 1474 |
following: |
| 1475 |
<span class="pre-in-pp"> |
| 1476 |
.TS H .TS H |
| 1477 |
c s s c s s |
| 1478 |
c s s c s s |
| 1479 |
c c c c c c |
| 1480 |
n n n. n n n. |
| 1481 |
Percent Increase .TH |
| 1482 |
2002-2012 Percent Increase |
| 1483 |
.TH 2002-2012 |
| 1484 |
<tbl data> <tbl data> |
| 1485 |
.TE .TE |
| 1486 |
</span> |
| 1487 |
The first example will create a table that spans multiple |
| 1488 |
pages if necessary, with a running header (“Percent |
| 1489 |
Increase / 2002-2012”) for that table appearing at |
| 1490 |
the top of each page until the table ends. The second example, |
| 1491 |
equally, may run to several pages, but without the running header. |
| 1492 |
See |
| 1493 |
<a href="#th"><b>TH</b></a> |
| 1494 |
for an explanation of <kbd>.TH</kbd> placement. |
| 1495 |
</p> |
| 1496 |
|
| 1497 |
<div id="h-tip" class="box-tip"> |
| 1498 |
<p class="tip"> |
| 1499 |
<span class="note">Tip:</span> |
| 1500 |
Generally speaking, it’s a good idea to get into the habit |
| 1501 |
of using <kbd>.TS H</kbd> all the time, since there are no |
| 1502 |
circumstances under which it fails, whereas <kbd>.TS</kbd> without |
| 1503 |
<kbd>H</kbd> will fail on tables that exceed the page length. |
| 1504 |
</p> |
| 1505 |
</div> |
| 1506 |
|
| 1507 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">BOXED</h5> |
| 1508 |
|
| 1509 |
<p> |
| 1510 |
If a table is to be boxed (i.e., <kbd>tbl</kbd> is given the flags |
| 1511 |
<kbd>'box'</kbd> or <kbd>'allbox'</kbd>) you must pass the argument |
| 1512 |
<kbd>BOXED</kbd> to <kbd>.TS</kbd>, as in this example: |
| 1513 |
<br/> |
| 1514 |
<span class="pre-in-pp"> |
| 1515 |
.TS BOXED |
| 1516 |
allbox; |
| 1517 |
c s s |
| 1518 |
c c c |
| 1519 |
n n n. |
| 1520 |
<tbl data> |
| 1521 |
.TE |
| 1522 |
</span> |
| 1523 |
</p> |
| 1524 |
|
| 1525 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">CENTER</h5> |
| 1526 |
|
| 1527 |
<p> |
| 1528 |
If a table is to be centered on the page, (i.e., <kbd>tbl</kbd> is |
| 1529 |
given the <kbd>'center'</kbd> flag), you must pass the argument |
| 1530 |
<kbd>CENTER</kbd> to <kbd>.TS</kbd>, as in this example, which |
| 1531 |
creates a (possibly) multipage boxed table, centered on the page, |
| 1532 |
with a running header. |
| 1533 |
<span class="pre-in-pp"> |
| 1534 |
.TS H BOXED CENTER |
| 1535 |
allbox center; |
| 1536 |
c s s |
| 1537 |
c s s |
| 1538 |
c c c |
| 1539 |
n n n. |
| 1540 |
Percent Increase |
| 1541 |
2002-2012 |
| 1542 |
.TH |
| 1543 |
<tbl data> |
| 1544 |
.TE |
| 1545 |
</span> |
| 1546 |
</p> |
| 1547 |
|
| 1548 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NEEDS</h5> |
| 1549 |
|
| 1550 |
<p> |
| 1551 |
If a table is not inside a float and you pass <kbd>.TS </kbd> the |
| 1552 |
<kbd>H</kbd> argument (which you should; see the tip |
| 1553 |
<a href="#h-tip">here</a>), |
| 1554 |
mom begins output immediately where the table occurs in the |
| 1555 |
input file <i>if there is enough room on the output page for the |
| 1556 |
table header plus at least one row of table data</i>. If there |
| 1557 |
isn’t enough room, mom breaks to a new page before beginning |
| 1558 |
the table, leaving a gap in |
| 1559 |
<a href="definitions.html#running">running text</a> |
| 1560 |
at the bottom of the previous page. If, for aesthetic reasons, |
| 1561 |
you would prefer that mom require more than one row of table data |
| 1562 |
beneath the header near the bottom of a page, you may increase the |
| 1563 |
number with the <kbd>NEEDS</kbd> argument, followed by the desired |
| 1564 |
number of rows. |
| 1565 |
</p> |
| 1566 |
|
| 1567 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5> |
| 1568 |
|
| 1569 |
<p> |
| 1570 |
<kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower |
| 1571 |
(<kbd>+</kbd>) the table |
| 1572 |
<span style="font-style: italic">within the space allotted for it</span> |
| 1573 |
by the amount you specify. This is useful for achieving good |
| 1574 |
optical centering between surrounding blocks of type. A unit of |
| 1575 |
measure is required. |
| 1576 |
</p> |
| 1577 |
|
| 1578 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5> |
| 1579 |
|
| 1580 |
<p> |
| 1581 |
<kbd>NO_SHIM</kbd> instructs mom not to apply |
| 1582 |
<a href="docprocessing.html#shim-vs-flex">shimming</a> |
| 1583 |
after a table, which she will do automatically when shimming is |
| 1584 |
enabled, which it is by default. Shimming ensures that running text |
| 1585 |
after the table falls properly on the page’s |
| 1586 |
<a href="definitions.html#baseline-grid">baseline grid</a>, |
| 1587 |
but can result in slightly unequal spacing above and below |
| 1588 |
(correctable with the <kbd>ADJUST</kbd> argument). |
| 1589 |
<kbd>NO_SHIM</kbd> is useful when you have several tables on the |
| 1590 |
page and there are visible differences in the spacing beneath them |
| 1591 |
as a result of shimming. To ensure a flush bottom margin, the last |
| 1592 |
table on the page should be shimmed, i.e. should not be given the |
| 1593 |
<kbd>NO_SHIM</kbd> argument. |
| 1594 |
</p> |
| 1595 |
|
| 1596 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5> |
| 1597 |
|
| 1598 |
<p> |
| 1599 |
<kbd>NO_FLEX</kbd> instructs mom not to apply |
| 1600 |
<a href="docprocessing.html#shim-vs-flex">flex-spacing</a> |
| 1601 |
after a table, which she will do automatically when flex-spacing is |
| 1602 |
enabled. <kbd>NO_FLEX</kbd> is useful when you have several tables |
| 1603 |
on the page and you want to distribute excess vertical |
| 1604 |
whitespace on the page amongst other flex-spacing points on the |
| 1605 |
page. If there are no others, the final table should be |
| 1606 |
flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument. |
| 1607 |
</p> |
| 1608 |
|
| 1609 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5> |
| 1610 |
|
| 1611 |
<p> |
| 1612 |
<kbd>CAPTION</kbd> allows you to give the table a caption. By |
| 1613 |
default, the caption appears above the table, but may be attached to |
| 1614 |
the label that appears beneath the table. See |
| 1615 |
<a href="#caption-after-label">CAPTION_AFTER_LABEL</a> |
| 1616 |
in |
| 1617 |
<a href="#captions-and-labels">Captions and labels</a>. |
| 1618 |
The text of the caption must be surrounded by double-quotes. |
| 1619 |
</p> |
| 1620 |
|
| 1621 |
<p> |
| 1622 |
Please note that if your table has a caption, you must invoke |
| 1623 |
<kbd>TS</kbd> with the <kbd>H</kbd> flag, which also entails the use |
| 1624 |
of |
| 1625 |
<a href="#th">TH</a>. |
| 1626 |
</p> |
| 1627 |
|
| 1628 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5> |
| 1629 |
|
| 1630 |
<p> |
| 1631 |
<kbd>SHORT_CAPTION</kbd> allows you to trim long captions for |
| 1632 |
inclusion in the List of Tables. The text you supply, surrounded |
| 1633 |
by double-quotes, is what will appear in the List. |
| 1634 |
</p> |
| 1635 |
|
| 1636 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5> |
| 1637 |
|
| 1638 |
<p> |
| 1639 |
<kbd>LABEL</kbd>, if given, appears beneath the table. The text you |
| 1640 |
supply, surrounded by double-quotes, is how the table is labelled |
| 1641 |
in both the document proper and the List of Tables. Mom provides |
| 1642 |
an auto-labelling facility for tables (see |
| 1643 |
<a href="#autolabel">AUTOLABEL</a>), |
| 1644 |
which, if enabled, overrides the <kbd>LABEL</kbd> argument. |
| 1645 |
</p> |
| 1646 |
|
| 1647 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5> |
| 1648 |
|
| 1649 |
<p> |
| 1650 |
<kbd>TARGET</kbd> followed by a unique name surrounded by |
| 1651 |
double-quotes creates a PDF target for the table so that it may be |
| 1652 |
linked to from other places in the file (with PDF_LINK; see |
| 1653 |
<a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>). |
| 1654 |
</p> |
| 1655 |
|
| 1656 |
<p> |
| 1657 |
<b><i>Please note:</i></b> The following functionality is available |
| 1658 |
only with groff 1.22.4 or later. |
| 1659 |
</p> |
| 1660 |
|
| 1661 |
<p> |
| 1662 |
When |
| 1663 |
<a href="#autolabel">autolabelling</a> |
| 1664 |
is enabled and the document is processed with |
| 1665 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>, |
| 1666 |
the target name can be used to generate the target’s label |
| 1667 |
number in running text if it is entered as a groff string, i.e. of |
| 1668 |
the form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you |
| 1669 |
create a target called “foo” for a table whose autolabel |
| 1670 |
number would be 3, entering |
| 1671 |
<br/> |
| 1672 |
<span class="pre-in-pp"> |
| 1673 |
See |
| 1674 |
.PDF_LINK foo "Table \*[foo]" |
| 1675 |
</span> |
| 1676 |
anywhere in running text would result in a pdf link that reads |
| 1677 |
“Table 3”. If chapter numbers are being prefixed to |
| 1678 |
labels, the same string in, say, chapter 5 would produce the pdf |
| 1679 |
link “Table 5.3”. |
| 1680 |
</p> |
| 1681 |
|
| 1682 |
<div class="macro-id-overline"> |
| 1683 |
<h4 id="th" class="docs" style="font-size: 100%; margin-top: .5em">The .TH macro</h4> |
| 1684 |
</div> |
| 1685 |
|
| 1686 |
<p> |
| 1687 |
The <b>TH</b> macro (<b>T</b>able <b>H</b>eader), which is required |
| 1688 |
when you begin a table with <kbd>.TS H</kbd>, allows you to |
| 1689 |
determine what goes in a table’s running header if it spans |
| 1690 |
multiple pages. Placing <kbd>.TH</kbd> under the first row of |
| 1691 |
<kbd>tbl</kbd> data makes the first row the header. If placed under |
| 1692 |
the second row, the first and second rows form the header, and so |
| 1693 |
on. |
| 1694 |
</p> |
| 1695 |
|
| 1696 |
<p> |
| 1697 |
As there are sometimes reasons to run <kbd>.TS H</kbd> when |
| 1698 |
you don’t, in fact, want a running header (e.g. when |
| 1699 |
your table has a caption), you can suppress it by placing |
| 1700 |
<kbd>.TH</kbd> immediately underneath your <kbd>tbl</kbd> formatting |
| 1701 |
specifications, the last line of which always ends with a period |
| 1702 |
(see <kbd>tbl(1)</kbd>). |
| 1703 |
</p> |
| 1704 |
|
| 1705 |
<p> |
| 1706 |
See the |
| 1707 |
<kbd><a href="#h">H</a></kbd> |
| 1708 |
argument to <kbd>.TS</kbd> for examples demonstrating <kbd>.TH</kbd> |
| 1709 |
placement. |
| 1710 |
</p> |
| 1711 |
|
| 1712 |
<div class="macro-id-overline"> |
| 1713 |
<h4 id="te" class="docs" style="font-size: 100%; margin-top: .5em">The .TE macro</h4> |
| 1714 |
</div> |
| 1715 |
|
| 1716 |
<p> |
| 1717 |
<kbd>tbl</kbd> blocks must be terminated with <kbd>.TE</kbd>, |
| 1718 |
which, as of version 2.0-c, takes a single, optional argument, |
| 1719 |
<kbd>SOURCE</kbd>. (Formerly, <kbd>TE</kbd> took a label/caption |
| 1720 |
argument along with arguments controlling placement.) The argument |
| 1721 |
is followed by the text of the table’s source, surrounded by |
| 1722 |
double-quotes. The SOURCE argument may only be used if |
| 1723 |
<a href="#mla">MLA</a> |
| 1724 |
(Modern Language Association) style is enabled. |
| 1725 |
</p> |
| 1726 |
|
| 1727 |
<div class="rule-medium"><hr/></div> |
| 1728 |
|
| 1729 |
<h3 id="pic" class="docs">pic support</h3> |
| 1730 |
|
| 1731 |
<p> |
| 1732 |
Mom documents can include diagrams generated with the groff |
| 1733 |
preprocessor <b>pic</b>. If you are unfamiliar with <b>pic</b>, I |
| 1734 |
recommend downloading a copy of |
| 1735 |
<a href="http://www.kohala.com/start/troff/gpic.raymond.ps">Making Pictures with GNU PIC</a> |
| 1736 |
which provides a thorough introduction and contains many examples. |
| 1737 |
If you use <b>pic</b>, you must pass groff or pdfmom the <b>-p</b> |
| 1738 |
flag when you process the file. |
| 1739 |
|
| 1740 |
</p> |
| 1741 |
|
| 1742 |
<p> |
| 1743 |
Diagrams created with <kbd>pic</kbd> begin with the macro |
| 1744 |
<kbd>.PS</kbd> (<b>P</b>ic <b>S</b>tart) and end with |
| 1745 |
<kbd>.PE</kbd> (<b>P</b>ic <b>E</b>nd). Everything between them is |
| 1746 |
interpreted by the preprocessor as pic instructions. Please note: |
| 1747 |
<i>Making Pictures with GNU PIC</i> says that <kbd>.PF</kbd> can |
| 1748 |
also be used to terminate a pic diagram, but this is not supported |
| 1749 |
by mom. |
| 1750 |
</p> |
| 1751 |
|
| 1752 |
<p> |
| 1753 |
Pic diagrams are always centered. Note that this represents a |
| 1754 |
change from version 2.0-b of mom, where centering diagrams required |
| 1755 |
passing <kbd>-mpic</kbd> to <b>groff</b> or |
| 1756 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a> |
| 1757 |
on the command line. |
| 1758 |
</p> |
| 1759 |
|
| 1760 |
<p> |
| 1761 |
In addition, mom treats <b>pic</b> diagrams identically to |
| 1762 |
<a href="#floats-intro">floats</a>, |
| 1763 |
which is to say that if a diagram doesn’t fit on the output |
| 1764 |
page, she will defer it to the top of the next page while continuing |
| 1765 |
to process |
| 1766 |
<a href="definitions.html#running">running text</a>. |
| 1767 |
<kbd>ADJUST</kbd> is ignored whenever a diagram is deferred, except |
| 1768 |
when moving from column to column on the same page, when the diagram |
| 1769 |
may need to be optically adjusted. Subsequent diagrams that do not |
| 1770 |
fit, if any, are output in order immediately after the first. |
| 1771 |
</p> |
| 1772 |
|
| 1773 |
<p> |
| 1774 |
Lastly, if your diagrams contain text, you may set all the type |
| 1775 |
parameters for the text (family, font, size, leading) separately |
| 1776 |
from the <b>pic</b> block with the macro |
| 1777 |
<a href="#pic-text-style">PIC_TEXT_STYLE</a>. |
| 1778 |
If you need to change the type parameters within the block |
| 1779 |
on-the-fly, you must use <b>pic</b>’s native facilities for |
| 1780 |
doing so. |
| 1781 |
</p> |
| 1782 |
|
| 1783 |
<div class="macro-id-overline"> |
| 1784 |
<h3 id="ps-pe" class= "macro-id">.PS / .PE</h3> |
| 1785 |
</div> |
| 1786 |
|
| 1787 |
<div class="box-macro-args"> |
| 1788 |
Macro: <b>PS</b> |
| 1789 |
<kbd class="macro-args"> |
| 1790 |
<br/> |
| 1791 |
Arguments: [ <width> <height> ] |
| 1792 |
<kbd class="macro-args"> |
| 1793 |
<br/> |
| 1794 |
[ LEFT ]</kbd> |
| 1795 |
<br/> |
| 1796 |
[ ADJUST +|-<vertical adjustment>]</kbd> |
| 1797 |
<span style="font-size: 95%"> |
| 1798 |
(<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 1799 |
required) |
| 1800 |
</span> |
| 1801 |
<kbd class="macro-args"><br/> |
| 1802 |
[ NO_SHIM ] |
| 1803 |
<br/> |
| 1804 |
[ NO_FLEX ] |
| 1805 |
<br/> |
| 1806 |
[ CAPTION "<caption>" ] |
| 1807 |
<br/> |
| 1808 |
[ SHORT_CAPTION "<short caption>" ] |
| 1809 |
<br/> |
| 1810 |
[ LABEL "<label>" ] |
| 1811 |
<br/> |
| 1812 |
[ TARGET "<name>" ] |
| 1813 |
</kbd> |
| 1814 |
<br/> |
| 1815 |
Macro: <b>PE</b> <span style="font-size: 95%">(no arguments; ends |
| 1816 |
the <b>pic</b> block)</span> |
| 1817 |
</div> |
| 1818 |
|
| 1819 |
<div class="box-important" style="margin-top: 1.5em"> |
| 1820 |
<p class="tip"> |
| 1821 |
<span class="important">IMPORTANT:</span> |
| 1822 |
All arguments to <b>PS</b> must appear on the same line as |
| 1823 |
<kbd>.PS</kbd>. Do not attempt to break them up with the |
| 1824 |
“line-continued” backslash. You may want to set your |
| 1825 |
text editor to “wrap” mode in order to see all your |
| 1826 |
arguments. This annoyance stems from the preprocessor mechanism |
| 1827 |
itself, not groff or mom. |
| 1828 |
</p> |
| 1829 |
</div> |
| 1830 |
|
| 1831 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">'width' and 'height'</h5> |
| 1832 |
|
| 1833 |
<p> |
| 1834 |
The <kbd>width</kbd> and <kbd>height</kbd> arguments to |
| 1835 |
<kbd>.PS</kbd> are idiosyncratic owing to the preprocessor itself. |
| 1836 |
Both are optional and both expect a value in inches, so neither |
| 1837 |
argument should have a |
| 1838 |
<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 1839 |
appended. |
| 1840 |
</p> |
| 1841 |
|
| 1842 |
<p> |
| 1843 |
If the <kbd>width</kbd> argument is supplied, the diagram, but |
| 1844 |
not any text it contains, is scaled to the given width. If a |
| 1845 |
literal width argument of <kbd>0</kbd> (zero) is given and a |
| 1846 |
<kbd>height</kbd> argument is supplied, the diagram, but not any |
| 1847 |
text it contains, will be scaled to the requested height. In the |
| 1848 |
case of two non-zero arguments being given, only the height scaling |
| 1849 |
is applied. |
| 1850 |
</p> |
| 1851 |
|
| 1852 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">LEFT</h5> |
| 1853 |
|
| 1854 |
<p> |
| 1855 |
By default, pic diagrams are centred on the page. If you would |
| 1856 |
prefer them to be flush left, pass <kbd>PS</kbd> the <kbd>LEFT</kbd> |
| 1857 |
argument. |
| 1858 |
</p> |
| 1859 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5> |
| 1860 |
|
| 1861 |
<p> |
| 1862 |
<kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower |
| 1863 |
(<kbd>+</kbd>) a diagram |
| 1864 |
<span style="font-style: italic">within the space allotted for it</span> |
| 1865 |
by the amount you specify. This is useful for achieving good |
| 1866 |
optical centering between surrounding blocks of type. A unit of |
| 1867 |
measure is required. |
| 1868 |
</p> |
| 1869 |
|
| 1870 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5> |
| 1871 |
|
| 1872 |
<p> |
| 1873 |
<kbd>NO_SHIM</kbd> instructs mom not to apply |
| 1874 |
<a href="docprocessing.html#shim-vs-flex">shimming</a> |
| 1875 |
after a <b>pic</b> diagram, which she will do automatically when |
| 1876 |
shimming is enabled, which it is by default. Shimming ensures that |
| 1877 |
running text after the diagram falls properly on the page’s |
| 1878 |
<a href="definitions.html#baseline-grid">baseline grid</a>, |
| 1879 |
but can result in slightly unequal spacing above and below |
| 1880 |
(correctable with the <kbd>ADJUST</kbd> argument). |
| 1881 |
<kbd>NO_SHIM</kbd> is useful when you have several diagrams on the |
| 1882 |
page and there are visible differences in the spacing beneath them |
| 1883 |
as a result of shimming. To ensure a flush bottom margin, the last |
| 1884 |
diagram on the page should be shimmed, i.e. should not be given the |
| 1885 |
<kbd>NO_SHIM</kbd> argument. |
| 1886 |
</p> |
| 1887 |
|
| 1888 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5> |
| 1889 |
|
| 1890 |
<p> |
| 1891 |
<kbd>NO_FLEX</kbd> instructs mom not to apply |
| 1892 |
<a href="docprocessing.html#shim-vs-flex">flex-spacing</a> |
| 1893 |
after a <b>pic</b> diagram, which she will do automatically when |
| 1894 |
flex-spacing is enabled. <kbd>NO_FLEX</kbd> is useful when you |
| 1895 |
have several diagrams on the page and you want to distribute excess |
| 1896 |
vertical whitespace on the page amongst other flex-spacing points |
| 1897 |
on the page. If there are no others, the final diagram should be |
| 1898 |
flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument. |
| 1899 |
</p> |
| 1900 |
|
| 1901 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5> |
| 1902 |
|
| 1903 |
<p> |
| 1904 |
<kbd>CAPTION</kbd> allows you to give the diagram a caption. By |
| 1905 |
default, the caption appears above the diagram, but may be attached to |
| 1906 |
the label that appears beneath it. See |
| 1907 |
<a href="#caption-after-label">CAPTION_AFTER_LABEL</a> |
| 1908 |
in |
| 1909 |
<a href="#captions-and-labels">Captions and labels</a>. |
| 1910 |
The text of the caption must be surrounded by double-quotes. |
| 1911 |
</p> |
| 1912 |
|
| 1913 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5> |
| 1914 |
|
| 1915 |
<p> |
| 1916 |
<kbd>SHORT_CAPTION</kbd> allows you to trim long captions for |
| 1917 |
inclusion in the List of Figures. The text you supply, surrounded |
| 1918 |
by double-quotes, is what will appear in the List. |
| 1919 |
</p> |
| 1920 |
|
| 1921 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5> |
| 1922 |
|
| 1923 |
<p> |
| 1924 |
<kbd>LABEL</kbd>, if given, appears beneath the diagram. The text you |
| 1925 |
supply, surrounded by double-quotes, is how the diagram is labelled |
| 1926 |
in both the document proper and the List of Figures. Mom provides |
| 1927 |
an auto-labelling facility for diagrams (see |
| 1928 |
<a href="#autolabel">AUTOLABEL</a>), |
| 1929 |
which, if enabled, overrides the <kbd>LABEL</kbd> argument. |
| 1930 |
</p> |
| 1931 |
|
| 1932 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5> |
| 1933 |
|
| 1934 |
<p> |
| 1935 |
<kbd>TARGET</kbd> followed by a unique name surrounded by |
| 1936 |
double-quotes creates a PDF target for the diagram so that it may be |
| 1937 |
linked to from other places in the file (with PDF_LINK; see |
| 1938 |
<a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>). |
| 1939 |
</p> |
| 1940 |
|
| 1941 |
<p> |
| 1942 |
<b><i>Please note:</i></b> The following functionality is available |
| 1943 |
only with groff 1.22.4 or later. |
| 1944 |
</p> |
| 1945 |
|
| 1946 |
<p> |
| 1947 |
When |
| 1948 |
<a href="#autolabel">autolabelling</a> |
| 1949 |
is enabled and the document is processed with |
| 1950 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>, |
| 1951 |
the target name can be used to generate the target’s label |
| 1952 |
number in running text if it is entered as a groff string, i.e. of |
| 1953 |
the form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you |
| 1954 |
create a target called “foo” for a diagram whose |
| 1955 |
autolabel number would be 3, entering |
| 1956 |
<br/> |
| 1957 |
<span class="pre-in-pp"> |
| 1958 |
See |
| 1959 |
.PDF_LINK foo "Figure \*[foo]" |
| 1960 |
</span> |
| 1961 |
anywhere in running text would result in a pdf link that reads |
| 1962 |
“Figure 3”. If chapter numbers are being prefixed to |
| 1963 |
labels, the same string in, say, chapter 5 would produce the pdf |
| 1964 |
link “Figure 5.3”. |
| 1965 |
</p> |
| 1966 |
|
| 1967 |
<!-- PIC_TEXT_STYLE --> |
| 1968 |
|
| 1969 |
<div class="macro-id-overline"> |
| 1970 |
<h3 id="pic-text-style" class= "macro-id">PIC_TEXT_STYLE</h3> |
| 1971 |
</div> |
| 1972 |
|
| 1973 |
<div class="box-macro-args"> |
| 1974 |
Macro: <b>PIC_TEXT_STYLE</b> \ |
| 1975 |
<br/> |
| 1976 |
<kbd class="macro-args"> |
| 1977 |
[ FAMILY ] "<family>" \ |
| 1978 |
<br/> |
| 1979 |
[ FONT ] "<font>" \ |
| 1980 |
<br/> |
| 1981 |
[ SIZE ] "+|-<size>" \ |
| 1982 |
<br/> |
| 1983 |
[ AUTOLEAD ] "<value>" |
| 1984 |
</kbd> |
| 1985 |
</div> |
| 1986 |
|
| 1987 |
<p> |
| 1988 |
Diagrams drawn with <b>pic</b> may contain text, and groff |
| 1989 |
<a href="inlines.html#intro-inlines">inline escapes</a> |
| 1990 |
may be used to alter the text parameters. A problem that arises |
| 1991 |
from so doing is that, in many cases, it clutters up the <b>pic</b> |
| 1992 |
code unnecessarily. |
| 1993 |
</p> |
| 1994 |
|
| 1995 |
<p> |
| 1996 |
PIC_TEXT_STYLE lets you establish the type parameters for text |
| 1997 |
inside a <b>pic</b> block all at once in cases where so doing |
| 1998 |
improves the readability of your mom source files. |
| 1999 |
</p> |
| 2000 |
|
| 2001 |
<p> |
| 2002 |
The arguments to PIC_TEXT_STYLE behave identically to the arguments |
| 2003 |
to other control macros, explained |
| 2004 |
<a href="docelement.html#control-macro-args">here</a>. |
| 2005 |
They may be given in any order, and you may use as many or as few as |
| 2006 |
you like. |
| 2007 |
</p> |
| 2008 |
|
| 2009 |
<div class="box-tip"> |
| 2010 |
<p class="tip"> |
| 2011 |
<span class="note">Note:</span> |
| 2012 |
Text within <b>pic</b> diagrams does not scale when you provide a |
| 2013 |
scaling argument to <kbd>.PS</kbd>. This is a limitation of the |
| 2014 |
preprocessor itself, not groff or mom. |
| 2015 |
</p> |
| 2016 |
</div> |
| 2017 |
|
| 2018 |
<div class="rule-medium"><hr/></div> |
| 2019 |
|
| 2020 |
<h3 id="grap" class="docs">grap support</h3> |
| 2021 |
|
| 2022 |
<p> |
| 2023 |
Grap is a <b>pic</b> preprocessor for creating graphs. Grap |
| 2024 |
usage is covered in the <kbd>grap(1)</kbd> manpage. Its mom |
| 2025 |
implementation is the same as for <b>pic</b> except that instead of |
| 2026 |
enclosing directives between |
| 2027 |
<a href="#ps-pe">.PS / .PE</a>, |
| 2028 |
they are enclosed between <b>.G1/.G2</b>. If you use <b>grap</b>, |
| 2029 |
you must pass groff or pdfmom the <b>-G</b> flag when you process |
| 2030 |
the file. |
| 2031 |
|
| 2032 |
</p> |
| 2033 |
|
| 2034 |
<p> |
| 2035 |
<b>.G1</b> takes all the same arguments as |
| 2036 |
<a href="#ps-pe">PS</a> |
| 2037 |
with one exception: the argument <b>GRAP</b> must always be given to |
| 2038 |
<b>.G1</b>. So, for example, a skeleton grap block raised 2 points |
| 2039 |
and with a caption would be entered: |
| 2040 |
<br/> |
| 2041 |
<span class="pre-in-pp"> |
| 2042 |
.G1 GRAP ADJUST +2p CAPTION "Graph caption" |
| 2043 |
<grap directives> |
| 2044 |
.G2 |
| 2045 |
</span> |
| 2046 |
|
| 2047 |
</p> |
| 2048 |
|
| 2049 |
<div class="rule-medium"><hr/></div> |
| 2050 |
|
| 2051 |
<h3 id="eqn" class="docs">eqn support</h3> |
| 2052 |
|
| 2053 |
<p> |
| 2054 |
Support for <b>eqn</b> is provided via extensions to the standard |
| 2055 |
<kbd>.EQ/.EN</kbd> macros. <kbd>eqn</kbd> usage itself is beyond |
| 2056 |
the scope of this documentation, but is covered in the manpage |
| 2057 |
<kbd>eqn(1)</kbd>. You can also download a copy of Ted |
| 2058 |
Harding’s |
| 2059 |
<a href="http://lists.gnu.org/archive/html/groff/2013-10/pdfTyBN2VWR1c.pdf"> |
| 2060 |
A Guide to Typesetting Mathematics Using GNU eqn |
| 2061 |
</a>, |
| 2062 |
which contains useful examples. If you use <b>eqn</b>, you must give groff or |
| 2063 |
pdfmom the <b>-e</b> flag. |
| 2064 |
|
| 2065 |
</p> |
| 2066 |
|
| 2067 |
<div class="macro-id-overline"> |
| 2068 |
<h3 id="eq-en" class= "macro-id">.EQ / .EN</h3> |
| 2069 |
</div> |
| 2070 |
|
| 2071 |
<div class="box-macro-args"> |
| 2072 |
Macro: <a href="#eq"><b>EQ</b></a> |
| 2073 |
<br/> |
| 2074 |
<kbd class="macro-args">Arguments: |
| 2075 |
<br/> |
| 2076 |
[ -L | -C | -I <indent> ]</kbd> |
| 2077 |
<span style="font-size: 95%"> |
| 2078 |
(<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 2079 |
required) |
| 2080 |
</span> |
| 2081 |
<kbd class="macro-args"><br/> |
| 2082 |
[ ADJUST +|-<vertical adjustment>]</kbd> |
| 2083 |
<span style="font-size: 95%"> |
| 2084 |
(<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 2085 |
required) |
| 2086 |
</span> |
| 2087 |
<kbd class="macro-args"><br/> |
| 2088 |
[ NO_SHIM ] |
| 2089 |
<br/> |
| 2090 |
[ NO_FLEX ] |
| 2091 |
<br/> |
| 2092 |
[ CAPTION "<caption>" ] |
| 2093 |
<br/> |
| 2094 |
[ LABEL "<label>" ] |
| 2095 |
<br/> |
| 2096 |
[ SHIFT_LABEL +|-<vertical adjustment> ] |
| 2097 |
<br/> |
| 2098 |
[ SHORT_CAPTION "<short caption>" ] |
| 2099 |
<br/> |
| 2100 |
[ TARGET "<name>" ] |
| 2101 |
<br/> |
| 2102 |
[ CONTINUED | CONT | ... ]</kbd> |
| 2103 |
</div> |
| 2104 |
|
| 2105 |
<div class="box-tip"> |
| 2106 |
<p class="tip"> |
| 2107 |
<span class="note">Note: Version 2.0-c change</span> |
| 2108 |
<br/> |
| 2109 |
2.0-c introduces revisions to <b>EQ</b>, including the addition |
| 2110 |
of a dash (<kbd>-</kbd>) to the positioning arguments |
| 2111 |
(<kbd>-L</kbd>, <kbd>-C</kbd>, and <kbd>-I</kbd>) and the removal of a |
| 2112 |
default value for <kbd>-I</kbd>. Other changes include passing all |
| 2113 |
options to <kbd>.EQ</kbd> (including the label) such that |
| 2114 |
<kbd>.EN</kbd> takes only a single, optional argument saying whether |
| 2115 |
the equation is to be continued at the next invocation of |
| 2116 |
<kbd>.EQ</kbd>. Please read this section carefully if you have |
| 2117 |
documents containing equations as they may need to be updated. |
| 2118 |
</p> |
| 2119 |
</div> |
| 2120 |
|
| 2121 |
<div class="box-important" style="margin-top: 1em"> |
| 2122 |
<p class="tip"> |
| 2123 |
<span class="important">IMPORTANT:</span> |
| 2124 |
All arguments to <b>EQ</b> must appear on the same line as |
| 2125 |
<kbd>.EQ</kbd>. Do not attempt to break them up with the |
| 2126 |
“line-continued” backslash. You may want to set your |
| 2127 |
text editor to “wrap” mode in order to see all your |
| 2128 |
arguments. This annoyance stems from the preprocessor mechanism |
| 2129 |
itself, not groff or mom. |
| 2130 |
</p> |
| 2131 |
</div> |
| 2132 |
|
| 2133 |
<div class="macro-id-overline" style="margin-top: .5em"> |
| 2134 |
<h4 id="eq" class="docs" style="font-size: 100%; margin-top: .5em">The .EQ macro</h4> |
| 2135 |
</div> |
| 2136 |
|
| 2137 |
<p> |
| 2138 |
Equations to be set with <b>eqn</b> begin with <kbd>.EQ</kbd>, |
| 2139 |
followed by <b>eqn</b> code. Equations are centered by default, |
| 2140 |
but may be set flush left or indented from the left margin |
| 2141 |
if <kbd>-L</kbd> or <kbd>-I</kbd> are passed as arguments to |
| 2142 |
<kbd>.EQ</kbd>. |
| 2143 |
</p> |
| 2144 |
|
| 2145 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">ADJUST</h5> |
| 2146 |
|
| 2147 |
<p> |
| 2148 |
<kbd>ADJUST</kbd> lets you raise (<kbd>-</kbd>) or lower |
| 2149 |
(<kbd>+</kbd>) an equation |
| 2150 |
<span style="font-style: italic">within the space allotted for it</span> |
| 2151 |
by the amount you specify. This is useful for achieving good |
| 2152 |
optical centering between surrounding blocks of type. A unit of |
| 2153 |
measure is required. |
| 2154 |
</p> |
| 2155 |
|
| 2156 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_SHIM</h5> |
| 2157 |
|
| 2158 |
<p> |
| 2159 |
<kbd>NO_SHIM</kbd> instructs mom not to apply |
| 2160 |
<a href="docprocessing.html#shim-vs-flex">shimming</a> |
| 2161 |
after an equation, which she will do automatically when shimming is |
| 2162 |
enabled, which it is by default. Shimming ensures that running text |
| 2163 |
after the equation falls properly on the page’s |
| 2164 |
<a href="definitions.html#baseline-grid">baseline grid</a>, |
| 2165 |
but can result in slightly unequal spacing above and |
| 2166 |
below (correctable with the <kbd>ADJUST</kbd> argument). |
| 2167 |
<kbd>NO_SHIM</kbd> is useful when you have several equations on the |
| 2168 |
page and there are visible differences in the spacing beneath them |
| 2169 |
as a result of shimming. To ensure a flush bottom margin, the last |
| 2170 |
equation on the page should be shimmed, i.e. should not be given the |
| 2171 |
<kbd>NO_SHIM</kbd> argument. |
| 2172 |
</p> |
| 2173 |
|
| 2174 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">NO_FLEX</h5> |
| 2175 |
|
| 2176 |
<p> |
| 2177 |
<kbd>NO_FLEX</kbd> instructs mom not to apply |
| 2178 |
<a href="docprocessing.html#shim-vs-flex">flex-spacing</a> |
| 2179 |
after an equation, which she will do automatically when flex-spacing |
| 2180 |
is enabled. <kbd>NO_FLEX</kbd> is useful when you have several |
| 2181 |
equations on the page and you want to distribute excess vertical |
| 2182 |
whitespace on the page amongst other flex-spacing points on |
| 2183 |
the page. If there are no others, the final equation should be |
| 2184 |
flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument. |
| 2185 |
</p> |
| 2186 |
|
| 2187 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5> |
| 2188 |
|
| 2189 |
<p> |
| 2190 |
<kbd>CAPTION</kbd> allows you to give the equation a caption. |
| 2191 |
Equation captions always appear beneath the equation. |
| 2192 |
</p> |
| 2193 |
|
| 2194 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SHORT_CAPTION</h5> |
| 2195 |
|
| 2196 |
<p> |
| 2197 |
<kbd>SHORT_CAPTION</kbd> allows you to trim long captions for |
| 2198 |
inclusion in the List of Equations. The text you supply, surrounded |
| 2199 |
by double-quotes, is what will appear in the List. |
| 2200 |
</p> |
| 2201 |
|
| 2202 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">LABEL</h5> |
| 2203 |
|
| 2204 |
<p> |
| 2205 |
<kbd>LABEL</kbd>, if given, appears on the same baseline as the last line of the |
| 2206 |
equation, flush with the left or right margin, depending on the |
| 2207 |
equation’s horizontal position. The text you supply, surrounded by |
| 2208 |
double-quotes, is how |
| 2209 |
the equation is labelled in both the document proper and the List of |
| 2210 |
Equations. Mom provides an auto-labelling facility for equations (see |
| 2211 |
<a href="#autolabel">AUTOLABEL</a>), |
| 2212 |
which, if enabled, overrides the <kbd>LABEL</kbd> argument. |
| 2213 |
</p> |
| 2214 |
|
| 2215 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">SHIFT_LABEL</h5> |
| 2216 |
|
| 2217 |
<p> |
| 2218 |
<kbd>SHIFT_LABEL</kbd> allows you to raise (<kbd>-</kbd>) or lower |
| 2219 |
(<kbd>+</kbd>) the equation label. It’s primary use is to |
| 2220 |
center equation labels vertically on the equation rather than flush |
| 2221 |
with the last line. Assuming a three-line equation, |
| 2222 |
<kbd>.EQ SHIFT_LABEL -1v</kbd> would raise the label by |
| 2223 |
one line, thus centering it vertically on the equation. |
| 2224 |
</p> |
| 2225 |
|
| 2226 |
<h5 class="docs" style="margin-top: 1em; text-transform: none">TARGET</h5> |
| 2227 |
|
| 2228 |
<p> |
| 2229 |
<kbd>TARGET</kbd> followed by a unique name surrounded by |
| 2230 |
double-quotes creates a PDF target for the equation so that it may |
| 2231 |
be linked to from other places in the file (with PDF_LINK; see |
| 2232 |
<a href="version-2.html#mom-pdf">Producing PDFs with groff and mom</a>). |
| 2233 |
</p> |
| 2234 |
|
| 2235 |
<p> |
| 2236 |
<b><i>Please note:</i></b> The following functionality is available |
| 2237 |
only with groff 1.22.4 or later. |
| 2238 |
</p> |
| 2239 |
|
| 2240 |
<p> |
| 2241 |
When |
| 2242 |
<a href="#autolabel">autolabelling</a> |
| 2243 |
is enabled and the document is processed with |
| 2244 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>, |
| 2245 |
the target name can be used to generate the target’s label |
| 2246 |
number in running text if it is entered as a groff string, i.e. of |
| 2247 |
the form <kbd><span class="nobr">\*[name]</span></kbd>. For example, if you |
| 2248 |
create a target called “foo” for an equation whose |
| 2249 |
autolabel number would be 3, entering |
| 2250 |
<br/> |
| 2251 |
<span class="pre-in-pp"> |
| 2252 |
See |
| 2253 |
.PDF_LINK foo "Equation \*[foo]" |
| 2254 |
</span> |
| 2255 |
anywhere in running text would result in a pdf link that reads |
| 2256 |
“Equation 3”. If chapter numbers are being prefixed to |
| 2257 |
labels, the same string in, say, chapter 5 would produce the pdf |
| 2258 |
link “Equation 5.3”. |
| 2259 |
</p> |
| 2260 |
|
| 2261 |
|
| 2262 |
<div class="macro-id-overline" style="margin-top: .5em"> |
| 2263 |
<h4 id="en" class="docs" style="font-size: 100%; margin-top: .5em">The .EN macro</h4> |
| 2264 |
</div> |
| 2265 |
|
| 2266 |
<p> |
| 2267 |
A block of <b>eqn</b> code is terminated with <kbd>.EN</kbd>. |
| 2268 |
</p> |
| 2269 |
|
| 2270 |
<p> |
| 2271 |
If an equation needs to span multiple lines, possibly aligned |
| 2272 |
with <b>eqn</b>’s <kbd>'mark'</kbd> and <kbd>'lineup'</kbd> |
| 2273 |
directives, separate invocations of <kbd><span class="nobr">.EQ/.EN</span></kbd> |
| 2274 |
are required for each line, and the optional argument, |
| 2275 |
<kbd>CONTINUED</kbd> (or <kbd>CONT</kbd>, or <kbd>...</kbd> [three |
| 2276 |
dots, an ellipsis]), must be passed to <kbd>.EN</kbd>. |
| 2277 |
</p> |
| 2278 |
|
| 2279 |
<p> |
| 2280 |
If <kbd>-L</kbd> or <kbd>-I</kbd> is given to the first |
| 2281 |
<kbd>.EQ</kbd> of a multi-line equation, they remain in effect |
| 2282 |
until an <kbd>.EN</kbd> without the <kbd>CONTINUED</kbd> argument |
| 2283 |
is reached. |
| 2284 |
</p> |
| 2285 |
|
| 2286 |
<p> |
| 2287 |
Mom does not treat equations as floats, therefore it is possible to |
| 2288 |
begin an equation on one page and terminate it on the next. If you |
| 2289 |
wish to keep all lines of an equation together, you must wrap the |
| 2290 |
equation, including all invocations of <kbd>.EQ/.EN</kbd>, inside |
| 2291 |
a |
| 2292 |
<a href="#floats-intro">float</a>. |
| 2293 |
</p> |
| 2294 |
|
| 2295 |
<div class="rule-medium"><hr/></div> |
| 2296 |
|
| 2297 |
<h3 id="refer" class="docs">refer support</h3> |
| 2298 |
|
| 2299 |
<p> |
| 2300 |
<b>refer</b> support is covered in the section |
| 2301 |
<a href="refer.html">Bibliographies and references</a>. |
| 2302 |
</p> |
| 2303 |
|
| 2304 |
<div class="rule-medium"><hr/></div> |
| 2305 |
|
| 2306 |
<h2 id="captions-and-labels" class="docs">Captions and labels</h2> |
| 2307 |
|
| 2308 |
<ul> |
| 2309 |
<li><a href="#autolabel">AUTOLABEL</a></li> |
| 2310 |
<li><a href="#caption-after-label">CAPTION_AFTER_LABEL</a></li> |
| 2311 |
<li><a href="#mla">MLA</a>—MLA-style captioning and labelling</li> |
| 2312 |
<li><a href="#captions-labels-sources">Set style parameters for captions, labels, and sources</a></li> |
| 2313 |
</ul> |
| 2314 |
|
| 2315 |
<p> |
| 2316 |
Mom includes facilities for adding captions and labels to figures, |
| 2317 |
tables, equations, and embedded images, including auto-labelling. If |
| 2318 |
Lists of Figures, Tables, and Equations are desired, captions (if |
| 2319 |
any) and labels (if any) are collected and output in the Lists with |
| 2320 |
the appropriate page number. |
| 2321 |
</p> |
| 2322 |
|
| 2323 |
<p> |
| 2324 |
The distinction between a caption and a label is that labels are |
| 2325 |
identifiers, e.g. “Fig. 1” or “Table 3”, |
| 2326 |
while captions are descriptive or informative. For most types of |
| 2327 |
writing, it is usual to provide both. |
| 2328 |
</p> |
| 2329 |
|
| 2330 |
<p> |
| 2331 |
By default, mom sets captions above figures (i.e. <b>pic</b> output and |
| 2332 |
embedded images) and tables. This behaviour may be modified with the |
| 2333 |
macro |
| 2334 |
<a href="#caption-after-label">CAPTION_AFTER_LABEL</a>. |
| 2335 |
Equations always have their captions set underneath. All aspects of |
| 2336 |
the text style for captions may be set with the macro |
| 2337 |
<a href="#captions-labels-sources">CAPTIONS</a>. |
| 2338 |
</p> |
| 2339 |
|
| 2340 |
<p> |
| 2341 |
Labels for tables are set underneath the table unless the |
| 2342 |
<a href="#mla">MLA</a> |
| 2343 |
macro has been invoked, in which case the label and caption appear |
| 2344 |
above the table, per MLA style, and the source for the table, if |
| 2345 |
any, appears underneath. Labels for figures are set underneath. |
| 2346 |
Equation labels, by default, are set on the same baseline as the |
| 2347 |
last line of the equation. Like captions, all aspects of text style |
| 2348 |
for labels may be established with a single macro |
| 2349 |
<a href="#labels">LABELS</a>. |
| 2350 |
Furthermore, mom can autolabel figures, tables, and equations, with |
| 2351 |
or without a prefixed chapter number. |
| 2352 |
</p> |
| 2353 |
|
| 2354 |
<div class="macro-id-overline"> |
| 2355 |
<h3 id="autolabel" class="macro-id">Autolabel</h3> |
| 2356 |
</div> |
| 2357 |
|
| 2358 |
<div class="box-macro-args"> |
| 2359 |
Macro: <b>AUTOLABEL_EQUATIONS</b> |
| 2360 |
<br/> |
| 2361 |
Macro: <b>AUTOLABEL_IMAGES</b> |
| 2362 |
<br/> |
| 2363 |
Macro: <b>AUTOLABEL_PIC</b> |
| 2364 |
<br/> |
| 2365 |
Macro: <b>AUTOLABEL_TABLES</b> |
| 2366 |
<br/> |
| 2367 |
<kbd class="macro-args">Arguments: |
| 2368 |
<br/> |
| 2369 |
[ PREFIX "<string>"] [ SUFFIX "<string>"] [ PREFIX_CHAPTER [ <n> ] ] |
| 2370 |
</kbd> |
| 2371 |
</div> |
| 2372 |
|
| 2373 |
<p> |
| 2374 |
<b>AUTOLABEL_<type></b> takes care of labelling <type> by |
| 2375 |
identifying each with a separate, incrementing numeric scheme, which |
| 2376 |
is also collected for output in Lists of Figures, Equations, and |
| 2377 |
Tables. |
| 2378 |
</p> |
| 2379 |
|
| 2380 |
<p> |
| 2381 |
Autolabelling may be disabled on-the-fly by giving any argument |
| 2382 |
other than <kbd>PREFIX</kbd>, <kbd>SUFFIX</kbd>, or |
| 2383 |
<kbd>PREFIX_CHAPTER</kbd> to the appropriate macro. For example, |
| 2384 |
<br/> |
| 2385 |
<span class="pre-in-pp"> |
| 2386 |
.AUTOLABEL_IMAGES NO |
| 2387 |
</span> |
| 2388 |
would disable autolabelling of images. |
| 2389 |
</p> |
| 2390 |
|
| 2391 |
<h4 class="docs" style="margin-top: -.5em">Prefixes and suffixes</h4> |
| 2392 |
|
| 2393 |
<p> |
| 2394 |
By default, when <b>AUTOLABEL</b> is enabled, the label numbers are |
| 2395 |
prefixed, and, in the case of equations, suffixed, with strings such |
| 2396 |
that they appear for tables as “Table <n>”, for |
| 2397 |
<b>pic</b> diagrams and embedded images as “Fig. <n>”, |
| 2398 |
and for equations as “(<n>)”. |
| 2399 |
</p> |
| 2400 |
|
| 2401 |
<p> |
| 2402 |
You can use <kbd>PREFIX <"string"></kbd> to change what |
| 2403 |
comes before the automatic numbering. For example, if you are |
| 2404 |
including musical excerpts in your document, MLA style requires that |
| 2405 |
they be labelled “Ex. <n>”. Since musical |
| 2406 |
excerpts are likely to be scanned images, you have to change the |
| 2407 |
prefix string images: |
| 2408 |
<br/> |
| 2409 |
<span class="pre-in-pp"> |
| 2410 |
.AUTOLABEL_IMAGES \ |
| 2411 |
PREFIX "Ex. " \ |
| 2412 |
SUFFIX "" |
| 2413 |
</span> |
| 2414 |
If you need a suffix after the automatic numbering, use |
| 2415 |
<kbd>SUFFIX <"string"></kbd>, like this: |
| 2416 |
<br/> |
| 2417 |
<span class="pre-in-pp"> |
| 2418 |
.AUTOLABEL_IMAGES \ |
| 2419 |
PREFIX "(Fig. " \ |
| 2420 |
SUFFIX ")" |
| 2421 |
</span> |
| 2422 |
Note from the above that both arguments, <kbd>PREFIX</kbd> and |
| 2423 |
<kbd>SUFFIX</kbd>, are required should you want either. Two |
| 2424 |
adjacent double-quotes leaves the string blank. |
| 2425 |
</p> |
| 2426 |
|
| 2427 |
<div class="box-tip"> |
| 2428 |
<p class="tip"> |
| 2429 |
<span class="note">Note:</span> |
| 2430 |
In automatically formatted |
| 2431 |
<a href="#lists-macros">“Lists of ...”</a>, |
| 2432 |
label number prefixes are stripped when autolabelling is enabled. |
| 2433 |
</p> |
| 2434 |
</div> |
| 2435 |
|
| 2436 |
<h4 class="docs" style="margin-top: -.5em">Prefixing chapter numbers</h4> |
| 2437 |
|
| 2438 |
<p> |
| 2439 |
If you would like mom to prefix chapter numbers to the label, |
| 2440 |
pass <kbd>AUTOLABEL_<type></kbd> the argument |
| 2441 |
<kbd>PREFIX_CHAPTER</kbd>. |
| 2442 |
</p> |
| 2443 |
|
| 2444 |
<p> |
| 2445 |
If for some reason you need to specify the chapter number, |
| 2446 |
you may do so by passing the number as an argument to |
| 2447 |
<kbd>PREFIX_CHAPTER</kbd>. Subsequent chapters or major sections |
| 2448 |
will increment by one as expected. |
| 2449 |
</p> |
| 2450 |
|
| 2451 |
<div class="box-tip"> |
| 2452 |
<p class="tip"> |
| 2453 |
<span class="note">Note:</span> |
| 2454 |
For the purposes of labelling, mom treats |
| 2455 |
<a href="docprocessing.html#doctype">DOCTYPE DEFAULT</a> |
| 2456 |
as if it were <b>DOCTYPE CHAPTER</b>, hence, with |
| 2457 |
<kbd>PREFIX_CHAPTER</kbd>, each collated <b>DEFAULT</b> |
| 2458 |
doctype’s prefixed “chapter” number is |
| 2459 |
incremented and the label number itself reset to “1”. |
| 2460 |
If you do not supply the <kbd>PREFIX_CHAPTER</kbd> argument, the |
| 2461 |
label number is <i>not</i> reset automatically. To reset it, invoke |
| 2462 |
<kbd>.AUTOLABEL_<type></kbd> after each |
| 2463 |
<a href="docprocessing.html#collate">COLLATE</a>. |
| 2464 |
</p> |
| 2465 |
</div> |
| 2466 |
|
| 2467 |
<div id="set-autolabel" class="box-macro-args" style="margin-top: .5em"> |
| 2468 |
Macro: <b>SET_AUTOLABEL</b> <kbd class="macro-args">FIG | TBL | PIC | EQN <n></kbd> |
| 2469 |
</div> |
| 2470 |
|
| 2471 |
<p> |
| 2472 |
You may sometimes need to set or reset the autolabel number for a |
| 2473 |
particular type of pre-processor or for embedded images. This is |
| 2474 |
likely to occur if you are using |
| 2475 |
<a href="#float">FLOAT</a> |
| 2476 |
in conjunction with the <kbd>TO_LIST</kbd> argument. |
| 2477 |
</p> |
| 2478 |
|
| 2479 |
<p> |
| 2480 |
For example, if your document has Figures (embedded images, pic |
| 2481 |
diagrams) and you want your tables to be labelled as Figures as |
| 2482 |
well, you have to wrap the tables inside a float and label the float |
| 2483 |
manually as “Fig. n”, sending it to the List of |
| 2484 |
Figures with <kbd>TO_LIST FIGURES</kbd>. |
| 2485 |
</p> |
| 2486 |
|
| 2487 |
<p> |
| 2488 |
Mom does not autolabel floats or assign them automatically |
| 2489 |
to a list, so she doesn’t know you’ve interrupted the |
| 2490 |
auto-incrementing label numbers. Use SET_AUTOLABEL get her back on |
| 2491 |
track. The number you give as an argument after telling her which |
| 2492 |
kind of label number to set is the one you want to appear next. |
| 2493 |
<br/> |
| 2494 |
<span class="pre-in-pp"> |
| 2495 |
.SET_AUTOLABEL FIG 6 |
| 2496 |
</span> |
| 2497 |
means the next autolabelled Figure will be “Fig. 6.” |
| 2498 |
</p> |
| 2499 |
|
| 2500 |
<div class="macro-id-overline"> |
| 2501 |
<h3 id="caption-after-label" class="macro-id">Captions after labels</h3> |
| 2502 |
</div> |
| 2503 |
|
| 2504 |
<div class="box-macro-args" style="margin-top: .5em"> |
| 2505 |
Macro: <b>CAPTION_AFTER_LABEL</b> <kbd class="macro-args">IMG | PIC | TBL | ALL [ <anything> ]</kbd> |
| 2506 |
</div> |
| 2507 |
|
| 2508 |
<p> |
| 2509 |
By default, mom sets captions above figures (<b>pic</b> output |
| 2510 |
and embedded images) and tables; labels are always underneath. |
| 2511 |
</p> |
| 2512 |
|
| 2513 |
<p> |
| 2514 |
<kbd>.CAPTION_AFTER_LABEL</kbd>, with one of the required arguments, |
| 2515 |
instructs mom to attach captions directly to the appropriate |
| 2516 |
labels, beginning on the same line. Any argument after the first |
| 2517 |
disables this behaviour, restoring caption placement to mom’s |
| 2518 |
default. For example, |
| 2519 |
<br/> |
| 2520 |
<span class="pre-in-pp"> |
| 2521 |
.CAPTION_AFTER_LABEL ALL |
| 2522 |
</span> |
| 2523 |
would enable captions after labels globally, while a subsequent |
| 2524 |
<br/> |
| 2525 |
<span class="pre-in-pp"> |
| 2526 |
.CAPTION_AFTER_LABEL IMG OFF |
| 2527 |
</span> |
| 2528 |
would disable captions after labels for embedded images only. |
| 2529 |
<kbd>OFF</kbd> can be anything you like (<kbd>X</kbd>, |
| 2530 |
<kbd>NO</kbd>, etc). |
| 2531 |
</p> |
| 2532 |
|
| 2533 |
<p> |
| 2534 |
If |
| 2535 |
<a href="#mla">MLA</a> |
| 2536 |
is enabled, there’s no need to invoke |
| 2537 |
<kbd>CAPTION_AFTER_LABEL</kbd> as this is implied. |
| 2538 |
</p> |
| 2539 |
|
| 2540 |
<div class="box-tip"> |
| 2541 |
<p class="tip"> |
| 2542 |
<span class="note">Note:</span> |
| 2543 |
A separate invocation of <kbd>.CAPTION_AFTER_LABEL</kbd> is required |
| 2544 |
for each one of the required first arguments. You cannot, for |
| 2545 |
example, do |
| 2546 |
<br/> |
| 2547 |
<span class="pre-in-pp"> |
| 2548 |
.CAPTION_AFTER_LABEL IMG TBL |
| 2549 |
</span> |
| 2550 |
Rather, you must do |
| 2551 |
<br/> |
| 2552 |
<span class="pre-in-pp"> |
| 2553 |
.CAPTION_AFTER_LABEL IMG |
| 2554 |
.CAPTION_AFTER_LABEL TBL |
| 2555 |
</span> |
| 2556 |
</p> |
| 2557 |
</div> |
| 2558 |
|
| 2559 |
<div class="macro-id-overline"> |
| 2560 |
<h3 id="mla" class="macro-id">MLA-style captioning and labelling</h3> |
| 2561 |
</div> |
| 2562 |
|
| 2563 |
<div class="box-macro-args" style="margin-top: .5em"> |
| 2564 |
Macro: <b>MLA</b> <kbd class="macro-args"> [ <anything> ]</kbd> |
| 2565 |
</div> |
| 2566 |
|
| 2567 |
<p> |
| 2568 |
Modern Language Association style dictates that captions should |
| 2569 |
always go after labels. Furthermore, labels and captions for tables |
| 2570 |
should go <i>above</i> the tables, with the source for the table, if |
| 2571 |
any, underneath. |
| 2572 |
</p> |
| 2573 |
|
| 2574 |
<p> |
| 2575 |
Invoking <kbd>.MLA</kbd> by itself takes care of these details. If |
| 2576 |
you need to disable MLA-style captioning and labelling mid-document, |
| 2577 |
<kbd>.MLA OFF</kbd> does the trick. <kbd>OFF</kbd> can be |
| 2578 |
anything you like (<kbd>X</kbd>, <kbd>NO</kbd>, etc). |
| 2579 |
</p> |
| 2580 |
|
| 2581 |
<div class="macro-id-overline" style="margin-top: 1em"> |
| 2582 |
<h3 id="captions-labels-sources" class="macro-id">Style parameters for captions, labels and sources</h3> |
| 2583 |
</div> |
| 2584 |
|
| 2585 |
<div class="box-macro-args" style="margin-top: .5em"> |
| 2586 |
Macro: <b>CAPTIONS</b> <kbd class="macro-args">EQN | IMG | PIC | TBL | FLOATING | ALL</kbd> |
| 2587 |
<br/> |
| 2588 |
Macro: <b>LABELS</b> <kbd class="macro-args">EQN | IMG | PIC | TBL | FLOATING | ALL</kbd> |
| 2589 |
<br/> |
| 2590 |
Macro: <b>SOURCES</b> <kbd class="macro-args">TBL</kbd> |
| 2591 |
<br/> |
| 2592 |
<kbd class="macro-args">Style arguments: |
| 2593 |
<br/> |
| 2594 |
FAMILY <family> \ |
| 2595 |
<br/> |
| 2596 |
FONT <font> \ |
| 2597 |
<br/> |
| 2598 |
SIZE +|-<size> \ |
| 2599 |
<br/> |
| 2600 |
AUTOLEAD <value> \ |
| 2601 |
<br/> |
| 2602 |
COLOR <color> \ |
| 2603 |
<br/> |
| 2604 |
QUAD LEFT | CENTER | RIGHT [ ON_LL ] \ |
| 2605 |
<br/> |
| 2606 |
INDENT <indent> \ |
| 2607 |
<br/> |
| 2608 |
ADJUST +|-<vertical adjustment> |
| 2609 |
</kbd> |
| 2610 |
</div> |
| 2611 |
|
| 2612 |
<div class="box-tip"> |
| 2613 |
<p class="tip"> |
| 2614 |
<span class="note">Note:</span> |
| 2615 |
Arguments may be broken into several lines using the |
| 2616 |
“line-continued” backslash (<b>\</b>), as shown above. |
| 2617 |
</p> |
| 2618 |
</div> |
| 2619 |
|
| 2620 |
<div class="box-tip"> |
| 2621 |
<p class="tip"> |
| 2622 |
<span class="note">Additional note:</span> |
| 2623 |
Mom’s default style for labels, captions, and sources is |
| 2624 |
the same as the style used for running text, with two exceptions: |
| 2625 |
labels are set in bold, except for eqn which is roman medium, and |
| 2626 |
the autolead value for all three is “2”, effectively |
| 2627 |
tightening the lead. Furthermore, they are quadded left (except |
| 2628 |
eqn, which is quadded right.) |
| 2629 |
</p> |
| 2630 |
</div> |
| 2631 |
|
| 2632 |
<p> |
| 2633 |
With the exception of <kbd>ADJUST</kbd> and <kbd>QUAD</kbd> (which |
| 2634 |
requires a bit of explanation), the style arguments to <kbd>CAPTIONS</kbd>, |
| 2635 |
<kbd>LABELS</kbd>, and <kbd>SOURCES</kbd> (which is only available |
| 2636 |
for tables) behave identically to the |
| 2637 |
<a href="docelement.html#control-macro-args">arguments to control macros</a>. |
| 2638 |
</p> |
| 2639 |
|
| 2640 |
<p> |
| 2641 |
The first, required argument after <kbd>CAPTIONS</kbd>, |
| 2642 |
<kbd>LABELS</kbd>, or <kbd>SOURCES</kbd> indicates the preprocessor |
| 2643 |
type for which you are setting the parameters. (For convenience |
| 2644 |
PDF_IMAGE—argument <kbd>IMG</kbd>—is here treated as a |
| 2645 |
preprocessor.) <kbd>FLOATING</kbd> sets the style for the macros |
| 2646 |
<a href="#caption">CAPTION</a> |
| 2647 |
and |
| 2648 |
<a href="#label">LABEL</a>, |
| 2649 |
which are used to label floats, quotes, and blockquotes. |
| 2650 |
</p> |
| 2651 |
|
| 2652 |
<p> |
| 2653 |
An argument of <kbd>ALL</kbd> sets a unified style for all |
| 2654 |
preprocessors, floats, quotes, and blockquotes. If the |
| 2655 |
<kbd>ALL</kbd> argument is given, arguments to subsequent |
| 2656 |
invocations of <kbd>CAPTIONS</kbd>, <kbd>LABELS</kbd>, or |
| 2657 |
<kbd>SOURCES</kbd> overwrite only the explicitly named style |
| 2658 |
parameters. |
| 2659 |
</p> |
| 2660 |
|
| 2661 |
<h4 class="docs">QUAD — quadding of labels, captions, and sources</h4> |
| 2662 |
|
| 2663 |
<h5 class="docs" style="text-transform: none">• pic, tbl, pdf images</h5> |
| 2664 |
|
| 2665 |
<p> |
| 2666 |
By default, figures (<b>pic</b> output and pdf images) and tables |
| 2667 |
have their captions and labels set quad left. Sources (for |
| 2668 |
tables) are also set quad left. Equations have their labels |
| 2669 |
set quad right, and their captions centered. |
| 2670 |
</p> |
| 2671 |
|
| 2672 |
<p> |
| 2673 |
Regardless of the quad direction, captions, labels and sources |
| 2674 |
are set on the width of the figure, table, or pdf image |
| 2675 |
unless you pass the optional <kbd>ON_LL</kbd> argument to |
| 2676 |
<kbd><span class="nobr">QUAD <direction></span></kbd>, in which case |
| 2677 |
the prevailing document line length is used instead. |
| 2678 |
</p> |
| 2679 |
|
| 2680 |
<h5 class="docs" style="text-transform: none">• eqn</h5> |
| 2681 |
|
| 2682 |
<p> |
| 2683 |
Equations behave differently. By default, equation labels are |
| 2684 |
set flush right with the page’s right margin regardless of |
| 2685 |
equation positioning, which is, again by default, centered. If the |
| 2686 |
equation is positioned left, the label will appear at the right |
| 2687 |
margin regardless of the direction you give to <kbd>QUAD</kbd>. If |
| 2688 |
the equation is indented with the |
| 2689 |
<kbd><span class="nobr">-I <indent></span></kbd> option, a quad |
| 2690 |
direction of <kbd>LEFT</kbd> is observed, but may overprint the last |
| 2691 |
line of the equation. |
| 2692 |
</p> |
| 2693 |
|
| 2694 |
<p> |
| 2695 |
Note that there is no <kbd>CENTER</kbd> option for equation labels, |
| 2696 |
and that captions are always quadded over the prevailing document |
| 2697 |
line length. |
| 2698 |
</p> |
| 2699 |
|
| 2700 |
<h5 class="docs" style="text-transform: none">• quotes and blockquotes</h5> |
| 2701 |
|
| 2702 |
<p> |
| 2703 |
Floating labels attached to <b>QUOTE</b>s are quadded on the |
| 2704 |
prevailing document line length, and require the <kbd>INDENT</kbd> |
| 2705 |
argument if you want to align them with the left and/or right edges |
| 2706 |
the quote. |
| 2707 |
</p> |
| 2708 |
|
| 2709 |
<p> |
| 2710 |
Floating labels attached to <b>BLOCKQUOTE</b>s are always quadded on |
| 2711 |
the indent and line length of the blockquote. |
| 2712 |
</p> |
| 2713 |
|
| 2714 |
<h5 class="docs" style="text-transform: none">• floats</h5> |
| 2715 |
|
| 2716 |
<p> |
| 2717 |
Floating labels and captions attached to <b>FLOAT</b>s are always |
| 2718 |
quadded over the prevailing document line length, and require the |
| 2719 |
<kbd>INDENT</kbd> argument if you want to align them with the left |
| 2720 |
and/or right edges of the float’s contents. |
| 2721 |
</p> |
| 2722 |
|
| 2723 |
<h4 class="docs">INDENT</h4> |
| 2724 |
|
| 2725 |
<p> |
| 2726 |
The <kbd>INDENT</kbd> argument may only be used if the label |
| 2727 |
or caption type is <kbd>FLOATING</kbd>, and only applies to |
| 2728 |
<b>FLOAT</b>s and <b>QUOTE</b>s, not <b>BLOCKQUOTE</b>s. |
| 2729 |
</p> |
| 2730 |
|
| 2731 |
<p> |
| 2732 |
It is not possible for mom to know the width of a float before |
| 2733 |
setting a label or caption attached to a float. She therefore sets |
| 2734 |
it on the prevailing document line length. While this isn’t |
| 2735 |
much of an issue when the label or caption quad is <b>CENTER</b>, |
| 2736 |
you may want to adjust the horizontal positioning when the quad is |
| 2737 |
<b>LEFT</b> or <b>RIGHT</b>. |
| 2738 |
</p> |
| 2739 |
|
| 2740 |
<p> |
| 2741 |
<kbd>INDENT</kbd>, with a numeric value to which a |
| 2742 |
<a href="definitions.html#unitofmeasure">unit of measure</a> |
| 2743 |
is appended, allows you to indent a floating label or caption so |
| 2744 |
it lines up with the left edge of a <b>FLOAT</b> or <b>QUOTE</b>. |
| 2745 |
<kbd>INDENT RIGHT</kbd> (with a value) allows you to shorten the |
| 2746 |
line length to the appropriate width. If you need both a left and |
| 2747 |
right indent, invoke <kbd>LABELS</kbd> or <kbd>CAPTIONS</kbd> twice, |
| 2748 |
one instance containing <kbd>INDENT <indent></kbd> and |
| 2749 |
the other <kbd>INDENT RIGHT <indent></kbd>. |
| 2750 |
</p> |
| 2751 |
|
| 2752 |
<h4 class="docs">ADJUST</h4> |
| 2753 |
|
| 2754 |
<p> |
| 2755 |
The <kbd>ADJUST</kbd> argument allows you to add(<kbd>+</kbd>) or |
| 2756 |
subtract (<kbd>-</kbd>) vertical space between labels and captions |
| 2757 |
and the output to which they are attached. The argument requires a |
| 2758 |
<a href="definitions.html#unitofmeasure">unit of measure</a>. |
| 2759 |
For example, if you find that table labels are a bit too close to |
| 2760 |
the table itself, |
| 2761 |
<br/> |
| 2762 |
<span class="pre-in-pp"> |
| 2763 |
.LABELS TBL ADJUST +3p |
| 2764 |
</span> |
| 2765 |
would put three extra points of space between the bottoms of tables |
| 2766 |
and the labels that appear beneath them. |
| 2767 |
</p> |
| 2768 |
|
| 2769 |
<h2 id="lists-of" class="docs">Lists of Figures, Tables, and Equations</h2> |
| 2770 |
|
| 2771 |
<p> |
| 2772 |
Besides a |
| 2773 |
<a href="tables-of-contents.html">Table of Contents</a>, |
| 2774 |
mom can generate Lists of Figures, Tables, and Equations. Labels |
| 2775 |
and captions are collected and concatenated, and output in lists |
| 2776 |
with the appropriate page number, just like a Table of Contents. |
| 2777 |
Including such lists in a document is as simple as adding whichever |
| 2778 |
you need of |
| 2779 |
<br/> |
| 2780 |
<span class="pre-in-pp"> |
| 2781 |
.LIST_OF_FIGURES |
| 2782 |
.LIST_OF_EQUATIONS |
| 2783 |
.LIST_OF_TABLES |
| 2784 |
</span> |
| 2785 |
to the end of your input file. |
| 2786 |
</p> |
| 2787 |
|
| 2788 |
<p> |
| 2789 |
Also like the Table of Contents, entries in the Lists’ output |
| 2790 |
are clickable PDF links when a document is viewed at the screen. |
| 2791 |
</p> |
| 2792 |
|
| 2793 |
<h3 id="lists-placement" class="docs">Placement of Lists</h3> |
| 2794 |
|
| 2795 |
<p> |
| 2796 |
Lists normally appear after the Table of Contents, and continue |
| 2797 |
the page numbering scheme used for it. By default, the Table of |
| 2798 |
Contents begins on roman-numeral page “i”. |
| 2799 |
</p> |
| 2800 |
|
| 2801 |
<p> |
| 2802 |
If you are using mom’s |
| 2803 |
<a href="tables-of-contents.html#auto-relocate-toc">AUTO_RELOCATE_TOC</a> |
| 2804 |
feature, you have two options for placement of the Lists within the |
| 2805 |
document. If you want the Lists shifted to the top of the document |
| 2806 |
along with the Table of Contents, invoke the Lists macros <i>after</i> |
| 2807 |
<a href="tables-of-contents.html#toc"><kbd>.TOC</kbd></a>. |
| 2808 |
If you prefer to have the Lists at the end of the document, invoke |
| 2809 |
the Lists macros <i>before</i> <kbd>.TOC</kbd>. |
| 2810 |
</p> |
| 2811 |
|
| 2812 |
<p> |
| 2813 |
Lists shifted with the Table of Contents do not appear in the Table |
| 2814 |
of Contents itself, but do appear as clickable links in the PDF |
| 2815 |
outline typically available in the left panel of most PDF viewers. |
| 2816 |
Lists that are not shifted with the Table of Contents appear in both |
| 2817 |
the Table of Contents itself and the PDF outline. |
| 2818 |
</p> |
| 2819 |
|
| 2820 |
<div class="macro-id-overline" style="margin-top: 1em"> |
| 2821 |
<h3 id="lists-macros" class="macro-id">Macros to generate Lists</h3> |
| 2822 |
</div> |
| 2823 |
|
| 2824 |
<div class="box-macro-args" style="margin-top: .5em"> |
| 2825 |
Macro: <b>LIST_OF_EQUATIONS</b> |
| 2826 |
<br/> |
| 2827 |
Macro: <b>LIST_OF_FIGURES</b> |
| 2828 |
<br/> |
| 2829 |
Macro: <b>LIST_OF_TABLES</b> |
| 2830 |
<br/> |
| 2831 |
<kbd class="macro-args">Arguments: |
| 2832 |
<br/> |
| 2833 |
[ TITLE_STRING "<string>" ] [ START_PAGENUM <page number> ] |
| 2834 |
</kbd> |
| 2835 |
</div> |
| 2836 |
|
| 2837 |
<p> |
| 2838 |
The first optional argument to the <kbd>LIST_OF_<type></kbd> |
| 2839 |
macros allows you to change the title that appears at the top of the |
| 2840 |
page. This is useful not only for internationalization, or to meet |
| 2841 |
the requirements of various style guides, but is also useful |
| 2842 |
for, say, documents containing musical examples, which, per |
| 2843 |
MLA-style, should be labelled “Example ” or |
| 2844 |
“Ex. ”. When it comes time to output the List of |
| 2845 |
Figures (to which musical examples, usually scanned pdf images, belong), |
| 2846 |
<br/> |
| 2847 |
<span class="pre-in-pp"> |
| 2848 |
LIST_OF_FIGURES TITLE_STRING "List of Examples" |
| 2849 |
</span> |
| 2850 |
ensures that the title of the List is correct. |
| 2851 |
</p> |
| 2852 |
|
| 2853 |
<p> |
| 2854 |
The second optional argument allows you to give a starting page |
| 2855 |
number for a list in cases where mom’s pagination scheme does |
| 2856 |
not provide the List with the starting page number you want. |
| 2857 |
</p> |
| 2858 |
<h3 id="formatting-lists" class="docs">Formatting and style parameters for Lists</h3> |
| 2859 |
|
| 2860 |
<p> |
| 2861 |
Like the Table of Contents, nearly every aspect of Lists can be |
| 2862 |
designed independently of a document’s overall style. By |
| 2863 |
default, Lists follow the formatting and style parameters of the |
| 2864 |
Table of Contents, both mom’s defaults and any changes you may |
| 2865 |
have made to the Table of Contents. |
| 2866 |
</p> |
| 2867 |
|
| 2868 |
<p> |
| 2869 |
If you wish to make changes to any aspect of Lists formatting |
| 2870 |
or styling, the macro <kbd>LISTS_STYLE</kbd> provides all the |
| 2871 |
tools necessary. It is unlikely that you’ll want the |
| 2872 |
formatting of the various list types to differ one from the other, |
| 2873 |
so <kbd>LISTS_STYLE</kbd> applies to all Lists. In the event that |
| 2874 |
you do need to change some aspect of the formatting for different |
| 2875 |
list types, simply invoke <kbd>LISTS_STYLE</kbd> immediately prior |
| 2876 |
to each list whose formatting needs to be changed. |
| 2877 |
</p> |
| 2878 |
|
| 2879 |
<div class="macro-id-overline" style="margin-top: 1em"> |
| 2880 |
<h3 id="lists-style" class="macro-id">Lists style</h3> |
| 2881 |
</div> |
| 2882 |
|
| 2883 |
<div class="box-macro-args" style="margin-top: .5em"> |
| 2884 |
Macro: <b>LISTS_STYLE</b> <kbd class="macro-args"> |
| 2885 |
<br/> |
| 2886 |
Arguments: |
| 2887 |
<br/> |
| 2888 |
FAMILY <family> \ |
| 2889 |
<br/> |
| 2890 |
FONT <font> \ |
| 2891 |
<br/> |
| 2892 |
PT_SIZE <size> \ |
| 2893 |
<br/> |
| 2894 |
LEAD <leading> \ |
| 2895 |
<br/> |
| 2896 |
TITLE_FAMILY <family> \ |
| 2897 |
<br/> |
| 2898 |
TITLE_FONT <font> \ |
| 2899 |
<br/> |
| 2900 |
TITLE_SIZE +|-<size> \ |
| 2901 |
<br/> |
| 2902 |
TITLE_QUAD LEFT | CENTER | RIGHT \ |
| 2903 |
<br/> |
| 2904 |
TITLE_COLOR <color> \ |
| 2905 |
<br/> |
| 2906 |
PN_FAMILY <family> \ |
| 2907 |
<br/> |
| 2908 |
PN_FONT <font> \ |
| 2909 |
<br/> |
| 2910 |
PN_SIZE +|-<size> \ |
| 2911 |
<br/> |
| 2912 |
EQN_PN_PADDING <placeholders> \ |
| 2913 |
<br/> |
| 2914 |
FIG_PN_PADDING <placeholders> \ |
| 2915 |
<br/> |
| 2916 |
TBL_PN_PADDING <placeholders> \ |
| 2917 |
<br/> |
| 2918 |
PAGENUM_STYLE DIGIT | ROMAN | roman | ALPHA | alpha \ |
| 2919 |
<br/> |
| 2920 |
NO_PAGINATION |
| 2921 |
</kbd> |
| 2922 |
</div> |
| 2923 |
|
| 2924 |
<div class="box-tip"> |
| 2925 |
<p class="tip"> |
| 2926 |
<span class="note">Note:</span> |
| 2927 |
Arguments may be broken into several lines using the |
| 2928 |
“line-continued” backslash (<b>\</b>), as shown above. |
| 2929 |
</p> |
| 2930 |
</div> |
| 2931 |
|
| 2932 |
<p> |
| 2933 |
<kbd>FAMILY</kbd> is the family for the entirety of Lists pages. |
| 2934 |
</p> |
| 2935 |
|
| 2936 |
<p> |
| 2937 |
<kbd>FONT</kbd> is the font for the entirety of Lists pages. |
| 2938 |
</p> |
| 2939 |
|
| 2940 |
<p> |
| 2941 |
<kbd>PT_SIZE</kbd> is the base point size for the entirety of Lists |
| 2942 |
pages. |
| 2943 |
</p> |
| 2944 |
|
| 2945 |
<p> |
| 2946 |
<kbd>LEAD</kbd> is the base leading for the entirety of Lists pages. |
| 2947 |
</p> |
| 2948 |
|
| 2949 |
<p> |
| 2950 |
<kbd>TITLE_FAMILY</kbd> is the family for the Lists titles if you |
| 2951 |
want it different from the family otherwise used for the Lists |
| 2952 |
pages. |
| 2953 |
</p> |
| 2954 |
|
| 2955 |
<p> |
| 2956 |
<kbd>TITLE_FONT</kbd> is the font for the Lists titles if you want |
| 2957 |
it different from the font otherwise used for the Lists pages. |
| 2958 |
</p> |
| 2959 |
|
| 2960 |
<p> |
| 2961 |
<kbd>TITLE_SIZE</kbd> tells mom by how much to increase |
| 2962 |
(<kbd>+</kbd>) or decrease (<kbd>-</kbd>) the point size of the |
| 2963 |
titles relative to the overall point size of Lists pages. |
| 2964 |
</p> |
| 2965 |
|
| 2966 |
<p> |
| 2967 |
<kbd>TITLE_QUAD</kbd> tells mom how to position the title |
| 2968 |
horizontally. |
| 2969 |
</p> |
| 2970 |
|
| 2971 |
<p> |
| 2972 |
<kbd>TITLE_COLOR</kbd> sets the colour for the titles. The colour |
| 2973 |
must be pre-initialized with |
| 2974 |
<a href="color.html#newcolor">NEWCOLOR</a> |
| 2975 |
or |
| 2976 |
<a href="color.html#xcolor">XCOLOR</a>. |
| 2977 |
</p> |
| 2978 |
|
| 2979 |
<p> |
| 2980 |
<kbd>PN_FAMILY</kbd> sets the family for entry pagenumbers. |
| 2981 |
</p> |
| 2982 |
|
| 2983 |
<p> |
| 2984 |
<kbd>PN_FONT</kbd> sets the font for entry pagenumbers. |
| 2985 |
</p> |
| 2986 |
|
| 2987 |
<p> |
| 2988 |
<kbd>PN_SIZE</kbd> tells mom by how much to increase (<kbd>+</kbd>) |
| 2989 |
or decrease (<kbd>-</kbd>) the point size of entry pagenumbers |
| 2990 |
relative to the overall point size of Lists pages. |
| 2991 |
</p> |
| 2992 |
|
| 2993 |
<p> |
| 2994 |
<kbd>EQN_PN_PADDING</kbd>, <kbd>FIG_PN_PADDING</kbd>, and |
| 2995 |
<kbd>TBL_PN_PADDING</kbd> tells mom how many placeholders to reserve |
| 2996 |
for the entry pagenumbers in their respective Lists. If, for example, |
| 2997 |
a document with both tables and figures runs to over a hundred |
| 2998 |
pages, but there are no tables after page 99, |
| 2999 |
<br/> |
| 3000 |
<span class="pre-in-pp"> |
| 3001 |
LISTS_STYLE FIG_PN_PADDING 3 |
| 3002 |
LISTS_STYLE TBL_PN_PADDING 2 |
| 3003 |
</span> |
| 3004 |
would prevent an unneeded, reserved placeholder from putting too |
| 3005 |
much space between the leader and the entry pagenumber in the List of |
| 3006 |
Tables. |
| 3007 |
</p> |
| 3008 |
|
| 3009 |
<p> |
| 3010 |
The padding in effect, unless you change it, is whatever was set for |
| 3011 |
the Tables of Contents; mom’s default is “3”. |
| 3012 |
</p> |
| 3013 |
|
| 3014 |
<p> |
| 3015 |
<kbd>PAGENUM_STYLE</kbd> tells mom which pagination format to use |
| 3016 |
for the page numbers of the Lists pages themselves. By default, |
| 3017 |
since Lists observe what is in effect for the Table of Contents, the |
| 3018 |
pagination format is “roman”. Please note that the |
| 3019 |
starting page number for any of the Lists is given as an argument to |
| 3020 |
the |
| 3021 |
<a href="#lists-of">LISTS_0F_<type></a> |
| 3022 |
macro. |
| 3023 |
</p> |
| 3024 |
|
| 3025 |
<p> |
| 3026 |
<kbd>NO_PAGINATION</kbd> disables pagination of Lists pages. |
| 3027 |
</p> |
| 3028 |
|
| 3029 |
<h2 id="box-intro" class="docs">Shaded backgrounds and frames (boxes)</h2> |
| 3030 |
|
| 3031 |
<p> |
| 3032 |
Mom lets you add shaded backgrounds and frames to text and other |
| 3033 |
material. For convenience, she calls backgrounds and frames |
| 3034 |
“boxes.” Entire passages may be boxed, or individual |
| 3035 |
document elements like headings, quotes, or pre-processor output. |
| 3036 |
Furthermore, boxes may be nested. |
| 3037 |
</p> |
| 3038 |
|
| 3039 |
<p> |
| 3040 |
Boxes start on the baseline where the boxed material would have |
| 3041 |
started were it not for the box, subject to minor aesthetic |
| 3042 |
corrections mom takes the liberty of making. |
| 3043 |
</p> |
| 3044 |
|
| 3045 |
<p> |
| 3046 |
Boxes extend from the current left margin to the current right |
| 3047 |
margin, respecting any active left and/or right indents. There are |
| 3048 |
two exceptions, |
| 3049 |
<a href="docelement.html#epigraph">EPIGRAPH BLOCK</a> |
| 3050 |
and |
| 3051 |
<a href="docelement.html#blockquote">BLOCKQUOTE</a>, |
| 3052 |
which are discussed |
| 3053 |
<a href="#quotes">here</a>. |
| 3054 |
</p> |
| 3055 |
|
| 3056 |
<p> |
| 3057 |
After a box is started, active left and right indents are |
| 3058 |
cleared. The box’s inset determines the new left and right |
| 3059 |
margins. Indents set inside a box are relative to the inset. |
| 3060 |
When a box is stopped, formerly active left and right indents |
| 3061 |
are restored. |
| 3062 |
</p> |
| 3063 |
|
| 3064 |
<p> |
| 3065 |
Frames are drawn from the perimeter inward. The inset is |
| 3066 |
relative to the inner edge of the frame. |
| 3067 |
</p> |
| 3068 |
|
| 3069 |
<p> |
| 3070 |
If a box (including the bottom inset) can complete on a page, it |
| 3071 |
does, even if there is no further room for type. This may, on |
| 3072 |
occasion, result in slight deviations from normal bottom margin |
| 3073 |
alignment. |
| 3074 |
</p> |
| 3075 |
|
| 3076 |
<p> |
| 3077 |
Boxes span pages whenever the boxed material continues on the next |
| 3078 |
page. Spanning boxes extend fully to the bottom margin of the page |
| 3079 |
on which they begin, leaving a slightly larger inset at the bottom |
| 3080 |
than around the other sides. |
| 3081 |
</p> |
| 3082 |
|
| 3083 |
<p> |
| 3084 |
When there is not enough room to set at least one line of type |
| 3085 |
inside a box, mom defers starting the box until the next page, |
| 3086 |
leaving a gap. |
| 3087 |
</p> |
| 3088 |
|
| 3089 |
<p> |
| 3090 |
Boxed material is not |
| 3091 |
<a href="docprocessing.html#shim-vs-flex">shimmed</a> |
| 3092 |
or |
| 3093 |
<a href="docprocessing.html#shim-vs-flex">flexed</a>. |
| 3094 |
If either was active prior to the box, it is restored when the box |
| 3095 |
ends and mom automatically shims or flexes whatever comes next. |
| 3096 |
</p> |
| 3097 |
|
| 3098 |
<div class="box-tip"> |
| 3099 |
<p class="tip"> |
| 3100 |
<span class="important">NOTE:</span> |
| 3101 |
Shaded backgrounds and frames are not available when your |
| 3102 |
<a href="docprocessing.html#printstyle">PRINTSTYLE</a> |
| 3103 |
is <kbd>TYPEWRITE</kbd> or when |
| 3104 |
<a href="docprocessing.html#columns">COLUMNS</a> are enabled. |
| 3105 |
</p> |
| 3106 |
</div> |
| 3107 |
|
| 3108 |
<div class="macro-id-overline"> |
| 3109 |
<h3 id="box" class= "macro-id">BOX</h3> |
| 3110 |
</div> |
| 3111 |
|
| 3112 |
<div id="box-macro" class="box-macro-args" style="margin-top: .5em"> |
| 3113 |
Macro: <b>BOX</b> <kbd class="macro-args"> [ <arguments> ] | <anything> |
| 3114 |
<br/> |
| 3115 |
Arguments: |
| 3116 |
<br/> |
| 3117 |
[ SHADED <color> | OUTLINED <colour> ] \ |
| 3118 |
<br/> |
| 3119 |
[ INSET <dist> ] \ |
| 3120 |
<br/> |
| 3121 |
[ WEIGHT <wt> ] \ |
| 3122 |
<br/> |
| 3123 |
[ ADJUST +|-<amount> ] \ |
| 3124 |
<br/> |
| 3125 |
[ EQN | PIC | GRAP | IMG ] |
| 3126 |
</kbd> |
| 3127 |
</div> |
| 3128 |
|
| 3129 |
<p> |
| 3130 |
Without arguments, BOX begins a shaded grey background. |
| 3131 |
The material inside is inset by one |
| 3132 |
<a href="definitions.html#picaspoints">pica</a>. |
| 3133 |
Any other type of box requires at a minimum either |
| 3134 |
<kbd>SHADED</kbd> or <kbd>OUTLINED</kbd>. In the case of boxes |
| 3135 |
that are to contain pdf images or pre-processor material for |
| 3136 |
<a href="#eqn">eqn</a>, |
| 3137 |
<a href="#pic">pic</a>, |
| 3138 |
or |
| 3139 |
<a href="#grap">grap</a>, |
| 3140 |
<kbd>IMG</kbd>, <kbd>EQN</kbd>, <kbd>PIC</kbd>, or <kbd>GRAP</kbd> |
| 3141 |
must also be given. Note that |
| 3142 |
<a href="#tbl">tbl</a> |
| 3143 |
does not have this requirement. |
| 3144 |
</p> |
| 3145 |
|
| 3146 |
<p> |
| 3147 |
BOX is a |
| 3148 |
<a href="definitions.html#toggle">toggle macro</a>, |
| 3149 |
so any argument other than one in the list completes the box |
| 3150 |
(<kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc). |
| 3151 |
</p> |
| 3152 |
|
| 3153 |
<p> |
| 3154 |
Boxes should be started inside toggle macros like |
| 3155 |
<a href="docelement.html#quote">QUOTE</a> |
| 3156 |
or |
| 3157 |
<a href="#float">FLOAT</a> |
| 3158 |
just after the macro is called, and terminated just before toggling |
| 3159 |
the macro off (unless you wish the box to enclose further material). |
| 3160 |
</p> |
| 3161 |
|
| 3162 |
<p> |
| 3163 |
Non-toggle macros like |
| 3164 |
<a href="docelement.html#heading">HEADING</a> |
| 3165 |
or |
| 3166 |
<a href="docelement.html#pp">PP</a> |
| 3167 |
require that the box be started beforehand. Boxed pre-processor |
| 3168 |
material must be fully enclosed by BOX / BOX OFF, as |
| 3169 |
in this recipe for a one-off boxed pic diagram: |
| 3170 |
<span class="pre-in-pp"> |
| 3171 |
.BOX PIC |
| 3172 |
.PS |
| 3173 |
<pic commands> |
| 3174 |
.PE |
| 3175 |
.BOX OFF |
| 3176 |
</span> |
| 3177 |
Arguments to BOX are not sticky. Each time you invoke BOX, you |
| 3178 |
must invoke it with arguments unless you want mom’s default grey |
| 3179 |
background. If all or several boxes in a document require the same |
| 3180 |
arguments, create a macro at the top of the input file that calls |
| 3181 |
BOX with the arguments you want, e.g. |
| 3182 |
<span class="pre-in-pp"> |
| 3183 |
.de PINK_BOX |
| 3184 |
.BOX \ |
| 3185 |
SHADED pink \ |
| 3186 |
OUTLINED darkred \ |
| 3187 |
WEIGHT 1p \ |
| 3188 |
INSET 9p |
| 3189 |
.. |
| 3190 |
</span> |
| 3191 |
<kbd>.PINK_BOX</kbd> may then be used instead of <kbd>.BOX</kbd> any |
| 3192 |
time you want a box with those arguments. |
| 3193 |
</p> |
| 3194 |
|
| 3195 |
<h3 class="docs">SHADED | OUTLINED</h3> |
| 3196 |
|
| 3197 |
<p> |
| 3198 |
<kbd>SHADED</kbd> or <kbd>OUTLINED</kbd> are required. Both may |
| 3199 |
be given, resulting in a shaded background with a frame, and both |
| 3200 |
require a colour, e.g. |
| 3201 |
<span class="pre-in-pp"> |
| 3202 |
.BOX SHADED blue OUTLINED black |
| 3203 |
</span> |
| 3204 |
The colour may be |
| 3205 |
</p> |
| 3206 |
|
| 3207 |
<ul style="margin-top: -1em;"> |
| 3208 |
<li>an xcolor name</li> |
| 3209 |
<li>a colour initialized with |
| 3210 |
<a href="color.html#newcolor">NEWCOLOR</a> |
| 3211 |
or |
| 3212 |
<a href="color.html#xcolor">XCOLOR</a> |
| 3213 |
</li> |
| 3214 |
<li>an RGB hexadecimal string beginning with <kbd>#</kbd> (e.g. #FF0000)</li> |
| 3215 |
</ul> |
| 3216 |
|
| 3217 |
<p> |
| 3218 |
Note that without <kbd>SHADED</kbd>, the above would simply draw a |
| 3219 |
black frame. |
| 3220 |
</p> |
| 3221 |
|
| 3222 |
<h3 class="docs">WEIGHT</h3> |
| 3223 |
|
| 3224 |
<p> |
| 3225 |
Mom’s default weight for <kbd>OUTLINED</kbd> is 1/2 |
| 3226 |
<a href="definitions.html#picaspoints">point</a>. |
| 3227 |
If you’d like to change it, give <kbd>WEIGHT</kbd> the desired |
| 3228 |
value with a unit of measure appended, typically points, e.g. |
| 3229 |
<span class="pre-in-pp"> |
| 3230 |
.BOX OUTLINED black WEIGHT 1p |
| 3231 |
</span> |
| 3232 |
</p> |
| 3233 |
|
| 3234 |
<h3 class="docs">INSET</h3> |
| 3235 |
|
| 3236 |
<p> |
| 3237 |
Mom’s default inset for boxes is one |
| 3238 |
<a href="definitions.html#picaspoints">pica</a> |
| 3239 |
on all sides. If you’d like a larger or smaller inset, give |
| 3240 |
<kbd>INSET</kbd> the distance you want with a unit of measure |
| 3241 |
appended, e.g. |
| 3242 |
<span class="pre-in-pp"> |
| 3243 |
.BOX SHADED pink INSET 2m |
| 3244 |
</span> |
| 3245 |
</p> |
| 3246 |
|
| 3247 |
<h3 class="docs">ADJUST</h3> |
| 3248 |
|
| 3249 |
<p> |
| 3250 |
If you are not happy with the starting position of a box, you can |
| 3251 |
change it by giving <kbd>ADJUST</kbd> the distance you want it |
| 3252 |
raised (-) or lowered (+) with a unit of measure appended. For |
| 3253 |
example, to lower a box three points, |
| 3254 |
<span class="pre-in-pp"> |
| 3255 |
.BOX OUTLINED black ADJUST +3p |
| 3256 |
</span> |
| 3257 |
To raise it, |
| 3258 |
<span class="pre-in-pp"> |
| 3259 |
.BOX OUTLINED black ADJUST -3p |
| 3260 |
</span> |
| 3261 |
</p> |
| 3262 |
|
| 3263 |
<h3 class="docs">PIC / GRAP / EQN / IMG</h3> |
| 3264 |
|
| 3265 |
<p> |
| 3266 |
The <kbd>PIC</kbd> argument must be given to BOX if the box contains |
| 3267 |
any |
| 3268 |
<a href="#pic">pic</a> |
| 3269 |
diagrams. Likewise, graphs made with |
| 3270 |
<a href="#grap">grap</a>, |
| 3271 |
equations made with |
| 3272 |
<a href="#eqn">eqn</a>, |
| 3273 |
and |
| 3274 |
<a href="#pdf-image">pdf images</a> |
| 3275 |
require a corresponding <kbd>GRAP</kbd>, <kbd>EQN</kbd>, or |
| 3276 |
<kbd>IMG</kbd> argument. |
| 3277 |
</p> |
| 3278 |
|
| 3279 |
<p> |
| 3280 |
If you’re boxing a single diagram, graph, or pdf image, wrap |
| 3281 |
it in a float, like this: |
| 3282 |
<span class="pre-in-pp"> |
| 3283 |
.FLOAT |
| 3284 |
.BOX PIC <other parameters> |
| 3285 |
.PS |
| 3286 |
<pic input> |
| 3287 |
.PE |
| 3288 |
.BOX OFF |
| 3289 |
.FLOAT OFF |
| 3290 |
</span> |
| 3291 |
Notice that in the case of pdf images, pic, and grap, this |
| 3292 |
represents a change from the norm, where the use of FLOAT may be |
| 3293 |
destructive and is discouraged. |
| 3294 |
</p> |
| 3295 |
|
| 3296 |
<h2 id="box-notes" class="docs">Additional notes on BOX usage and behaviour</h2> |
| 3297 |
|
| 3298 |
<h3 id="qbef" class="docs">QUOTE, BLOCKQUOTE, EPIGRAPH, FLOAT</h3> |
| 3299 |
|
| 3300 |
<p> |
| 3301 |
<a href="docelement.html#quote">QUOTE</a>, |
| 3302 |
<a href="docelement.html#blockquote">BLOCKQUOTE</a>, |
| 3303 |
<a href="docelement.html#epigraph">EPIGRAPH</a>, |
| 3304 |
and |
| 3305 |
<a href="images.html#float">FLOAT</a> |
| 3306 |
require that boxes be started <i>after</i> they are |
| 3307 |
invoked and stopped just before they are toggled off: |
| 3308 |
<span class="pre-in-pp"> |
| 3309 |
.QUOTE |
| 3310 |
.BOX <parameters> |
| 3311 |
Text of quote |
| 3312 |
.BOX OFF |
| 3313 |
.QUOTE OFF |
| 3314 |
</span> |
| 3315 |
</p> |
| 3316 |
|
| 3317 |
<h3 id="code" class="docs">CODE</h3> |
| 3318 |
|
| 3319 |
<p> |
| 3320 |
If you’re boxing |
| 3321 |
<a href="docelement.html#code">CODE</a> |
| 3322 |
that’s wrapped inside |
| 3323 |
<a href="docelement.html#quote">QUOTE</a>, |
| 3324 |
as described |
| 3325 |
<a href="docelement.html#quote-code">here</a>, |
| 3326 |
set the quote indent to “0” with |
| 3327 |
<span class="pre-in-pp"> |
| 3328 |
.QUOTE_STYLE INDENT 0 |
| 3329 |
</span> |
| 3330 |
so that the box’s leftmost inset is respected. |
| 3331 |
</p> |
| 3332 |
|
| 3333 |
<p> |
| 3334 |
Here’s a recipe for setting boxed code with an 18-point inset: |
| 3335 |
<span class="pre-in-pp"> |
| 3336 |
.QUOTE_STYLE INDENT 0 |
| 3337 |
.QUOTE |
| 3338 |
.CODE |
| 3339 |
.BOX INSET 18p |
| 3340 |
Hello, world. |
| 3341 |
.BOX OFF |
| 3342 |
.QUOTE OFF |
| 3343 |
</span> |
| 3344 |
Note that CODE, wrapped inside QUOTE, does not require a corresponding CODE OFF. |
| 3345 |
</p> |
| 3346 |
|
| 3347 |
<h4 id="quotes" class="docs">Description of boxed BLOCKQUOTES and EPIGRAPH BLOCKS</h4> |
| 3348 |
|
| 3349 |
<p> |
| 3350 |
When you box a BLOCKQUOTE, or an EPIGRAPH with the <kbd>BLOCK</kbd> |
| 3351 |
argument, the box is centred on the page and is only as wide as the |
| 3352 |
blockquote or epigraph plus the box’s inset. |
| 3353 |
</p> |
| 3354 |
|
| 3355 |
<p> |
| 3356 |
QUOTE and EPIGRAPH (without the <kbd>BLOCK</kbd> argument), on the |
| 3357 |
other hand, set the box fully to the left and right margins. |
| 3358 |
</p> |
| 3359 |
|
| 3360 |
<h4 id="leftover" class="docs">Leftover box syndrome</h4> |
| 3361 |
|
| 3362 |
<p> |
| 3363 |
Boxed quotes and blockquotes sometimes exhibit leftover box |
| 3364 |
syndrome, where the page after a fully terminated boxed quote or |
| 3365 |
blockquote begins with an empty bit of box. Equally, you may |
| 3366 |
sometimes see the lower edge of a quote’s or |
| 3367 |
blockquote’s box falling slightly below the page’s |
| 3368 |
bottom margin. |
| 3369 |
</p> |
| 3370 |
|
| 3371 |
<p> |
| 3372 |
The solution in both situations is to use the <kbd>ADJUST</kbd> |
| 3373 |
argument to raise or lower the box’s starting position. |
| 3374 |
Leftover box syndrome is usually fixed by raising the box slightly. |
| 3375 |
When the box runs too deep, lowering it is generally recommended, |
| 3376 |
although this will result in a widowed line at the top of the next |
| 3377 |
page. In either case, some experimentation is necessary. |
| 3378 |
</p> |
| 3379 |
|
| 3380 |
<h3 id="slides" class="docs">SLIDES</h3> |
| 3381 |
|
| 3382 |
<p> |
| 3383 |
On a slide with no pauses, boxes behave as they do in printed |
| 3384 |
documents. |
| 3385 |
</p> |
| 3386 |
|
| 3387 |
<p> |
| 3388 |
When a slide contains pauses, only the material up to the first |
| 3389 |
pause is boxed. As subsequent material is revealed, the box changes |
| 3390 |
location, moving down to surround each new item. This behaviour |
| 3391 |
persists until the box is stopped, making it useful for highlighting |
| 3392 |
material as it is revealed. |
| 3393 |
</p> |
| 3394 |
|
| 3395 |
<h3 id="footnotes" class="docs">Footnotes</h3> |
| 3396 |
|
| 3397 |
<p> |
| 3398 |
You don’t have to worry about boxes encroaching on footnotes. |
| 3399 |
Mom makes sure they don’t. |
| 3400 |
</p> |
| 3401 |
|
| 3402 |
<h2 id="page-color-intro" class="docs">Page colour</h2> |
| 3403 |
|
| 3404 |
<p> |
| 3405 |
Mom lets you change the page (“paper”) colour |
| 3406 |
from white to anything you like. While this has limited application |
| 3407 |
in printed documents, it can be effective in |
| 3408 |
<a href="docprocessing.html#slides">slide presentations</a>. |
| 3409 |
</p> |
| 3410 |
|
| 3411 |
<div class="macro-id-overline"> |
| 3412 |
<h3 id="page-color" class= "macro-id">PAGE_COLOR</h3> |
| 3413 |
</div> |
| 3414 |
|
| 3415 |
<div id="page-color-macro" class="box-macro-args" style="margin-top: .5em"> |
| 3416 |
Macro: <b>PAGE_COLOR</b> <kbd class="macro-args"> <color> | OFF | off</kbd> |
| 3417 |
</div> |
| 3418 |
<p class="requires" style="font-style: normal"> |
| 3419 |
<i>Aliased as</i> <kbd>PAGE_COLOUR</kbd>, <kbd>SLIDE_COLOR</kbd>, |
| 3420 |
<i>and</i> <kbd>SLIDE_COLOUR</kbd>. |
| 3421 |
</p> |
| 3422 |
|
| 3423 |
<p> |
| 3424 |
When you invoke PAGE_COLOR with a <kbd>color</kbd> argument, the |
| 3425 |
current and subsequent pages turn the colour you request. If |
| 3426 |
more than one instance of PAGE_COLOR appears before a page break, |
| 3427 |
including <kbd>PAGE_COLOR OFF</kbd>, only the last applies. |
| 3428 |
</p> |
| 3429 |
|
| 3430 |
<div class="box-tip"> |
| 3431 |
<p class="tip"> |
| 3432 |
<span class="note">Note:</span> |
| 3433 |
Unlike other |
| 3434 |
<a href="definitions.html#toggle">toggle macros</a>, |
| 3435 |
PAGE_COLOR requires the use of <kbd>OFF</kbd> or <kbd>off</kbd> |
| 3436 |
to terminate it rather than an arbitrary string (<kbd>OFF</kbd>, |
| 3437 |
<kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc). |
| 3438 |
</p> |
| 3439 |
</div> |
| 3440 |
|
| 3441 |
<div class="rule-long"><hr/></div> |
| 3442 |
|
| 3443 |
<!-- Navigation links --> |
| 3444 |
<table style="width: 100%; margin-top: 12px;"> |
| 3445 |
<tr> |
| 3446 |
<td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td> |
| 3447 |
<td style="width: 20%; text-align: center;"><a href="#top">Top</a></td> |
| 3448 |
<td style="width: 46%; text-align: right;"><a href="headfootpage.html">Next: Page headers/footers, pagination</a></td> |
| 3449 |
</tr> |
| 3450 |
</table> |
| 3451 |
|
| 3452 |
</div> |
| 3453 |
|
| 3454 |
<div class="bottom-spacer"><br/></div> |
| 3455 |
|
| 3456 |
</body> |
| 3457 |
</html> |