Debian Codegraph @

contrib/mom/momdoc/goodies.html

raw
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 -- Goodies</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="inlines.html#top">Next: Inline escapes</a></td>
38 </tr>
39 </table>
40
41 <h1 id="goodies" class="docs">Goodies</h1>
42
43 <p>
44 The macros in this section are a collection of useful (and sometimes
45 nearly indispensable) routines to simplify typesetting.
46 </p>
47
48 <div id="goodies-macros-mini-toc" style="margin-top: -1em; font-size: 95%;">
49 <div class="mini-toc-col-1">
50 <ul class="no-enumerator">
51 <li class="list-head-goodies"><a href="#alias">ALIAS</a> <span class="normal-smaller">&ndash; rename macros</span></li>
52 <li class="list-head-goodies"><a href="#caps">CAPS</a> <span class="normal-smaller">&ndash; convert to upper case</span></li>
53 <li class="list-head-goodies"><a href="#center-block">CENTER_BLOCK</a> <span class="normal-smaller">&ndash; centre blocks of type with quad intact</span></li>
54 <li class="list-head-goodies"><a href="#esc-char">ESC_CHAR</a> <span class="normal-smaller">&ndash; change the escape character to something other than a backslash</span></li>
55 <li class="list-head-goodies"><a href="#hang">HANG</a> <span class="normal-smaller">&ndash; hang character(s) outside right margin (inline escape)</span></li>
56 <li class="list-head-goodies"><a href="#left-hang">LEFT_HANG</a> <span class="normal-smaller">&ndash; hang character(s) outside left margin</span></li>
57 <li class="list-head-goodies"><a href="#silent">SILENT</a> <span class="normal-smaller">&ndash; hide input lines from output</span></li>
58 <li class="list-head-goodies"><a href="#sizespecs">SIZESPECS</a> <span class="normal-smaller">&ndash; get cap-height, x-height and descender depth of a font</span></li>
59 <li class="list-head-goodies"><a href="#smartquotes">SMARTQUOTES</a> <span class="normal-smaller">&ndash; convert typewriter doublequotes to proper doublequotes</span></li>
60 <li class="list-head-goodies"><a href="#string">STRING</a> <span class="normal-smaller">&ndash; user-definable strings</span></li>
61 <li class="list-head-goodies"><a href="#trap">TRAP</a> <span class="normal-smaller">&ndash; suspend/re-invoke traps</span></li>
62 <li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Underscoring/underlining</span>
63 <ul class="sublist">
64 <li class="list-head-goodies text-color"><a href="#underscore">UNDERSCORE</a> <span class="normal-smaller">&ndash; single underscore</span>
65 <ul class="sublist sub">
66 <li class="list-head-goodies text-color"><a href="#underscore-weight">Controlling the weight of underscores</a></li>
67 <li class="list-head-goodies text-color"><a href="#underscore-color">Colourising underscores</a></li>
68 </ul></li>
69 <li class="list-head-goodies text-color"><a href="#underscore2">UNDERSCORE2</a> <span class="normal-smaller">&ndash; double underscore</span></li>
70 <li class="list-head-goodies text-color"><a href="#underline">UNDERLINE</a>
71 <ul class="sublist sub">
72 <li class="list-head-goodies text-color"><a href="#ul">\*[UL]</a> <span class="normal-sub-sub">&ndash; inline escape to underline</span></li>
73 </ul></li>
74 </ul></li>
75 <li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Padding</span>
76 <ul class="sublist">
77 <li class="list-head-goodies text-color"><a href="#pad">PAD</a> <span class="normal-smaller">&ndash; insert equalized whitespace into lines</span>
78 <ul class="sublist sub">
79 <li class="list-head-goodies text-color"><a href="#pad-marker">PAD_MARKER</a> <span class="normal-sub-sub">&ndash; change/set the marker used with PAD</span></li>
80 </ul></li>
81 </ul></li>
82 </ul>
83 </div>
84 <div class="mini-toc-col-2">
85 <ul class="no-enumerator">
86 <li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Leaders</span>
87 <ul class="sublist">
88 <li class="list-head-goodies text-color"><a href="#leader">\*[LEADER]</a> <span class="normal-smaller">&ndash; inline escape to add leaders to a line</span></li>
89 <li class="list-head-goodies text-color"><a href="#leader-character">LEADER_CHARACTER</a> <span class="normal-smaller">&ndash; change/set the leader character</span></li>
90 </ul></li>
91 <li class="list-head-goodies no-anchor"><span style="font-size: 90%;">Drop caps</span>
92 <ul class="sublist">
93 <li class="list-head-goodies text-color"><a href="#dropcap">DROPCAP</a> <span class="normal-smaller">&ndash; set a drop cap</span></li>
94 <li class="list-head-goodies text-color" style="list-style-type: none;"><a href="#dropcap-support"><span class="normal-smaller" style="font-weight: bold;">Support macros for DROPCAP</span></a>
95 <ul class="sublist sub">
96 <li class="list-head-goodies text-color"><a href="#dropcap-family">DROPCAP_FAMILY</a> <span class="normal-sub-sub">&ndash; change drop cap family</span></li>
97 <li class="list-head-goodies text-color"><a href="#dropcap-font">DROPCAP_FONT</a> <span class="normal-sub-sub">&ndash; change drop cap font</span></li>
98 <li class="list-head-goodies text-color"><a href="#dropcap-adjust">DROPCAP_ADJUST</a> <span class="normal-sub-sub">&ndash; alter size of drop cap</span></li>
99 <li class="list-head-goodies text-color"><a href="#dropcap-color">DROPCAP_COLOR</a> <span class="normal-sub-sub">&ndash; change colour of drop cap</span></li>
100 <li class="list-head-goodies text-color"><a href="#dropcap-gutter">DROPCAP_GUTTER</a> <span class="normal-sub-sub">&ndash; change space between drop cap and running text</span></li>
101 </ul></li>
102 </ul></li>
103 <li class="list-head-goodies text-color no-anchor"><span style="font-size: 90%;">Superscripts</span>
104 <ul class="sublist">
105 <li class="list-head-goodies text-color"><a href="#sup">\*[SUP]</a> <span class="normal-smaller">&ndash; inline escape to set superscripts</span>
106 <ul class="sublist sub">
107 <li class="list-head-goodies text-color"><a href="#sup-raise">SUPERSCRIPT_RAISE_AMOUNT</a> <span class="normal-sub-sub">(control superscript raise amount</span></li>
108 <li class="list-head-goodies text-color"><a href="#cond-or-ext-sup">\*[CONDSUP]</a> <span class="normal-sub-sub">&ndash; condensed superscripts</span></li>
109 <li class="list-head-goodies text-color"><a href="#cond-or-ext-sup">\*[EXTSUP]</a> <span class="normal-sub-sub">&ndash; extended superscripts</span></li>
110 </ul></li>
111 </ul></li>
112 </ul>
113 </div>
114 </div>
115
116 <div class="rule-medium" style="padding-bottom: 1em;"><hr/></div>
117
118 <!-- -ALIAS- -->
119
120 <div class="macro-id-overline">
121 <h3 id="alias" class="macro-id">Rename macros</h3>
122 </div>
123
124 <div class="box-macro-args">
125 Macro: <b>ALIAS</b> <kbd class="macro-args">&lt;new name&gt; &lt;old name&gt;</kbd>
126 </div>
127
128 <p>
129 The ALIAS macro may well be your best friend. With it, you can
130 change the name of a macro to anything you like (provided the new
131 name is not already being used by mom).
132 </p>
133
134 <p>
135 Groff has always been a bit intimidating for new users because
136 its standard macro packages use very terse macro names. Mom
137 doesn&#8217;t like people to feel intimidated; she wants them
138 to feel welcome. Consequently, she tries for easy-to-grasp,
139 self-explanatory macro names. However, mom knows that people have
140 their own ways of thinking, their own preferences, their own habits.
141 Some of her macro names may not suit you; they might be too long,
142 or aren&#8217;t what you automatically think of when you want to
143 do a particular thing, or might conflict with habits you&#8217;ve
144 developed over the years.
145 </p>
146
147 <p>
148 If you don&#8217;t like one of mom&#8217;s macro names, say,
149 PAGEWIDTH, change it, like this:
150 <br/>
151 <span class="pre-in-pp">
152 .ALIAS PW PAGEWIDTH
153 | |
154 new--+ +--official
155 name name
156 </span>
157 The first argument to ALIAS is the new name you want for a macro.
158 The second is the &#8220;official&#8221; name by which the macro is
159 normally invoked. After ALIAS, either can be used.
160 </p>
161
162 <div class="box-tip">
163 <p class="tip">
164 <span class="tip">Tip:</span>
165 A particularly good candidate for ALIAS is the macro
166 <a href="typesetting.html#ps">PT_SIZE</a>.
167 A more natural name for it would simply be PS, but PS conflicts
168 with the <b>eqn</b> equation preprocessor and thus mom uses the
169 longer form. However, if you&#8217;re not using <b>eqn</b>, you can
170 happily rename PT_SIZE to
171 PS:
172 <br/>
173 <span class="pre-in-pp">
174 .ALIAS PS PT_SIZE
175 </span>
176 </p>
177 </div>
178
179 <div class="box-tip">
180 <p class="tip">
181 <span class="note">Note:</span>
182 If you use ALIAS a lot, and always for the same things, consider
183 creating an aliases file of the form
184 <br/>
185 <span class="pre-in-pp">
186 .ALIAS &lt;new name&gt; &lt;old name&gt;
187 .ALIAS &lt;new name&gt; &lt;old name&gt;
188 .ALIAS &lt;new name&gt; &lt;old name&gt;
189 ...etc
190 </span>
191 Put the file someplace convenient and source it (include it) at the
192 beginning of your documents with the
193 <a href="docprocessing.html#include">INCLUDE</a>
194 macro. Assuming that you&#8217;ve created an aliases file called
195 <b>mom-aliases</b> in your home directory under a directory called
196 <b>Mom</b>, you&#8217;d source it by placing
197 <br/>
198 <span class="pre-in-pp">
199 .INCLUDE /home/&lt;username&gt;/Mom/mom-aliases
200 </span>
201 at the top of your documents.
202 </p>
203
204 <p class="tip-bottom">
205 If you share documents that make use of an alias file, remember that
206 other people don&#8217;t have the file. Paste the whole thing at
207 the top of your documents, please.
208 </p>
209 </div>
210
211 <div class="box-tip">
212 <p class="tip">
213 <span class="experts">Experts:</span>
214 ALIAS is an alias of <kbd>.als</kbd>. You can use either, or mix
215 &#8217;n&#8217; match with impunity.
216 </p>
217 </div>
218
219 <!-- -SILENT- -->
220 <div class="macro-id-overline">
221 <h3 id="silent" class="macro-id">Hide input lines from output</h3>
222 </div>
223
224 <div class="box-macro-args">
225 Macro: <b>SILENT</b> <kbd class="macro-args">toggle</kbd>
226 </div>
227
228 <p class="alias" style="margin-bottom: 0;">
229 <i>Alias:</i> <b>COMMENT</b>
230 </p>
231
232 <p>
233 Sometimes, you want to &#8220;hide&#8221;
234 <a href="definitions.html#inputline">input lines</a>
235 from final output. This is most likely to be the case when setting
236 up string tabs (see the
237 <a href="typesetting.html#string-tabs-tut">quickie tutorial on string tabs</a>
238 for an example), but there are other places where you might want
239 input lines to be invisible as well. Any place you don&#8217;t want
240 input lines to appear in the output, use the SILENT macro.
241 </p>
242
243 <p>
244 SILENT is a toggle. Invoking it without an argument turns it on;
245 any argument turns it off. E.g.,
246 <br/>
247 <span class="pre-in-pp">
248 .SILENT
249 A line of text
250 .SILENT OFF
251 </span>
252 The line &#8220;A line of text&#8221; will not appear in the
253 output copy.
254 </p>
255
256 <p>
257 SILENT is aliased as COMMENT. If you want to insert non-printing
258 comments into your documents, you may prefer this.
259 </p>
260
261 <div class="box-tip">
262 <p class="tip">
263 <span class="tip">Tip:</span>
264 SILENT does not automatically break an
265 <a href="definitions.html#inputline">input line</a>
266 (see
267 <a href="typesetting.html#br">BR</a>)
268 when you&#8217;re in one of the
269 <a href="definitions.html#filled">fill modes</a>
270 (<a href="typesetting.html#justify">JUSTIFY</a>
271 or
272 <a href="typesetting.html#quad">QUAD&nbsp;L&nbsp;|&nbsp;R&nbsp;|&nbsp;C&nbsp;|&nbsp;J</a>).
273 The same applies to tabs
274 (<a href="typesetting.html#tab-set">typesetting</a>
275 or
276 <a href="typesetting.html#st">string</a>)
277 to which you&#8217;ve passed the J or QUAD argument. You must
278 insert <kbd>.BR</kbd> yourself, or risk a portion of your text
279 disappearing into a black hole.
280 </p>
281 </div>
282
283 <!-- -TRAP- -->
284
285 <div class="macro-id-overline">
286 <h3 id="trap" class="macro-id">Suspend / re-invoke traps</h3>
287 </div>
288
289 <div class="box-macro-args">
290 Macro: <b>TRAP</b> <kbd class="macro-args">toggle</kbd>
291 </div>
292
293 <p>
294 Traps are vertical positions on the output page at which
295 you or mom have instructed groff to start doing something
296 automatically. Commonly, this is near the bottom of the page, where
297 behind-the-scenes processing is needed in order for one page to
298 finish and another to start.
299 </p>
300
301 <p>
302 Sometimes, traps get sprung when you don&#8217;t want them. If this
303 happens, surround just the offending macros and input lines with
304 <br/>
305 <span class="pre-in-pp">
306 .TRAP OFF
307 ...
308 .TRAP
309 </span>
310 TRAP is a toggle, therefore any argument turns it off (i.e., suspends
311 the trap), and no argument turns it (back) on.
312 </p>
313
314 <!-- -SMARTQUOTES- -->
315
316 <div class="macro-id-overline">
317 <h3 id="smartquotes" class="macro-id">Convert typewriter doublequotes to proper doublequotes</h3>
318 </div>
319
320 <div class="box-macro-args">
321 Macro: <b>SMARTQUOTES</b> <kbd class="macro-args">[&lt;off&gt;] [ ,, | &gt;&gt; | &lt;&lt; ]</kbd>
322 </div>
323
324 <span style="margin-left: .5em">or</span>
325
326 <div class="box-macro-args">
327 Macro: <b>SMARTQUOTES</b> <kbd class="macro-args">DA | DE | ES | FR | IT | NL | NO | PT | SV</kbd>
328 </div>
329
330 <p>
331 If you invoke SMARTQUOTES without an argument, mom converts all
332 instances of the inch-mark, (<kbd>"</kbd>), also called
333 a doublequote, into the appropriate instances of true Anglo-American
334 open-and close-doublequotes. (See
335 <a href="#sq-international">Internationalization</a>
336 for how to get SMARTQUOTES to behave correctly for non-English
337 quoting styles.)
338 </p>
339
340 <p>
341 Typographically, there is a difference between the inch-mark and
342 quotation marks&mdash;a big difference. Sadly, typewriters and computer
343 keyboards supply only one: the inch-mark. While using inches for
344 doublequotes is, and always has been, acceptable in typewriter-style
345 copy, it has never been, and, God willing, never will be acceptable in
346 typeset copy. Failure to turn inches into quotes is the first thing
347 a professional typesetter notices in documents prepared by amateurs.
348 And you don&#8217;t want to look like an amateur, do you?
349 </p>
350
351 <h3 id="sq-international" class="docs">Internationalization</h3>
352 <p>
353 If you invoke SMARTQUOTES with one of the optional arguments
354 (<kbd>,,</kbd> or <kbd>&gt;&gt;</kbd>
355 or <kbd>&lt;&lt;</kbd>) you can use
356 <kbd>&quot;</kbd> (i.e. the inch-mark/doublequotes key)
357 as &#8220;cheap&#8221; open-and close-quotes when inputting text in
358 a language other than English, and have mom convert them, on output,
359 into the chosen open-and close-quote style.
360 </p>
361
362 <p>
363 <kbd>,,</kbd> opens quotes with &#8220;lowered
364 doublequotes&#8221; and closes them with &#8220;raised
365 doublequotes&#8221;, as in this ascii approximation:
366 <br/>
367 <span class="pre-in-pp">
368 ,,Hilfe !``
369 </span>
370
371 <kbd>&gt;&gt;</kbd> opens quotes with guillemets
372 pointing to the right, and closes them with guillemets pointing to
373 the left, as in this ascii approximation:
374 <br/>
375 <span class="pre-in-pp">
376 &gt;&gt;Zurück !&lt;&lt;
377 </span>
378 <kbd>&lt;&lt;</kbd> opens quotes with guillemets
379 pointing to the left, and closes them with guillemets pointing to
380 the right, as in this ascii approximation:
381 <br/>
382 <span class="pre-in-pp">
383 &lt;&lt;Mais monsieur! Je ne suis pas ce genre de fille!&gt;&gt;
384 </span>
385 Please note: the above arguments to SMARTQUOTES are literal
386 ASCII characters. <kbd>,,</kbd> is two commas;
387 <kbd>&lt;&lt;</kbd> is two less-than signs;
388 <kbd>&gt;&gt;</kbd> is two greater-than signs.
389 </p>
390
391 <p>
392 Alternatively, you can pass SMARTQUOTES the two-letter, ISO 639
393 abbreviation for the language you&#8217;re writing in, and mom will
394 output the correct quotes.
395 <br/>
396 <span class="pre-in-pp">
397 .SMARTQUOTES DA = Danish &gt;&gt;text&lt;&lt;
398 .SMARTQUOTES DE = German ,,text``
399 .SMARTQUOTES ES = Spanish ``text´´
400 .SMARTQUOTES FR = French &lt;&lt; text &gt;&gt;
401 .SMARTQUOTES IT = Italian &lt;&lt; text &gt;&gt;
402 .SMARTQUOTES NL = Dutch ´´text´´
403 .SMARTQUOTES NO = Norwegian &lt;&lt;text&gt;&gt;
404 .SMARTQUOTES PT = Portuguese &lt;&lt;text&gt;&gt;
405 .SMARTQUOTES SV = Swedish &gt;&gt;text&gt;&gt;
406 </span>
407 </p>
408
409 <p>
410 Turn SMARTQUOTES off by passing it any argument not in the argument
411 list (e.g. <kbd>OFF</kbd>, <kbd>QUIT</kbd>, <kbd>X</kbd>, etc)
412 </p>
413
414 <p>
415 If you&#8217;re using the
416 <a href="docprocessing.html#docprocessing">document processing macros</a>
417 with
418 <a href="docprocessing.html#printstyle">PRINTSTYLE&nbsp;TYPESET</a>,
419 smartquotes are on by default (in the Anglo-American style); with
420 <a href="docprocessing.html#printstyle">PRINTSTYLE&nbsp;TYPEWRITE</a>,
421 it&#8217;s off by default (and should probably stay that way).
422 </p>
423
424 <p>
425 Finally, if you&#8217;re fussy about the kerning of quote marks in
426 relation to the text they surround, or have special quoting needs,
427 you have to enter quote marks by hand using groff&#8217;s native
428 <a href="definitions.html#inlines">inline escapes</a>
429 for special characters (see <kbd>man&nbsp;groff-char</kbd>
430 for a complete list of special characters). Entering quote marks
431 this way allows you to use mom&#8217;s
432 <a href="inlines.html#inline-kerning-mom">inline kerning escapes</a>
433 to fine-tune the look of quotes.
434 </p>
435
436 <div class="box-tip">
437 <p class="tip">
438 <span class="note">Note:</span>
439 SMARTQUOTES does not work on single quotes, which most people
440 input with the apostrophe (found at the right-hand end of the
441 &#8220;home row&#8221; on a QWERTY keyboard). Groff will interpret
442 all instances of the apostrophe as an apostrophe, making the symbol
443 useless as an open-single-quote. For open single quotes, input
444 the backtick character typically found under the tilde on most
445 keyboards. Here&#8217;s an example of correct input copy with
446 single quotes:
447 <br/>
448 <span class="pre-in-pp">
449 "But she said, `I don&#8217;t want to!'"
450 </span>
451 </p>
452
453 <p class="tip-bottom" style="margin-top: -1em;">
454 <span class="additional-note">Additional note:</span>
455 Whether or not you have SMARTQUOTES turned on, get into the habit of
456 entering the foot-and inch-marks, when you need them, with the
457 <a href="definitions.html#inlines">inline escapes</a>
458 <kbd><span class="nobr">\*[FOOT]</span></kbd> and
459 <kbd><span class="nobr">\*[INCH]</span></kbd>, instead of
460 <kbd>'</kbd> and <kbd>"</kbd>.
461 </p>
462 </div>
463
464 <!-- -CAPS- -->
465
466 <div class="macro-id-overline">
467 <h3 id="caps" class="macro-id">Convert to upper case</h3>
468 </div>
469
470 <div class="box-macro-args">
471 Macro: <b>CAPS</b> <kbd class="macro-args">toggle</kbd>
472 </div>
473
474 <p>
475 CAPS converts all lower case letters to upper case.
476 Primarily, it&#8217;s a support macro used by the
477 <a href="docprocessing.html#docprocessing">document processing macros</a>,
478 but you may find it helpful on occasion. CAPS is a toggle, therefore
479 no argument turns it on, any argument (<kbd>OFF</kbd>,
480 <kbd>QUIT</kbd>, <kbd>X</kbd>, etc) turns it off.
481 <br/>
482 <span class="pre-in-pp">
483 .CAPS
484 All work and no play makes Jack a dull boy.
485 .CAPS OFF
486 </span>
487
488 produces, on output
489 <br/>
490 <span class="pre-in-pp">
491 ALL WORK AND NO PLAY MAKES JACK A DULL BOY.
492 </span>
493 If you wish to capitalise a section of type inline, use the
494 <a href="definitions.html#inlines">inline escapes</a>,
495 <a href="inlines.html#uc-lc"><kbd><span class="nobr">\*[UC]...\*[LC]</span></kbd></a>
496 like this:
497 <br/>
498 <span class="pre-in-pp">
499 All work \*[UC]and\*[LC] no play makes Jack a dull boy.
500 </span>
501
502 The above produces, on output
503 <br/>
504 <span class="pre-in-pp">
505 All work AND no play makes Jack a dull boy.
506 </span>
507 </p>
508
509 <div class="box-tip">
510 <p class="tip">
511 <span class="note">Note:</span>
512 <kbd>\*[LC]</kbd> must come after a terminating period.
513 <br/>
514 <span class="pre-in-pp">
515 \*[UC]All work and no play makes Jack a dull boy.\*[LC]
516 </span>
517 not
518 <span class="pre-in-pp">
519 \*[UC]All work and no play makes Jack a dull boy\*[LC].
520 </span>
521 Conversely, an initial period must come <em>before</em>
522 <kbd>\*[UC]</kbd>, or be preceded by <kbd>\&amp;</kbd>, like this:
523 <br/>
524 <span class="pre-in-pp">
525 .\*[UC]start\*[LC] is used to begin document processing.
526 </span>
527 or
528 <span class="pre-in-pp">
529 \*[UC]\&amp;.start\*[LC] is used to begin document processing.
530 </span>
531 Upon output, either will produce
532 <br/>
533 <span class="pre-in-pp">
534 START is used to begin document processing.
535 </span>
536 </p>
537 </div>
538
539 <!-- -STRING- -->
540
541 <div class="macro-id-overline">
542 <h3 id="string" class="macro-id">User-defined strings</h3>
543 </div>
544
545 <div class="box-macro-args">
546 Macro: <b>STRING</b> <kbd class="macro-args">&lt;name&gt; &lt;what you want in the string&gt;</kbd>
547 </div>
548
549 <p>
550 You may find sometimes that you have to type out portions of text
551 repeatedly. If you&#8217;d like not to wear out your fingers, you can
552 define a string that, whenever you call it by name, outputs whatever
553 you put into it.
554 </p>
555
556 <p>
557 For example, say you&#8217;re creating a document that repeatedly uses
558 the phrase &#8220;the Montreal/Windsor corridor&#8221;. Instead
559 of typing all that out every time, you could define a string, like
560 this:
561 <br/>
562 <span class="pre-in-pp">
563 .STRING mw the Montreal/Windsor corridor
564 </span>
565 Once a string is defined, you can call it any time with the
566 <a href="definitions.html#inlines">inline escape</a>
567 <kbd><span class="nobr">\*[&lt;name&gt;]</span></kbd>. Using the example
568 string above
569 <br/>
570 <span class="pre-in-pp">
571 The schedule for trains along \*[mw]:
572 </span>
573 produces, on output
574 <br/>
575 <span class="pre-in-pp">
576 The schedule for trains along the Montreal/Windsor corridor:
577 </span>
578 </p>
579
580 <div class="box-tip">
581 <p class="tip">
582 <span class="note">Note:</span>
583 Be very careful not to put any spaces at the ends of strings
584 you&#8217;re defining, unless you want them. Everything after
585 the name argument you pass to STRING goes into the string,
586 including trailing spaces. It&#8217;s a good idea to get into the
587 habit of using groff&#8217;s native commenting mechanism, <kbd
588 class="bold">\"</kbd>, immediately following any string definition
589 in order to avoid spaces you can&#8217;t see, like this
590 <br/>
591 <span class="pre-in-pp">
592 .STRING mw the Montreal/Windsor corridor\"
593 </span>
594 </p>
595 </div>
596
597 <div class="box-tip">
598 <p class="tip">
599 <span class="experts">Experts:</span>
600 STRING is an alias for <b>ds</b>. You can use either, or mix
601 &#8217;n&#8217; match with impunity.
602 </p>
603 </div>
604
605 <!-- -ESC_CHAR- -->
606
607 <div class="macro-id-overline">
608 <h3 id="esc-char" class="macro-id">Change the escape character</h3>
609 </div>
610
611 <div class="box-macro-args">
612 Macro: <b>ESC_CHAR</b> <kbd class="macro-args">&lt;new character&gt; | &lt;anything&gt;</kbd>
613 </div>
614
615 <p>
616 Groff&#8217;s and mom&#8217;s default escape character is
617 the backslash. Sometimes, you may want to include a literal
618 backslash in your document. There are two ways to accomplish
619 this. One is simply to double the backslash character (<kbd
620 class="bold">\\</kbd>), which is convenient if you don&#8217;t have
621 a lot of backslashes to input. If you need to input a whole batch
622 of backslashes (say, when including code snippets in your document),
623 you can use ESC_CHAR to make the change permanent (until you decide
624 to restore the escape character to its default, the backslash).
625 </p>
626
627 <p>
628 ESC_CHAR with a single character argument changes the escape
629 character to whatever the argument is. ESC_CHAR with no argument
630 restores the escape character to the backslash.
631 </p>
632
633 <div class="box-tip">
634 <p class="tip">
635 <span class="important">Important:</span>
636 Changing the escape character prevents macros, which require that
637 the backslash be the escape character, from functioning correctly.
638 Do not introduce any subsequent macros without first restoring the
639 escape character to its default.
640 </p>
641 </div>
642
643 <div class="box-tip">
644 <p class="tip">
645 <span class="experts">Experts:</span>
646 ESC_CHAR is an alias of <kbd>.ec</kbd>. Mix &#8217;n&#8217; match
647 the two with impunity.
648 </p>
649 </div>
650
651 <!-- -SIZESPECS- -->
652
653 <div class="macro-id-overline">
654 <h3 id="sizespecs" class="macro-id">Get cap-height, x-height and descender depth of a font</h3>
655 </div>
656
657 <div class="box-macro-args">
658 Macro: <b>SIZESPECS</b>
659 </div>
660
661 <p>
662 Whenever you need to get the
663 <a href="definitions.html#capheight">cap-height</a>,
664 <a href="definitions.html#xheight">x-height</a>
665 or
666 <a href="definitions.html#descender">descender</a>
667 depth of type at the current point size, invoke <kbd
668 class="bold">.SIZESPECS</kbd>, which takes no argument.
669 The dimensions are stored in the string registers
670 <b><span class="nobr">\*[$CAP_HEIGHT]</span></b>,
671 <b><span class="nobr">\*[$X_HEIGHT]</span></b>,
672 and
673 <b><span class="nobr">\*[$DESCENDER]</span></b>, respectively, in
674 <a href="definitions.html#units">machine units</a>
675 to which the
676 <a href="definitions.html#unitofmeasure">unit of measure</a>,
677 <b>u</b>, is already appended.
678 </p>
679
680 <p>
681 Thus, if you wanted to advance 2 inches from your current position
682 on the page plus the cap-height of the current point size of type
683 <br/>
684 <span class="pre-in-pp">
685 .PT_SIZE &lt;n&gt;
686 .SIZESPECS
687 .ALD 2i+\*[$CAP_HEIGHT]
688 </span>
689 would do the trick.
690 </p>
691
692 <!-- -UNDERSCORE- -->
693
694 <div class="macro-id-overline">
695 <h3 id="underscore" class="macro-id">Single underscore</h3>
696 </div>
697
698 <div class="box-macro-args">
699 Macro: <b>UNDERSCORE</b> <kbd class="macro-args">[ &lt;distance below baseline&gt; ] [ PREFIX &lt;prefix&gt; ] [ SUFFIX &lt;suffix&gt; ] &quot;&lt;string&gt;&quot;</kbd>
700 </div>
701
702 <p class="requires">
703 &bull;&nbsp;&lt;distance below baseline&gt; requires a <a href="definitions.html#unitofmeasure">unit of measure</a>
704 </p>
705
706 <p>
707 By default, UNDERSCORE places an underscore 2 points beneath the
708 required
709 <a href="definitions.html#stringargument">string argument</a>.
710 The string must be enclosed in double-quotes, like this:
711 <br/>
712 <span class="pre-in-pp">
713 .UNDERSCORE "Unmonitored monopolies breed high prices and poor products"
714 </span>
715 If you wish to change the distance of the rule from the baseline,
716 use the optional argument
717 <kbd>&lt;distance&nbsp;below&nbsp;baseline&gt;</kbd>
718 (with a unit of measure).
719 <br/>
720 <span class="pre-in-pp">
721 .UNDERSCORE 3p "Unmonitored monopolies breed high prices and poor products"
722 </span>
723 The above places the upper edge of the underscore 3 points below the
724 <a href="definitions.html#baseline">baseline</a>.
725 </p>
726
727 <div class="box-tip">
728 <p class="tip">
729 <span class="note">Tip:</span>
730 UNDERSCORE can also be used for strikethrough effects by supplying a
731 negative value to the distance argument.
732 </p>
733 </div>
734
735 <p>
736 <kbd>PREFIX</kbd> and <kbd>SUFFIX</kbd> allow you to add
737 non-underscored punctuation (or other glyphs) to the beginning
738 and/or end of the underscored string. If the argument to either
739 <kbd>PREFIX</kbd> or <kbd>SUFFIX</kbd> contains spaces, surround the
740 argument with double-quotes. For example, the following underscores
741 the text string but not the surrounding punctuation.
742 <br/>
743 <span class="pre-in-pp">
744 .UNDERSCORE PREFIX ( SUFFIX .) "Unmonitored monopolies breed high prices and poor products"
745 </span>
746 </p>
747
748 <div class="box-tip">
749 <p class="tip">
750 <span class="note">Note:</span>
751 UNDERSCORE does not work across line breaks in output copy, which is
752 to say that you can&#8217;t underscore a multi-line passage simply
753 by putting the text of the whole thing in the string you pass to
754 UNDERSCORE. If you need to underscore several lines of type, use
755 <a href="#underline">UNDERLINE</a>.
756 </p>
757 </div>
758
759 <div class="box-tip">
760 <p class="tip">
761 <span class="note">Additional note:</span>
762 In
763 <a href="definitions.html#filled">nofill modes</a>,
764 UNDERSCORE causes a break before and after, meaning the underscored
765 word or phrase will appear as a separate line in your output. If
766 you wish to embed an underscored word or phrase into non-filled
767 text, temporarily change to the corresponding fill mode with
768 <a href="typesetting.html#quad">QUAD</a>
769 and insert breaks manually with
770 <a href="typesetting.html#br">BR</a>
771 as appropriate, reverting to the original nofill mode afterwards.
772 </p>
773 </div>
774
775 <h3 id="underscore-weight" class="docs">Controlling the weight of underscores</h3>
776 <p>
777 The weight (thickness) of underscores may be controlled with the
778 macro UNDERSCORE_WEIGHT. Thus, if you want underscores with a
779 weight of 1-1/2 points, you&#8217;d invoke:
780 <br/>
781 <span class="pre-in-pp">
782 .UNDERSCORE_WEIGHT 1.5
783 </span>
784 prior to invoking <kbd>.UNDERSCORE</kbd>. Every
785 subsequent instance of <kbd>.UNDERSCORE</kbd> will use
786 this weight.
787 </p>
788
789 <p>
790 Mom&#8217;s default underscore weight is 1/2 point.
791 </p>
792
793 <div class="box-tip">
794 <p class="tip">
795 <span class="note">Note:</span>
796 UNDERSCORE_WEIGHT also sets the weight of
797 <a href="#UNDERSCORE2">double underscores.</a>
798 </p>
799 </div>
800
801 <h3 id="underscore-color" class="docs">Colourising underscored text</h3>
802 <p>
803 If you want underscored text to be in a different colour from the
804 text around it, use the
805 <a href="color.html#color">COLOR</a>
806 macro rather than the
807 <a href="color.html#color-inline">inline escape for changing colour</a>.
808 In other words, assuming your prevailing text colour is black and
809 you want underscored text in red
810 <br/>
811 <span class="pre-in-pp">
812 .COLOR red
813 .UNDERSCORE "text to underscore"
814 .COLOR black
815 </span>
816 rather than
817 <br/>
818 <span class="pre-in-pp">
819 .UNDERSCORE "\*[red]text to underscore\*[black]"
820 </span>
821 The latter will render the text in red but the underscore in black.
822 You can, of course, use this to create rainbow effects if that's
823 what you want, e.g. text in red, underscore in blue, and prevailing
824 type in black:
825 <br/>
826 <span class="pre-in-pp">
827 .UNDERSCORE "\*[red]text to underscore\*[blue]"
828 .COLOR black
829 </span>
830 </p>
831
832 <!-- -UNDERSCORE2- -->
833
834 <div class="macro-id-overline">
835 <h3 id="underscore2" class="macro-id">Double underscore</h3>
836 </div>
837
838 <div class="box-macro-args">
839 Macro: <b>UNDERSCORE2</b> <kbd class="macro-args">[ &lt;distance below baseline&gt; [ &lt;distance between rules&gt; ] [ PREFIX &lt;prefix&gt; ] [ SUFFIX &lt;suffix&gt; ] &quot;&lt;string&gt;&quot;</kbd>
840 </div>
841
842 <p class="requires">
843 &bull;&nbsp;&lt;distance below baseline&gt;
844 and
845 &lt;distance between rules&gt;
846 require a <a href="definitions.html#unitofmeasure">unit of measure</a>
847 </p>
848
849 <p>
850 By default, UNDERSCORE2 places a double underscore 2 points beneath
851 the required
852 <a href="definitions.html#stringargument">string argument</a>.
853 The string must be enclosed in double-quotes, like this:
854 <br/>
855 <span class="pre-in-pp">
856 .UNDERSCORE2 "Unmonitored monopolies breed high prices and poor products"
857 </span>
858 The default distance between the two rules is 2 points, measured
859 from the bottom edge of the upper rule to the top edge of the lower
860 one.
861 </p>
862
863 <p>
864 If you wish to change the distance of the double underscore from the
865 <a href="definitions.html#baseline">baseline</a>,
866 use the optional argument
867 <kbd>&lt;distance&nbsp;below&nbsp;baseline&gt;</kbd>
868 (with a unit of measure), e.g.
869 <br/>
870 <span class="pre-in-pp">
871 .UNDERSCORE2 3p "Unmonitored monopolies breed high prices and poor products"
872 </span>
873 which places the upper edge of the first rule of the double
874 underscore 3 points below the baseline.
875 </p>
876
877 <p>
878 If you wish to change the distance between the two rules as well,
879 use the second optional argument
880 <kbd>&lt;distance&nbsp;between&nbsp;rules&gt;</kbd>
881 (with a unit of measure). The distance between the two rules
882 is measured from the bottom edge of the upper rule to the top
883 edge of the lower one. Be aware that you must give a value for
884 <kbd>&lt;distance&nbsp;below&nbsp;baseline&gt;</kbd> if you want to
885 use <kbd>&lt;distance&nbsp;between&nbsp;rules&gt;</kbd>.
886 </p>
887
888 <p>
889 <kbd>PREFIX</kbd> and <kbd>SUFFIX</kbd> allow you to add
890 non-underscored punctuation (or other glyphs) to the beginning
891 and/or end of the double-underscored string. If the argument to
892 either <kbd>PREFIX</kbd> or <kbd>SUFFIX</kbd> contains spaces,
893 surround the argument with double-quotes. For example, the
894 following double-underscores the text string but not the surrounding
895 punctuation.
896 <br/>
897 <span class="pre-in-pp">
898 .UNDERSCORE2 PREFIX ( SUFFIX .) "Unmonitored monopolies breed high prices and poor products"
899 </span>
900 The weight (thickness) of double underscores may be controlled with
901 the macro
902 <a href="#underscore-weight">UNDERSCORE_WEIGHT</a>
903 (q.v).
904 </p>
905
906 <p>
907 See
908 <a href="#underscore-color">here</a>
909 for advice on colourising double-underscored text.
910 </p>
911
912 <div class="box-tip">
913 <p class="tip">
914 <span class="note">Note:</span>
915 In
916 <a href="definitions.html#filled">nofill modes</a>,
917 UNDERSCORE2 causes a break before and after, meaning the double-underscored
918 word or phrase will appear as a separate line in your output. If
919 you wish to embed a double-underscored word or phrase into non-filled
920 text, temporarily change to the corresponding fill mode with
921 <a href="typesetting.html#quad">QUAD</a>
922 and insert breaks manually with
923 <a href="typesetting.html#br">BR</a>
924 as appropriate, reverting to the original nofill mode afterwards.
925 </p>
926 </div>
927
928 <!-- -UNDERLINE- -->
929 <div class="macro-id-overline">
930 <h3 id="underline" class="macro-id">Underline</h3>
931 </div>
932
933 <div class="box-macro-args">
934 Macro: <b>UNDERLINE</b> <kbd class="macro-args">toggle</kbd>
935 </div>
936
937 <p>
938 The distinction between underscoring and underlining is that
939 underscoring is suitable for occasional effects (a word here,
940 a phrase there), whereas underlining underlines whole passages
941 of type. Furthermore, you cannot colourise underlining.
942 There&#8217;s a special macro,
943 <a href="#underline-specs">UNDERLINE_SPECS</a>,
944 to control the weight and distance from the baseline of the
945 underline.
946 </p>
947
948 <p>
949 Lastly, files that use UNDERLINE must be processed with
950 <br/>
951 <span class="pre-in-pp">
952 pdfmom -Tps filename.mom &gt; filename.pdf
953 </span>
954 since groff&#8217;s pdf driver does not recognize UNDERLINE.
955 </p>
956
957 <p>
958 Note that
959 <a href="docprocessing.html#printstyle">PRINTSTYLE&nbsp;TYPEWRITE</a>
960 uses UNDERLINE to underline italics
961 and pseudo-italics (<a href="typesetting.html#slant-inline">SLANT</a>)
962 by default. The default may be changed (see
963 <a href="docprocessing.html#printstyle-italics">Underlining of italics</a>)
964 but if it's what you want, you must process your document as shown
965 above.
966 </p>
967
968 <p>
969 UNDERLINE is a toggle macro, therefore you invoke it by itself (i.e.
970 with no argument) to initiate underlining, and with any argument
971 (<kbd>OFF</kbd>, <kbd>QUIT</kbd>, <kbd>END</kbd>, <kbd>X</kbd>, etc)
972 to turn it off.
973 </p>
974
975 <div class="box-tip">
976 <p class="tip-top">
977 <span class="note">Note:</span>
978 Underlining may also be turned on and off
979 <a href="definitions.html#inlines">inline</a>
980 with the escapes
981 <a href="#ul"><kbd><span class="nobr">\*[UL]...\*[ULX]</span></kbd></a>.
982 </p>
983
984 <p class="tip-bottom">
985 <span class="additional-note">Additional note:</span>
986 In document processing, neither <kbd>.UNDERLINE</kbd> nor
987 <kbd><span class="nobr">\*[UL]</span></kbd> persist past the current document element tag.
988 For example, if you turn underlining on in a paragraph
989 (<kbd><a href="docelement.html#pp">.PP</a></kbd>),
990 your next paragraph will not be underlined.
991 </p>
992 </div>
993
994 <h4 id="underline-specs" class="docs">UNDERLINE_SPECS</h4>
995
996 <p>
997 The weight of underlining and the distance from the baseline is
998 set with
999 <br/>
1000 <span class="pre-in-pp">
1001 .UNDERLINE_SPECS &lt;weight&gt; &lt;distance&gt;
1002 </span>
1003 The <kbd>&lt;weight&gt;</kbd> argument can be expressed in any
1004 <a href="definitions.html#unitofmeasure">unit of measure</a>
1005 you like, but points is the most usual. Mom&#8217;s default is 1/2 point
1006 (.5p). The same holds for the <kbd>&lt;distance&gt;</kbd> argument;
1007 mom&#8217;s default is 1-1/4 points (1.25p).
1008 </p>
1009
1010 <!-- -UL- -->
1011
1012 <h4 id="ul" class="docs">INLINE ESCAPE FOR UNDERLINING</h4>
1013
1014 <p>
1015 The macro pair,
1016 <kbd><a href="#underline">.UNDERLINE</a></kbd> /
1017 <kbd>.UNDERLINE&nbsp;OFF</kbd>, and the inline escapes,
1018 <span class="nobr"><kbd>\*[UL]</kbd> / <kbd>\*[ULX]</kbd></span>, are
1019 functionally identical, hence, in
1020 <a href="definitions.html#filled">fill</a>
1021 modes
1022 <br/>
1023 <span class="pre-in-pp">
1024 Which should I heed?
1025 .UNDERLINE
1026 Just do it
1027 .UNDERLINE OFF
1028 or
1029 .UNDERLINE
1030 just say no?
1031 .UNDERLINE OFF
1032 </span>
1033 produces the same result as
1034 <br/>
1035 <span class="pre-in-pp">
1036 Which should I heed? \*[UL]Just do it\*[ULX] or \*[UL]just say no?\*[ULX]
1037 </span>
1038 In either case, this is a misuse of UNDERLINE.
1039 <a href="#underscore">UNDERSCORE</a>
1040 is preferable.
1041 </p>
1042
1043 <!-- -PAD- -->
1044
1045 <div class="macro-id-overline">
1046 <h3 id="pad" class="macro-id">Insert equalized whitespace into lines</h3>
1047 </div>
1048
1049 <div class="box-macro-args">
1050 Macro: <b>PAD</b> <kbd class="macro-args">&quot;&lt;string with pad markers inserted&gt;&quot; [ NOBREAK ]</kbd>
1051 </div>
1052
1053 <p>
1054 With PAD, you can insert proportional amounts of whitespace into a
1055 line. The optional <kbd id="nobreak" class="bold">NOBREAK</kbd>
1056 argument tells mom not to advance on the page after the PAD macro
1057 has been invoked.
1058 </p>
1059
1060 <p>
1061 PAD calculates the difference between the length of text on the line
1062 and the distance remaining to its end, then inserts the difference
1063 (as whitespace) at the place(s) you specify.
1064 </p>
1065
1066 <p>
1067 Take, for example, the following relatively common typesetting
1068 situation, found at the bottom of legal agreements:
1069 <br/>
1070 <span class="pre">
1071 Date Signature |
1072 </span>
1073 </p>
1074
1075 <p>
1076 The person signing the agreement is supposed to fill in the date
1077 as well as a signature. Space needs to be left for both, but the
1078 exact amount is neither known, nor important. All that matters is
1079 that there be a little space after Date, and rather more space after
1080 Signature. (In the above, <kbd>|</kbd> represents the
1081 end of the line at the prevailing line length.)
1082 </p>
1083
1084 <p>
1085 The
1086 <a href="goodies.html#pad-marker">pad marker</a>
1087 (see below) is <kbd>#</kbd> (the pound or number sign
1088 on your keyboard) and can be used multiple times in a line. With
1089 that in mind, here&#8217;s how you&#8217;d input the Date/Signature line
1090 (assuming a length of 30 picas):
1091 <br/>
1092 <span class="pre">
1093 .LL 30P
1094 .PAD "Date#Signature###"
1095 </span>
1096 </p>
1097
1098 <p>
1099 When the line is output, the space remaining on the line, after
1100 &quot;Date&quot; and &quot;Signature&quot; have been taken into
1101 account, is split into four (because there are four # signs). One
1102 quarter of the space is inserted between Date and Signature, the
1103 remainder is inserted after Signature.
1104 </p>
1105
1106 <div class="examples-container">
1107 <h3 id="pad-example" class="docs notes">Example of PAD usage</h3>
1108 <p style="margin-top: .5em;">
1109 One rarely wants merely to insert space in a line; one usually wants
1110 to fill it with something, hence PAD is particularly useful in
1111 conjunction with
1112 <a href="typesetting.html#string-tabs">string tabs</a>.
1113 The following uses the Date/Signature example, above, but adds
1114 rules into the whitespace through the use of string tabs and
1115 mom&#8217;s
1116 <a href="definitions.html#inlines">inline escape</a>
1117 <a href="inlines.html#inline-rule-mom"><kbd><span class="nobr">\*[RULE]</span></kbd></a>.
1118 <br/>
1119 <span class="pre-in-pp">
1120 .LL 30P
1121 .PAD "Date \*[ST1]#\*[ST1X] Signature \*[ST2]###\*[ST2X]" NOBREAK
1122 .ST 1 J
1123 .ST 2 J
1124 .TAB 1
1125 \*[RULE]
1126 .TN
1127 \*[RULE]
1128 .TQ
1129 </span>
1130 </p>
1131
1132 <p>
1133 Here&#8217;s what the example does:
1134 </p>
1135 <ol style="margin-top: -.5em; margin-bottom: -.5em;">
1136 <li>Pads the Date/Signature line with a shorter space for Date
1137 (<kbd>#</kbd>) and a longer space for Signature
1138 (<kbd>###</kbd>), encloses the padded space with string tabs
1139 markers, and outputs the line without advancing on the page.
1140 </li>
1141 <li>Sets the quad for the two string tabs (in this instance, justified).
1142 </li>
1143 <li>Calls the first string tab and draws a rule to its full
1144 length.
1145 </li>
1146 <li>Calls the second tab with
1147 <a href="typesetting.html#tn">TN</a>
1148 (which moves to tab 2 and stays on the same baseline)
1149 then draws a rule to the full length of string tab 2.
1150 </li>
1151 </ol>
1152
1153 <p>
1154 Often, when setting up string tabs this way, you don&#8217;t want the
1155 padded line to print immediately. To accomplish this, use
1156 <kbd><a href="#silent">SILENT</a></kbd>.
1157 See the
1158 <a href="typesetting.html#string-tabs-tut">quickie tutorial on string tabs</a>
1159 for an example.
1160 </p>
1161 </div>
1162
1163 <div class="box-tip">
1164 <p class="tip-top">
1165 <span class="note">Note:</span>
1166 Because the pound sign
1167 (<kbd>#</kbd>) is used as the pad marker, you
1168 can&#8217;t use it as a literal part of the pad string. If you need
1169 the sign to appear in the text of a padded line, change the pad
1170 marker with
1171 <kbd><a href="#pad-marker">PAD_MARKER</a></kbd>.
1172 Also, be aware that <kbd>#</kbd> as a pad marker
1173 only applies within the PAD macro; at all other times it prints
1174 literally, just as you&#8217;d expect.
1175 </p>
1176
1177 <p class="tip-bottom">
1178 Another important consideration when using PAD is that because the
1179 string must be enclosed in double-quotes, you can&#8217;t use the
1180 double-quote (<kbd>"</kbd>) as part of the string. The
1181 way to circumvent this is to use the groff
1182 <a href="definitions.html#inlines">inline escapes</a>
1183 <kbd>\(lq</kbd> and <kbd>\(rq</kbd>
1184 (leftquote and rightquote respectively) whenever double-quotes are
1185 required in the string passed to PAD.
1186 </p>
1187 </div>
1188
1189 <!-- -PAD_MARKER- -->
1190
1191 <div class="macro-id-overline">
1192 <h3 id="pad-marker" class="macro-id">Change/set the marker used with PAD</h3>
1193 </div>
1194
1195 <div class="box-macro-args">
1196 Macro: <b>PAD_MARKER</b> <kbd class="macro-args">"&lt;character to use as the pad marker&gt;</kbd>
1197 </div>
1198
1199 <p>
1200 If you need to change mom&#8217;s default pad marker (<kbd
1201 class="bold">#</kbd>), either because you want a literal # in
1202 the padded line, or simply because you want to use another character
1203 instead, use PAD_MARKER, whose argument is the new pad marker
1204 character you want.
1205 <br/>
1206 <span class="pre-in-pp">
1207 .PAD_MARKER @
1208 </span>
1209 changes the pad marker to <kbd>@</kbd>.
1210 </p>
1211
1212 <p>
1213 Once you&#8217;ve changed the pad marker, the new marker remains in effect
1214 for every instance of
1215 <a href="#pad">PAD</a>
1216 until you change it again (say, back to the pound sign).
1217 </p>
1218
1219 <!-- -\*[LEADER]- -->
1220
1221 <div class="macro-id-overline">
1222 <h3 id="leader" class="macro-id">Inline escape to add leaders to a line</h3>
1223 </div>
1224
1225 <div class="box-macro-args">
1226 Inline: <b>\*[LEADER]</b>
1227 </div>
1228
1229 <p>
1230 Whenever you want to fill a line or tab with
1231 <a href="definitions.html#leader">leaders</a>,
1232 use the
1233 <a href="definitions.html#inlines">inline escape</a>
1234 <kbd><span class="nobr">\*[LEADER]</span></kbd>. The remainder of the line or
1235 tab will be filled with the leader character. Mom&#8217;s default
1236 leader character is a period (dot), but you can change it to any
1237 character you like with
1238 <kbd><a href="#leader-character">LEADER_CHARACTER</a></kbd>.
1239 </p>
1240
1241 <div class="box-tip">
1242 <p class="tip-top">
1243 <span class="note">Note:</span>
1244 <kbd>\*[LEADER]</kbd> fills lines or tabs right to
1245 their end. You cannot insert leaders into a line or tab and have
1246 text following the leader on the same line or in the same tab.
1247 Should you wish to achieve such an effect typographically, create
1248 tabs for each element of the line and fill them appropriately with
1249 the text and leaders you need.
1250 <a href="typesetting.html#string-tabs">String tabs</a>
1251 are perfect for this. An example follows.
1252 <br/>
1253 <span class="pre">
1254 .LL 30P
1255 .PAD "Date\*[ST1]#\*[ST1X] Signature\*[ST2]###\*[ST2X]" NOBREAK
1256 .EL
1257 .ST 1 J
1258 .ST 2 J
1259 .TAB 1
1260 \*[LEADER]
1261 .TN
1262 \*[LEADER]
1263 .TQ
1264 </span>
1265 </p>
1266
1267 <p class="tip-bottom">
1268 The PAD line sets the words Date and Signature, and marks string
1269 tabs around the pad space inserted in the line. The string tabs are
1270 then &quot;set&quot;, called, and filled with leaders. The result
1271 looks like this:
1272 <br/>
1273 <span class="pre" style="margin-bottom: -1em;">
1274 Date.............Signature.....................................
1275 </span>
1276 </p>
1277 </div>
1278
1279 <!-- -LEADER_CHARACTER- -->
1280
1281 <div class="macro-id-overline">
1282 <h3 id="leader-character" class="macro-id">Change/set the leader character</h3>
1283 </div>
1284
1285 <div class="box-macro-args">
1286 Macro: <b>LEADER_CHARACTER</b> <kbd class="macro-args">&lt;character&gt;</kbd>
1287 </div>
1288
1289 <p>
1290 LEADER_CHARACTER takes one argument: a single character you would
1291 like to be used for
1292 <a href="definitions.html#leader">leaders</a>.
1293 (See
1294 <a href="#leader"><kbd><span class="nobr">\*[LEADER]</span></kbd></a>
1295 for an explanation of how to fill lines with leaders.)
1296 </p>
1297
1298 <p>
1299 For example, to change the leader character from mom&#8217;s
1300 default (a period) to the underscore character, enter
1301 <br/>
1302 <span class="pre-in-pp">
1303 .LEADER_CHARACTER _
1304 </span>
1305 </p>
1306
1307 <div class="box-tip">
1308 <p class="tip">
1309 <span class="tip">Tip:</span>
1310 A particularly useful function of LEADER_CHARACTER is that it can be
1311 used to increase the spacing of mom&#8217;s default leaders. This is
1312 done by assigning to LEADER_CHARACTER both the period (dot) and a
1313 space. The technique requires a little low-level groffing:
1314 <br/>
1315 <span class="pre-in-pp">
1316 .char \[leader] . \"
1317 .LEADER_CHARACTER \[leader]
1318 </span>
1319 The <kbd>.char</kbd>
1320 <a href="definitions.html#primitives">primitive</a>
1321 allows you to define a character called <kbd>leader</kbd>, to which
1322 you assign a period and a space. The <kbd>\"</kbd>, which, in
1323 groff, is used to add non-printing comments to a line, is not
1324 strictly necessary. Its presence here lets you see that
1325 there&#8217;s a space after the period.
1326 </p>
1327 </div>
1328
1329 <!-- -DROPCAP- -->
1330
1331 <div class="macro-id-overline">
1332 <h3 id="dropcap" class="macro-id">Drop caps</h3>
1333 </div>
1334
1335 <div class="box-macro-args">
1336 Macro: <b>DROPCAP</b> <kbd class="macro-args">&lt;dropcap letter&gt; &lt;number of lines to drop&gt; [ COND &lt;percentage&gt; | EXT &lt;percentage&gt; ]</kbd>
1337 </div>
1338
1339 <p>
1340 The first two arguments to DROPCAP are the letter you want to be the
1341 <a href="definitions.html#dropcap">drop cap</a>
1342 and the number of lines you want it to drop. By default, mom uses
1343 the current family and font for the drop cap.
1344 </p>
1345
1346 <p>
1347 The optional argument (<kbd>COND</kbd> or <kbd>EXT</kbd>) indicates
1348 that you want the drop cap condensed (narrower) or extended (wider).
1349 If you use <kbd class="bold">COND</kbd> or <kbd>EXT</kbd>, you must
1350 follow the argument with the percentage of the letter&#8217;s normal
1351 width you want it condensed or extended. No percent sign
1352 (<kbd>%</kbd>) is required.
1353 </p>
1354
1355 <p>
1356 Mom will do her very best to get the drop cap to line up with the
1357 first line of text indented beside it, then set the correct number
1358 of indented lines, and restore your left margin when the number of
1359 drop cap lines has been reached.
1360 </p>
1361
1362 <p>
1363 Beginning a paragraph with a drop cap &#8220;T&#8221; looks like this:
1364 <br/>
1365 <span class="pre">
1366 .DROPCAP T 3 COND 90
1367 he thousand injuries of Fortunato I had borne as best I
1368 could, but when he ventured upon insult, I vowed revenge.
1369 You who so well know the nature of my soul will not suppose,
1370 however, that I gave utterance to a threat...
1371 </span>
1372 </p>
1373
1374 <p>
1375 The drop cap, slightly condensed but in the current family and font,
1376 will be three lines tall, with whatever text fills those three
1377 lines indented to the right of the letter. The remainder of the
1378 paragraph&#8217;s text will revert to the left margin.
1379 </p>
1380
1381 <div class="box-tip">
1382 <p class="tip">
1383 <span class="note">Note:</span>
1384 When using the
1385 <a href="docprocessing.html#docprocessing">document processing macro</a>
1386 <a href="docelement.html#pp">PP</a>,
1387 DROPCAP only works
1388 </p>
1389 <ul style="margin-top: -1em; margin-bottom: -.5em;">
1390 <li>with initial paragraphs (i.e. at the start of the document,
1391 or after
1392 <a href="docelement.html#heading">HEADING</a>),</li>
1393 <li>when <kbd>.DROPCAP</kbd> comes immediately after <kbd>.PP</kbd>,</li>
1394 <li>the
1395 <a href="docprocessing.html#printstyle">PRINTSTYLE</a>
1396 is TYPESET.</li>
1397 </ul>
1398 <p>
1399 If these conditions aren&#8217;t met, DROPCAP is silently ignored.
1400 </p>
1401
1402 <p class="tip-bottom" style="margin-top: -1em;">
1403 <span class="additional-note">Additional note:</span>
1404 If you have dropcaps after
1405 <a href="docelement.html#heading">HEADING</a>s,
1406 you must increase the <kbd>NEEDS</kbd> argument to
1407 <a href="docelement.html#heading-style">HEADING_STYLE</a>
1408 to match the number of dropcap lines. For example, assuming
1409 dropcaps that are three lines tall:
1410 <br/>
1411 <span class="pre-in-pp">
1412 .HEADING_STYLE 1 NEEDS 3
1413 </span>
1414 </p>
1415 </div>
1416
1417 <div class="box-important">
1418 <p class="tip">
1419 <span class="important">Warning:</span>
1420 DROPCAP puts a bit of a strain on resource-challenged systems. If
1421 you have such a system and use drop caps extensively in a document,
1422 be prepared for a wait while mom does her thing.
1423 </p>
1424 </div>
1425
1426 <h3 id="dropcap-support" class="docs control-macros-header">Support macros for DROPCAP</h3>
1427 <p>
1428 Drop caps are the bane of most typesetters&#8217; existence.
1429 It&#8217;s very difficult to get the size of the drop cap right
1430 for the number of drop lines, especially if the drop cap is in a
1431 different family from the prevailing family of running text. Not
1432 only that, but there&#8217;s the gutter around the drop cap to take
1433 into account, plus the fact that the letter may be too wide or too
1434 narrow to look anything but odd or misplaced.
1435 </p>
1436
1437 <p>
1438 Mom solves the last of these problems with the <kbd>COND</kbd> and
1439 <kbd>EXT</kbd> arguments. The rest she solves with macros that
1440 change the default behaviour of DROPCAP, namely
1441 </p>
1442 <ul class="no-enumerator" style="margin-top: -.5em; margin-left: -.5em;">
1443 <li><a href="#dropcap-family">DROPCAP_FAMILY</a></li>
1444 <li><a href="#dropcap-font">DROPCAP_FONT</a></li>
1445 <li><a href="#dropcap-color">DROPCAP_COLOR</a></li>
1446 <li><a href="#dropcap-adjust">DROPCAP_ADJUST</a></li>
1447 <li><a href="#dropcap-gutter">DROPCAP_GUTTER</a></li>
1448 </ul>
1449
1450 <p style="margin-top: -.5em;">
1451 These macros must, of course, come before you invoke DROPCAP.
1452 </p>
1453
1454 <h3 id="dropcap-family" class="control-macro">&bull;&nbsp;DROPCAP_FAMILY</h3>
1455 <p style="margin-left: .66em;">
1456 Set the drop cap family by giving DROPCAP_FAMILY the name of the
1457 family you want, e.g.
1458 <br/>
1459 <span class="pre-in-pp">
1460 .DROPCAP_FAMILY H
1461 </span>
1462 which will set the family to Helvetica for the drop cap only.
1463 </p>
1464
1465 <h3 id="dropcap-font" class="control-macro">&bull;&nbsp;DROPCAP_FONT</h3>
1466 <p style="margin-left: .66em;">
1467 Set the drop cap font by giving DROPCAP_FONT the name of the font
1468 you want, e.g.
1469 <br/>
1470 <span class="pre-in-pp">
1471 .DROPCAP_FONT I
1472 </span>
1473 which will set the font to italic for the drop cap only.
1474 </p>
1475
1476 <h3 id="dropcap-adjust" class="control-macro">&bull;&nbsp;DROPCAP_ADJUST</h3>
1477 <p style="margin-left: .66em;">
1478 If the size mom calculates for the drop cap isn&#8217;t precisely
1479 what you want, you can increase or decrease it with DROPCAP_ADJUST,
1480 like this: e.g.
1481 <br/>
1482 <span class="pre-in-pp">
1483 .DROPCAP_ADJUST +1
1484 </span>
1485 or
1486 <br/>
1487 <span class="pre">
1488 .DROPCAP_ADJUST -.75
1489 </span>
1490 </p>
1491
1492 <p style="margin-left: .66em;">
1493 DROPCAP_ADJUST only understands
1494 <a href="definitions.html#picaspoints">points</a>,
1495 therefore do not append any
1496 <a href="definitions.html#unitofmeasure">unit of measure</a>
1497 to the argument. And always be sure to prepend the plus or
1498 minus sign, depending on whether you want the drop cap larger or
1499 smaller.
1500 </p>
1501
1502 <h3 id="dropcap-color" class="control-macro">&bull;&nbsp;DROPCAP_COLOR</h3>
1503 <p style="margin-left: .66em;">
1504 If you&#8217;d like your drop cap colourized, simply invoke
1505 <kbd>.DROPCAP_COLOR&nbsp;&lt;color&gt;</kbd> with the name of a
1506 colour you&#8217;ve already created (&#8220;initialized&#8221;) with
1507 <a href="color.html#newcolor">NEWCOLOR</a>
1508 or
1509 <a href="color.html#xcolor">XCOLOR</a>.
1510 Only the drop cap will be colourized; all other text will remain at
1511 the current colour default (usually black).
1512 </p>
1513
1514 <h3 id="dropcap-gutter" class="control-macro">&bull;&nbsp;DROPCAP_GUTTER</h3>
1515 <p style="margin-left: .66em;">
1516 By default, mom puts three points of space between the drop cap
1517 and the text indented beside it. If you want another value, use
1518 DROPCAP_GUTTER (with a unit of measure), like this:
1519 <br/>
1520 <span class="pre-in-pp">
1521 .DROPCAP_GUTTER 6p
1522 </span>
1523 </p>
1524
1525 <!-- -\*[SUP]- -->
1526
1527 <div class="macro-id-overline">
1528 <h3 id="sup" class="macro-id">Superscript</h3>
1529 </div>
1530
1531 <div class="box-macro-args">
1532 Inlines: <kbd>\*[SUP]...\*[SUPX]</kbd>
1533 </div>
1534
1535 <p>
1536 Superscripts are accomplished
1537 <a href="definitions.html#inlines">inline</a>.
1538 Whenever you need one, typically for numerals, all you need
1539 to do is surround the superscript with the inlines above.
1540 <kbd><span class="nobr">\*[SUP]</span></kbd> begins superscripting;
1541 <kbd><span class="nobr">\*[SUPX]</span></kbd> turns it off.
1542 </p>
1543
1544 <p id="cond-or-ext-sup">
1545 If your running type is
1546 <a href="typesetting.html#cond-inline">pseudo-condensed</a>
1547 or
1548 <a href="typesetting.html#ext-inline">pseudo-extended</a>
1549 and you want your superscripts to be equivalently pseudo-condensed
1550 or -extended, use
1551 <br/>
1552 <kbd><span class="nobr">\*[CONDSUP]...\*[CONDSUPX]</span></kbd> or
1553 <kbd><span class="nobr">\*[EXTSUP]...\*[EXTSUPX]</span></kbd>.
1554 </p>
1555
1556 <p>
1557 The superscript inlines are primarily used by the
1558 <a href="docprocessing.html#docprocessing">document processing macros</a>
1559 for automatic generation of numbered footnotes. However, you may
1560 find them useful for other purposes.
1561 </p>
1562
1563 <div class="box-tip">
1564 <p class="tip">
1565 <span class="note">Note:</span>
1566 Mom does a pretty fine job of making superscripts look good in any
1567 font and at any size. If you&#8217;re fussy, though (and I am),
1568 about precise vertical placement, kerning, weight, size, and so on,
1569 you may want to roll your own solution.
1570 </p>
1571 </div>
1572
1573 <h3 id="sup-raise" class="docs">SUPERSCRIPT RAISE AMOUNT</h3>
1574 <p>
1575 By default, mom raises superscripts 1/3 of an
1576 <a href="definitions.html#em">em</a>
1577 above the baseline. If you&#8217;re not happy with this default,
1578 you can change it by invoking SUPERSCRIPT_RAISE_AMOUNT with the
1579 amount you want them raised. A
1580 <a href="definitions.html#unitofmeasure">unit of measure</a>
1581 must be appended directly to the amount. Thus, if you want
1582 superscripts raised by 3
1583 <a href="definitions.html#picaspoints">points</a>
1584 instead of 1/3 em, you&#8217;d do
1585 <br/>
1586 <span class="pre-in-pp">
1587 .SUPERSCRIPT_RAISE_AMOUNT 3p
1588 </span>
1589 and all subsequent superscripts would be raised by 3 points.
1590 </p>
1591
1592 <!-- -CENTER BLOCK- -->
1593
1594 <div class="macro-id-overline">
1595 <h3 id="center-block" class="macro-id">Centre blocks of type</h3>
1596 </div>
1597
1598 <div class="box-macro-args">
1599 Macro: <b>CENTER_BLOCK</b> <kbd class="macro-args">&lt;toggle&gt;</kbd>
1600 </div>
1601
1602 <p>
1603 Blocks of type sometimes need to be centred on the page with their quad
1604 direction (left, centre, right) left intact. The
1605 document processing macros
1606 <a href="docelement.html#quote">QUOTE</a>
1607 and
1608 <a href="docelement.html#blockquote">BLOCKQUOTE</a>
1609 take care of this automatically, but there are other situations
1610 where you may want to centre blocks of type. An example might be
1611 left-quadded
1612 <a href="docelement.html#list-intro">nested lists</a>.
1613 </p>
1614
1615 <p>
1616 Whenever you want to centre a block of type on the page, surround it
1617 with <kbd>.CENTER_BLOCK/.CENTER_BLOCK OFF</kbd> (or <kbd>QUIT</kbd>,
1618 <kbd>X</kbd>, etc).
1619 </p>
1620
1621 <div class="macro-id-overline">
1622 <h3 id="left-hang" class="macro-id">Hanging characters</h3>
1623 </div>
1624 <br/>
1625 <div class="box-macro-args">
1626 Macro: <b>LEFT_HANG</b> <kbd class="macro-args">&lt;character&gt; [ &lt;gutter&gt;</kbd> ]
1627 </div>
1628 <p class="requires">
1629 &bull;&nbsp;left-hung characters
1630 </p>
1631
1632 <div class="box-macro-args" style="margin-top: 1em">
1633 Inline: <b>\*[HANG <kbd class="macro-args">&lt;character&gt;</kbd>]</b>
1634 </div>
1635 <p class="requires">
1636 &bull;&nbsp;right-hung characters
1637 </p>
1638
1639 <p>
1640 Hung characters, frequently punctuation, fall outside the left or
1641 right margin. Their purpose is usually to fine-tune justification.
1642 Consider the following:
1643 </p>
1644
1645 <table style="margin-left: 3%; margin-right: 6%; text-align: justify">
1646 <tr>
1647 <td style="padding-right: 1em">
1648 &#8220;Play the man, Master Ridley; we
1649 shall this day light such a candle,
1650 by God's grace, in England, as I
1651 trust shall never be put out.&#8221;
1652 </td>
1653 <td>
1654 &nbsp;&nbsp;
1655 </td>
1656 <td style="margin-right: 0; padding-right: 0">
1657 &#8220;
1658 <br/>
1659 <br/>
1660 <br/>
1661 </td>
1662 <td style="margin-left: 0; padding-left: 0">
1663 Play the man, Master Ridley; we
1664 shall this day light such a candle,
1665 by God's grace, in England, as I
1666 trust shall never be put out.&#8221;</td>
1667 </tr>
1668 </table>
1669
1670 <p>
1671 In the right hand example, the opening double-quote hangs outside
1672 the left margin, creating a uniform left margin for the text.
1673 </p>
1674
1675 <h4 class="docs">Left hung characters</h4>
1676
1677 <p>
1678 LEFT_HANG hangs its first argument, the character to be hung, to
1679 the left of the left margin. The optional second argument lets you
1680 specify an amount of space to insert between the hung character and
1681 the text.
1682 </p>
1683
1684 <p>
1685 Input text after LEFT_HANG must begin with the character to be hung
1686 PLUS a
1687 <a href="inlines.html#inline-horizontal-mom">horizontal motion</a>
1688 corresponding to <kbd>&lt;gutter&gt;</kbd> if one was given.
1689 If the hung character is a left double-quote, <kbd>\[lq]</kbd>
1690 must be used as the argument to LEFT_HANG and the usual keyboard
1691 double-quote (<kbd>"</kbd>) entered as the input text so as not to
1692 confuse
1693 <a href="goodies.html#smartquotes">SMARTQUOTES</a>
1694 The following example demonstrates:
1695 <br/>
1696 <span class="pre-in-pp">
1697 .LEFT_HANG \[lq] 1p
1698 "\*[FWD 1p]This line will have its opening double-quote
1699 plus one point of space hung outside the left margin."
1700 </span>
1701 </p>
1702
1703 <p style="margin-top: -1em">
1704 Note that what follows LEFT_HANG must be an input line and therefore
1705 it cannot be used to left-hang a
1706 <a href="docelement.html#heading">HEADING</a>
1707 character.
1708 </p>
1709
1710 <div class="box-tip">
1711 <p class="tip">
1712 <span class="important">Important:</span>
1713 Versions of mom lower than 2.5_a that included LEFT_HANG required
1714 that the character and its gutter be entered as a single,
1715 concatenated argument, using horizontal motions to establish the
1716 gutter
1717 (e.g.
1718 <a href="inlines.html#inline-horizontal-mom">FWD</a>,
1719 <a href="inlines.html#inline-horizontal-mom">BCK</a>).
1720 Documents created with versions prior to 2.5_a may have to be
1721 updated.
1722 </p>
1723 </div>
1724
1725 <h4 class="docs">Right hung characters</h4>
1726
1727 <p>
1728 The <kbd>\*[HANG&nbsp;c]</kbd> inline escape hangs its argument outside
1729 the right margin of justified or quad right copy. The argument may
1730 be a single character, or a single character preceded by a
1731 horizontal motion, effectively establishing a gutter between the
1732 right margin and the hung character:
1733 <br/>
1734 <span class="pre-in-pp" style="margin-bottom: .25em">
1735 This line will have its closing period hung outside
1736 the right margin with a one point gutter\*[HANG \*[FWD 1p].]
1737 </span>
1738 If the hung character is a right double-quote, <kbd>"\[rq]"</kbd>
1739 must be used as the argument (that is, the <kbd>\[rq]</kbd>
1740 character surrounded by double-quotes). The double-quotes are
1741 required for all special characters of the form
1742 <kbd style="whitespace: nowrap">\[name]</kbd>.
1743 Horizontal motion, if any, must fall inside the double-quotes:
1744 <br/>
1745 <span class="pre-in-pp">
1746 ...and they all lived happily ever after.\*[HANG "\*[FWD 1p]\[rq]"]
1747 </span>
1748 </p>
1749
1750 <p>
1751 If the hung character is a hyphen,
1752 <kbd style="whitespace: nowrap"><span class="nobr">\*[HANG&nbsp;-]</span></kbd>
1753 must come at the end of an
1754 <a href="definitions.html#inputline">input line</a>.
1755 This restriction does not apply to other characters, which may come
1756 anywhere in an input line provided that, on output, the line breaks
1757 at the point you introduced the hung character.
1758 </p>
1759
1760 <p>
1761 For the exceptionally fussy, <kbd>\*[HANG]</kbd> may also be used to
1762 improve visual centring; when text is centred, <kbd
1763 style="whitespace: nowrap">\*[HANG&nbsp;c]</kbd>
1764 hangs the character to the right of the centred line instead of the
1765 margin.
1766 </p>
1767
1768 <div class="rule-long"><hr/></div>
1769
1770 <!-- Navigation links -->
1771 <table style="width: 100%; margin-top: 12px;">
1772 <tr>
1773 <td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td>
1774 <td style="width: 33%; text-align: center;"><a href="#top">Top</a></td>
1775 <td style="width: 33%; text-align: right;"><a href="inlines.html#top">Next: Inline escapes</a></td>
1776 </tr>
1777 </table>
1778
1779 </div>
1780
1781 <div class="bottom-spacer"><br/></div>
1782
1783 </body>
1784 </html>