]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/groff/contrib/mom/momdoc/typemacdoc.html
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / groff / contrib / mom / momdoc / typemacdoc.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
5 <title>Mom -- Typesetting macros in document processing</title>
6 </head>
7 <body bgcolor="#dfdfdf">
8
9 <!====================================================================>
10
11 <a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
12 <a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
13 <a href="toc.html">Back to Table of Contents</a>
14 <p>
15
16 <a name="TOP"></a>
17 <a name="TYPESETTING">
18         <h1 align="center"><u>USING TYPESETTING MACROS DURING DOCUMENT PROCESSING</u></h1>
19 </a>
20
21 During document processing, most of the
22 <a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>
23 affect type in the document globally.  For example, if you turn kerning
24 off, pairwise kerning is disabled not only in paragraphs, but
25 also in headers, footers, quotes, and so on.
26 <p>
27 Typesetting macros that alter margins and line lengths affect
28 <a href="definitions.html#TERMS_RUNNING">running text</a>
29 globally (or at least try to), but leave headers/footers and footnotes
30 alone.  (To indent footnotes, see the full explanation of the
31 <a href="docelement.html#FOOTNOTE">FOOTNOTE</a>
32 macro.)
33 <p>
34 <strong>Mom</strong>'s tabs
35 (both
36 <a href="typesetting.html#TYPESETTING_TABS">typesetting tabs</a>
37 and
38 <a href="typesetting.html#STRING_TABS">string tabs</a>)
39 behave as expected in running text during document processing.  Tab
40 structures that do not exceed the line length of running text are
41 preserved sensibly from page to page, and, if
42 <a href="docprocessing.html#COLUMNS">COLUMNS</a>
43 are enabled, from column to column.
44 <p>
45 Some typesetting macros, however, when used during document
46 processing, behave in special ways.  These are the macros that deal
47 with the basic parameters of type style: horizontal and vertical
48 margins, line length,
49 <a href="definitions.html#TERMS_FAMILY">family</a>,
50 <a href="definitions.html#TERMS_FONT">font</a>,
51 <a href="definitions.html#TERMS_PS">point size</a>,
52 <a href="definitions.html#TERMS_LEADING">leading</a>,
53 and
54 <a href="definitions.html#TERMS_QUAD">quad</a>.
55
56 <p>
57 <strong>Mom</strong> assumes that any changes to these parameters
58 stem from a temporary need to set type in a style different from that
59 provided by <strong>mom</strong>'s
60 <a href="docelement.html#INDEX_DOCELEMENT">document element tags</a>.
61 In other words, you need to do a bit of creative typesetting in the
62 middle of a document.
63 <p>
64 The following lists those typesetting macros whose behaviour during
65 document processing requires some explanation.
66 (Please refer to
67 <a href="#TB_MARGINS">Top and bottom margins in document processing</a>
68 for information on how <strong>mom</strong> interprets
69 <a href="typesetting.html#T_MARGIN">T_MARGIN</a>
70 and
71 <a href="typesetting.html#B_MARGIN">B_MARGIN</a>
72 in document processing.  Additionally, see
73 <a href="#ADD_SPACE">ADD_SPACE</a>
74 if you encounter the problem of trying to get <strong>mom</strong>
75 to put space at the tops of pages after the first.)
76
77 <pre>
78 MACRO           EFFECT DURING DOCUMENT PROCESSING
79 -----           ---------------------------------
80
81 L_MARGIN        *The left margin of all running text
82                  assumes the new value.
83
84                 *The line length remains unaltered.
85
86                 *The header and footer left margin
87                  remain at the current document default.
88
89                 (You won't use this often by itself.  Most
90                  likely, you'll use it in combination with
91                  R_MARGIN or LL.)
92
93 R_MARGIN        *The right margin of all running text
94                  assumes the new value.  In other words,
95                  the line length is altered.
96
97                 *The header and footer right margin
98                  remain at the current document default.
99
100 LL              *The line length of all running text
101                  is set to the new value.
102
103                 *The header and footer line length remain
104                  at the current document default.
105
106 FAMILY          *Changes family for the duration of the
107                  current tag only.  As soon as another document
108                  element tag is invoked, the family reverts to
109                  the current default for the new tag.
110
111 FT              *Changes font for the duration of the
112                  current tag only.  As soon as another document
113                  element tag is entered, the font reverts
114                  to the current default for the new tag.
115
116                  N.B. -- \*[SLANT] and \*[BOLDER] affect
117                  paragraph text, and remain in effect for all
118                  paragraphs until turned off.  If you want to
119                  use them in a macro that takes a string
120                  argument, include the escape in the string.
121                  \*[COND] and \*[EXT] behave similarly.
122
123 PT_SIZE         *Changes point size for the duration of the
124                  current tag only.  As soon as another document
125                  element tag is entered, the point size reverts
126                  to the current document default for the new
127                  tag.
128
129 LS              *Changes line space for the duration of the
130                  current tag only.  As soon as another document
131                  element tag is entered, the line space reverts to
132                  the current document default for the new
133                  tag.
134
135                  Using LS to temporarily change leading within a
136                  document will almost certainly result in a bottom
137                  margin that doesn't align with the bottom margin
138                  of subsequent pages.  You'll need to use the SHIM
139                  macro to get mom back on track when you're ready
140                  to return to the document's default leading.
141
142 QUAD            *Changes quad for the duration of the
143                  current tag only.  As soon as another document
144                  element tag is entered, the quad reverts to
145                  the current document default for the new
146                  tag.
147
148                  N.B. -- Line-for-line quadding macros
149                  (LEFT, CENTER, RIGHT) are also temporary,
150                  overridden by the QUAD value of any subsequent
151                  document element tag.
152 </pre>
153 <hr>
154
155 <!=====================================================================>
156
157 <a name="TB_MARGINS">
158         <h2><u>Top and bottom margins in document processing</u></h2>
159 </a>
160
161 Normally, <strong>mom</strong> establishes the top and bottom margins
162 of
163 <a href="definitions.html#TERMS_RUNNING">running text</a>
164 in documents from the values of <strong>HEADER_MARGIN +
165 HEADER_GAP</strong> and <strong>FOOTER_MARGIN + FOOTER_GAP</strong>
166 respectively.  However, if you invoke
167 <a href="typesetting.html#T_MARGIN">T_MARGIN</a>
168 or
169 <a href="typesetting.html#B_MARGIN">B_MARGIN</a>
170 either before or after
171 <a href="docelement.html#START">START</a>,
172 they set the top and bottom margins of running text irrespective
173 of <strong>HEADER_GAP</strong> and <strong>FOOTER_GAP</strong>.
174 <p>
175 Put another way, in document processing, <strong>T_MARGIN</strong>
176 and <strong>B_MARGIN</strong> set the top and bottom margins of
177 running text, but have no effect on the placement of
178 <a href="definitions.html#TERMS_HEADER">headers</a>,
179 <a href="definitions.html#TERMS_FOOTER">footers</a>,
180 or page numbers.
181
182 <a name="ADD_SPACE">
183         <h2><u>ADD_SPACE</u></h2>
184 </a>
185
186 <p>
187 Occasionally, you may want to insert space before the start of
188 <a href="definitions.html#TERMS_RUNNING">running text</a>
189 on pages after the first.
190 <p>
191 You might have tried using
192 <a href="typesetting.html#ALD">ALD</a>
193 or
194 <a href="typesetting.html#SPACE">SPACE</a>
195 and found it did nothing.  This is because <strong>mom</strong>
196 normally inhibits any extra space before the start of running text
197 on pages after the first.
198 <p>
199 If you need the space, you must use the macro,
200 <strong>ADD_SPACE</strong>, in conjuction with
201 <a href="typesetting.html#NEWPAGE">NEWPAGE</a>.
202 <strong>ADD_SPACE</strong> takes as its single argument the
203 distance you want <strong>mom</strong> to advance from the normal
204 baseline position at the top of the page.  A
205 <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
206 is required.
207
208 <p>
209 For example, say you wanted to insert 2 inches of space before the
210 start of running text on a page other than the first.  You'd
211 accomplish it with
212
213 <p>
214 <pre>
215         .NEWPAGE
216         .ADD_SPACE 2i
217 </pre>
218
219 which would terminate your current page, break to a new page,
220 print the header (assuming headers are on) and insert 2 inches of
221 space before the start of running text.
222 <p>
223 Since adding space in this way is almost sure to disrupt
224 <strong>mom</strong>'s ability to guarantee perfectly flush bottom
225 margins, I highly recommend using the
226 <a href="docprocessing.html#SHIM">SHIM</a>
227 macro immediately after <strong>ADD_SPACE</strong>.
228 <p>
229 <hr>
230 <a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
231 <a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
232 <a href="#TOP">Top</a>&nbsp;&nbsp;
233 <a href="toc.html">Back to Table of Contents</a>
234 </body>
235 </html>