PageRenderTime 15ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

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