summaryrefslogtreecommitdiff
path: root/contrib/mom/momdoc/typemacdoc.html
blob: b95844fa643a50aaf2102752234af27f1a7ed4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
This file is part of groff, the GNU roff type-setting system.

Copyright (C) 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
Written by Peter Schaffter.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being this comment section, with no Front-Cover
Texts, and with no Back-Cover Texts.

A copy of the Free Documentation License is included as a file called
FDL in the main directory of the groff source package.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
<title>Mom -- Typesetting macros in document processing</title>
</head>
<body bgcolor="#dfdfdf">

<!-- ==================================================================== -->

<a name="TOP"></a>

<p>
<a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
<a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
</p>

<a name="TYPESETTING"><h1 align="center"><u>Using the typesetting macros during document processing</u></h1></a>

<p>
<a href="#BEHAVIOUR">Typesetting macro behaviour</a>
<br/>

<a href="#TB_MARGINS">Top and bottom margins in document processing</a>
<br/>

<a href="#SPACE">Inserting space at the top of a page</a>
<br/>

&nbsp;&nbsp;&nbsp;&nbsp;* <a href="#ADD_SPACE">ADD_SPACE</a>
</p>

<a name="BEHAVIOUR"><h2><u>Typesetting macro behaviour</u></h2></a>

<p>
During document processing, most of the
<a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>
affect type in the document globally.  For example, if you turn
kerning off, pairwise kerning is disabled not only in paragraphs,
but also in headers, footers, quotes, and so on.
</p>

<p>
Typesetting macros that alter margins and line lengths affect
<a href="definitions.html#TERMS_RUNNING">running text</a>
globally (or at least try to), but leave headers/footers and
footnotes alone.  (To indent footnotes, see the full explanation of
the
<a href="docelement.html#FOOTNOTE">FOOTNOTE</a>
macro.)
</p>

<p>
<strong>Mom</strong>'s tabs
(both
<a href="typesetting.html#TYPESETTING_TABS">typesetting tabs</a>
and
<a href="typesetting.html#STRING_TABS">string tabs</a>)
behave as expected in running text during document processing.  Tab
structures that do not exceed the line length of running text are
preserved sensibly from page to page, and, if
<a href="docprocessing.html#COLUMNS">COLUMNS</a>
are enabled, from column to column.
</p>

<p>
Some typesetting macros, however, when used during document
processing, behave in special ways.  These are the macros that deal
with the basic parameters of type style: horizontal and vertical
margins, line length,
<a href="definitions.html#TERMS_FAMILY">family</a>,
<a href="definitions.html#TERMS_FONT">font</a>,
<a href="definitions.html#TERMS_PS">point size</a>,
<a href="definitions.html#TERMS_LEADING">leading</a>,
and
<a href="definitions.html#TERMS_QUAD">quad</a>.
</p>

<p>
<strong>Mom</strong> assumes that any changes to these parameters
stem from a temporary need to set type in a style different from
that provided by <strong>mom</strong>'s
<a href="docelement.html#INDEX_DOCELEMENT">document element tags</a>.
In other words, you need to do a bit of creative typesetting in the
middle of a document.
</p>

<p>
The following lists those typesetting macros whose behaviour during
document processing requires some explanation.
(Please refer to
<a href="#TB_MARGINS">Top and bottom margins in document processing</a>
for information on how <strong>mom</strong> interprets
<a href="typesetting.html#T_MARGIN">T_MARGIN</a>
and
<a href="typesetting.html#B_MARGIN">B_MARGIN</a>
in document processing.  Additionally, see
<a href="#ADD_SPACE">ADD_SPACE</a>
if you encounter the problem of trying to get <strong>mom</strong>
to put space at the tops of pages after the first.)
</p>

<pre>
MACRO           EFFECT DURING DOCUMENT PROCESSING
-----           ---------------------------------

L_MARGIN        *The left margin of all running text
                 assumes the new value.

                *The line length remains unaltered.

                *The header and footer left margin
                 remain at the current document default.

                (You won't use this often by itself.  Most
                 likely, you'll use it in combination with
                 R_MARGIN or LL.)

R_MARGIN        *The right margin of all running text
                 assumes the new value.  In other words,
                 the line length is altered.

                *The header and footer right margin
                 remain at the current document default.

LL              *The line length of all running text
                 is set to the new value.

                *The header and footer line length remain
                 at the current document default.

FAMILY          *Changes family for the duration of the
                 current tag only.  As soon as another document
                 element tag is invoked, the family reverts to
                 the current default for the new tag.

