PageRenderTime 72ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/contrib/groff/contrib/mom/momdoc/intro.html

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