c93c54d36e93cc9676cc5ab0e7c866eb40f0268a
[platform/upstream/groff.git] / contrib / mom / momdoc / inlines.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 <head>
21   <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
22   <title>Mom -- Inline escapes</title>
23   <link rel="stylesheet" type="text/css" href="stylesheet.css" />
24 </head>
25
26 <body style="background-color: #f5faff;">
27
28 <!-- ==================================================================== -->
29
30 <div id="top" class="page">
31
32 <!-- Navigation links -->
33 <table style="width: 100%;">
34 <tr>
35   <td><a href="toc.html">Back to Table of Contents</a></td>
36   <td style="text-align: right;"><a href="color.html#top">Next: Coloured text</a></td>
37 </tr>
38 </table>
39
40 <h1 id="inline-escapes" class="docs">Inline escapes</h1>
41
42 <div style="text-align: center;">
43 <a href="#index-inlines">List of inline escapes</a>
44 </div>
45
46 <div class="rule-medium"><hr/></div>
47
48 <h2 id="intro-inlines" class="docs">Introduction</h2>
49 <p>
50 Inline escapes, as described in the
51 <a href="definitions.html#inlines">groff terms</a>
52 section of this manual, are typesetting commands that appear in text
53 <a href="definitions.html#inputline">input lines</a>,
54 as opposed to macros and other
55 <a href="definitions.html#controllines">control lines</a>
56 that must appear on lines by themselves.
57 </p>
58
59 <p>
60 Aside from altering type parameters within a line, inlines also tell
61 groff about special characters&mdash;em-dashes, bullets,
62 <a href="definitions.html#figurespace">figure/digit-width spaces</a>,
63 and so on.  It is beyond the scope of this manual to provide
64 a complete list of groff&#8217;s inline functions and special
65 characters.  I recommend having a look at the
66 <a href="intro.html#canonical">canonical reference materials</a>
67 should you need more information than is contained herein.
68 </p>
69
70 <p>
71 In groff, the escape character is the backslash (<kbd>\</kbd>).
72 Groff interprets everything following the backslash as instructions,
73 not literal text, until the escape sequence is complete.  Should
74 you need the actual backslash character as part of a line of text,
75 simply enter it twice (<kbd>\\</kbd>).  Groff understands that this
76 means "please print a backslash character."
77 </p>
78
79 <p>
80 You can also use <kbd>\e</kbd> to print a literal backslash, or use
81 <a href="goodies.html#esc-char">ESC_CHAR</a> to change the escape
82 character to something other than the backslash, which lets you
83 use a single backslash as a literal backslash.
84 </p>
85
86 <p>
87 Groff has a number of ways of recognizing what constitutes a
88 complete escape sequence.  This is both a boon and a curse; some
89 escape sequences have no terminating delimiter and consequently
90 become difficult to distinguish from real input text.  Others
91 require the use of an opening parenthesis with no corresponding
92 closing parenthesis.  Still others need to be enclosed in square
93 brackets.
94 </p>
95
96 <p>
97 Mom recognizes that certain escapes get used more often than others.
98 For these, she has a consistent input style that takes the form
99 <kbd>\*[...]</kbd>, which makes them stand out well from the text of
100 your documents.  These escapes are the ones listed under
101 <a href="#inlines-mom">Mom&#8217;s personal inline escapes</a>.
102 </p>
103
104 <p>
105 Despite mom&#8217;s best intentions, there are still
106 a number of typesetting functions that can only be accomplished
107 with groff&#8217;s native inline escapes.  I've listed the ones that
108 strike me as essential, but there are many others.  If you want
109 to know what they are, please read the
110 <a href="intro.html#canonical">canonical reference materials</a>
111 pertaining to groff.
112 </p>
113
114 <div class="box-tip">
115 <p class="tip">
116 <span class="tip">Helpful bit of information:</span>
117 Inline escapes can be used in
118 <a href="docprocessing.html#docprocessing">document processing macros</a>
119 that take
120 <a href="definitions.html#stringargument">string arguments</a>.
121 </p>
122 </div>
123
124 <div class="macro-list-container">
125 <h3 id="index-inlines" class="macro-list">List of inline escapes</h3>
126
127 <ul class="macro-list">
128 <li id="inlines-mom"><a href="#inlines-mom-top">Mom&#8217;s personal inline escapes</a>
129 <ul class="no-enumerator" style="margin-left: -1.5em;">
130   <li><a href="#inline-fonts-mom">Changing fonts</a></li>
131   <li><a href="#inline-size-mom">Changing point size</a></li>
132   <li><a href="#uc-lc">Capitalise a section of type</a></li>
133   <li><a href="#inline-kerning-mom">Pairwise kerning</a></li>
134   <li><a href="#inline-horizontal-mom">Horizontal movement</a></li>
135   <li><a href="#inline-vertical-mom">Vertical movement</a></li>
136   <li><a href="#inline-b-mom">Terminate a line without advancing on the page</a></li>
137   <li><a href="#tb-plus-mom">Call the next sequential tab without advancing on the page</a></li>
138   <li><a href="#inline-rule-mom">Full measure rules</a>
139   <ul class="sublist" style="font-size: 100%;">
140     <li><a href="#rule-weight">Macro to control the weight of rules</a></li>
141   </ul></li>
142 </ul></li>
143 <li id="inlines-groff"><a href="#inlines-groff-top">Commonly-used groff inline escapes</a>
144 <ul class="no-enumerator" style="margin-left: -1.5em;">
145   <li><kbd>\f</kbd>&nbsp;<a href="#inline-fonts-groff">Font control</a></li>
146   <li><kbd>\h</kbd>&nbsp;<a href="#inline-horizontal-groff">Inline horizontal motions</a></li>
147   <li><kbd>\v</kbd>&nbsp;<a href="#inline-vertical-groff">Inline vertical motions</a></li>
148   <li><kbd>\w</kbd>&nbsp;<a href="#inline-stringwidth-groff">String width function</a></li>
149   <li><kbd>\l</kbd>&nbsp;<a href="#inline-linedrawing-groff">Horizontal line drawing function</a></li>
150   <li style="margin-left: 1.6em;"><a href="#inline-characters-groff">Special characters</a></li>
151 </ul></li>
152 </ul>
153 </div>
154
155 <div class="rule-medium"><hr/></div>
156
157 <!-- -INLINE_FONTS_MOM- -->
158
159 <h2 id="inlines-mom-top" class="macro-group">Mom&#8217;s personal inline escapes</h2>
160
161 <h3 id="inline-fonts-mom" class="docs">Changing fonts</h3>
162
163 <p>
164 Mom provides five escapes for changing fonts inline:
165 <br/>
166 <span class="pre-in-pp">
167   \*[ROM]   Change to the medium roman font
168   \*[IT]    Change to the medium italic font
169   \*[BD]    Change to the bold roman font
170   \*[BDI]   Change to the bold italic font
171   \*[PREV]  Revert to the previous font (once only)*
172 </span>
173 </p>
174
175 <div class="box-tip">
176 <p class="tip">
177 <span class="note">Note:</span>
178 <kbd>\*[PREV]</kbd> does not operate "stack style".  It returns
179 to the previous font once only, and afterwards has no effect.  In
180 other words, in the case of <kbd>\*[PREV]\*[PREV]</kbd>, only the
181 first <kbd>\*[PREV]</kbd> is respected; the second one is silently
182 ignored.
183 </p>
184 </div>
185
186 <p>
187 These escapes are provided for merely for convenience, legibility,
188 and consistency when typesetting with mom.  For more complete and
189 flexible inline font control, please see
190 <a href="#inline-fonts-groff">font control with <kbd>\f</kbd></a>.
191 </p>
192
193 <div class="box-notes">
194 <h3 id="inlines-docprocessing-fonts" class="docs notes">Notes concerning document processing</h3>
195 <p style="margin-top: .5em;">
196 If you&#8217;re using the
197 <a href="docprocessing.html#docprocessing">document processing macros</a>,
198 inline font changes remain in effect only for the duration of the
199 current document element tag.
200 </p>
201
202 <p class="tip-bottom">
203 Additionally, if you&#8217;re designing your own
204 <a href="headfootpage.html#headfootpage-intro">HEADERS or FOOTERS</a>
205 and want to use mom&#8217;s inline escapes for changing fonts as
206 part of the the left, centre and/or right strings, or in the strings
207 for
208 <a href="headfootpage.html#hdrftr-rectoverso">recto</a>
209 and/or
210 <a href="headfootpage.html#hdrftr-rectoverso">verso</a>
211 HEADERS or FOOTERS, or in the strings passed to
212 <a href="headfootpage.html#headers-and-footers">HEADERS_AND_FOOTERS</a>,
213 you must enter the inlines beginning with <kbd>\E*</kbd>
214 rather than just <kbd>\*</kbd>, eg <kbd>\E*[BD]</kbd>.
215 </p>
216 </div>
217
218 <!-- -INLINE_SIZE_MOM- -->
219
220 <h3 id="inline-size-mom" class="docs">Changing point size</h3>
221 <p>
222 Mom has two inline escapes for changing point size:
223 <br/>
224 <span class="pre-in-pp">
225   \*[SIZE &lt;size&gt;]
226 </span>
227 and
228 <br/>
229 <span class="pre-in-pp">
230   \*S[&lt;size&gt;]
231 </span>
232 where &#8220;size&#8221; is the new size you want.  You can use
233 either; they behave exactly the same way.  For example, to change
234 the point size of type inline to 12 points, you could enter either
235 <br/>
236 <span class="pre-in-pp">
237   \*[SIZE 12]
238 </span>
239 or
240 <br/>
241 <span class="pre-in-pp">
242   \*S[12]
243 </span>
244 Entering either <kbd>\*[SIZE]</kbd> or <kbd>\*S[]</kbd> with no
245 argument reverts to the former point size.
246 </p>
247
248 <p>
249 The advantage of the first form is that it&#8217;s easy to remember,
250 and follows mom&#8217;s usual inline syntax.  The advantage of the
251 second is that it&#8217;s more concise.
252 </p>
253
254 <p>
255 Notice that in both cases, the new size does not require a
256 <a href="definitions.html#unitofmeasure">unit of measure</a>;
257 <a href="definitions.html#picaspoints">points</a>
258 is assumed.  However, a unit of measure may be appended to the size
259 if that&#8217;s what you wish.  Fractional sizes are, of course,
260 allowed.
261 </p>
262
263 <p>
264 The size given to <kbd>\*[SIZE&nbsp;&lt;size&gt;]</kbd> or
265 <kbd>\*S[&lt;size&gt;]</kbd> may be expressed in plus or minus
266 terms, which can be very useful.  In the following examples, the
267 word &#8220;mom&#8221; will be output 2 points larger than the point
268 size of the rest of the line.
269 <br/>
270 <span class="pre-in-pp">
271   While she isn't perfect, \*S[+2]mom\*S[-2] isn't half bad.
272   While she isn't perfect, \*[SIZE +2]mom\*[SIZE -2] isn't half bad.
273 </span>
274 Please note that inline size changes do not update the leading if
275 <a href="typesetting.html#autolead">AUTOLEAD</a>
276 is enabled.
277 </p>
278
279 <div class="box-notes">
280 <h3 id="inline-docprocessing-ps" class="docs notes">NOTE CONCERNING DOCUMENT PROCESSING</h3>
281 <p style="margin-top: .5em;">
282 If you&#8217;re using the
283 <a href="docprocessing.html#docprocessing">document processing macros</a>
284 and wish to design your own
285 <a href="headfootpage.html#headfootpage-intro">HEADERS or FOOTERS</a>
286 using mom&#8217;s inline escape for changing point size as part of
287 the left, centre and/or right strings, or in the strings for
288 <a href="headfootpage.html#hdrftr-rectoverso">recto</a>
289 and/or
290 <a href="headfootpage.html#hdrftr-rectoverso">verso</a>
291 HEADERS or FOOTERS, or in the strings passed to
292 <a href="headfootpage.html#headers-and-footers">HEADERS_AND_FOOTERS</a>,
293 you <i>must</i> use the form <kbd>\*S[&lt;n&gt;]</kbd>
294 and enter the inline beginning with <kbd>\E*</kbd>, like this:
295 <kbd>\E*S[&lt;+|-&gt;&lt;n&gt;]</kbd>.
296 </p>
297
298 <p class="tip-bottom">
299 <span class="additional-note">Additional note:</span>
300 If you&#8217;re accustomed to groff&#8217;s usual way of handling
301 inline size requests <kbd>(\sN, \s±N, \s(NN, \s±(NN, \s[NNN],
302 \s±[NNN]),</kbd> feel free to continue with your old habits.  Mom
303 doesn&#8217;t care.
304 </p>
305 </div>
306
307 <!-- -CAPITALISATION- -->
308
309 <h3 id="uc-lc" class="docs">Capitalise a section of type</h3>
310 <p>
311 If you need to capitalise a region of type inline, bracket the
312 region of type with the inline escapes, <kbd>\*[UC]</kbd> (Upper Case)
313 and <kbd>\*[LC]</kbd> (Lower Case), like this:
314 <br/>
315 <span class="pre-in-pp">
316   All work \*[UC]and\*[LC] no play makes Jack a dull boy.
317 </span>
318 The above produces, on output
319 <br/>
320 <span class="pre-in-pp">
321   All work AND no play makes Jack a dull boy.
322 </span>
323 </p>
324
325 <div class="box-tip">
326 <p class="tip">
327 <span class="note">Note:</span>
328 <kbd>\*[UC]</kbd> and <kbd>\*[LC]</kbd> must not be used inside the
329 <a href="definitions.html#stringargument">string arguments</a>
330 passed to the
331 <a href="headfootpage.html#hdrftr-strings">HEADER_&lt;POSITION&gt;</a>
332 macro.  Instead, use the control macro
333 <a href="headfootpage.html#_caps">HEADER_&lt;POSITION&gt;_CAPS.</a>
334 For
335 <a href="headfootpage.html#hdrftr-rectoverso">HEADER_RECTO</a>
336 (or _VERSO) or
337 <a href="headfootpage.html#hdrftr-rectoverso">FOOTER_RECTO</a>
338 (or _VERSO), supply the <kbd>CAPS</kbd> option to the appropriate
339 macro.
340 </p>
341 </div>
342
343 <!-- -INLINE_KERNING_MOM- -->
344
345 <h3 id="inline-kerning-mom" class="docs">Pairwise kerning</h3>
346 <p>
347 Pairwise kerning means moving specific letter pairs closer
348 together or further apart (see
349 <a href="definitions.html#kern">Typesetting terms, kerning</a>
350 for more details).
351 </p>
352
353 <p>
354 Mom permits inline pairwise kerning through the use of the inline
355 escapes
356 <br/>
357 <span class="pre-in-pp">
358   \*[BU &lt;n&gt;]&nbsp;Closes the space between letters (Back Units).
359   \*[FU &lt;n&gt;]&nbsp;Opens the space between letters  (Forward Units).
360 </span>
361 <b>&lt;n&gt;</b> is the number of
362 <a href="definitions.html#kernunit">kern units</a>
363 by which to close or open the space between letters.
364 </p>
365
366 <p>
367 For example,
368 <br/>
369 <span class="pre-in-pp">
370   THE HUMAN COST OF COMMODIF\*[FU 1]YING FRESH W\*[BU 4]A\*[BU 5]TER
371 </span>
372 moves the letter Y in &#8220;COMMODIFYING&#8221; one kern unit away
373 from the letter F, and the letter A in &#8220;WATER&#8221; four
374 kern units closer to the letter W.  Additionally, the letter T in
375 &#8220;WATER&#8221; is moved five kern units closer to the letter A.
376 </p>
377
378 <p>
379 For backward compatibility, the forms
380 <br/>
381 <span class="pre-in-pp">
382   \*[BU1]...\*[BU36]&nbsp;Move backward 1...36 <a href="definitions.html#kernunit">kern units</a>
383   \*[FU1]...\*[FU36]&nbsp;Move forward  1...36 <a href="definitions.html#kernunit">kern units</a>
384 </span>
385 also exist (ie with no space before the number of kern units desired,
386 up to a limit of 36).
387 </p>
388
389 <p id="kernunit">
390 The default size of a kern unit is 1/36 of the current point size;
391 this may be changed by invoking the macro, <kbd>.KERN_UNIT</kbd>,
392 with the desired value, which represents a fraction of the current
393 point size.  For example, to change the kern unit to 1/54 of the
394 current point size,
395 <br/>
396 <span class="pre-in-pp">
397   .KERN_UNIT 54
398 </span>
399 To restore the kern unit to its default, invoke
400 <kbd>.KERN_UNIT</kbd> with an argument of <kbd>DEFAULT</kbd>.
401 </p>
402
403
404 <div class="box-notes">
405 <h3 id="inlines-docprocessing-kerning" class="docs notes">Notes concerning document processing</h3>
406 <p style="margin-top: .5em;">
407 If you&#8217;re using the
408 <a href="docprocessing.html#docprocessing">document processing macros</a>
409 and wish to design your own
410 <a href="headfootpage.html#headfootpage-intro">HEADERS or FOOTERS</a>
411 using mom&#8217;s inline escapes for kerning as part of the left,
412 centre and/or right strings, or in the strings for
413 <a href="headfootpage.html#hdrftr-rectoverso">recto</a>
414 and/or
415 <a href="headfootpage.html#hdrftr-rectoverso">verso</a>
416 HEADERS or FOOTERS, or in the strings passed to
417 <a href="headfootpage.html#headers-and-footers">HEADERS_AND_FOOTERS</a>,
418 you <i>must</i> use the forms <kbd>\E*[BU&lt;n&gt;]</kbd>
419 and <kbd>\E*[FU&lt;n&gt;]</kbd> (ie with no space), and enter the
420 inline beginning with <kbd>\E*</kbd> rather than just <kbd>\*</kbd>,
421 eg <kbd>\E*[BU4]</kbd>.
422 </p>
423  
424 <p class="tip-bottom">
425 <span class="additional-note">Additional note:</span>
426 Using the <kbd>BU</kbd> or <kbd>FU</kbd> escapes between characters
427 pairs that are already automatically kerned (see
428 <a href="typesetting.html#kern">KERN</a>)
429 disables the automatic
430 kerning and uses the value you give to BU or FU instead.
431 </p>
432 </div>
433
434 <!-- -INLINE_HORIZONTAL_MOM- -->
435
436 <h3 id="inline-horizontal-mom" class="docs">Horizontal inline movement</h3>
437 <p>
438 Sometimes, you may need to insert a specified amount amount of white
439 space into an
440 <a href="definitions.html#outputline">output line</a>,
441 or&mdash;occasionally&mdash;back up to a previous position on an
442 <a href="definitions.html#inputline">output</a>
443 line in order to create special typographic effects.
444 </p>
445
446 <p>
447 Mom&#8217;s inline escapes for these horizontal movements are
448 <br/>
449 <span id="bck" class="pre-in-pp">
450   \*[BCK &lt;n unit&gt;]&nbsp;&nbsp;Move backward inline the specified number of
451                     <a href="definitions.html#unitofmeasure">units of measure</a>; decimal fractions are allowed.
452 </span>
453 and
454 <span id="fwd" class="pre-in-pp">
455   \*[FWD &lt;n unit&gt;]&nbsp;&nbsp;Move forward inline the specified number of
456                     <a href="definitions.html#unitofmeasure">units of measure</a>; decimal fractions are allowed.
457 </span>
458 </p>
459
460 <p>
461 For example,
462 <br/>
463 <span class="pre-in-pp">
464     1.\*[FWD 12p]The Free Trade Play-Offs: WalMart 100, Mexico 0
465 </span>
466 puts 12 points of space between <kbd>1.</kbd> and
467 <kbd>The</kbd>.
468 </p>
469
470 <div class="box-tip">
471 <p class="tip">
472 <span class="note">Note:</span>
473 For backward compatibility, the forms
474 <br/>
475 <span class="pre-in-pp">
476   \*[BP.25]...\*[BP12.75]&nbsp;Move backward .25...12.75 points
477   \*[FP.25]...\*[FP12.75]&nbsp;Move forward  .25...12.75 points
478 </span>
479 also exist (ie with no space before the digit and points being
480 the unit of measure, hence no unit of measure required).  Both
481 accept quarter points, so it&#8217;s possible to do, for example,
482 <kbd>\*[FP.5]</kbd> or <kbd>\*[BP1.25]</kbd> up to a limit
483 of 12.75 points.
484 </p>
485 </div>
486
487 <div class="box-notes">
488 <h3 id="inlines-docprocessing-horizontal" class="docs notes">Note concerning document processing</h3>
489 <p style="margin-top: .5em; padding-bottom: .5em;">
490 If you&#8217;re using the
491 <a href="docprocessing.html#docprocessing">document processing macros</a>
492 and wish to design your own
493 <a href="headfootpage.html#headfootpage-intro">HEADERS or FOOTERS</a>
494 using mom&#8217;s inline escapes for horizontal movements as part of
495 the left, centre and/or right strings, or in the strings for
496 <a href="headfootpage.html#hdrftr-rectoverso">recto</a>
497 and/or
498 <a href="headfootpage.html#hdrftr-rectoverso">verso</a>
499 HEADERS or FOOTERS, or in the strings passed to
500 <a href="headfootpage.html#headers-and-footers">HEADERS_AND_FOOTERS</a>,
501 you <i>must</i> use the forms <kbd>\E*[BP&lt;n&gt;]</kbd>
502 and <kbd>\E*[FP&lt;n&gt;]</kbd> (ie with no space), and enter the
503 inline beginning with <kbd>\E*</kbd> rather than just <kbd>\*</kbd>,
504 eg <kbd>\E*[BP.755]</kbd>.
505 </p>
506 </div>
507
508 <!-- -INLINE_VERTICAL_MOM- -->
509
510 <h3 id="inline-vertical-mom" class="docs">Vertical inline movement</h3>
511 <p>
512 If you need to move portions of type up or down on a line, mom
513 provides the following inline escapes:
514 <br/>
515 <span id="down" class="pre-in-pp">
516   \*[DOWN &lt;n unit&gt;]&nbsp;Move down inline the specified number of
517                     <a href="definitions.html#unitofmeasure">units of measure</a>
518
519   <span id="up">\*[UP &lt;n unit&gt;]&nbsp;Move up inline the specified number of
520                   <a href="definitions.html#unitofmeasure">units of measure</a></span>
521 </span>
522 For example,
523 <br/>
524 <span class="pre-in-pp">
525   Tel: 905\*[UP 1p]-\*[DOWN 1p]4072
526 </span>
527 moves the hyphen in the telephone number up by 1 point, then
528 moves back down by the same amount.
529 </p>
530
531 <div class="box-tip">
532 <p class="tip">
533 <span class="note">Note:</span>
534 <kbd>\*[UP]</kbd> and <kbd>\*[DOWN]</kbd> do not work in conjunction
535 with the inline escape,
536 <kbd><a href="#inline-rule-mom">\*[RULE]</a></kbd>.
537 </p>
538
539 <p>
540 <span class="additional-note">Additional note:</span>
541 For backward compatibility, the following are also available:
542 <br/>
543 <span class="pre-in-pp">
544   \*[ALD.25]...\*[ALD12.75]   Advance lead .25...12.75 points (move downward)
545   \*[RLD.25]...\*[RLD12.75]   Reverse lead .25...12.75 points (move upward)
546 </span>
547 </p>
548
549 <p class="tip-bottom">
550 Both <kbd>\*[ALD]</kbd> and <kbd>\*[RLD]</kbd> work in points, hence
551 you mustn&#8217;t use a unit of measure.
552 </p>
553 </div>
554
555 <div class="box-notes">
556 <h3 id="inline-docprocessing-vertical" class="docs notes">Note concerning document processing</h3>
557 <p style="margin-top: .5em; padding-bottom: .5em;">
558 If you&#8217;re using the
559 <a href="docprocessing.html#docprocessing">document processing macros</a>
560 and wish to design your own
561 <a href="headfootpage.html#headfootpage-intro">HEADERS or FOOTERS</a>
562 using mom&#8217;s inline escapes for vertical movements as part of
563 the left, centre and/or right strings, or in the strings for
564 <a href="headfootpage.html#hdrftr-rectoverso">recto</a>
565 and/or
566 <a href="headfootpage.html#hdrftr-rectoverso">verso</a>
567 HEADERS or FOOTERS, or in the strings passed to
568 <a href="headfootpage.html#headers-and-footers">HEADERS_AND_FOOTERS</a>,
569 you <i>must</i> use the forms <kbd>\E*[ALD&lt;n&gt;]</kbd>
570 and <kbd>\E*[RLD&lt;n&gt;]</kbd> (ie with no space), and enter the
571 inline beginning with <kbd>\E*</kbd> rather than just <kbd>\*</kbd>,
572 eg <kbd>\E*[ALD.5]</kbd>.
573 </p>
574 </div>
575
576 <!-- -INLINE_B_MOM- -->
577
578 <h3 id="inline-b-mom" class="docs">Terminate a line without advancing on the page</h3>
579 <p>
580 Sometimes, you want mom to break a line but not advance on the page.
581 This can be accomplished with the macro,
582 <a href="typesetting.html#el">EL</a>
583 or with the escape, <kbd>\*[B]</kbd>.  Simply attach <kbd>\*[B]</kbd>
584 to the end of any input line.  Using the example given in the
585 document entry for EL, you'd use <kbd>\*[B]</kbd> like this:
586 <br/>
587 <span class="pre-in-pp">
588   .LEFT
589   .LS 12.5
590   A line of text.\*[B]
591   .ALD 24p
592   The next line of text.
593 </span>
594
595 <kbd>\*[B]</kbd> works reliably regardless of the current
596 <a href="definitions.html#filled">fill mode</a>.
597 </p>
598
599 <!-- -INLINE_TB+_MOM- -->
600
601 <h3 id="tb-plus-mom" class="docs">Call the next sequential tab without advancing on the page</h3>
602 <p>
603 Sometimes, you want mom to move to the next tab in sequence (eg
604 from TAB 1 to TAB 2, or TAB 8 to TAB 9) without mom advancing on the
605 page.  (See the NOTE
606 <a href="typesetting.html#note-tn">here</a>
607 if you&#8217;re not clear how mom manages tabs and linebreaks.)
608 To do so, simply attach the escape <kbd>\*[TB+]</kbd> to the end of
609 the input line in previous tab, like this:
610 <br/>
611 <span class="pre-in-pp">
612   .TAB 1
613   Some text\*[TB+]  \" In tab 1
614   Some more text    \" In tab 2, same baseline.
615 </span>
616
617 <kbd>\*[TB+]</kbd> works reliably regardless of the current
618 <a href="definitions.html#filled">fill mode</a>.
619 </p>
620
621 <!-- -INLINE_RULE_MOM- -->
622
623 <h3 id="inline-rule-mom" class="docs">Full measure rules</h3>
624 <p>
625 I find I often need rules drawn to the full measure of the current line
626 or tab length.  The official way to do this is <kbd>\l'\n[.lu]'</kbd>,
627 which is annoying to type, and doesn&#8217;t mean a whole heck of a lot if
628 you&#8217;re new to groff.  The inline, <kbd>\*[RULE]</kbd>, is a simple
629 replacement for <kbd>\l'\n[.lu]'</kbd>.  Use it whenever you need
630 a rule drawn to the full measure of the current line or tab length, for
631 example:
632 <br/>
633 <span class="pre-in-pp">
634   .LL 6P
635   \*[RULE]
636 </span>
637
638 The above draws a rule the full measure of the 6-pica line length.
639 For another way to draw full measure rules, see the macro,
640 <a href="graphical.html#drh">DRH</a>.
641 </p>
642
643 <p>
644 <kbd>\*[RULE]</kbd> must appear on an
645 <a href="definitions.html#inputline">input line</a>
646 by itself, and always causes a break when entered after a normal
647 input line of text.  It does not, however, deposit a break when used
648 immediately after a macro.
649 </p>
650
651 <p>
652 The weight of the rule drawn with <kbd>\*[RULE]</kbd> is controlled
653 with the macro
654 <a href="#rule-weight">RULE_WEIGHT</a>.
655 Mom&#8217;s default is 1/2 point.
656 </p>
657
658 <div class="box-tip">
659 <p class="tip">
660 <span class="note">Note:</span>
661 <kbd>\*[RULE]</kbd> draws the rule to the full measure, hence it
662 cannot be used to fill the remainder of a partial line with a rule
663 in this way:
664 <br/>
665 <span class="pre-in-pp">
666   Signature__________________________________________
667 </span>
668 If you wish to accomplish this effect, you have to use
669 <kbd>\*[RULE]</kbd> in conjunction with the
670 <a href="goodies.html#pad">PAD</a>
671 macro and
672 <a href="typesetting.html#string-tabs">string tabs</a>.
673 (See the
674 <a href="goodies.html#pad-example">example</a>
675 provided with PAD.)
676 <a name="RULE_EXCEPTION"></a>
677 </p>
678
679 <p>
680 Please also note that the inline escapes
681 <a href="#up"><kbd>\*[UP]</kbd></a>
682 and
683 <a href="#down"><kbd>\*[DOWN]</kbd></a>
684 cannot be used in conjunction with <kbd>\*[RULE]</kbd>.
685 </p>
686
687 <p>This <i>doesn&#8217;t</i> work:
688 <br/>
689 <span class="pre-in-pp">
690   \*[DOWN 2p]\*[RULE]\*[UP 2p]
691 </span>
692 whereas this does:
693 <br/>
694 <span class="pre-in-pp">
695   .ALD 2p
696   \*[RULE]
697   .RLD 2p
698 </span>
699 </p>
700
701 <p class="tip-bottom">
702 See groff&#8217;s
703 <a href="#inline-linedrawing-groff">Horizontal line drawing function</a>
704 for more information on drawing horizontal rules.
705 </p>
706 </div>
707
708 <!-- -RULE_WEIGHT- -->
709
710 <div id="rule-weight" class="box-macro-args">
711 Macro: <b>RULE_WEIGHT</b> <kbd>&lt;weight in points&gt;</kbd>
712 </div>
713
714 <p class="requires">
715 &bull;&nbsp;Must <span class="normal">not</span> have a
716 <a href="definitions.html#unitofmeasure">unit of measure</a>
717 appended.
718 <br/>
719 &nbsp;&nbsp;Argument must be greater than 0 and less than 100; decimal
720 fractions are allowed.
721 </p>
722
723 <p>
724 RULE_WEIGHT allows you to tell mom how heavy (in other words, how
725 &#8220;thick&#8221;) you want the rules drawn with the inline
726 escape,
727 <a href="#inline-rule-mom"><kbd>\*[RULE]</kbd></a>.
728 It takes a single argument: the weight of the rule in
729 <a href="definitions.html#picaspoints">points</a>
730 <i>but without the</i>
731 <a href="definitions.html#unitofmeasure">unit of measure</a>
732 <kbd>p</kbd> <i>attached</i>.  Thus, to set the weight of rules
733 drawn with <kbd>\*[RULE]</kbd> to 1-1/4 points, you'd do
734 <br/>
735 <span class="pre-in-pp">
736   .RULE_WEIGHT 1.25
737 </span>
738 </p>
739
740 <p>
741 RULE_WEIGHT also sets the weight of rules drawn
742 with
743 <a href="graphical.html#drh"><kbd>.DRH</kbd></a>
744 when DRH is not given any arguments.
745 </p>
746
747 <div class="rule-medium"><hr/></div>
748
749 <!-- -INLINE_FONT_GROFF- -->
750
751 <h2 id="inlines-groff-top" class="macro-group">Commonly-used groff inline escapes</h2>
752
753 <h3 id="inline-fonts-groff" class="docs">Font control (<kbd style="text-transform: none">\f</kbd>)</h3>
754
755 <p>
756 Groff&#8217;s basic mechanism for inline font control is the escape
757 <kbd>\f[&lt;font&gt;]</kbd>. 
758 <br/>
759 <span class="pre-in-pp">
760   \f[R]   Change to the medium roman font  (equivalent to mom's \*[ROM])
761   \f[I]   Change to the medium italic font (equivalent to mom's \*[IT])
762   \f[B]   Change to the bold roman font    (equivalent to mom's \*[BD])
763   \f[BI]  Change to the bold italic font   (equivalent to mom's \*[BDI])
764   \f[P]   Revert to the previous font      (equivalent to mom's \*[PREV])
765 </span>
766 </p>
767
768 <p>
769 <kbd>\f[&lt;font&gt;]</kbd> can be used with any valid
770 <a href="definitions.html#font">font style</a>
771 registered with groff.  (See
772 <a href="appendices.html#style-extensions">here</a>
773 for a list of pre-registered font styles provided by mom).
774 </p>
775
776 <p>
777 <kbd>\f[&lt;font&gt;]</kbd> can also take a complete valid
778 family+font name combo.  This is especially useful should you
779 need to change both family and font inline.  For example, if your
780 prevailing family and font are Times Roman and you want a few words
781 in Courier Bold Italic, you could do this:
782 <br/>
783 <span class="pre-in-pp">
784   .FAM T
785   .FT  R
786   The command \f[CBI]ls -l\f[P] gives a "long" directory listing.
787 </span>
788 The Unix command <kbd>ls -l</kbd> will appear in Courier Bold Italic
789 in a line that is otherwise in Times Roman.
790 </p>
791
792 <!-- -INLINE_HORIZONTAL_GROFF- -->
793
794 <h3 id="inline-horizontal-groff" class="docs">Inline horizontal motions (<kbd style="text-transform: none;">\h</kbd>)</h3>
795
796 <p>
797 Whenever you need to move forward or backward on a line, use the
798 inline
799 <br/>
800 <span class="pre-in-pp">
801   \h'&lt;distance&gt;'
802 </span>
803 In order to avoid unpleasant surprises, always append a
804 <a href="definitions.html#unitofmeasure">unit of measure</a>
805 to <kbd>&lt;distance&gt;</kbd>.  For example,
806 <br/>
807 <span class="pre-in-pp">
808   \h'1.25i'
809 </span>
810 moves you 1.25 inches to the right (forward) of the horizontal
811 position on the current
812 <a href="definitions.html#outputline">output line</a>.
813 </p>
814
815 <div class="box-tip">
816 <p class="tip">
817 <span class="note">Note:</span>
818 <kbd>\h'&lt;distance&gt;'</kbd> is exactly equivalent to
819 <a href="#fwd"><kbd>\*[FWD n&lt;unit&gt;]</kbd></a>.
820 </p>
821 </div>
822
823 <p>
824 To move backwards by the same amount, do
825 <br/>
826 <span class="pre-in-pp">
827   \h'-1.25i'
828 </span>
829 </p>
830
831 <div class="box-tip">
832 <p class="tip" style="margin-top: -1em;">
833 <span class="note">Note:</span>
834 <kbd>\h'-&lt;distance&gt;'</kbd> is exactly equivalent to
835 <a href="#bck"><kbd>\*[BCK n&lt;unit&gt;]</kbd></a>.
836 </p>
837 </div>
838
839 <!-- -INLINE_VERTICAL_GROFF- -->
840
841 <h3 id="inline-vertical-groff" class="docs">Inline vertical motions (<kbd style="text-transform: none;">\v</kbd>)</h3>
842
843 <p>
844 If you need to raise or lower type on a line (say, for sub- or
845 superscripts, or any other special effect), use
846 <br/>
847 <span class="pre-in-pp">
848   \v'&lt;distance&gt;'
849 </span>
850 In order to avoid unpleasant surprises, always append a
851 <a href="definitions.html#unitofmeasure">unit of measure</a>
852 to <kbd>&lt;distance&gt;</kbd>.  For example, 
853 <br/>
854 <span class="pre-in-pp">
855   \v'.6m'
856 </span>
857 moves you (approx.) 2/3 of an
858 <a href="definitions.html#em">em</a>
859 downward on the current
860 <a href="definitions.html#outputline">output line</a>.
861 </p>
862
863 <div class="box-tip">
864 <p class="tip">
865 <span class="note">Note:</span>
866 <kbd>\v'&lt;distance&gt;'</kbd> is exactly equivalent to
867 <a href="#down"><kbd>\*[DOWN n&lt;unit&gt;]</kbd></a>.
868 </p>
869 </div>
870
871 <p style="margin-top: -.5em;">
872 To move upward an equivalent amount, do
873 <br/>
874 <span class="pre-in-pp">
875   \v'-.6m'
876 </span>
877 </p>
878
879 <div class="box-tip" style="margin-top: -1em;">
880 <p class="tip">
881 <span class="note">Note:</span>
882 <kbd>\v'&lt;-distance&gt;'</kbd> is exactly equivalent to
883 <a href="#up"><kbd>\*[UP n&lt;unit&gt;]</kbd></a>.
884 </p>
885 </div>
886
887 <div class="box-important">
888 <p class="tip">
889 <span class="important">Important:</span>
890 The vertical motion of <kbd>\v</kbd> affects ONLY type on the
891 current
892 <a href="definitions.html#outputline">output line</a>.
893 When groff breaks the output line, the effect of
894 <kbd>\v</kbd> is cancelled; the baseline of the next output line
895 is where it would be if you hadn&#8217;t used <kbd>\v</kbd>.
896 </p>
897 </div>
898
899 <div class="box-tip">
900 <p class="tip">
901 <span class="tip">Tip:</span>
902 When using <kbd>\v</kbd> for occasional effects in a line,
903 don&#8217;t forget to reverse it when you've done what you want to
904 do.  Otherwise, the remaining type will be set too high (if you
905 used <kbd>\v</kbd> with the minus sign) or too low (if you used
906 <kbd>\v</kbd> without the minus sign).
907 </p>
908 </div>
909
910 <!-- -INLINE_STRINGWIDTH_GROFF- -->
911
912 <h3 id="inline-stringwidth-groff" class="docs">String width function (<kbd style="text-transform: none;">\w</kbd>)</h3>
913
914 <p>
915 In the context of mom, the string width inline
916 <kbd>\w'&lt;string&gt;'</kbd> primarily serves to let you establish the
917 horizontal measure of something (eg indents) based on the length
918 of a bit of text.  For example, if you want a left indent the length
919 of the word &#8220;Examples:&#8221; plus a space, you can set it with
920 the <kbd>\w</kbd> inline escape:
921 <br/>
922 <span class="pre-in-pp">
923   .IL "\w'Examples: '"
924 </span>
925 </p>
926
927 <div class="box-tip" style="margin-top: -1em;">
928 <p class="tip">
929 <span class="note">Note:</span>
930 Whenever you pass <kbd>\w'string'</kbd>
931 to a macro that normally requires a
932 <a href="definitions.html#unitofmeasure">unit of measure</a>,
933 <i>do NOT add a unit of measure to the</i>
934 <kbd>\w'string'</kbd> <i>argument.</i>
935 </p>
936
937 <p class="tip-bottom">
938 Furthermore, if the string is composed of several words separated
939 by spaces, you MUST surround the whole escape with double quotes,
940 as in the example above.
941 </p>
942 </div>
943
944 <!-- -INLINE_LINEDRAWING_GROFF- -->
945
946 <h3 id="inline-linedrawing-groff" class="docs">Horizontal line drawing function (<kbd style="text-transform: none;">\l</kbd>)</h3>
947
948 <p>
949 The <kbd>\l'distance'</kbd> inline allows you to draw a horizontal
950 rule of the specified distance.  You must supply a
951 <a href="definitions.html#unitofmeasure">unit of measure</a>.
952 Therefore, to set a 3-pica rule into a line of text, you'd do
953 <br/>
954 <span class="pre-in-pp">
955   A line of text with a superfluous \l'3P' 3-pica rule in it.
956 </span>
957 <kbd>\l'3P'</kbd>, above, not only draws the rule, but advances 3
958 picas horizontally as well, just as you'd expect.
959 </p>
960
961 <p>
962 For an easy way of drawing rules to the full measure of the current
963 line or tab length, see
964 <a href="#inline-rule-mom">Full measure rules</a>.
965 </p>
966
967 <p>
968 The weight (thickness) of rules varies according to the point
969 size in effect when you invoke <kbd>\l</kbd>, but you can&#8217;t fix
970 the weight with any real precision.  A point size of 12 produces
971 a tastefully moderate rule weight of between one-half and one
972 point (depending on your printer).
973 </p>
974
975 <div class="box-tip">
976 <p class="tip">
977 <span class="note">Note:</span>
978 Besides <kbd>\l</kbd>, <b>groff</b> provides a number of more
979 sophisticated &#8220;drawing&#8221; escapes.  It is well beyond
980 the scope of this documentation to demonstrate their usage; see
981 <br/>
982 <span class="pre-in-pp">
983   info groff =&gt; Escape index =&gt; \D
984 </span>
985 for directions concerning their use.  The drawing escapes can be a
986 bit unwieldy, so mom provides &#8220;user-friendly&#8221; macros for
987 the
988 <a href="graphical.html#top">graphical objects</a>
989 most commonly enountered in typesetting: horizontal and vertical
990 rules, boxes, and circles (ellipses).
991 </p>
992
993 <p class="tip-bottom">
994 Additionally, groff comes with two &#8220;preprocessors&#8221; that
995 let you create ruled tables and vector diagrams (line drawings):
996 <b>tbl</b> and <b>pic</b>.  The documentation for <b>tbl</b> can be
997 downloaded from
998 <br/>
999   <a style="display: inline-block; margin-left: 2em; margin-top: .5em; margin-bottom: .5em" href="http://cm.bell-labs.com/cm/cs/doc/76/tbl.ps.gz">http://cm.bell-labs.com/cm/cs/doc/76/tbl.ps.gz</a>
1000 <br/>
1001 and <b>pic</b> from
1002 <br/>
1003   <a style="display: inline-block; margin-left: 2em; margin-top: .5em; margin-bottom: .5em" href="http://www.kohala.com/start/troff/gpic.raymond.ps">http://www.kohala.com/start/troff/gpic.raymond.ps</a>
1004 <br/>
1005 Both are powerful tools, but they can be nasty to learn&mdash;at
1006 first, anyway.  You may prefer to use a vector drawing program
1007 to create diagrams and tables; inserting the results into a
1008 document is easy enough with
1009 <a href="images.html#pdf-image">PDF_IMAGE</a>
1010 or
1011 <a href="images.html#pspic">PSPIC</a>.
1012 </p>
1013 </div>
1014
1015 <!-- -INLINE_CHARACTERS_GROFF- -->
1016
1017 <h3 id="inline-characters-groff" class="docs">Special characters and symbols</h3>
1018 <p>
1019 Here follows a short list of commonly-used special characters
1020 available via inline escapes.  If you&#8217;re not sure of the
1021 meaning of some of these characters, consult the
1022 <a href="definitions.html#top">Definitions of Terms</a>.
1023 </p>
1024
1025 <p>
1026 For a complete list of special characters and glyphs (ie just
1027 about anything you'd ever want to appear on the printed page,
1028 including mathematical symbols, accented characters, unusual
1029 ligatures and letters unique to various European languages), consult
1030 <kbd>man groff-char</kbd>.
1031 </p>
1032
1033 <span class="pre">
1034   CHARACTER                   ESCAPE SEQUENCE
1035   ---------                   ---------------
1036   Comment line                \# or .\"
1037   Fixed-width space           \&lt;space&gt; (ie backslash followed by a space)
1038   Unbreakable space           \~
1039   Digit-width (figure) space  \0
1040   Zero-width character        \&amp;
1041   Discretionary hyphen        \%
1042   Backslash                   \\ or \e
1043   Plus&#47;minus (arithmetic)     \[+-]
1044   Subtract (arithmetic)       \[mi]
1045   Multiply (arithmetic)       \[mu]
1046   Divide (arithmetic)         \[di]
1047   Em-dash                     \[em]
1048   En-dash                     \[en]
1049   Left double-quote           \[lq]
1050   Right double-quote          \[rq]
1051   Open (left) single-quote    \[oq]
1052   Close (right) single-quote  \[oq]
1053   Bullet                      \[bu]
1054   Ballot box                  \[sq]
1055   One-quarter                 \[14]
1056   One-half                    \[12]
1057   Three-quarters              \[34]
1058   Degree sign                 \[de]
1059   Dagger                      \[dg]
1060   Foot mark                   \[fm]
1061   Cent sign                   \[ct]
1062   Registered trademark        \[rg]
1063   Copyright                   \[co]
1064   Section symbol              \[se]
1065 </span>
1066 <br/>
1067
1068 <div class="rule-long"><hr/></div>
1069
1070 <!-- Navigation links -->
1071 <table style="width: 100%; margin-top: 12px;">
1072 <tr>
1073   <td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td>
1074   <td style="width: 33%; text-align: center;"><a href="#top">Top</a></td>
1075   <td style="width: 33%; text-align: right;"><a href="color.html#top">Next: Coloured text</a></td>
1076 </tr>
1077 </table>
1078
1079 </div>
1080
1081 <div class="bottom-spacer"><br/></div>
1082
1083 </body>
1084 </html>
1085 <!-- vim: fileencoding=utf-8: nomodified: -->