intro.html revision 1.1 1 1.1 christos <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 1.1 christos <html>
3 1.1 christos <head>
4 1.1 christos <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
5 1.1 christos <title>What is mom?</title>
6 1.1 christos </head>
7 1.1 christos <body bgcolor="#dfdfdf">
8 1.1 christos
9 1.1 christos <!====================================================================>
10 1.1 christos
11 1.1 christos <a href="definitions.html#TOP">Next</a>
12 1.1 christos <a href="toc.html">Back to Table of Contents</a>
13 1.1 christos
14 1.1 christos <a name="TOP"></a>
15 1.1 christos <a name="INTRO">
16 1.1 christos <h1 align="center"><u>WHAT IS MOM?</u></h1>
17 1.1 christos </a>
18 1.1 christos
19 1.1 christos <a href="#INTRO_INTRO">Who is mom meant for?</a>
20 1.1 christos <br>
21 1.1 christos <a href="#INTRO_TYPESETTING">Typesetting with mom</a>
22 1.1 christos <br>
23 1.1 christos <a href="#INTRO_DOCPROCESSING">Document processing with mom</a>
24 1.1 christos <br>
25 1.1 christos <a href="#INTRO_PHILOSOPHY">Mom's philosophy</a>
26 1.1 christos <br>
27 1.1 christos <a href="#INTRO_DOCUMENTATION">A note on mom's documentation</a>
28 1.1 christos <br>
29 1.1 christos <a href="#CANONICAL">Canonical reference materials</a>
30 1.1 christos <br>
31 1.1 christos <a href="#MACRO_ARGS">How to read macro arguments</a>
32 1.1 christos
33 1.1 christos <h2><a name="INTRO_INTRO"><u>Who is mom meant for?</u></a></h2>
34 1.1 christos
35 1.1 christos <strong>Mom</strong> ("my own macros", "my other
36 1.1 christos macros", "maximum overdrive macros"...) is a macro set for
37 1.1 christos groff, designed to format documents for PostScript output.
38 1.1 christos She's aimed at three kinds of users:
39 1.1 christos <br>
40 1.1 christos <ol>
41 1.1 christos <li>typesetters who suspect groff might be "the right
42 1.1 christos tool for the job" but who are
43 1.1 christos frustrated/intimidated by groff's terse, geeky,
44 1.1 christos not-always-typographically-intuitive
45 1.1 christos <a href="definitions.html#TERMS_PRIMITIVES">primitives</a>;
46 1.1 christos <br>
47 1.1 christos <li>non-scientific writers (novelists, short story writers,
48 1.1 christos journalists, students) who just want their work to
49 1.1 christos look good;
50 1.1 christos <br>
51 1.1 christos <li>newbies to computer typesetting, document processing, or
52 1.1 christos groff who need a well-documented macro set to help them get
53 1.1 christos started.
54 1.1 christos </ol>
55 1.1 christos <p>
56 1.1 christos As might be inferred from the above, <strong>mom</strong> is two macro
57 1.1 christos packages in one: a set of typesetting macros, and a set of document
58 1.1 christos processing macros. The typesetting macros govern the physical
59 1.1 christos aspects of page layout and provide sane, comprehensible control over
60 1.1 christos typographic refinements. The document processing macros let you focus
61 1.1 christos on a document's content and logical structure without worrying about
62 1.1 christos typesetting or page layout at all.
63 1.1 christos <p>
64 1.1 christos Because <strong>mom</strong> provides both typesetting and document
65 1.1 christos processing macros, it's safe to say she blurs the distinction between
66 1.1 christos document processing and document design. While her basic document style
67 1.1 christos comes with pretty spiffy defaults (okay--change "spiffy"
68 1.1 christos to "typographically professional"), you can easily control
69 1.1 christos how all the various document elements look: titles, page headers and
70 1.1 christos footers, page numbering, heads, subheads, footnotes and so on can be
71 1.1 christos made to come out exactly the way you want. And should you need precise
72 1.1 christos typographic control over elements in a document that fall outside the
73 1.1 christos range of <strong>mom</strong>'s document element tags, you don't have to
74 1.1 christos read up on groff
75 1.1 christos <a href="definitions.html#TERMS_PRIMITIVES">primitives</a>
76 1.1 christos in order to accomplish what you want; the typesetting macros take
77 1.1 christos care of that.
78 1.1 christos <p>
79 1.1 christos
80 1.1 christos <a name="INTRO_TYPESETTING">
81 1.1 christos <h2><u>Typesetting with mom</u></h2>
82 1.1 christos </a>
83 1.1 christos
84 1.1 christos <strong>Mom</strong>'s typesetting macros control the basic parameters
85 1.1 christos of type: margins, line length, type family, font, point size,
86 1.1 christos linespacing, and so on. In addition, they allow you to move around
87 1.1 christos on the page horizontally and vertically, and to set up tabs, indents,
88 1.1 christos and columns. Finally, they let you adjust such typographic details as
89 1.1 christos justification style, letter spacing, word spacing, hyphenation, and
90 1.1 christos kerning.
91 1.1 christos
92 1.1 christos <p>
93 1.1 christos In terms of typographic control, these macros resemble the
94 1.1 christos commands used on dedicated typesetting computers like Compugraphics and
95 1.1 christos Linotronics. Most of them simply give access to groff's typesetting
96 1.1 christos primitives in a way that's consistent and easy to use. A few of
97 1.1 christos them (tabs and indents, for example) handle fundamental typesetting
98 1.1 christos requirements in ways radically different from groff primitives.
99 1.1 christos
100 1.1 christos <p>
101 1.1 christos With <strong>mom</strong>'s typesetting macros, you can, if you wish,
102 1.1 christos create individual output pages that you design from the ground up.
103 1.1 christos Provided you have not signalled to <strong>mom</strong> that you
104 1.1 christos want document processing (via the
105 1.1 christos <a href="docprocessing.html#START">START</a>
106 1.1 christos macro; see below), every macro is a literal command that remains in
107 1.1 christos effect until you modify it or turn it off. This means that if you
108 1.1 christos want to create flyers, surveys, tabulated forms, curricula vitae and
109 1.1 christos so on, you may do so in the good old-fashioned way: one step at a
110 1.1 christos time with complete control over every element on the page.
111 1.1 christos <p>
112 1.1 christos Years of reading various mailing lists dealing with computer
113 1.1 christos typesetting (groff, TeX, and friends) have convinced me that no program
114 1.1 christos can ever replace the human eye and human input when it comes to high
115 1.1 christos quality typesetting. As of this writing, a thread on the subject of
116 1.1 christos "micro typography" in groff has been going on for nearly a
117 1.1 christos month. The reason for the lengthy thread is obvious; words and
118 1.1 christos punctuation on the printed page are too variable, too fluid, to be
119 1.1 christos rendered flawlessly by any algorithm, no matter how clever. (For
120 1.1 christos whatever it's worth, a similar problem exists with engraving musical
121 1.1 christos scores by computer.)
122 1.1 christos <p>
123 1.1 christos <strong>Mom</strong> does not try to solve the problems posed
124 1.1 christos by things like hanging punctuation, left-margin adjustments for
125 1.1 christos upper case letters like T and W, and so on. She merely tries to
126 1.1 christos provide tools that allow knowledgeable typesetters to come up with
127 1.1 christos solutions to these problems in ways that are easier and more
128 1.1 christos intuitive than manipulating groff at the
129 1.1 christos <a href="definitions.html#TERMS_PRIMITIVES">primitive</a>
130 1.1 christos level. As a professional typesetter of more than two decades, and a
131 1.1 christos writer, I have encountered few situations that cannot be handled by
132 1.1 christos <strong>mom</strong>'s typesetting macros.
133 1.1 christos <p>
134 1.1 christos <strong>Author's note:</strong> One area where groff itself needs
135 1.1 christos serious rethinking is in the matter of an algorithm that takes into
136 1.1 christos account both word and letter spacing when
137 1.1 christos <a href="definitions.html#TERMS_JUST">justifying</a>
138 1.1 christos lines. At present, only word spacing is adjusted, requiring what I
139 1.1 christos consider an unnecessary amount of user intervention whenever
140 1.1 christos letter spacing is required.
141 1.1 christos <p>
142 1.1 christos <a name="INTRO_DOCPROCESSING">
143 1.1 christos <h2><u>Document processing with mom</u></h2>
144 1.1 christos </a>
145 1.1 christos
146 1.1 christos <strong>Mom</strong>'s document processing macros let you format
147 1.1 christos documents without having to worry about the typographic details.
148 1.1 christos In this respect, <strong>mom</strong> is similar to other groff macro
149 1.1 christos packages, as well as to html and LaTeX. Where <strong>mom</strong>
150 1.1 christos differs is in the degree of control you have over the look and
151 1.1 christos placement of the various elements of a document. For example, if you
152 1.1 christos don't want your heads underlined, or you want them bigger/smaller,
153 1.1 christos or you'd prefer them to be in a different font, or you'd rather they
154 1.1 christos were flush left instead of centred, you can make the changes easily
155 1.1 christos and have them apply to the whole document. Temporary and one-off
156 1.1 christos changes are easy, too.
157 1.1 christos <p>
158 1.1 christos <strong>Mom</strong> has some nifty features other macro sets
159 1.1 christos don't provide. For example, you can switch between draft-style and
160 1.1 christos final-copy output. If you regularly make submissions to publishers
161 1.1 christos and editors who insist on "typewritten, double-spaced," there's a
162 1.1 christos special macro--
163 1.1 christos <a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>
164 1.1 christos --that changes typeset documents into ones that would make your
165 1.1 christos high-school typing teacher proud. Footnotes, endnotes, tables of
166 1.1 christos contents, multiple columns, nested lists, recto/verso printing and
167 1.1 christos user designable headers and footers are also part of the fun.
168 1.1 christos <p>
169 1.1 christos <a name="INTRO_PHILOSOPHY">
170 1.1 christos <h2><u>Mom's philosophy</u></h2>
171 1.1 christos </a>
172 1.1 christos
173 1.1 christos Formatting documents should be easy, from soup to nuts. Writers need
174 1.1 christos to focus on what they're writing, not on how it looks. From the
175 1.1 christos moment you fire up an editor to the moment you add "FINIS"
176 1.1 christos to your opus, nothing should interfere with the flow of your words.
177 1.1 christos The commands needed to format your work should be easy to remember,
178 1.1 christos comprehensible, and stand out well from the text. There shouldn't
179 1.1 christos be too much clutter. Your documents should be as readable inside a
180 1.1 christos text editor as they are on the printed page.
181 1.1 christos <p>
182 1.1 christos Unfortunately, in computerland, "easy,"
183 1.1 christos "comprehensible," and "readable" often mean
184 1.1 christos "you're stuck with what you get." No document formatting
185 1.1 christos system can give you exactly what you want all the time, every time.
186 1.1 christos Documents, it seems, always need to be tweaked, either to satisfy a
187 1.1 christos typographic whim or to clarify some aspect of their content.
188 1.1 christos <p>
189 1.1 christos Groff has traditionally solved the problem of formatting vs. tweaking
190 1.1 christos by requiring users of the common macro packages (mm, ms, me and their
191 1.1 christos offspring) to resort to groff
192 1.1 christos <a href="definitions.html#TERMS_PRIMITIVES">primitives</a>
193 1.1 christos and
194 1.1 christos <a href="definitions.html#TERMS_INLINES">inline escapes</a>
195 1.1 christos for their special typesetting needs. Not to put too fine a point on
196 1.1 christos it, groff primitives tend toward the abstruse, and most inline escapes
197 1.1 christos are about as readable in-line as an encrypted password. This does
198 1.1 christos not make for happy-camper writers, who either find themselves stuck
199 1.1 christos with a document formatting style they don't really like, or are
200 1.1 christos forced to learn groff from the ground up--a daunting task, to say
201 1.1 christos the least.
202 1.1 christos <p>
203 1.1 christos <strong>Mom</strong> aims to make creating documents a simple matter,
204 1.1 christos but with no corresponding loss of user control. The document
205 1.1 christos processing macros provide an excellent set of defaults, but if
206 1.1 christos something is not to your liking, you can change it. And in combination
207 1.1 christos with the typesetting macros, you have all the tools you need to
208 1.1 christos massage passages and tweak pages until they look utterly professional.
209 1.1 christos <p>
210 1.1 christos One rarely hears the word "user interface" in conjunction
211 1.1 christos with document processing. Since the user formatting takes place
212 1.1 christos inside a text editor, little thought is given to the look and feel
213 1.1 christos of the formatting commands. <strong>Mom</strong> attempts to rectify
214 1.1 christos this by providing users with a consistent, readable "coding"
215 1.1 christos style. Most of the macros (especially in the document processing set)
216 1.1 christos have humanly-readable names. Not only does this speed up learning
217 1.1 christos the macros, it makes the sense of what's going on in a document,
218 1.1 christos typographically and structurally, easier to decipher.
219 1.1 christos <p>
220 1.1 christos <strong>Mom</strong> does not try to be all things to all people.
221 1.1 christos In contrast to the normal groff philosophy, she does not try to
222 1.1 christos produce output that looks good no matter where it's displayed.
223 1.1 christos She's designed for printed output, although with
224 1.1 christos <a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>
225 1.1 christos she produces acceptable terminal copy. She makes no attempt to be
226 1.1 christos compatible with older versions of troff.
227 1.1 christos <p>
228 1.1 christos One special feature in <strong>mom</strong>'s design is the attention
229 1.1 christos she pays to aligning the bottom margins of every page. Nothing screams
230 1.1 christos "shoddy" in typeset documents louder than bottom margins
231 1.1 christos that wander, or, in typesetter jargon, "hang." There are,
232 1.1 christos of course, situations where whitespace at the bottom of a page may
233 1.1 christos be desirable (for example, you wouldn't want a head to appear at the
234 1.1 christos bottom of the page without some text underneath it), but in all cases
235 1.1 christos where hanging bottom margins can be avoided, <strong>mom</strong> does
236 1.1 christos avoid them, by clever adjustments to leading ("line spacing")
237 1.1 christos and the spacing between different elements on the page.
238 1.1 christos <p>
239 1.1 christos <a name="INTRO_DOCUMENTATION">
240 1.1 christos <h2><u>A note on mom's documentation</u></h2>
241 1.1 christos </a>
242 1.1 christos
243 1.1 christos Writing documentation is tough, no doubt about it. One is never
244 1.1 christos quite sure of the user's level of expertise. Is s/he new to the
245 1.1 christos application, new to its underlying protocols and programs, new to
246 1.1 christos the operating system, new to computers? At some point, one has to
247 1.1 christos decide who the documentation is for. Making the wrong decision can
248 1.1 christos mean the difference between a program that gets used and a program
249 1.1 christos that gets tossed.
250 1.1 christos <p>
251 1.1 christos <strong>Mom</strong>'s documentation assumes users know their way
252 1.1 christos around GNU/Linux. It further assumes they at least know what groff
253 1.1 christos is, even if they don't know much about it. Lastly, it assumes that
254 1.1 christos everyone--groff newbies and experts alike--learns faster from
255 1.1 christos a few well-placed examples than from manpage-style reference docs.
256 1.1 christos What <strong>mom</strong>'s documentation doesn't assume is that
257 1.1 christos you know everything--not about groff, not about typesetting,
258 1.1 christos not about document processing. Even experts have odd lacunae in
259 1.1 christos their knowledge base. Therefore, whenever I suspect that a term
260 1.1 christos or procedure will cause head scratching, I offer an explanation.
261 1.1 christos And when explanations aren't enough, I offer examples.
262 1.1 christos <br>
263 1.1 christos
264 1.1 christos <a name="CANONICAL"><h3><u>Canonical reference materials</u></h3></a>
265 1.1 christos <p>
266 1.1 christos The canonical reference materials for groff are
267 1.1 christos <strong>cstr54</strong> (a downloadable PostScript copy of which is
268 1.1 christos available
269 1.1 christos <a href="http://www.kohala.com/start/troff/">here</a>)
270 1.1 christos and the <strong>troff</strong> and <strong>groff_diff</strong>
271 1.1 christos manpages. Another excellent source of information (maybe the best)
272 1.1 christos is the groff <strong>info</strong> pages, available by typing
273 1.1 christos <p>
274 1.1 christos <pre>
275 1.1 christos info groff
276 1.1 christos </pre>
277 1.1 christos
278 1.1 christos at the command line (assuming you have <strong>info</strong>
279 1.1 christos installed on your system). And for inputting special characters,
280 1.1 christos see <strong>man groff_char.</strong>
281 1.1 christos <p>
282 1.1 christos I've tried to avoid reiterating the information contained in these
283 1.1 christos documents; however, in a few places, this has proved impossible.
284 1.1 christos But be forewarned: I have no qualms about sidestepping excruciating
285 1.1 christos completeness concerning groff usage; I'm more interested in getting
286 1.1 christos <strong>mom</strong> users up and running. <em>Mea culpa.</em>
287 1.1 christos <p>
288 1.1 christos <strong>Note:</strong> <strong>Mom</strong>'s macro file
289 1.1 christos (om.tmac) is heavily commented. Each macro is preceded by a
290 1.1 christos description of its arguments, function and usage, which may
291 1.1 christos give you information in addition to what's contained in this
292 1.1 christos documentation.
293 1.1 christos <p>
294 1.1 christos <a name="MACRO_ARGS">
295 1.1 christos <h3><u>How to read macro arguments</u></h3>
296 1.1 christos </a>
297 1.1 christos
298 1.1 christos The concise descriptions of macros in this documentation typically
299 1.1 christos look like this:
300 1.1 christos <blockquote>
301 1.1 christos Macro: <strong>NAME</strong> <nobr>arguments</nobr>
302 1.1 christos </blockquote>
303 1.1 christos <var>arguments</var> lists the macro's arguments using conventions that
304 1.1 christos should be familiar to anyone who has ever read a manpage. Briefly:
305 1.1 christos <p>
306 1.1 christos <ol>
307 1.1 christos <li>Macro arguments are separated from each other by spaces.
308 1.1 christos <li>If an argument is surrounded by chevrons
309 1.1 christos ( < > ), it's a description of the argument,
310 1.1 christos not the argument itself.
311 1.1 christos <li>If an argument begins with or is surrounded by double-quotes, the
312 1.1 christos double quotes MUST be included in the argument.
313 1.1 christos <li>If the user has a choice between several arguments, each of the
314 1.1 christos choices is separated by the pipe character ( | ),
315 1.1 christos which means "or."
316 1.1 christos <li>Arguments that are optional are surrounded by square brackets.
317 1.1 christos <li><off> in an argument list means that any argument
318 1.1 christos other than those in the argument list turns the macro off.
319 1.1 christos </ol>
320 1.1 christos
321 1.1 christos <a name="TOGGLE_MACRO"><h3><u>Toggle macros</u></h3></a>
322 1.1 christos <p>
323 1.1 christos Some macros don't require an argument. They simply start something.
324 1.1 christos When you need to turn them off, the same macro with <em>any</em>
325 1.1 christos argument will do the trick. That's right: ANY argument. This permits
326 1.1 christos choosing whatever works for you: OFF, END, QUIT, DONE, Q, X... Hell,
327 1.1 christos it could even be I_LOVE_MOM.
328 1.1 christos <p>
329 1.1 christos Since these macros toggle things on and off, the argument list
330 1.1 christos simply reads
331 1.1 christos <blockquote>
332 1.1 christos <nobr>toggle</nobr>
333 1.1 christos </blockquote>
334 1.1 christos <br>
335 1.1 christos <hr>
336 1.1 christos
337 1.1 christos <h3>Example 1: an argument requiring double-quotes</h3>
338 1.1 christos <blockquote>
339 1.1 christos Macro: <strong>TITLE</strong> <nobr>"<title of document>"</nobr>
340 1.1 christos </blockquote>
341 1.1 christos <p>
342 1.1 christos The required argument to <strong>TITLE</strong> is the title of your
343 1.1 christos document. Since it's surrounded by double-quotes, you must
344 1.1 christos include them in the argument, like this:
345 1.1 christos <p>
346 1.1 christos <pre>
347 1.1 christos .TITLE "My Pulitzer Novel"
348 1.1 christos </pre>
349 1.1 christos
350 1.1 christos <h3>Example 2: a macro with required and optional arguments</h3>
351 1.1 christos <blockquote>
352 1.1 christos Macro: <strong>TAB_SET</strong> <nobr><tab #> <indent> <length> [ L | R | C | J [ QUAD ] ]</nobr>
353 1.1 christos </blockquote>
354 1.1 christos <p>
355 1.1 christos The first required argument is a number that identifies the tab (say,
356 1.1 christos "3"). The second required argument is an indent from the left margin
357 1.1 christos (say, 6 picas). The third required argument is the length of the tab
358 1.1 christos (say, 3 picas). Therefore, at a minimum, when using this macro,
359 1.1 christos you would enter:
360 1.1 christos <p>
361 1.1 christos <pre>
362 1.1 christos .TAB_SET 3 6P 3P
363 1.1 christos </pre>
364 1.1 christos
365 1.1 christos The remaining two arguments are optional. The first is a single
366 1.1 christos letter, either L, R, C or J. The second, which is itself optional
367 1.1 christos after L, R, C or J, is the word QUAD. Therefore, depending on
368 1.1 christos what additional information you wish to pass to the macro,
369 1.1 christos you could enter:
370 1.1 christos <p>
371 1.1 christos <pre>
372 1.1 christos .TAB_SET 3 6P 3P L
373 1.1 christos or
374 1.1 christos .TAB_SET 3 6P 3P L QUAD
375 1.1 christos </pre>
376 1.1 christos
377 1.1 christos <a name="TOGGLE_EXAMPLE"></a>
378 1.1 christos <h3>Example 3: a sample toggle macro:</h3>
379 1.1 christos <blockquote>
380 1.1 christos Macro: <strong>QUOTE</strong> <nobr>toggle</nobr>
381 1.1 christos </blockquote>
382 1.1 christos <p>
383 1.1 christos <strong>QUOTE</strong> begins a section of quoted text in a document
384 1.1 christos and doesn't require an argument. When the quote's finished,
385 1.1 christos you have to tell <strong>mom</strong> it's done.
386 1.1 christos <p>
387 1.1 christos <pre>
388 1.1 christos .QUOTE
389 1.1 christos So runs my dream, but what am I?
390 1.1 christos An infant crying in the night
391 1.1 christos An infant crying for the light
392 1.1 christos And with no language but a cry.
393 1.1 christos .QUOTE OFF
394 1.1 christos </pre>
395 1.1 christos
396 1.1 christos Alternatively, you could have turned the quote off with END, or
397 1.1 christos X, or something else.
398 1.1 christos
399 1.1 christos <p>
400 1.1 christos <hr>
401 1.1 christos <a href="definitions.html#TOP">Next</a>
402 1.1 christos <a href="#TOP">Top</a>
403 1.1 christos <a href="toc.html">Table of Contents</a>
404 1.1 christos </body>
405 1.1 christos </html>
406