/contrib/groff/contrib/mom/momdoc/goodies.html

https://bitbucket.org/freebsd/freebsd-head/ · HTML · 1057 lines · 955 code · 86 blank · 16 comment · 0 complexity · 9cc753939d796a4d8e7a431381e91d67 MD5 · raw file

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