diff options
Diffstat (limited to 'contrib/mom/momdoc/inlines.html')
-rw-r--r-- | contrib/mom/momdoc/inlines.html | 516 |
1 files changed, 516 insertions, 0 deletions
diff --git a/contrib/mom/momdoc/inlines.html b/contrib/mom/momdoc/inlines.html new file mode 100644 index 00000000..8a19d308 --- /dev/null +++ b/contrib/mom/momdoc/inlines.html @@ -0,0 +1,516 @@ +<html> +<head> +<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> +<title>Mom -- Inline escapes</title> +</head> +<body bgcolor="#dfdfdf"> + +<!====================================================================> + +<a href="docprocessing.html#TOP">Next</a> +<a href="goodies.html#TOP">Prev</a> +<a href="toc.html">Back to Table of Contents</a> + +<a name="TOP"></a> +<h2> + <a name="INLINE_ESCAPES"><u>Inline escapes</u></a> +</h2> + +<a href="#INLINE_ESCAPES_INTRO">Introduction to inline escapes</a> +<br> +<a href="#INDEX_INLINES">Index of inline escapes</a> +<br> + +<a name="INLINE_ESCAPES_INTRO"> + <h2><u>Introduction to inline escapes</u></h2> +</a> + +<a name="INTRO_INLINE_ESCAPES"> +Inline escapes, as described in the +<a href="definitions.html#TERMS_INLINES">groff terms</a> +section of this manual, are typesetting commands that appear in +text +<a href="definitions.html#TERMS_INPUTLINE">input lines</a>, +as opposed to macros and other +<a href="definitions.html#TERMS_CONTROLLINES">control lines</a> +that must appear on lines by themselves. +<p> +Aside from altering type parameters within a line, inlines also +tell groff about special characters -- em-dashes, bullets, +<a href="definitions.html#TERMS_FIGURESPACE">figure/digit-width spaces</a>, +and so on. It is beyond the scope of this manual to provide a +complete list of groff's inline functions and special characters. +I recommend having a look at the +<a href="intro.html#CANONICAL">canonical reference materials</a> +should you need more information than is contained herein. +<p> +In groff, the escape character is the backslash ( \ ). Groff interprets +everything following the backslash as instructions, not literal text, +until the escape sequence is complete. Should you need the actual +backslash character as part of a line of text, simply enter it twice +( \\ ). Groff understands that this means "please print a backslash +character." (You can also use <strong>\e</strong> to print a literal +backslash.) +<p> +Groff has a number of ways of recognising what constitutes a complete +escape sequence. This is both a boon and a curse; some escape +sequences have no terminating delimiter and consequently become +difficult to distinguish from real input text. Others require +the use of an opening parenthesis with no corresponding closing +parenthesis. Still others need to be enclosed in square brackets. +<p> +<strong>Mom</strong> recognises that certain escapes get used more +often than others. For these, she has a consistent input style that +takes the form \*[...], which makes them stand out well from the text +of your documents. These escapes are the ones listed under +<a href="#INLINES_MOM">Mom's personal inlines</a>. +<p> +Despite <strong>mom</strong>'s best intentions, there are still +a number of typesetting functions that can only be accomplished +with groff's native inline escapes. I've listed the ones that +strike me as essential, but there are many others. If you want +to know what they are, please read the +<a href="intro.html#CANONICAL">canonical reference materials</a> +pertaining to groff. +<p> +<strong>HELPFUL BIT OF INFORMATION:</strong> Inline escapes can be used +in +<a href="docprocessing.html#DOCPROCESSING">document processing macros</a> +that take +<a href="definitions.html#TERMS_STRINGARGUMENT">string arguments</a>. +<p> +<a name="INDEX_INLINES"><h3><u>Inlines index</u></h3></a> +<ul> + <li><a name="INLINES_MOM"><strong>Mom's personal inlines</strong></a> + <ul> + <li><a href="#INLINE_FONTS_MOM">Changing fonts</a> + <li><a href="#INLINE_SIZE_MOM">Changing point size</a> + <li><a href="#INLINE_KERNING_MOM">Pairwise kerning</a> + <li><a href="#INLINE_HORIZONTAL_MOM">Horizontal movement</a> + <li><a href="#INLINE_VERTICAL_MOM">Vertical movement</a> + </ul> + <li><a name="INLINES_GROFF"><strong>Groff inline escapes</strong></a> + <ul> + <li><a href="#INLINE_FONTS_GROFF">Font control</a> <strong>\f</strong> + <li><a href="#INLINE_HORIZONTAL_GROFF">Inline horizontal motions</a> <strong>\h</strong> + <li><a href="#INLINE_VERTICAL_GROFF">Inline vertical motions</a> <strong>\v</strong> + <li><a href="#INLINE_STRINGWIDTH_GROFF">String width function</a> <strong>\w</strong> + <li><a href="#INLINE_LINEDRAWING_GROFF">Horizontal line drawing function</a> <strong>\l</strong> + <li><a href="#INLINE_CHARACTERS_GROFF">Special characters</a> + </ul> +</ul> +<hr> + +<!---INLINE_FONTS_MOM---> + +<h2><u>Mom's personal inlines</u></h2> + +<a name="INLINE_FONTS_MOM"><h3><u>Changing fonts</u></h3></a> + +<p> +<strong>Mom</strong> provides five inlines to change fonts +inline. +<p> +<table valign="baseline" summary="inlinefonts"> +<tr><td width="15"><td><strong>\*[ROM]</strong><td>Change font to roman +<tr><td><td><strong>\*[IT]</strong><td>Change font to italic +<tr><td><td><strong>\*[BD]</strong><td>Change font to bold +<tr><td><td><strong>\*[BDI]</strong><td>Change font to bold italic +<tr><td><td><strong>\*[PREV]</strong><td>Revert to previous font</td></tr> +</table> +<p> +See also +<a href="#INLINE_FONTS_GROFF">font control with \f</a> +for other ways to change fonts inline. + +<p> +<strong>NOTE:</strong> If you're using the +<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>, +inline font changes remain in effect only for the duration of the +current macro. +<br> + +<!---INLINE_SIZE_MOM---> + +<hr width="66%" align="left"> +<a name="INLINE_SIZE_MOM"><h3><u>Changing point size</u></h3></a> + +<p> +<strong>Mom</strong>'s inline escape for changing point +size, sadly, does not observe her normal inline syntax +<strong>\*[whatever]</strong>. It's the only exception, and there's +no way around it. The escape for changing point size looks like this: +<p> +<pre> + \*S[size] +</pre> + +where "size" is the new size you want. For example, to +change the point size inline to 12 points, you'd enter +<p> +<pre> + \*S[12] +</pre> + +Notice that the new size does not require a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>; +<a href="definitions.html#TERMS_PICASPOINTS">points</a> +is assumed. However, a unit of measure may be appended to the size, +if that's what you wish. Fractional sizes are, of course, allowed. +<p> +The size given to <strong>\*S</strong> may be expressed in plus +or minus terms, which can be very useful. In the following +example, the word "mom" will be output 2 points larger +than the point size of the rest of the line. +<p> +<pre> + While she isn't perfect, \*S[+2]mom\*S[-2] isn't half bad. +</pre> + +<strong>NOTE:</strong> If you're accustomed to groff's usual way +of handling inline size requests (<kbd>\sN, \s±N, \s(NN, \s±(NN, +\s[NNN], \s±[NNN]</kbd>), feel free to continue with your old habits. +<strong>Mom</strong> doesn't care. +<br> + +<!---INLINE_KERNING_MOM---> + +<hr width="66%" align="left"> +<a name="INLINE_KERNING_MOM"><h3><u>Pairwise kerning</u></h3></a> + +<p> +Pairwise kerning means moving specific letter pairs closer +together or further apart (see +<a href="definitions.html#TERMS_KERN">Typesetting terms, kerning</a> +for more details). <strong>Mom</strong> permits inline pairwise +kerning through the use of the inline escapes +<p> +<table valign="baseline" summary="inlinekerning"> +<tr><td width="15"><td><strong>\*[BU1]...\*[BU36]</strong><td> +Move back 1...36 +<a href="definitions.html#TERMS_KERNUNITS">kern units</a> +<tr><td><td><strong>\*[FU1]...\*[FU36]</strong><td> +Move forward 1...36 +<a href="definitions.html#TERMS_KERNUNITS">kern units</a></td></tr> +</table> +<p> +For example, +<p> +<pre> + THE HUMAN COST OF COMMODIFYING FRESH W\*[BU4]ATER +</pre> + +moves the letter A in "WATER" four kern units closer +to the letter W. +<p> +<strong>NOTE:</strong> Using <strong>BU</strong> or <strong>FU</strong> +between characters pairs that are already automatically kerned +disables the automatic kerning and uses the value you give to +<strong>BU</strong> or <strong>FU</strong> instead. +<br> + +<!---INLINE_HORIZONTAL_MOM---> + +<hr width="66%" align="left"> +<a name="INLINE_HORIZONTAL_MOM"><h3><u>Horizontal inline movement</u></h3></a> + +<p> +If you need to move backward or forward on a line by a just few +points, use +<p> +<table valign="baseline" summary="inlinehorizontal"> +<tr><td width="15"><td><strong>\*[BP1]...\*[BP12]</strong><td> +Move back 1...12 points +<tr><td><td><strong>\*[FP1]...\*[FP12]</strong><td> +Move forward 1...12 points</td></tr> +</table> +<p> +For example, +<p> +<pre> + 1.\*[FP12]The Free Trade Play-Offs: WalMart 100, Mexico 0 +</pre> + +puts 12 points of space between "1." and +"The". +<p> +Both <strong>\*[FP]</strong> and <strong>\*[BP]</strong> accept +quarter points as well. Hence it's possible to do, for example, +<strong>\*[FP.5]</strong> or <strong>\*[BP1.25]</strong> or +<strong>\*[ALD3.75]</strong>. +<p> +<strong>NOTE:</strong> If you need to move forward or backward by +more than 12.75 points, or wish to use a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> +other than points, use the groff inline +<a href="#INLINE_HORIZONTAL_GROFF">\h</a>. +<br> + +<!---INLINE_VERTICAL_MOM---> + +<hr width="66%" align="left"> +<a name="INLINE_VERTICAL_MOM"><h3><u>Vertical inline movement</u></h3></a> + +<p> +If you need to move up or down in a line by a just few +points, use +<p> +<table valign="baseline" summary="inlinevertical"> +<tr><td width="15"><td><strong>\*[ALD1]...\*[ALD12]</strong><td> +Advance lead 1...12 points (move downward) +<tr><td><td><strong>\*[RLD1]...\*[RLD12]</strong><td> +Reverse lead 1...12 points (move upward)</td></tr> +</table> +<p> +For example, +<p> +<pre> + Tel: 905\*[RLD1]-\*[ALD1]4072 +</pre> + +moves the hyphen in the telephone number up by 1 point, then +moves back down by the same amount. +<p> +Both <strong>\*[ALD]</strong> and <strong>\*[RLD]</strong> accept +quarter points as well. Hence it's possible to do, for example, +<strong>\*[RLD3.25]</strong> or <strong>\*[ALD1.5]</strong> or +<strong>\*[ALD4.75]</strong>. +<p> +<strong>NOTE:</strong> If you need to move up or down by +more than 12.75 points, or wish to use a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> +other than points, use the groff inline +<a href="#INLINE_VERTICAL_GROFF">\v</a>. +<br> +<hr> + +<!---INLINE_FONT_GROFF---> + +<h2><u>Groff inline escapes</u></h2> + +<a name="INLINE_FONTS_GROFF"><h3><u>Font control with \f</u></h3></a> + +<p> +Groff's basic mechanism for inline font control is the escape +<strong>\f</strong>. +<p> +<table valign="baseline" summary="inlinefontsgroff"> +<tr><td width="15"><td><strong>\fR</strong><td>Change font to roman +<tr><td><td><strong>\fI</strong><td>Change font to italic +<tr><td><td><strong>\fB</strong><td>Change font to bold +<tr><td><td><strong>\f(BI</strong><td>Change font to bold italic +<tr><td><td><strong>\fP</strong><td>Revert to previous font</td></tr> +</table> +<p> +A special instance of <strong>\f</strong> is +<strong>\f[font]</strong>, where "font" can be a +complete legal family/font name combo. This is especially +useful should you need to change both family and font inline. +For example, if your prevailing family and font are Times Roman +and you want a few words in Courier Bold Italic, you could do +this: +<p> +<pre> + .FAM T + .FT R + The command \f[CBI]ls -l\fP gives a "long" directory listing. +</pre> + +The Unix command "ls -l" will appear in Courier Bold Italic +in a line that is otherwise in Times Roman. +<br> + +<!---INLINE_HORIZONTAL_GROFF---> + +<hr width="66%" align="left"> +<a name="INLINE_HORIZONTAL_GROFF"><h3><u>Inline horizontal motions with \h</u></h3></a> + +<p> +Whenever you need to move forward or backward on a line, use the inline +<strong>\h'distance'</strong>. In order to avoid unpleasant surprises, +always append a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> +to "distance". +<p> +<pre> + \h'1.25i' +</pre> + +moves you 1.25 inches to the right (forwards) of the horizontal +position on the current +<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>. +<p> +<pre> + \h'-1.25i' +</pre> + +moves you 1.25 inches to the left (backwards). +<br> + +<!---INLINE_VERTICAL_GROFF---> + +<hr width="66%" align="left"> +<a name="INLINE_VERTICAL_GROFF"><h3><u>Inline vertical motions with \v</u></h3></a> + +<p> +If you need to raise or lower type on a line (say, for sub- or +superscripts, or any other special effect), use +<strong>\v'distance'</strong>. In order to avoid unpleasant +surprises, always append a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> +to "distance". +<p> +<pre> + \v'.6m' +</pre> + +moves you (approx.) 2/3 of an +<a href="definitions.html#TERMS_EM">em</a> +downward on the current +<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>. +<p> +<pre> + \v'-.6m' +</pre> + +moves you (approx.) 2/3 of an em upward. +<p> +<strong>IMPORTANT:</strong> The vertical motion of <strong>\v</strong> +affects ONLY type on the current +<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>. +When groff breaks the output line, the effect of +<strong>\v</strong> is cancelled; the baseline of the next output line +is where it would be if you hadn't used <strong>\v</strong>. +<p> +<strong>TIP:</strong> When using <strong>\v</strong> for +occasional effects on a line, don't forget to reverse it when +you've done what you want to do. Otherwise, the remaining type +will be set too high (if you used <strong>\v</strong> with the +minus sign) or too low (if you used <strong>\v</strong> without +the minus sign). +<br> + +<!---INLINE_STRINGWIDTHL_GROFF---> + +<hr width="66%" align="left"> +<a name="INLINE_STRINGWIDTH_GROFF"><h3><u>String width function \w</u></h3></a> + +<p> +In the context of <strong>mom</strong>, the string width inline +<strong>\w'string'</strong> primarily serves to let you +establish the horizontal measure of something (e.g. indents) based +on the length of a bit of text. For example, if you want a left +indent the length of the word "Examples:" plus a +space, you can set it with the <strong>\w</strong> inline escape: +<p> +<pre> + .IL "\w'Examples: '" +</pre> + +<strong>NOTE:</strong> Whenever you pass <strong>\w'string'</strong> +to a macro that normally requires a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>, +<em>do <strong>NOT</strong> add a unit of measure to the \w'string' +argument.</em> +<p> +Furthermore, if the string is composed of several words separated +by spaces, you MUST surround the whole escape with double quotes, +as in the example above. +<br> + +<!---INLINE_LINEDRAWING_GROFF---> + +<hr width="66%" align="left"> +<a name="INLINE_LINEDRAWING_GROFF"><h3><u>Horizontal line drawing function \l</u></h3></a> + +<p> +The <strong>\l'distance'</strong> inline allows you to draw a +horizontal rule of the specified distance. You must supply a +<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>. +Therefore, to set a 3-pica rule into a line of text, you'd do +<p> +<pre> + A line of text with a superfluous \l'3P' 3-pica rule in it. +</pre> + +<strong>\l'3P'</strong> above not only draws the rule, but +advances 3 picas horizontally as well, just as you'd expect. +<p> +The weight (thickness) of rules varies according to the point size +in effect when you invoke <strong>\l</strong>, but you can't fix +the weight with any real precision. A point size of 12 produces +a tastefully moderate rule weight of between one-half and one +point (depending on your printer), and is the point size used by +<strong>mom</strong> for all macros and routines that create rules. +<p> +<strong>NOTE:</strong> There are, in addition to <strong>\l</strong>, +a number of other line-drawing escapes, but frankly, using them for +typographically precise drawing is a bit like hammering in a nail +with a screwdriver -- doable, but not recommended. +<p> +Groff comes with a number of "preprocessors" designed to ease +creating rules, boxes, splines, and so on (tbl, pic, and friends), but +I tend not to use them. A firm believer in the "right tool for +the job," I prefer a vector drawing program (in my case, tgif) +when I need to combine type with graphic elements (say, a complex +ruled form). Inserting the results into a document is easy enough +with <strong>.PSPIC</strong> (consult the <strong>grops</strong> +man page for information on this indispensible and easy-to-use macro). +<br> + +<!---INLINE_CHARACTERS_GROFF---> + +<hr width="66%" align="left"> +<a name="INLINE_CHARACTERS_GROFF"><h3><u>Special characters and symbols</u></h3></a> + +<p> +Here follows a short list of commonly-used special characters available +via inline escapes. If you're not sure of the meaning of some of +these characters, consult the +<a href="definitions.html#TERMS">Definitions of Terms</a>. +For a more complete list, consult the section <em>Special +Character Names</em> at the end of the <em>Tutorial Examples</em> +in <strong>cstr54</strong>, available +<a href="http://www.kohala.com/start/troff/">here</a>. + +<p> +<pre> + CHARACTER ESCAPE SEQUENCE + --------- --------------- + + Comment line \# + Fixed-width space \<space> i.e. backslash followed by a space + Unbreakable space \~ + Digit-width (figure) space \0 + Zero-width character \& + Discretionary hyphen \% + Backslash \\ or \e + Plus/minus (arithmetic) \(+- + Subtract (arithmetic) \(mi + Multiply (arithmetic) \(mu + Divide (arithmetic) \(di + Em-dash \(em + En-dash \(en + Left double-quote \(lq + Right double-quote \(rq + Bullet \(bu + Ballot box \(sq + One-quarter \(14 + One-half \(12 + Three-quarters \(34 + Degree sign \(de + Dagger \(dg + Foot mark \(fm + Cent sign \(ct + Registered trademark \(rg + Copyright \(co + Section symbol \(se +</pre> + +<hr> +<a href="docprocessing.html#TOP">Next</a> +<a href="goodies.html#TOP">Prev</a> +<a href="#TOP">Top</a> +<a href="toc.html">Back to Table of Contents</a> +</body> +</html> |