1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 2 <html> 3 <head> 4 <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 5 <title>Mom -- Goodies</title> 6 </head> 7 <body bgcolor="#dfdfdf"> 8 9 <!====================================================================> 10 11 <a href="inlines.html#TOP">Next</a> 12 <a href="typesetting.html#TOP">Prev</a> 13 <a href="toc.html">Back to Table of Contents</a> 14 <p> 15 <a name="TOP"></a> 16 <a name="GOODIES"> 17 <h1 align="center"><u>Goodies</u></h1> 18 </a> 19 <p> 20 <a name="INTRO_GOODIES"></a> 21 The macros in this section are a collection of useful (and sometimes 22 nearly indispensable) routines to simplify typesetting. 23 <p> 24 <a name="INDEX_GOODIES"> 25 <h3><u>Goodies list</u></h3> 26 </a> 27 28 <ul> 29 <li><a href="#ALIAS">ALIAS</a> (rename macros) 30 <li><a href="#SILENT">SILENT</a> ("hide" input lines from output) 31 <li><a href="#TRAP">TRAP</a> (suspend/re-invoke traps) 32 <li><a href="#SMARTQUOTES">SMARTQUOTES</a> (convert typewriter doublequotes to proper doublequotes) 33 <li><a href="#CAPS">CAPS</a> (convert to upper case) 34 <li><a href="#STRING">STRING</a> (user-definable strings) 35 <br> 36 <li><strong>Underscore/underline</strong> 37 <ul> 38 <li><a href="#UNDERSCORE">UNDERSCORE</a> (single underscore) 39 <li><a href="#UNDERSCORE2">UNDERSCORE2</a> (double underscore) 40 <li><a href="#UNDERLINE">UNDERLINE</a> (underline -- Courier only!) 41 <li><a href="#UL">\*[UL]</a> (inline escape to underline -- Courier only!) 42 </ul> 43 <li><strong>Padding</strong> 44 <ul> 45 <li><a href="#PAD">PAD</a> (insert equalized space into lines) 46 <li><a href="#PAD_MARKER">PAD_MARKER</a> (change/set the marker used with <strong>PAD</strong>) 47 </ul> 48 <li><strong>Leaders</strong> 49 <ul> 50 <li><a href="#LEADER">\*[LEADER]</a> (inline escape to add leaders to a line) 51 <li><a href="#LEADER_CHARACTER">LEADER_CHARACTER</a> (change/set the leader character) 52 </ul> 53 <li><strong>Drop caps</strong> 54 <ul> 55 <li><a href="#DROPCAP">DROPCAP</a> (set a drop cap) 56 <li><strong>Support macros for DROPCAP</strong> 57 <ul> 58 <li><a href="#DROPCAP_FAMILY">DROPCAP_FAMILY</a> (change drop cap family) 59 <li><a href="#DROPCAP_FONT">DROPCAP_FONT</a> (change drop cap font) 60 <li><a href="#DROPCAP_ADJUST">DROPCAP_ADJUST</a> (alter size of drop cap) 61 <li><a href="#DROPCAP_COLOR">DROPCAP_COLOR</a> (change colour of drop cap) 62 <li><a href="#DROPCAP_GUTTER">DROPCAP_GUTTER</a> (change space between drop cap and running text) 63 </ul> 64 </ul> 65 <li><strong>Superscripts</strong> 66 <ul> 67 <li><a href="#SUP">\*[SUP]</a> (set superscript) 68 <li><a href="#CONDSUP">\*[CONDSUP]</a> (set condensed superscript) 69 <li><a href="#EXTSUP">\*[EXTSUP]</a> (set extended superscript) 70 </ul> 71 <li><strong>Lists</strong> 72 <ul> 73 <li><a href="docelement.html#LIST_INTRO">Introduction to lists</a> 74 <li><a href="docelement.html#LIST">LIST</a> 75 <li><a href="docelement.html#ITEM">ITEM</a> 76 <li><a href="docelement.html#SHIFT_LIST">SHIFT_LIST</a> 77 <li><a href="docelement.html#RESET_LIST">RESET_LIST</a> 78 <li><a href="docelement.html#PAD_LIST_DIGITS">PAD_LIST_DIGITS</a> 79 </ul> 80 </ul> 81 82 <!---ALIAS---> 83 84 <hr width="66%" align="left"> 85 <a name="ALIAS"><h3><u>Rename macros</u></h3></a> 86 <br> 87 <nobr>Macro: <strong>ALIAS</strong> <new name> <old name></nobr> 88 89 <p> 90 The <strong>ALIAS</strong> macro may well be your best friend. With it, 91 you can change the name of a macro to anything you like 92 (provided the new name is not already being used by 93 <strong>mom</strong>; see the 94 <a href="reserved.html#RESERVED">list of reserved words</a>). 95 <p> 96 Groff has always been a bit intimidating for new users because 97 its standard macro packages use very terse macro names. 98 <strong>Mom</strong> doesn't like people to feel intimidated; she wants 99 them to feel welcome. Consequently, she tries for easy-to-grasp, 100 self-explanatory macro names. However, <strong>mom</strong> knows 101 that people have their own ways of thinking, their own preferences, 102 their own habits. Some of her macro names may not suit you; they 103 might be too long, or aren't what you automatically think of 104 when you want to do a particular thing, or might conflict with habits 105 you've developed over the years. 106 <p> 107 If you don't like one of <strong>mom</strong>'s macro names, 108 say, PAGEWIDTH, change it, like this: 109 <p> 110 <pre> 111 .ALIAS PW PAGEWIDTH 112 | | 113 new__| |__official 114 name name 115 </pre> 116 117 The first argument to <strong>ALIAS</strong> is the new name you want 118 for a macro. The second is the "official" name by 119 which the macro is normally invoked. After <strong>ALIAS</strong>, 120 either can be used. 121 <p> 122 Note that in <strong>ALIAS</strong>, you do NOT include the period 123 (dot) that precedes the macro when it's a 124 <a href="definitions.html#TERMS_CONTROLLINES">control line</a>. 125 <p> 126 <strong>NOTE:</strong> If you use <strong>ALIAS</strong> a lot, 127 and always for the same things, consider creating an aliases 128 file of the form 129 <p> 130 <pre> 131 .ALIAS <new name> <old name> 132 .ALIAS <new name> <old name> 133 .ALIAS <new name> <old name> 134 ...etc 135 </pre> 136 137 Put the file someplace convenient and source it at the 138 beginning of your documents using the groff 139 <a href="definitions.html#TERMS_PRIMITIVES">primitive</a> 140 <strong>.so</strong>. Assuming that you've created an aliases file 141 called mom_aliases in your home directory under a directory 142 called <code>Mom</code>, you'd source it by placing 143 <p> 144 <pre> 145 .so /home/<username>/Mom/mom_aliases 146 </pre> 147 148 at the top of your documents. 149 <p> 150 If you share documents that make use of an alias file, remember that 151 other people don't have the file! Paste the whole thing at the top 152 of your documents, please. 153 <p> 154 <strong>EXPERTS:</strong> <strong>ALIAS</strong> is an alias of 155 <code>.als</code>. You can use either, or mix 'n' match with 156 impunity. 157 <p> 158 159 <!---SILENT---> 160 161 <hr width="66%" align="left"> 162 <a name="SILENT"><h3><u>Hide input lines from output</u></h3></a> 163 <br> 164 <nobr>Macro: <strong>SILENT</strong> toggle</nobr> 165 <br> 166 Alias: <strong>COMMENT</strong> 167 168 <p> 169 Sometimes, you want to "hide" 170 <a href="definitions.html#TERMS_INPUTLINE">input lines</a> 171 from final output. This is most likely to be the case when setting 172 up string tabs (see the 173 <a href="STRING_TABS_TUT">quickie tutorial on string tabs</a> 174 for an example), but there are other places where you might want input 175 lines to be invisible as well. Any place you don't want input lines 176 to appear in the output, use the <strong>SILENT</strong> macro. 177 <p> 178 <strong>SILENT</strong> is a toggle. Invoking it without an argument 179 turns it on; any argument turns it off. E.g., 180 <p> 181 <pre> 182 .SILENT 183 A line of text 184 .SILENT OFF 185 </pre> 186 187 The line "A line of text" will not appear in the 188 output copy. 189 <p> 190 <strong>SILENT</strong> is aliased as <strong>COMMENT</strong>. 191 If you want to insert non-printing comments into your documents, 192 you may prefer this. 193 <p> 194 <strong>NOTE: SILENT</strong> does not automatically break an 195 <a href="definitions.html#TERMS_INPUTLINE">input line</a> 196 (see 197 <a href="typesetting.html#BR">BR</a>) 198 when you're in one of the 199 <a href="definitions.html#TERMS_FILLED">fill modes</a> 200 (<a href="typesetting.html#JUSTIFY">JUSTIFY</a> 201 or 202 <a href="typesetting.html#QUAD">QUAD L | R | C | J</a>). 203 The same applies to tabs 204 (<a href="typesetting.html#TAB_SET">typesetting</a> 205 or 206 <a href="typesetting.html#ST">string</a>) 207 to which you've passed the <strong>J</strong> or <strong>QUAD</strong> 208 argument. You must insert <code>.BR</code> yourself, or risk a 209 portion of your text disappearing into a black hole. 210 <p> 211 212 <!---TRAP---> 213 214 <hr width="66%" align="left"> 215 <a name="TRAP"><h3><u>Suspend/re-invoke traps</u></h3></a> 216 <br> 217 <nobr>Macro: <strong>TRAP</strong> toggle</nobr> 218 219 <p> 220 Traps are vertical positions on the output page at which you or 221 <strong>mom</strong> have instructed groff to start doing 222 something automatically. Commonly, this is near the bottom of 223 the page, where automatic behind-the-scenes processing is needed 224 in order for one page to finish and another to start. 225 <p> 226 Sometimes, traps get sprung when you don't want them. If this 227 happens, surround just the offending macros and input lines with 228 <p> 229 <pre> 230 .TRAP OFF 231 ... 232 .TRAP 233 </pre> 234 235 <strong>TRAP</strong> is a toggle, therefore any argument 236 turns it off (i.e. suspends the trap), and no argument turns it 237 (back) on. 238 <p> 239 240 <!---SMARTQUOTES---> 241 242 <hr width="66%" align="left"> 243 <a name="SMARTQUOTES"><h3><u>Convert typewriter doublequotes to proper doublequotes</u></h3></a> 244 <br> 245 <nobr>Macro: <strong>SMARTQUOTES</strong> [<off>] [ ,, | >> | << ]</nobr> 246 <br> 247 or 248 <br> 249 <nobr>Macro: <strong>SMARTQUOTES</strong> DA | DE | ES | FR | IT | NL | NO | PT | SV</nobr> 250 251 <p> 252 If you invoke <strong>SMARTQUOTES</strong> without an argument, 253 <strong>mom</strong> converts all instances of the inch-mark, 254 (<kbd>"</kbd> -- also called a "doublequote"), into 255 the appropriate instances of true Anglo-American open- and 256 close-doublequotes. (See 257 <a href="#SQ_INTERNATIONAL">Internationalization</a> 258 for how to get SMARTQUOTES to behave correctly for non-English 259 quoting styles.) 260 <p> 261 Typographically, there is a difference between the inch-mark and 262 doublequotes -- a BIG difference. Sadly, typewriters and computer 263 keyboards supply only one: the inch-mark. While using inches for 264 doublequotes is, and always has been, acceptable in typewriter-style 265 copy, it has never been, and, God willing, never will be acceptable in 266 typeset copy. Failure to turn inches into quotes is the first thing 267 a professional typesetter notices in documents prepared by amateurs. 268 And you don't want to look like an amateur, do you? 269 <p> 270 <a name="SQ_INTERNATIONAL"><h3>Internationalization</h3></a> 271 <p> 272 If you invoke <strong>SMARTQUOTES</strong> with one of the optional 273 arguments (<kbd>,,</kbd> or <kbd>>></kbd> or 274 <kbd><<</kbd>) you can use <kbd>"</kbd> as "cheap" 275 open- and close-quotes when inputting text in a language other than 276 English, and have <strong>mom</strong> convert them, on output, 277 into the chosen open- and close-quote style. 278 <p> 279 <kbd>,,</kbd> opens quotes with "lowered doublequotes" and 280 closes them with "raised doublequotes", as in this ascii 281 approximation: 282 <p> 283 <pre> 284 ,,Hilfe !`` 285 </pre> 286 287 <kbd>>></kbd> opens quotes with guillemets pointing to the 288 right, and closes them with guillemets pointing to the left, as in 289 this ascii approximation: 290 <p> 291 <pre> 292 >>Zurck !<< 293 </pre> 294 295 <kbd><<</kbd> opens quotes with guillemets pointing to the 296 left, and closes them with guillemets pointing to the right, as in 297 this ascii approximation: 298 <p> 299 <pre> 300 <<Mais monsieur! Je ne suis pas ce genre de fille!>> 301 </pre> 302 303 Please note: the above arguments to <strong>SMARTQUOTES</strong> 304 are literal ASCII characters. <kbd>,,</kbd> is two commas, 305 <kbd><<</kbd> is two less-than signs and <kbd>>></kbd> 306 is two greater-than signs. 307 <p> 308 Alternatively, you can pass <strong>SMARTQUOTES</strong> the 309 two-letter, ISO 639 abbreviation for the language you're writing in, 310 and <strong>mom</strong> will output the correct quotes. 311 <p> 312 <pre> 313 .SMARTQUOTES DA = Danish >>text<< 314 .SMARTQUOTES DE = German ,,text`` 315 .SMARTQUOTES ES = Spanish ``text 316 .SMARTQUOTES FR = French << text >> 317 .SMARTQUOTES IT = Italian << text >> 318 .SMARTQUOTES NL = Dutch text 319 .SMARTQUOTES NO = Norwegian <<text>> 320 .SMARTQUOTES PT = Portuguese <<text>> 321 .SMARTQUOTES SV = Swedish >>text>> 322 </pre> 323 <p> 324 Turn <strong>SMARTQUOTES</strong> off by passing it any argument 325 <em>not</em> in the argument list (e.g. <strong>OFF</strong>, 326 <strong>QUIT</strong>, <strong>X</strong>, etc.) 327 <p> 328 If you're using the 329 <a href="docprocessing.html#DOCPROCESSING">document processing macros</a> 330 with 331 <a href="#PRINTSTYLE">PRINTSTYLE TYPESET</a>, 332 <strong>SMARTQUOTES</strong> is on by default (in the Anglo-American 333 style); with 334 <a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>, 335 it's off by default (and should probably stay that way). 336 <p> 337 Finally, if you're fussy about the kerning of quote marks in 338 relation to the text they surround, or have special quoting needs, 339 you have to enter quote marks by hand using groff's native 340 <a href="definitions.html#TERMS_INLINES">inline escapes</a> 341 for special characters (see man groff_char for a complete list of 342 special characters). Entering quote marks this way allows you to 343 use <strong>mom</strong>'s 344 <a href="inlines.html#INLINE_KERNING_MOM">inline kerning escapes</a> 345 to fine-tune the look of quotes. 346 <p> 347 <strong>NOTE:</strong> <strong>SMARTQUOTES</strong> does not work on 348 single quotes, which most people input with the apostrophe (found at 349 the right-hand end of the "home row" on a QWERTY keyboard). 350 Groff will interpret all instances of the apostrophe as an apostrophe, 351 making the symbol useless as an open-single-quote. For open single 352 quotes, input the backtick character typically found under the tilde 353 on most keyboards. (Pour nous autres, "backtick" veut dire 354 l'accent grave.) 355 Here's an example of correct input copy with single quotes: 356 <p> 357 <pre> 358 "But she said, `I don't want to!'" 359 </pre> 360 361 <strong>ADDITIONAL NOTE:</strong> Whether or not you have 362 <strong>SMARTQUOTES</strong> turned on, get into the habit of entering 363 the foot- and inch-marks, when you need them, with the 364 <a href="definitions.html#TERMS_INLINES">inline escapes</a> 365 <strong>\*[FOOT]</strong> and <strong>\*[INCH]</strong>, instead 366 of <kbd>'</kbd> and <kbd>"</kbd>. 367 <p> 368 369 <!---CAPS---> 370 371 <hr width="66%" align="left"> 372 <a name="CAPS"><h3><u>Convert to upper case</u></h3></a> 373 <br> 374 <nobr>Macro: <strong>CAPS</strong> toggle</nobr> 375 376 <p> 377 <strong>CAPS</strong> converts all lower case letters to upper 378 case. Primarily, it's a support macro used by the 379 <a href="docprocessing.html#DOCPROCESSING">document processing macros</a>, 380 but you may find it helpful on occasion. <strong>CAPS</strong> 381 is a toggle, therefore no argument turns it on, any argument 382 turns it off. 383 <p> 384 <pre> 385 .CAPS 386 All work and no play makes Jack a dull boy. 387 .CAPS OFF 388 </pre> 389 390 produces, on output 391 <p> 392 <pre> 393 ALL WORK AND NO PLAY MAKES JACK A DULL BOY. 394 </pre> 395 396 <!---STRING---> 397 398 <hr width="66%" align="left"> 399 <a name="STRING"><h3><u>User-defined strings</u></h3></a> 400 <br> 401 <nobr>Macro: <strong>STRING</strong> <name> <what you want in the string></nobr> 402 403 <p> 404 You may find sometimes that you have to type out portions of text 405 repeatedly. If you'd like not to wear out your fingers, you can 406 define a "string" that, whenever you call it by name, 407 outputs whatever you put into it. 408 <p> 409 For example, say you're creating a document that repeatedly uses 410 the phrase "the Montreal/Windsor corridor". Instead of 411 typing all that out every time, you could define a string, like 412 this: 413 <p> 414 <pre> 415 .STRING mw the Montreal/Windsor corridor 416 </pre> 417 418 Once a string is defined, you can call it any time with the 419 <a href="definitions.html#INLINES">inline escape</a> 420 <kbd>\*[<stringname>]</kbd>. Using the example string above 421 <p> 422 <pre> 423 The schedule for trains along \*[mw]: 424 </pre> 425 426 produces, on output 427 <p> 428 <pre> 429 The schedule for trains along the Montreal/Windsor corridor: 430 </pre> 431 432 <strong>NOTE:</strong> Be very careful not to put any spaces at the 433 ends of strings you're defining, unless you want them. Everything 434 after the name argument you pass to <strong>STRING</strong> goes 435 into the string, including trailing spaces. 436 <p> 437 <strong>Experts: STRING</strong> is an alias for <strong>ds</strong>. 438 You can use either, or mix 'n' match with impunity. 439 <p> 440 441 <!---UNDERSCORE---> 442 443 <hr width="66%" align="left"> 444 <a name="UNDERSCORE"><h3><u>Single underscore</u></h3></a> 445 <br> 446 <nobr>Macro: <strong>UNDERSCORE</strong> [ <distance below baseline> ] "<string>"</nobr> 447 <br> 448 <em>*Optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em> 449 450 <p> 451 By default, <strong>UNDERSCORE</strong> places an underscore 2 points 452 beneath the required 453 <a href="definitions.html#TERMS_STRINGARGUMENT">string argument</a>. 454 The string must be enclosed in double-quotes, like this: 455 <p> 456 <pre> 457 .UNDERSCORE "Unmonitored monopolies breed high prices and poor products." 458 </pre> 459 460 If you wish to change the distance of the rule from the 461 baseline, use the optional argument <i><distance below 462 baseline></i> (with a unit of measure). 463 <p> 464 <pre> 465 .UNDERSCORE 3p "Unmonitored monopolies breed high prices and poor products." 466 </pre> 467 468 The above places the underscore 3 points below the baseline. 469 <p> 470 <a name="NOTES_UNDERSCORE"></a> 471 <strong>NOTES:</strong> 472 <br> 473 <strong>UNDERSCORE</strong> does not work across line breaks in output 474 copy, which is to say that you can't underscore a multi-line passage 475 simply by putting the text of the whole thing in the string you pass 476 to <strong>UNDERSCORE</strong>. Each 477 <a href="definitions.html#TERMS_OUTPUTLINE">output line</a> 478 or portion of an output line you want underscored must be plugged 479 separately into <strong>UNDERSCORE</strong>. Bear in mind, though, 480 that underscoring should at best be an occasional effect in typeset 481 copy. If you want to emphasize an entire passage, it's much, much 482 better to change fonts (e.g. to italic or bold). 483 <p> 484 You can easily and successfully underline entire passages in simulated 485 typewriter-style copy (i.e. if your font is Courier, or you're using 486 the document processing macro 487 <a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>), 488 with the 489 <a href="#UNDERLINE">UNDERLINE</a> 490 macro. <strong>UNDERLINE</strong> is designed specifically for this 491 purpose, but works only with the Courier font. 492 <p> 493 <strong>Mom</strong> doesn't always get the position and length 494 of the underscore precisely right in 495 <a href="definitions.html#TERMS_JUST">justified</a> 496 copy, although she's fine with all the other 497 <a href="definitions.html#TERMS_FILLED">fill modes</a>, 498 as well as with the no-fill modes. As of this writing, I have 499 no solution to the occasional problems with justified copy. 500 <p> 501 <strong>UNDERSCORE</strong> tends to confuse 502 <strong>gxditview</strong>, even though the output, when 503 printed, looks fine. Generally, I recommend using <strong>gv</strong> 504 to preview files anyway. See the section on 505 <a href="#PREVIEWING">previewing</a>. 506 <p> 507 508 <!---UNDERSCORE2---> 509 510 <hr width="66%" align="left"> 511 <a name="UNDERSCORE2"><h3><u>Double underscore</u></h3></a> 512 <br> 513 <nobr>Macro: <strong>UNDERSCORE2</strong> [ <distance below baseline> [ <distance between rules> ] ] "<string>"</nobr> 514 <br> 515 <em>*Optional arguments require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em> 516 517 <p> 518 By default, <strong>UNDERSCORE2</strong> places a double underscore 519 2 points beneath the required 520 <a href="definitions.html#TERMS_STRINGARGUMENT">string argument</a>. 521 The string must be enclosed in double-quotes, like this: 522 <p> 523 <pre> 524 .UNDERSCORE2 "Unmonitored monopolies breed high prices and poor products." 525 </pre> 526 527 The default distance between the two rules is 2 points. 528 <p> 529 If you wish to change the distance of the double underscore from 530 the baseline, use the optional argument <i><distance below 531 baseline></i> (with a unit of measure), e.g., 532 <p> 533 <pre> 534 .UNDERSCORE2 3p "Unmonitored monopolies breed high prices and poor products." 535 </pre> 536 537 which places the double underscore 3 points below the baseline. 538 <p> 539 If you wish to change the distance between the two rules as 540 well, use the second optional argument <i><distance between 541 rules></i> (with a unit of measure). Be aware that you must 542 give a value for the first optional argument if you want to use 543 the second. 544 <p> 545 <strong>NOTE:</strong> the same restrictions and caveats apply 546 to <strong>UNDERSCORE2</strong> as to 547 <strong>UNDERSCORE</strong>. See the 548 <a href="#NOTES_UNDERSCORE">NOTES</a> 549 for <strong>UNDERSCORE</strong>. 550 <p> 551 552 <!---UNDERLINE---> 553 554 <hr width="66%" align="left"> 555 <a name="UNDERLINE"><h3><u>Underline text -- Courier font only!</u></h3></a> 556 <br> 557 <nobr>Macro: <strong>UNDERLINE</strong> toggle</nobr> 558 559 <p> 560 If your font is Courier, or you're using the document processing macro 561 <a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>, 562 <strong>UNDERLINE</strong> allows you to underline words and 563 passages that, in typeset copy, would be italicized. You invoke 564 <strong>UNDERLINE</strong> as you do with all toggle macros -- 565 by itself (i.e. with no argument) to initiate underlining, and 566 with any argument to turn underlining off. 567 <p> 568 When on, <strong>UNDERLINE</strong> underlines letters, words 569 and numbers, but not punctuation or spaces. This makes for more 570 readable copy than a solid underline. 571 <p> 572 <strong>NOTE:</strong> Underlining may also be turned on and off 573 <a href="definitions.html#TERMS_INLINES">inline</a> 574 with the escapes 575 <a href="#UL">\*[UL]...\*[ULX].</a> 576 <p> 577 578 <!---UL---> 579 580 <hr width="66%" align="left"> 581 <a name="UL"><h3><u>Inline escape for underlining -- Courier font only!</u></h3></a> 582 <br> 583 Inline: <strong>\*[UL]...\*[ULX]</strong> 584 585 <p> 586 If your font is Courier, or you're using the document processing macro 587 <a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>, 588 <strong>\*[UL]...\*[ULX]</strong> underlines words and 589 passages that, in typeset copy, would be italicized. 590 <p> 591 <strong>\*[UL]</strong> underlines all letters, words and numbers 592 following it, but not punctuation or spaces. This makes for more 593 readable copy than a solid underline. When you no longer want 594 underlining, <strong>\*[ULX]</strong> turns underlining off. 595 <p> 596 The macro 597 <a href="#UNDERLINE">UNDERLINE</a> 598 and the inline escape <strong>\*[UL]</strong> are functionally 599 identical, hence 600 <p> 601 <pre> 602 .FAM C 603 .FT R 604 .PT_SIZE 12 605 .LS 24 606 .SS 0 607 .QUAD LEFT 608 Which should I heed? 609 .UNDERLINE 610 Just do it 611 .UNDERLINE OFF 612 or 613 .UNDERLINE 614 just say no? 615 .UNDERLINE OFF 616 </pre> 617 618 produces the same result as 619 <p> 620 <pre> 621 .FAM C 622 .FT R 623 .PT_SIZE 12 624 .LS 24 625 .SS 0 626 .QUAD LEFT 627 Which should I heed? \*[UL]Just do it\*[ULX] or \*[UL]just say no?\*[ULX] 628 </pre> 629 630 <!---PAD---> 631 632 <hr width="66%" align="left"> 633 <a name="PAD"><h3><u>Insert space into lines</u></h3></a> 634 <br> 635 <nobr>Macro: <strong>PAD</strong> "<string with pad markers inserted>" [NOBREAK]</nobr> 636 637 <p> 638 With <strong>PAD</strong>, you can insert unspecified amounts of 639 whitespace into a line. The optional <strong>NOBREAK</strong> 640 argument tells <strong>mom</strong> not to advance on the page 641 after the <strong>PAD</strong> macro has been invoked. 642 <p> 643 <strong>PAD</strong> calculates the difference between the length of 644 text on the line and the distance remaining to its end, then inserts 645 the difference (as whitespace) at the place(s) you specify. 646 <p> 647 Take, for example, the following relatively common typesetting 648 situation, found at the bottom of legal agreements: 649 <p> 650 <pre> 651 Date Signature | 652 </pre> 653 654 The person signing the agreement is supposed to fill in the date 655 as well as a signature. Space needs to be left for both, but 656 the exact amount is neither known, nor important. All that 657 matters is that there be a little space after Date, and rather 658 more space after Signature. (In the above, | represents 659 the end of the line at the prevailing line length.) 660 <p> 661 The 662 <a href="#PADMARKER">pad marker</a> 663 (see below) is # (the pound or number sign on your keyboard) and 664 can be used multiple times in a line. With that in mind, here's how 665 you'd input the Date/Signature line (assuming a length of 30 picas): 666 <p> 667 <pre> 668 .LL 30P 669 .PAD "Date#Signature###" 670 </pre> 671 672 When the line is output, the space remaining on the line, after 673 "Date" and "Signature" have been taken into 674 account, is split into four (because there are four # signs). 675 One quarter of the space is inserted between Date and Signature, 676 the remainder is inserted after Signature. 677 <a name="PAD_EXAMPLE"></a> 678 <p> 679 One rarely wants merely to insert space in a line; one usually 680 wants to fill it with something, hence <strong>PAD</strong> is 681 particularly useful in conjunction with 682 <a href="#STRING_TABS">string tabs</a>. 683 The following uses the Date/Signature example above, but adds 684 rules into the whitespace through the use of string tabs and 685 <strong>mom</strong>'s 686 <a href="definitions.html#TERMS_INLINES">inline escape</a> 687 <a href="inlines.html#INLINE_RULE_MOM">\*[RULE]</a>. 688 (Instead of <strong>\*[RULE]</strong>, 689 groff's line drawing function, 690 <a href="inlines.html#INLINE_LINEDRAWING_GROFF">\l</a> 691 could be used.) 692 <p> 693 <pre> 694 .LL 30P 695 .PAD "Date \*[ST1]#\*[ST1X] Signature \*[ST2]###\*[ST2X]" NOBREAK 696 .ST 1 J 697 .ST 2 J 698 .TAB 1 699 \*[RULE] 700 .TN 701 \*[RULE] 702 .TQ 703 </pre> 704 705 If you're not a typesetter, and if you're new to groff, the 706 example probably looks like gibberish. My apologies. However, 707 remember that typesetting is a craft, and without having studied 708 the craft, it takes a while to grasp its concepts. 709 <p> 710 Basically, what the example does is: 711 <br> 712 <ol> 713 <li>Pads the Date/Signature line (using the pad marker #), 714 encloses the padded space with two string tabs markers, 715 and outputs the line. 716 <br> 717 <li>Sets the two string tabs (notice the use of 718 <a href="#EL">EL</a> 719 beforehand; you don't want <strong>mom</strong> 720 to advance a line at this point). 721 <br> 722 <li>Calls the first string tab and draws a rule to its full 723 length. 724 <br> 725 <li>Calls the second tab with 726 <a href="#TN">TN</a> 727 (which moves to tab 2 and stays on the same baseline) 728 then draws a rule to the full length of string tab 2. 729 </ol> 730 <br> 731 Often, when setting up string tabs this way, you don't want the 732 padded line to print immediately. To accomplish this, use 733 <a href="#SILENT">SILENT</a>. 734 See the <a href="#STRING_TABS_TUT">quickie tutorial on string tabs</a> 735 for an example. 736 <p> 737 <strong>NOTE:</strong> Because the pound sign (#) is used as the pad 738 marker, you can't use it as a literal part of the pad string. If you 739 need the sign to appear in the text of a padded line, change the pad 740 marker with <a href="#PAD_MARKER">PAD_MARKER</a>. Also, be aware 741 that # as a pad marker only applies within the <strong>PAD</strong> 742 macro; at all other times it prints literally, just as you'd expect. 743 <p> 744 Another important consideration when using <strong>PAD</strong> is that 745 because the string must be enclosed in double-quotes, you can't use the 746 double-quote (") as part of the string. The way to circumvent 747 this is to use the groff 748 <a href="definitions.html#TERMS_INLINES">inline escapes</a> 749 <strong>\(lq</strong> and <strong>\(rq</strong> (leftquote and 750 rightquote respectively) whenever double-quotes are required in the 751 string passed to <strong>PAD</strong>. 752 <p> 753 754 <!---PAD_MARKER---> 755 756 <hr width="66%" align="left"> 757 <a name="PAD_MARKER"><h3><u>Change/set the marker used with PAD</u></h3></a> 758 <br> 759 <nobr>Macro: <strong>PAD_MARKER</strong> <character to use as the pad marker></nobr> 760 761 <p> 762 If you need to change <strong>mom</strong>'s default pad marker 763 (#), either because you want a literal # in the padded line, 764 or simply because you want to use another character instead, use 765 <strong>PAD_MARKER</strong>, whose argument is the new pad marker 766 character you want. 767 <p> 768 <pre> 769 .PAD_MARKER @ 770 </pre> 771 772 changes the pad marker to @. 773 <p> 774 Once you've changed the pad marker, the new marker remains in 775 effect for every instance of 776 <a href="#PAD">PAD</a> 777 until you change it again (say, back to the pound sign). 778 <p> 779 780 <!---\*[LEADER]---> 781 782 <hr width="66%" align="left"> 783 <a name="LEADER"><h3><u>Inline escape to add leaders to a line</u></h3></a> 784 <br> 785 Inline: <strong>\*[LEADER]</strong> 786 787 <p> 788 Whenever you want to fill a line or tab with 789 <a href="definitions.html#TERMS_LEADER">leaders</a>, 790 use the 791 <a href="definitions.html#TERMS_INLINES">inline escape</a> 792 <strong>\*[LEADER]</strong>. The remainder of the line or tab will be 793 filled with the leader character. <strong>Mom</strong>'s 794 default leader character is a period (dot), but you can change 795 it to any character you like with 796 <a href="#LEADER_CHARACTER">LEADER_CHARACTER</a>. 797 <p> 798 <strong>NOTE:</strong> <strong>\*[LEADER]</strong> fills lines 799 or tabs right to their end. You cannot insert leaders into a 800 line or tab and have text following the leader on the same line 801 or in the same tab. Should you wish to achieve such an effect 802 typographically, create tabs for each element of the line and 803 fill them appropriately with the text and leaders you need. 804 <a href="#STRING_TABS">String tabs</a> are perfect for this. An 805 example follows. 806 <p> 807 <pre> 808 .LL 30P 809 .PAD "Date\*[ST1]#\*[ST1X]Signature\*[ST2]###\*[ST2X]" 810 .EL 811 .ST 1 J 812 .ST 2 J 813 .TAB 1 814 \*[LEADER] 815 .TN 816 \*[LEADER] 817 .TQ 818 </pre> 819 820 The <strong>PAD</strong> line sets the words Date and Signature, 821 and marks string tabs around the pad space inserted in the line. 822 The string tabs are then "set", called, and filled 823 with leaders. The result looks like this: 824 <p> 825 <pre> 826 Date.............Signature..................................... 827 </pre> 828 829 <!---LEADER_CHARACTER---> 830 831 <hr width="66%" align="left"> 832 <a name="LEADER_CHARACTER"><h3><u>Change/set the leader character</u></h3></a> 833 <br> 834 <nobr>Macro: <strong>LEADER_CHARACTER</strong> <character></nobr> 835 836 <p> 837 <strong>LEADER_CHARACTER</strong> takes one argument: a single 838 character you would like to be used for 839 <a href="definitions.html#TERMS_LEADER">leaders</a>. 840 (See 841 <a href="#LEADER">\*[LEADER]</a> for an explanation of how to 842 fill lines with leaders.) 843 <p> 844 For example, to change the leader character from <strong>mom</strong>'s 845 default (a period) to the underscore character, enter 846 <p> 847 <pre> 848 .LEADER_CHARACTER _ 849 </pre> 850 851 <!---DROPCAP---> 852 853 <hr width="66%" align="left"> 854 <a name="DROPCAP"><h3><u>Drop caps</u></h3></a> 855 <br> 856 <nobr>Macro: <strong>DROPCAP</strong> <dropcap letter> <number of lines to drop> [ COND <percentage> | EXT <percentage> ]</nobr> 857 858 <p> 859 The first two arguments to <strong>DROPCAP</strong> are the letter you 860 want to be the 861 <a href="definitions.html#TERMS_DROPCAP">drop cap</a> 862 and the number of lines you want it to drop. By default, 863 <strong>mom</strong> uses the current family and font for the drop cap. 864 <p> 865 The optional argument (COND or EXT) indicates that you want the 866 drop cap condensed (narrower) or extended (wider). If you use 867 <strong>COND</strong> or <strong>EXT</strong>, you must follow the 868 argument with the percentage of the letter's normal width you want 869 it condensed or extended. No percent sign (%) is required. 870 <p> 871 <strong>Mom</strong> will do her very best to get the drop cap to 872 line up with the first line of text indented beside it, then set 873 the correct number of indented lines, and restore your left margin 874 when the number of drop cap lines has been reached. 875 <p> 876 Beginning a paragraph with a drop cap "T" looks 877 like this: 878 <p> 879 <pre> 880 .DROPCAP T 3 COND 90 881 he thousand injuries of Fortunato I had borne as best I 882 could, but when he ventured upon insult, I vowed revenge. 883 You who so well know the nature of my soul will not suppose, 884 however, that I gave utterance to a threat... 885 </pre> 886 887 The drop cap, slightly condensed but in the current family and font, 888 will be three lines tall, with whatever text fills those three 889 lines indented to the right of the letter. The remainder of the 890 paragraph's text will revert to the left margin. 891 <p> 892 <strong>NOTE:</strong> When using the 893 <a href="docprocessing.html#DOCPROCESSING">document processing macro</a> 894 <a href="#PP">PP</a>, 895 <strong>DROPCAP</strong> only works 896 <br> 897 <ul> 898 <li>with initial paragraphs (i.e. at the start of the document, 899 or after 900 <a href="#HEAD">HEAD</a>), 901 <li>when <strong>DROPCAP</strong> comes immediately after <strong>PP</strong>, 902 <li>and when the 903 <a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE</a> 904 is TYPESET. 905 </ul> 906 <br> 907 If these conditions aren't met, <strong>DROPCAP</strong> is silently ignored. 908 <p> 909 <strong>WARNING:</strong> <strong>DROPCAP</strong> puts a bit of 910 a strain on resource-challenged systems. If you have such a 911 system and use drop caps extensively in a document, be prepared 912 for a wait while <strong>mom</strong> does her thing. 913 914 <h3><a name="DROPCAP_SUPPORT"><u>Support macros for DROPCAP</u></a></h3> 915 Drop caps are the bane of most typesetters' existence. It's 916 very difficult to get the size of the drop cap right for the 917 number of drop lines, especially if the drop cap is in a 918 different family from the prevailing family of running text. 919 Not only that, but there's the gutter around the drop cap to 920 take into account, plus the fact that the letter may be too wide 921 or too narrow to look anything but odd or misplaced. 922 <p> 923 <strong>Mom</strong> solves the last of these problems with the 924 <strong>COND</strong> and <strong>EXT</strong> arguments. The 925 rest she solves with macros that change the default behaviour of 926 <strong>DROPCAP</strong>, namely 927 <p> 928 <a href="#DROPCAP_FAMILY">DROPCAP_FAMILY</a>, 929 <br> 930 <a href="#DROPCAP_FONT">DROPCAP_FONT</a>, 931 <br> 932 <a href="#DROPCAP_COLOR">DROPCAP_COLOR</a>, 933 <br> 934 <a href="#DROPCAP_ADJUST">DROPCAP_ADJUST</a> 935 <br> 936 and 937 <br> 938 <a href="#DROPCAP_GUTTER">DROPCAP_GUTTER</a>. 939 <p> 940 These macros must, of course, come before you invoke 941 <strong>DROPCAP</strong>. 942 943 <h3><a name="DROPCAP_FAMILY"><u>DROPCAP_FAMILY</u></a></h3> 944 945 Set the drop cap family by giving 946 <strong>DROPCAP_FAMILY</strong> the name of the family you want, 947 e.g. 948 <p> 949 <pre> 950 .DROPCAP_FAMILY H 951 </pre> 952 953 which will set the family to Helvetica for the drop cap only. 954 955 <h3><a name="DROPCAP_FONT"><u>DROPCAP_FONT</u></a></h3> 956 957 Set the drop cap font by giving 958 <strong>DROPCAP_FONT</strong> the name of the font you want, 959 e.g. 960 <p> 961 <pre> 962 .DROPCAP_FONT I 963 </pre> 964 965 which will set the font to italic for the drop cap only. 966 967 <h3><a name="DROPCAP_ADJUST"><u>DROPCAP_ADJUST</u></a></h3> 968 969 If the size <strong>mom</strong> calculates for the drop cap 970 isn't precisely what you want, you can increase or decrease it 971 with <strong>DROPCAP_ADJUST</strong>, like this: 972 e.g. 973 <p> 974 <pre> 975 .DROPCAP_ADJUST +1 976 or 977 .DROPCAP_ADJUST -.75 978 </pre> 979 980 <strong>DROPCAP_ADJUST</strong> only understands 981 <a href="definitions.html#TERMS_PICASPOINTS">points</a>, 982 therefore do not append any 983 <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> 984 to the argument. And always be sure to prepend the plus or 985 minus sign, depending on whether you want the drop cap larger or 986 smaller. 987 988 989 <h3><a name="DROPCAP_COLOR"><u>DROPCAP_COLOR</u></a></h3> 990 991 If you'd like your drop cap colourized, simply invoke 992 <strong>DROPCAP_COLOR</strong> with the name of a colour you've already 993 created ("initialized") with 994 <a href="color.html#NEWCOLOR">NEWCOLOR</a> 995 or 996 <a href="color.html#XCOLOR">XCOLOR</a>. Only the drop cap will be 997 colourized; all other text will remain at the current colour 998 default (usually black). 999 1000 <h3><a name="DROPCAP_GUTTER"><u>DROPCAP_GUTTER</u></a></h3> 1001 1002 By default, <strong>mom</strong> puts three points of space 1003 between the drop cap and the text indented beside it. If you 1004 want another value, use <strong>DROPCAP_GUTTER</strong> (with a 1005 unit of measure), like this: 1006 <p> 1007 <pre> 1008 .DROPCAP_GUTTER 6p 1009 </pre> 1010 1011 <!---\*[SUP]---> 1012 1013 <hr width="66%" align="left"> 1014 <a name="SUP"><h3><u>Superscript</u></h3></a> 1015 <br> 1016 Inlines: <strong>\*[SUP]...\*[SUPX]</strong> 1017 1018 <p> 1019 Superscripts are accomplished 1020 <a href="definitions.html#TERMS_INLINES">inline</a>. 1021 Whenever you need one, typically for numerals, all you need to 1022 do is surround the superscript with the inlines above. 1023 <strong>\*[SUP]</strong> begins superscripting; 1024 <strong>\*[SUPX]</strong> turns it off. 1025 <a name="CONDSUP"></a> 1026 <a name="EXTSUP"></a> 1027 <p> 1028 If your running type is 1029 <a href="#COND_INLINE">pseudo-condensed</a> 1030 or 1031 <a href="#EXT_INLINE">pseudo-extended</a> 1032 and you want your superscripts to be equivalently pseudo-condensed or 1033 -extended, use <strong>\*[CONDSUP]...\*[CONDSUPX]</strong> or 1034 <strong>\*[EXTSUP]...\*[EXTSUPX]</strong>. 1035 <p> 1036 The superscript inlines are primarily used by the 1037 <a href="docprocessing.html#DOCPROCESSING">document processing macros</a> 1038 for automatic generation of numbered footnotes. However, you may 1039 find them useful for other purposes. 1040 <p> 1041 <strong>NOTE:</strong> <strong>Mom</strong> does a pretty fine job of 1042 making superscripts look good in any font and at any size. If you're 1043 fussy, though (and I am), about precise vertical placement, kerning, 1044 weight, size, and so on, you may want to roll your own solution. 1045 And sorry, there's no <strong>mom</strong> equivalent for subscripts. 1046 I'm neither a mathematician nor a chemist, so I don't need them. 1047 Of course, anyone who wishes to contribute a subscript routine to 1048 <strong>mom</strong> will receive eternal blessings not only in this 1049 lifetime, but in all lifetimes to come. 1050 <p> 1051 <hr> 1052 <a href="inlines.html#TOP">Next</a> 1053 <a href="typesetting.html#TOP">Prev</a> 1054 <a href="#TOP">Top</a> 1055 <a href="toc.html">Back to Table of Contents</a> 1056 </body> 1057 </html> 1058