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 36 macros", "maximum overdrive macros"...) is a macro set for 37 groff, designed to format documents for PostScript output. 38 She'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> 56 As might be inferred from the above, <strong>mom</strong> is two macro 57 packages in one: a set of typesetting macros, and a set of document 58 processing macros. The typesetting macros govern the physical 59 aspects of page layout and provide sane, comprehensible control over 60 typographic refinements. The document processing macros let you focus 61 on a document's content and logical structure without worrying about 62 typesetting or page layout at all. 63 <p> 64 Because <strong>mom</strong> provides both typesetting and document 65 processing macros, it's safe to say she blurs the distinction between 66 document processing and document design. While her basic document style 67 comes with pretty spiffy defaults (okay--change "spiffy" 68 to "typographically professional"), you can easily control 69 how all the various document elements look: titles, page headers and 70 footers, page numbering, heads, subheads, footnotes and so on can be 71 made to come out exactly the way you want. And should you need precise 72 typographic control over elements in a document that fall outside the 73 range of <strong>mom</strong>'s document element tags, you don't have to 74 read up on groff 75 <a href="definitions.html#TERMS_PRIMITIVES">primitives</a> 76 in order to accomplish what you want; the typesetting macros take 77 care 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 85 of type: margins, line length, type family, font, point size, 86 linespacing, and so on. In addition, they allow you to move around 87 on the page horizontally and vertically, and to set up tabs, indents, 88 and columns. Finally, they let you adjust such typographic details as 89 justification style, letter spacing, word spacing, hyphenation, and 90 kerning. 91 92 <p> 93 In terms of typographic control, these macros resemble the 94 commands used on dedicated typesetting computers like Compugraphics and 95 Linotronics. Most of them simply give access to groff's typesetting 96 primitives in a way that's consistent and easy to use. A few of 97 them (tabs and indents, for example) handle fundamental typesetting 98 requirements in ways radically different from groff primitives. 99 100 <p> 101 With <strong>mom</strong>'s typesetting macros, you can, if you wish, 102 create individual output pages that you design from the ground up. 103 Provided you have not signalled to <strong>mom</strong> that you 104 want document processing (via the 105 <a href="docprocessing.html#START">START</a> 106 macro; see below), every macro is a literal command that remains in 107 effect until you modify it or turn it off. This means that if you 108 want to create flyers, surveys, tabulated forms, curricula vitae and 109 so on, you may do so in the good old-fashioned way: one step at a 110 time with complete control over every element on the page. 111 <p> 112 Years of reading various mailing lists dealing with computer 113 typesetting (groff, TeX, and friends) have convinced me that no program 114 can ever replace the human eye and human input when it comes to high 115 quality typesetting. As of this writing, a thread on the subject of 116 "micro typography" in groff has been going on for nearly a 117 month. The reason for the lengthy thread is obvious; words and 118 punctuation on the printed page are too variable, too fluid, to be 119 rendered flawlessly by any algorithm, no matter how clever. (For 120 whatever it's worth, a similar problem exists with engraving musical 121 scores by computer.) 122 <p> 123 <strong>Mom</strong> does not try to solve the problems posed 124 by things like hanging punctuation, left-margin adjustments for 125 upper case letters like T and W, and so on. She merely tries to 126 provide tools that allow knowledgeable typesetters to come up with 127 solutions to these problems in ways that are easier and more 128 intuitive than manipulating groff at the 129 <a href="definitions.html#TERMS_PRIMITIVES">primitive</a> 130 level. As a professional typesetter of more than two decades, and a 131 writer, 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 135 serious rethinking is in the matter of an algorithm that takes into 136 account both word and letter spacing when 137 <a href="definitions.html#TERMS_JUST">justifying</a> 138 lines. At present, only word spacing is adjusted, requiring what I 139 consider an unnecessary amount of user intervention whenever 140 letter 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 147 documents without having to worry about the typographic details. 148 In this respect, <strong>mom</strong> is similar to other groff macro 149 packages, as well as to html and LaTeX. Where <strong>mom</strong> 150 differs is in the degree of control you have over the look and 151 placement of the various elements of a document. For example, if you 152 don't want your heads underlined, or you want them bigger/smaller, 153 or you'd prefer them to be in a different font, or you'd rather they 154 were flush left instead of centred, you can make the changes easily 155 and have them apply to the whole document. Temporary and one-off 156 changes are easy, too. 157 <p> 158 <strong>Mom</strong> has some nifty features other macro sets 159 don't provide. For example, you can switch between draft-style and 160 final-copy output. If you regularly make submissions to publishers 161 and editors who insist on "typewritten, double-spaced," there's a 162 special macro-- 163 <a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a> 164 --that changes typeset documents into ones that would make your 165 high-school typing teacher proud. Footnotes, endnotes, tables of 166 contents, multiple columns, nested lists, recto/verso printing and 167 user 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 173 Formatting documents should be easy, from soup to nuts. Writers need 174 to focus on what they're writing, not on how it looks. From the 175 moment you fire up an editor to the moment you add "FINIS" 176 to your opus, nothing should interfere with the flow of your words. 177 The commands needed to format your work should be easy to remember, 178 comprehensible, and stand out well from the text. There shouldn't 179 be too much clutter. Your documents should be as readable inside a 180 text editor as they are on the printed page. 181 <p> 182 Unfortunately, in computerland, "easy," 183 "comprehensible," and "readable" often mean 184 "you're stuck with what you get." No document formatting 185 system can give you exactly what you want all the time, every time. 186 Documents, it seems, always need to be tweaked, either to satisfy a 187 typographic whim or to clarify some aspect of their content. 188 <p> 189 Groff has traditionally solved the problem of formatting vs. tweaking 190 by requiring users of the common macro packages (mm, ms, me and their 191 offspring) to resort to groff 192 <a href="definitions.html#TERMS_PRIMITIVES">primitives</a> 193 and 194 <a href="definitions.html#TERMS_INLINES">inline escapes</a> 195 for their special typesetting needs. Not to put too fine a point on 196 it, groff primitives tend toward the abstruse, and most inline escapes 197 are about as readable in-line as an encrypted password. This does 198 not make for happy-camper writers, who either find themselves stuck 199 with a document formatting style they don't really like, or are 200 forced to learn groff from the ground up--a daunting task, to say 201 the least. 202 <p> 203 <strong>Mom</strong> aims to make creating documents a simple matter, 204 but with no corresponding loss of user control. The document 205 processing macros provide an excellent set of defaults, but if 206 something is not to your liking, you can change it. And in combination 207 with the typesetting macros, you have all the tools you need to 208 massage passages and tweak pages until they look utterly professional. 209 <p> 210 One rarely hears the word "user interface" in conjunction 211 with document processing. Since the user formatting takes place 212 inside a text editor, little thought is given to the look and feel 213 of the formatting commands. <strong>Mom</strong> attempts to rectify 214 this by providing users with a consistent, readable "coding" 215 style. Most of the macros (especially in the document processing set) 216 have humanly-readable names. Not only does this speed up learning 217 the macros, it makes the sense of what's going on in a document, 218 typographically and structurally, easier to decipher. 219 <p> 220 <strong>Mom</strong> does not try to be all things to all people. 221 In contrast to the normal groff philosophy, she does not try to 222 produce output that looks good no matter where it's displayed. 223 She's designed for printed output, although with 224 <a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a> 225 she produces acceptable terminal copy. She makes no attempt to be 226 compatible with older versions of troff. 227 <p> 228 One special feature in <strong>mom</strong>'s design is the attention 229 she pays to aligning the bottom margins of every page. Nothing screams 230 "shoddy" in typeset documents louder than bottom margins 231 that wander, or, in typesetter jargon, "hang." There are, 232 of course, situations where whitespace at the bottom of a page may 233 be desirable (for example, you wouldn't want a head to appear at the 234 bottom of the page without some text underneath it), but in all cases 235 where hanging bottom margins can be avoided, <strong>mom</strong> does 236 avoid them, by clever adjustments to leading ("line spacing") 237 and 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 243 Writing documentation is tough, no doubt about it. One is never 244 quite sure of the user's level of expertise. Is s/he new to the 245 application, new to its underlying protocols and programs, new to 246 the operating system, new to computers? At some point, one has to 247 decide who the documentation is for. Making the wrong decision can 248 mean the difference between a program that gets used and a program 249 that gets tossed. 250 <p> 251 <strong>Mom</strong>'s documentation assumes users know their way 252 around GNU/Linux. It further assumes they at least know what groff 253 is, even if they don't know much about it. Lastly, it assumes that 254 everyone--groff newbies and experts alike--learns faster from 255 a few well-placed examples than from manpage-style reference docs. 256 What <strong>mom</strong>'s documentation doesn't assume is that 257 you know everything--not about groff, not about typesetting, 258 not about document processing. Even experts have odd lacunae in 259 their knowledge base. Therefore, whenever I suspect that a term 260 or procedure will cause head scratching, I offer an explanation. 261 And 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> 266 The canonical reference materials for groff are 267 <strong>cstr54</strong> (a downloadable PostScript copy of which is 268 available 269 <a href="http://www.kohala.com/start/troff/">here</a>) 270 and the <strong>troff</strong> and <strong>groff_diff</strong> 271 manpages. Another excellent source of information (maybe the best) 272 is the groff <strong>info</strong> pages, available by typing 273 <p> 274 <pre> 275 info groff 276 </pre> 277 278 at the command line (assuming you have <strong>info</strong> 279 installed on your system). And for inputting special characters, 280 see <strong>man groff_char.</strong> 281 <p> 282 I've tried to avoid reiterating the information contained in these 283 documents; however, in a few places, this has proved impossible. 284 But be forewarned: I have no qualms about sidestepping excruciating 285 completeness 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 290 description of its arguments, function and usage, which may 291 give you information in addition to what's contained in this 292 documentation. 293 <p> 294 <a name="MACRO_ARGS"> 295 <h3><u>How to read macro arguments</u></h3> 296 </a> 297 298 The concise descriptions of macros in this documentation typically 299 look like this: 300 <blockquote> 301 Macro: <strong>NAME</strong> <nobr>arguments</nobr> 302 </blockquote> 303 <var>arguments</var> lists the macro's arguments using conventions that 304 should 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> 323 Some macros don't require an argument. They simply start something. 324 When you need to turn them off, the same macro with <em>any</em> 325 argument will do the trick. That's right: ANY argument. This permits 326 choosing whatever works for you: OFF, END, QUIT, DONE, Q, X... Hell, 327 it could even be I_LOVE_MOM. 328 <p> 329 Since these macros toggle things on and off, the argument list 330 simply 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> 339 Macro: <strong>TITLE</strong> <nobr>"<title of document>"</nobr> 340 </blockquote> 341 <p> 342 The required argument to <strong>TITLE</strong> is the title of your 343 document. Since it's surrounded by double-quotes, you must 344 include 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> 352 Macro: <strong>TAB_SET</strong> <nobr><tab #> <indent> <length> [ L | R | C | J [ QUAD ] ]</nobr> 353 </blockquote> 354 <p> 355 The 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, 359 you would enter: 360 <p> 361 <pre> 362 .TAB_SET 3 6P 3P 363 </pre> 364 365 The remaining two arguments are optional. The first is a single 366 letter, either L, R, C or J. The second, which is itself optional 367 after L, R, C or J, is the word QUAD. Therefore, depending on 368 what additional information you wish to pass to the macro, 369 you 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> 380 Macro: <strong>QUOTE</strong> <nobr>toggle</nobr> 381 </blockquote> 382 <p> 383 <strong>QUOTE</strong> begins a section of quoted text in a document 384 and doesn't require an argument. When the quote's finished, 385 you 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 396 Alternatively, you could have turned the quote off with END, or 397 X, 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