FT              *Changes font for the duration of the
                 current tag only.  As soon as another document
                 element tag is entered, the font reverts
                 to the current default for the new tag.

                 N.B. &mdash; \*[SLANT] and \*[BOLDER] affect
                 paragraph text, and remain in effect for all
                 paragraphs until turned off.  If you want to
                 use them in a macro that takes a string
                 argument, include the escape in the string.
                 \*[COND] and \*[EXT] behave similarly.

PT_SIZE         *Changes point size for the duration of the
                 current tag only.  As soon as another document
                 element tag is entered, the point size reverts
                 to the current document default for the new
                 tag.

LS              *Changes line space for the duration of the
                 current tag only.  As soon as another document
                 element tag is entered, the line space reverts to
                 the current document default for the new
                 tag.

                 Using LS to temporarily change leading within a
                 document will almost certainly result in a bottom
                 margin that doesn't align with the bottom margin
                 of subsequent pages.  You'll need to use the SHIM
                 macro to get mom back on track when you're ready
                 to return to the document's default leading.

QUAD            *Changes quad for the duration of the
                 current tag only.  As soon as another document
                 element tag is entered, the quad reverts to
                 the current document default for the new
                 tag.

                 N.B. &mdash; Line-for-line quadding macros
                 (LEFT, CENTER, RIGHT) are also temporary,
                 overridden by the QUAD value of any subsequent
                 document element tag.
</pre>

<hr/>

<!-- ===================================================================== -->

<a name="TB_MARGINS"><h2><u>Top and bottom margins in document processing</u></h2></a>

<p>
Normally, <strong>mom</strong> establishes the top and bottom
margins of
<a href="definitions.html#TERMS_RUNNING">running text</a>
in documents from the values of <strong>HEADER_MARGIN +
HEADER_GAP</strong> and <strong>FOOTER_MARGIN + FOOTER_GAP</strong>
respectively.  However, if you invoke
<a href="typesetting.html#T_MARGIN">T_MARGIN</a>
or
<a href="typesetting.html#B_MARGIN">B_MARGIN</a>
either before or after
<a href="docelement.html#START">START</a>,
they set the top and bottom margins of running text irrespective of
<strong>HEADER_GAP</strong> and <strong>FOOTER_GAP</strong>.
</p>

<p>
Put another way, in document processing, <strong>T_MARGIN</strong>
and <strong>B_MARGIN</strong> set the top and bottom margins of
running text, but have no effect on the placement of
<a href="definitions.html#TERMS_HEADER">headers</a>,
<a href="definitions.html#TERMS_FOOTER">footers</a>,
or page numbers.
</p>

<hr/>

<!-- ==================================================================== -->

<a name="SPACE"><h2><u>Inserting space at the top of a page</u></h2></a>

<p>
Occasionally, you may want to insert space before the start of
<a href="definitions.html#TERMS_RUNNING">running text</a>
on pages after the first.
</p>

<p>
You might have tried using
<a href="typesetting.html#ALD">ALD</a>
or
<a href="typesetting.html#SPACE">SPACE</a>
and found it did nothing.  This is because <strong>mom</strong>
normally inhibits any extra space before the start of running text
on pages after the first.
</p>

<p>
If you need the space, you must use the macro,
<strong>ADD_SPACE</strong>, in conjuction with
<a href="typesetting.html#NEWPAGE">NEWPAGE</a>.
</p>

<!-- -ADD_SPACE- -->

<hr width="66%" align="left"/>

<a name="ADD_SPACE"></a>

<p>
<nobr>Macro: <strong>ADD_SPACE</strong> <kbd>&lt;amount of space&gt;</kbd></nobr>
<br/>

<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
</p>

<p>
<strong>ADD_SPACE</strong> takes as its single argument the distance
you want <strong>mom</strong> to advance <em>from the normal
baseline position</em> at the top of any page after the first
(i.e. the one on which the docheader is normally printed).  A <a
href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> is
required.
</p>

<p>
For example, say you wanted to insert 2 inches of space before the
start of
<a href="definitions.html#TERMS_RUNNING">running text</a>
on a page other than the first.  You'd accomplish it with

<pre>
    .NEWPAGE
    .ADD_SPACE 2i
</pre>

which would terminate your current page, break to a new page,
print the header (assuming headers are on) and insert 2 inches of
space before the start of running text.
</p>

<p>
Since adding space in this way is almost sure to disrupt
<strong>mom</strong>'s ability to guarantee perfectly flush bottom
margins, I highly recommend using the
<a href="docprocessing.html#SHIM">SHIM</a>
macro immediately after <strong>ADD_SPACE</strong>.
</p>

<hr/>

<p>
<a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
<a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
</p>

</body>
</html>

<!-- vim: fileencoding=latin1: nomodified:
-->