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>What is mom?</title> 6</head> 7<body bgcolor="#dfdfdf"> 8 9<!====================================================================> 10 11<a href="definitions.html#TOP">Next</a> 12<a href="toc.html">Back to Table of Contents</a> 13 14<a name="TOP"></a> 15<a name="INTRO"> 16 <h1 align="center"><u>WHAT IS MOM?</u></h1> 17</a> 18 19<a href="#INTRO_INTRO">Who is mom meant for?</a> 20<br> 21<a href="#INTRO_TYPESETTING">Typesetting with mom</a> 22<br> 23<a href="#INTRO_DOCPROCESSING">Document processing with mom</a> 24<br> 25<a href="#INTRO_PHILOSOPHY">Mom's philosophy</a> 26<br> 27<a href="#INTRO_DOCUMENTATION">A note on mom's documentation</a> 28<br> 29<a href="#CANONICAL">Canonical reference materials</a> 30<br> 31<a href="#MACRO_ARGS">How to read macro arguments</a> 32 33<h2><a name="INTRO_INTRO"><u>Who is mom meant for?</u></a></h2> 34 35<strong>Mom</strong> ("my own macros", "my other 36macros", "maximum overdrive macros"...) is a macro set for 37groff, designed to format documents for PostScript output. 38She's aimed at three kinds of users: 39<br> 40<ol> 41 <li>typesetters who suspect groff might be "the right 42 tool for the job" 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. 54</ol> 55<p> 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. 63<p> 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 "spiffy" 68to "typographically professional"), 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. 78<p> 79 80<a name="INTRO_TYPESETTING"> 81 <h2><u>Typesetting with mom</u></h2> 82</a> 83 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 90kerning. 91 92<p> 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. 99 100<p> 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. 111<p> 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"micro typography" 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.) 122<p> 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. 133<p> 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. 141<p> 142<a name="INTRO_DOCPROCESSING"> 143 <h2><u>Document processing with mom</u></h2> 144</a> 145 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. 157<p> 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. 168<p> 169<a name="INTRO_PHILOSOPHY"> 170 <h2><u>Mom's philosophy</u></h2> 171</a> 172 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. 181<p> 182Unfortunately, in computerland, "easy," 183"comprehensible," and "readable" often mean 184"you're stuck with what you get." 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. 188<p> 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> 193and 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. 202<p> 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. 209<p> 210One rarely hears the word "user interface" 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 "coding" 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. 219<p> 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 224<a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a> 225she produces acceptable terminal copy. She makes no attempt to be 226compatible with older versions of troff. 227<p> 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"shoddy" in typeset documents louder than bottom margins 231that wander, or, in typesetter jargon, "hang." 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 ("line spacing") 237and the spacing between different elements on the page. 238<p> 239<a name="INTRO_DOCUMENTATION"> 240 <h2><u>A note on mom's documentation</u></h2> 241</a> 242 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. 250<p> 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. 262<br> 263 264<a name="CANONICAL"><h3><u>Canonical reference materials</u></h3></a> 265<p> 266The canonical reference materials for groff are 267<strong>cstr54</strong> (a downloadable PostScript copy of which is 268available 269<a href="http://www.kohala.com/start/troff/">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 273<p> 274<pre> 275 info groff 276</pre> 277 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> 281<p> 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> 287<p> 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 292documentation. 293<p> 294<a name="MACRO_ARGS"> 295 <h3><u>How to read macro arguments</u></h3> 296</a> 297 298The concise descriptions of macros in this documentation typically 299look like this: 300<blockquote> 301Macro: <strong>NAME</strong> <nobr>arguments</nobr> 302</blockquote> 303<var>arguments</var> lists the macro's arguments using conventions that 304should be familiar to anyone who has ever read a manpage. Briefly: 305<p> 306<ol> 307 <li>Macro arguments are separated from each other by spaces. 308 <li>If an argument is surrounded by chevrons 309 ( < > ), 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 ( | ), 315 which means "or." 316 <li>Arguments that are optional are surrounded by square brackets. 317 <li><off> in an argument list means that any argument 318 other than those in the argument list turns the macro off. 319</ol> 320 321<a name="TOGGLE_MACRO"><h3><u>Toggle macros</u></h3></a> 322<p> 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. 328<p> 329Since these macros toggle things on and off, the argument list 330simply reads 331<blockquote> 332<nobr>toggle</nobr> 333</blockquote> 334<br> 335<hr> 336 337<h3>Example 1: an argument requiring double-quotes</h3> 338<blockquote> 339Macro: <strong>TITLE</strong> <nobr>"<title of document>"</nobr> 340</blockquote> 341<p> 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: 345<p> 346<pre> 347 .TITLE "My Pulitzer Novel" 348</pre> 349 350<h3>Example 2: a macro with required and optional arguments</h3> 351<blockquote> 352Macro: <strong>TAB_SET</strong> <nobr><tab #> <indent> <length> [ L | R | C | J [ QUAD ] ]</nobr> 353</blockquote> 354<p> 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: 360<p> 361<pre> 362 .TAB_SET 3 6P 3P 363</pre> 364 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: 370<p> 371<pre> 372 .TAB_SET 3 6P 3P L 373 or 374 .TAB_SET 3 6P 3P L QUAD 375</pre> 376 377<a name="TOGGLE_EXAMPLE"></a> 378<h3>Example 3: a sample toggle macro:</h3> 379<blockquote> 380Macro: <strong>QUOTE</strong> <nobr>toggle</nobr> 381</blockquote> 382<p> 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. 386<p> 387<pre> 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. 393 .QUOTE OFF 394</pre> 395 396Alternatively, you could have turned the quote off with END, or 397X, or something else. 398 399<p> 400<hr> 401<a href="definitions.html#TOP">Next</a> 402<a href="#TOP">Top</a> 403<a href="toc.html">Table of Contents</a> 404</body> 405</html> 406