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