1 <?xml version="1.0" encoding="utf-8"?>
3 This file is part of groff, the GNU roff type-setting system.
5 Copyright (C) 2004-2018 Free Software Foundation, Inc.
6 Written by Peter Schaffter (peter@schaffter.ca).
8 Permission is granted to copy, distribute and/or modify this document
9 under the terms of the GNU Free Documentation License, Version 1.3 or
10 any later version published by the Free Software Foundation; with no
11 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
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.
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">
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" />
26 <body style="background-color: #f5faff;">
28 <!-- ==================================================================== -->
30 <div id="top" class="page">
32 <!-- Navigation links -->
33 <table style="width: 100%;">
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>
40 <h1 id="inline-escapes" class="docs">Inline escapes</h1>
42 <div style="text-align: center;">
43 <a href="#index-inlines">List of inline escapes</a>
46 <div class="rule-medium"><hr/></div>
48 <h2 id="intro-inlines" class="docs">Introduction</h2>
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.
60 Aside from altering type parameters within a line, inlines also tell
61 groff about special characters—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’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.
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."
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.
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
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’s personal inline escapes</a>.
105 Despite mom’s best intentions, there are still
106 a number of typesetting functions that can only be accomplished
107 with groff’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>
114 <div class="box-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>
120 <a href="definitions.html#stringargument">string arguments</a>.
124 <div class="macro-list-container">
125 <h3 id="index-inlines" class="macro-list">List of inline escapes</h3>
127 <ul class="macro-list">
128 <li id="inlines-mom"><a href="#inlines-mom-top">Mom’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>
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> <a href="#inline-fonts-groff">Font control</a></li>
146 <li><kbd>\h</kbd> <a href="#inline-horizontal-groff">Inline horizontal motions</a></li>
147 <li><kbd>\v</kbd> <a href="#inline-vertical-groff">Inline vertical motions</a></li>
148 <li><kbd>\w</kbd> <a href="#inline-stringwidth-groff">String width function</a></li>
149 <li><kbd>\l</kbd> <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>
155 <div class="rule-medium"><hr/></div>
157 <!-- -INLINE_FONTS_MOM- -->
159 <h2 id="inlines-mom-top" class="macro-group">Mom’s personal inline escapes</h2>
161 <h3 id="inline-fonts-mom" class="docs">Changing fonts</h3>
164 Mom provides five escapes for changing fonts inline:
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)*
175 <div class="box-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
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>.
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’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.
202 <p class="tip-bottom">
203 Additionally, if you’re designing your own
204 <a href="headfootpage.html#headfootpage-intro">HEADERS or FOOTERS</a>
205 and want to use mom’s inline escapes for changing fonts as
206 part of the left, centre and/or right strings, or in the strings
208 <a href="headfootpage.html#hdrftr-rectoverso">recto</a>
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>, e.g., <kbd>\E*[BD]</kbd>.
218 <!-- -INLINE_SIZE_MOM- -->
220 <h3 id="inline-size-mom" class="docs">Changing point size</h3>
222 Mom has two inline escapes for changing point size:
224 <span class="pre-in-pp">
225 \*[SIZE <size>]
229 <span class="pre-in-pp">
232 where “size” 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
236 <span class="pre-in-pp">
241 <span class="pre-in-pp">
244 Entering either <kbd>\*[SIZE]</kbd> or <kbd>\*S[]</kbd> with no
245 argument reverts to the former point size.
249 The advantage of the first form is that it’s easy to remember,
250 and follows mom’s usual inline syntax. The advantage of the
251 second is that it’s more concise.
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’s what you wish. Fractional sizes are, of course,
264 The size given to <kbd>\*[SIZE <size>]</kbd> or
265 <kbd>\*S[<size>]</kbd> may be expressed in plus or minus
266 terms, which can be very useful. In the following examples, the
267 word “mom” will be output 2 points larger than the point
268 size of the rest of the line.
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.
274 Please note that inline size changes do not update the leading if
275 <a href="typesetting.html#autolead">AUTOLEAD</a>
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’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’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>
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[<n>]</kbd>
294 and enter the inline beginning with <kbd>\E*</kbd>, like this:
295 <kbd>\E*S[<+|-><n>]</kbd>.
298 <p class="tip-bottom">
299 <span class="additional-note">Additional note:</span>
300 If you’re accustomed to groff’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
307 <!-- -CAPITALISATION- -->
309 <h3 id="uc-lc" class="docs">Capitalise a section of type</h3>
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:
315 <span class="pre-in-pp">
316 All work \*[UC]and\*[LC] no play makes Jack a dull boy.
318 The above produces, on output
320 <span class="pre-in-pp">
321 All work AND no play makes Jack a dull boy.
325 <div class="box-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>
331 <a href="headfootpage.html#hdrftr-strings">HEADER_<POSITION></a>
332 macro. Instead, use the control macro
333 <a href="headfootpage.html#_caps">HEADER_<POSITION>_CAPS.</a>
335 <a href="headfootpage.html#hdrftr-rectoverso">HEADER_RECTO</a>
337 <a href="headfootpage.html#hdrftr-rectoverso">FOOTER_RECTO</a>
338 (or _VERSO), supply the <kbd>CAPS</kbd> option to the appropriate
343 <!-- -INLINE_KERNING_MOM- -->
345 <h3 id="inline-kerning-mom" class="docs">Pairwise kerning</h3>
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>
354 Mom permits inline pairwise kerning through the use of the inline
357 <span class="pre-in-pp">
358 \*[BU <n>] Closes the space between letters (Back Units).
359 \*[FU <n>] Opens the space between letters (Forward Units).
361 <b><n></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.
369 <span class="pre-in-pp">
370 THE HUMAN COST OF COMMODIF\*[FU 1]YING FRESH W\*[BU 4]A\*[BU 5]TER
372 moves the letter Y in “COMMODIFYING” one kern unit away
373 from the letter F, and the letter A in “WATER” four
374 kern units closer to the letter W. Additionally, the letter T in
375 “WATER” is moved five kern units closer to the letter A.
379 For backward compatibility, the forms
381 <span class="pre-in-pp">
382 \*[BU1]...\*[BU36] Move backward 1...36 <a href="definitions.html#kernunit">kern units</a>
383 \*[FU1]...\*[FU36] Move forward 1...36 <a href="definitions.html#kernunit">kern units</a>
385 also exist (ie with no space before the number of kern units desired,
386 up to a limit of 36).
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
396 <span class="pre-in-pp">
399 To restore the kern unit to its default, invoke
400 <kbd>.KERN_UNIT</kbd> with an argument of <kbd>DEFAULT</kbd>.
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’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’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>
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<n>]</kbd>
419 and <kbd>\E*[FU<n>]</kbd> (ie with no space), and enter the
420 inline beginning with <kbd>\E*</kbd> rather than just <kbd>\*</kbd>,
421 e.g., <kbd>\E*[BU4]</kbd>.
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.
434 <!-- -INLINE_HORIZONTAL_MOM- -->
436 <h3 id="inline-horizontal-mom" class="docs">Horizontal inline movement</h3>
438 Sometimes, you may need to insert a specified amount amount of white
440 <a href="definitions.html#outputline">output line</a>,
441 or—occasionally—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.
447 Mom’s inline escapes for these horizontal movements are
449 <span id="bck" class="pre-in-pp">
450 \*[BCK <n unit>] Move backward inline the specified number of
451 <a href="definitions.html#unitofmeasure">units of measure</a>; decimal fractions are allowed.
454 <span id="fwd" class="pre-in-pp">
455 \*[FWD <n unit>] Move forward inline the specified number of
456 <a href="definitions.html#unitofmeasure">units of measure</a>; decimal fractions are allowed.
463 <span class="pre-in-pp">
464 1.\*[FWD 12p]The Free Trade Play-Offs: WalMart 100, Mexico 0
466 puts 12 points of space between <kbd>1.</kbd> and
470 <div class="box-tip">
472 <span class="note">Note:</span>
473 For backward compatibility, the forms
475 <span class="pre-in-pp">
476 \*[BP.25]...\*[BP12.75] Move backward .25...12.75 points
477 \*[FP.25]...\*[FP12.75] Move forward .25...12.75 points
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’s possible to do, for example,
482 <kbd>\*[FP.5]</kbd> or <kbd>\*[BP1.25]</kbd> up to a limit
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’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’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>
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<n>]</kbd>
502 and <kbd>\E*[FP<n>]</kbd> (ie with no space), and enter the
503 inline beginning with <kbd>\E*</kbd> rather than just <kbd>\*</kbd>,
504 e.g., <kbd>\E*[BP.75]</kbd>.
508 <!-- -INLINE_VERTICAL_MOM- -->
510 <h3 id="inline-vertical-mom" class="docs">Vertical inline movement</h3>
512 If you need to move portions of type up or down on a line, mom
513 provides the following inline escapes:
515 <span id="down" class="pre-in-pp">
516 \*[DOWN <n unit>] Move down inline the specified number of
517 <a href="definitions.html#unitofmeasure">units of measure</a>
519 <span id="up">\*[UP <n unit>] Move up inline the specified number of
520 <a href="definitions.html#unitofmeasure">units of measure</a></span>
524 <span class="pre-in-pp">
525 Tel: 905\*[UP 1p]-\*[DOWN 1p]4072
527 moves the hyphen in the telephone number up by 1 point, then
528 moves back down by the same amount.
531 <div class="box-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>.
540 <span class="additional-note">Additional note:</span>
541 For backward compatibility, the following are also available:
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)
549 <p class="tip-bottom">
550 Both <kbd>\*[ALD]</kbd> and <kbd>\*[RLD]</kbd> work in points, hence
551 you mustn’t use a unit of measure.
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’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’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>
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<n>]</kbd>
570 and <kbd>\E*[RLD<n>]</kbd> (ie with no space), and enter the
571 inline beginning with <kbd>\E*</kbd> rather than just <kbd>\*</kbd>,
572 e.g., <kbd>\E*[ALD.5]</kbd>.
576 <!-- -INLINE_B_MOM- -->
578 <h3 id="inline-b-mom" class="docs">Terminate a line without advancing on the page</h3>
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:
587 <span class="pre-in-pp">
592 The next line of text.
595 <kbd>\*[B]</kbd> works reliably regardless of the current
596 <a href="definitions.html#filled">fill mode</a>.
599 <!-- -INLINE_TB+_MOM- -->
601 <h3 id="tb-plus-mom" class="docs">Call the next sequential tab without advancing on the page</h3>
603 Sometimes, you want mom to move to the next tab in sequence (e.g.,
604 from TAB 1 to TAB 2, or TAB 8 to TAB 9) without mom advancing on the
606 <a href="typesetting.html#note-tn">here</a>
607 if you’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:
611 <span class="pre-in-pp">
613 Some text\*[TB+] \" In tab 1
614 Some more text \" In tab 2, same baseline.
617 <kbd>\*[TB+]</kbd> works reliably regardless of the current
618 <a href="definitions.html#filled">fill mode</a>.
621 <!-- -INLINE_RULE_MOM- -->
623 <h3 id="inline-rule-mom" class="docs">Full measure rules</h3>
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’t mean a whole heck of a lot if
628 you’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
633 <span class="pre-in-pp">
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>.
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.
652 The weight of the rule drawn with <kbd>\*[RULE]</kbd> is controlled
654 <a href="#rule-weight">RULE_WEIGHT</a>.
655 Mom’s default is 1/2 point.
658 <div class="box-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
665 <span class="pre-in-pp">
666 Signature__________________________________________
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>
672 <a href="typesetting.html#string-tabs">string tabs</a>.
674 <a href="goodies.html#pad-example">example</a>
676 <a name="RULE_EXCEPTION"></a>
680 Please also note that the inline escapes
681 <a href="#up"><kbd>\*[UP]</kbd></a>
683 <a href="#down"><kbd>\*[DOWN]</kbd></a>
684 cannot be used in conjunction with <kbd>\*[RULE]</kbd>.
687 <p>This <i>doesn’t</i> work:
689 <span class="pre-in-pp">
690 \*[DOWN 2p]\*[RULE]\*[UP 2p]
694 <span class="pre-in-pp">
701 <p class="tip-bottom">
703 <a href="#inline-linedrawing-groff">Horizontal line drawing function</a>
704 for more information on drawing horizontal rules.
708 <!-- -RULE_WEIGHT- -->
710 <div id="rule-weight" class="box-macro-args">
711 Macro: <b>RULE_WEIGHT</b> <kbd><weight in points></kbd>
715 • Must <span class="normal">not</span> have a
716 <a href="definitions.html#unitofmeasure">unit of measure</a>
719 Argument must be greater than 0 and less than 100; decimal
720 fractions are allowed.
724 RULE_WEIGHT allows you to tell mom how heavy (in other words, how
725 “thick”) you want the rules drawn with the inline
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
735 <span class="pre-in-pp">
741 RULE_WEIGHT also sets the weight of rules drawn
743 <a href="graphical.html#drh"><kbd>.DRH</kbd></a>
744 when DRH is not given any arguments.
747 <div class="rule-medium"><hr/></div>
749 <!-- -INLINE_FONT_GROFF- -->
751 <h2 id="inlines-groff-top" class="macro-group">Commonly-used groff inline escapes</h2>
753 <h3 id="inline-fonts-groff" class="docs">Font control (<kbd style="text-transform: none">\f</kbd>)</h3>
756 Groff’s basic mechanism for inline font control is the escape
757 <kbd>\f[<font>]</kbd>.
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])
769 <kbd>\f[<font>]</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).
777 <kbd>\f[<font>]</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:
783 <span class="pre-in-pp">
786 The command \f[CBI]ls -l\f[P] gives a "long" directory listing.
788 The Unix command <kbd>ls -l</kbd> will appear in Courier Bold Italic
789 in a line that is otherwise in Times Roman.
792 <!-- -INLINE_HORIZONTAL_GROFF- -->
794 <h3 id="inline-horizontal-groff" class="docs">Inline horizontal motions (<kbd style="text-transform: none;">\h</kbd>)</h3>
797 Whenever you need to move forward or backward on a line, use the
800 <span class="pre-in-pp">
803 In order to avoid unpleasant surprises, always append a
804 <a href="definitions.html#unitofmeasure">unit of measure</a>
805 to <kbd><distance></kbd>. For example,
807 <span class="pre-in-pp">
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>.
815 <div class="box-tip">
817 <span class="note">Note:</span>
818 <kbd>\h'<distance>'</kbd> is exactly equivalent to
819 <a href="#fwd"><kbd>\*[FWD n<unit>]</kbd></a>.
824 To move backwards by the same amount, do
826 <span class="pre-in-pp">
831 <div class="box-tip">
832 <p class="tip" style="margin-top: -1em;">
833 <span class="note">Note:</span>
834 <kbd>\h'-<distance>'</kbd> is exactly equivalent to
835 <a href="#bck"><kbd>\*[BCK n<unit>]</kbd></a>.
839 <!-- -INLINE_VERTICAL_GROFF- -->
841 <h3 id="inline-vertical-groff" class="docs">Inline vertical motions (<kbd style="text-transform: none;">\v</kbd>)</h3>
844 If you need to raise or lower type on a line (say, for sub- or
845 superscripts, or any other special effect), use
847 <span class="pre-in-pp">
850 In order to avoid unpleasant surprises, always append a
851 <a href="definitions.html#unitofmeasure">unit of measure</a>
852 to <kbd><distance></kbd>. For example,
854 <span class="pre-in-pp">
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>.
863 <div class="box-tip">
865 <span class="note">Note:</span>
866 <kbd>\v'<distance>'</kbd> is exactly equivalent to
867 <a href="#down"><kbd>\*[DOWN n<unit>]</kbd></a>.
871 <p style="margin-top: -.5em;">
872 To move upward an equivalent amount, do
874 <span class="pre-in-pp">
879 <div class="box-tip" style="margin-top: -1em;">
881 <span class="note">Note:</span>
882 <kbd>\v'<-distance>'</kbd> is exactly equivalent to
883 <a href="#up"><kbd>\*[UP n<unit>]</kbd></a>.
887 <div class="box-important">
889 <span class="important">Important:</span>
890 The vertical motion of <kbd>\v</kbd> affects ONLY type on the
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’t used <kbd>\v</kbd>.
899 <div class="box-tip">
901 <span class="tip">Tip:</span>
902 When using <kbd>\v</kbd> for occasional effects in a line,
903 don’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).
910 <!-- -INLINE_STRINGWIDTH_GROFF- -->
912 <h3 id="inline-stringwidth-groff" class="docs">String width function (<kbd style="text-transform: none;">\w</kbd>)</h3>
915 In the context of mom, the string width inline
916 <kbd>\w'<string>'</kbd> primarily serves to let you establish the
917 horizontal measure of something (e.g., 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 “Examples:” plus a space, you can set it with
920 the <kbd>\w</kbd> inline escape:
922 <span class="pre-in-pp">
927 <div class="box-tip" style="margin-top: -1em;">
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>
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.
944 <!-- -INLINE_LINEDRAWING_GROFF- -->
946 <h3 id="inline-linedrawing-groff" class="docs">Horizontal line drawing function (<kbd style="text-transform: none;">\l</kbd>)</h3>
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
954 <span class="pre-in-pp">
955 A line of text with a superfluous \l'3P' 3-pica rule in it.
957 <kbd>\l'3P'</kbd>, above, not only draws the rule, but advances 3
958 picas horizontally as well, just as you'd expect.
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>.
968 The weight (thickness) of rules varies according to the point
969 size in effect when you invoke <kbd>\l</kbd>, but you can’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).
975 <div class="box-tip">
977 <span class="note">Note:</span>
978 Besides <kbd>\l</kbd>, <b>groff</b> provides a number of more
979 sophisticated “drawing” escapes. It is well beyond
980 the scope of this documentation to demonstrate their usage; see
982 <span class="pre-in-pp">
983 info groff => Escape index => \D
985 for directions concerning their use. The drawing escapes can be a
986 bit unwieldy, so mom provides “user-friendly” macros for
988 <a href="graphical.html#top">graphical objects</a>
989 most commonly enountered in typesetting: horizontal and vertical
990 rules, boxes, and circles (ellipses).
993 <p class="tip-bottom">
994 Additionally, groff comes with two “preprocessors” 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
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>
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>
1005 Both are powerful tools, but they can be nasty to learn—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>
1011 <a href="images.html#pspic">PSPIC</a>.
1015 <!-- -INLINE_CHARACTERS_GROFF- -->
1017 <h3 id="inline-characters-groff" class="docs">Special characters and symbols</h3>
1019 Here follows a short list of commonly-used special characters
1020 available via inline escapes. If you’re not sure of the
1021 meaning of some of these characters, consult the
1022 <a href="definitions.html#top">Definitions of Terms</a>.
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>.
1034 CHARACTER ESCAPE SEQUENCE
1035 --------- ---------------
1036 Comment line \# or .\"
1037 Fixed-width space \<space> (ie backslash followed by a space)
1038 Unbreakable space \~
1039 Digit-width (figure) space \0
1040 Zero-width character \&
1041 Discretionary hyphen \%
1043 Plus/minus (arithmetic) \[+-]
1044 Subtract (arithmetic) \[mi]
1045 Multiply (arithmetic) \[mu]
1046 Divide (arithmetic) \[di]
1049 Left double-quote \[lq]
1050 Right double-quote \[rq]
1051 Open (left) single-quote \[oq]
1052 Close (right) single-quote \[oq]
1057 Three-quarters \[34]
1062 Registered trademark \[rg]
1064 Section symbol \[se]
1068 <div class="rule-long"><hr/></div>
1070 <!-- Navigation links -->
1071 <table style="width: 100%; margin-top: 12px;">
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>
1081 <div class="bottom-spacer"><br/></div>