1 <?xml version="1.0" encoding="utf-8"?>
3 This file is part of groff, the GNU roff type-setting system.
5 Copyright (C) 2004-2018 Free Software Foundation, Inc.
6 Written by Peter Schaffter (peter@schaffter.ca).
8 Permission is granted to copy, distribute and/or modify this document
9 under the terms of the GNU Free Documentation License, Version 1.3 or
10 any later version published by the Free Software Foundation; with no
11 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
14 A copy of the Free Documentation License is included as a file called
15 FDL in the main directory of the groff source package.
18 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
19 <html xmlns="http://www.w3.org/1999/xhtml">
22 <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
23 <title>Mom -- Version 2.0 notes</title>
24 <link rel="stylesheet" type="text/css" href="stylesheet.css" />
27 <body style="background-color: #f5faff;">
29 <!-- ==================================================================== -->
31 <div id="top" class="page">
33 <!-- Navigation links -->
34 <table style="width: 100%;">
36 <td><a href="toc.html">Back to Table of Contents</a></td>
37 <td style="text-align: right;"><a href="intro.html#top">Next: Introduction to mom</a></td>
41 <h1 class="docs">Version 2.0 notes</h1>
43 <div style="width: 70%; margin: auto;">
44 <ol style="margin-left: -1em;">
45 <li><a href="#prefatory">Prefatory comments</a></li>
46 <li><a href="#differences">Differences between 2.0 and 1.x</a>
47 <ul class="no-enumerator" style="padding-left: 0">
48 <li><a href="#pdf-support">2.1 PDF support</a>
49 <ul class="no-enumerator" style="padding-left: 1em">
50 <li><a href="#mom-pdf">2.1.1 The manual, <span class="book-title">Producing PDFs with groff and mom</span></a></li>
51 <li><a href="#pdf-image">2.1.2 PDF_IMAGE</a></li>
53 <li><a href="#covers">2.2 Covers</a></li>
54 <li><a href="#headings">2.3 Headings</a></li>
55 <li><a href="#margin-notes">2.4 Margin notes</a></li>
56 <li><a href="#floats">2.5 Floats</a></li>
57 <li><a href="#table-of-contents">2.5 Tables of contents</a></li>
59 <li><a href="#v2.1-changes">Version 2.1 changes</a></li>
60 <li><a href="#pdfmom">The <strong>pdfmom</strong> wrapper around groff</a></li>
61 <li><a href="#install-font">The <strong>install-font.sh</strong> script</a></li>
65 <div class="rule-medium"><hr/></div>
67 <h2 id="prefatory" class="docs">1. Prefatory comments</h2>
70 Version 2.0 comes about as a result of Deri James’
71 contribution of <strong>gropdf</strong> to <strong>groff</strong>,
72 and his subsequent work integrating the device with
77 Whereas the 1.x releases were oriented toward PostScript output,
78 2.0 focuses on PDF output, a bias reflected throughout this
79 documentation. Users are strongly encouraged to process their files
81 <a href="#pdfmom"><strong>pdfmom</strong></a>,
82 a wrapper around <strong>groff -Tpdf</strong>, in order to take
83 full advantage of all PDF has to offer.
87 While portions of mom have been rewritten, and new features
88 introduced, 2.0 is backwardly compatible with 1.x releases. Changes
89 are either transparent, or accompanied by notifications on stderr.
93 The implementation of nested heads has been completely rethought,
94 as has the manner of styling of them. There are no limits on
95 how deep the nesting can go. The 1.x macros <kbd>HEAD</kbd>,
96 <kbd>SUBHEAD</kbd>, and <kbd>SUBSUHEAD</kbd> may still be used, but
97 must be re-designed with the new <kbd>HEADING_STYLE</kbd> macro
98 if their 1.x defaults are not desired.
102 In conjunction with the changes to nested heads, Table of Contents
103 generation has also been rethought. Greater flexibility in the
104 inclusion of toc entry numbering been added. Like nested heads,
105 there’s a new macro <kbd>TOC_ENTRY_STYLE</kbd> that permits
106 styling of each level in the toc hierarchy separately. The default
107 overall layout has also been significantly improved, achieving a
108 level of typographical elegance formerly lacking. Best of all, the
109 Table of Contents can now be repositioned to the correct spot at the
110 top of a document from within the mom source file.
114 When mom files are processed with <strong>pdfmom</strong>, a PDF
115 outline for the Contents panel of PDF viewers is automatically
116 generated. In addition, entries in the Table of Contents
117 are clickable links when a document is viewed at the screen.
118 <strong>pdfmom</strong> also permits setting a document’s
119 papersize within the source file without the corresponding need for
120 <kbd>-P-p<papersize></kbd> on the command line.
124 Lastly, while not strictly part of mom, a bash script,
125 <strong>install-font.sh</strong>, has been posted at the
126 <a href="http://www.schaffter.ca/mom/">mom site</a>.
127 The script significantly eases the installation of new
128 groff families and fonts, with conversion to .pfa
129 and .t42 being performed by <strong>fontforge</strong>.
132 <h2 id="differences" class="docs">2. Differences between v2.0 and v1.x</h2>
134 <h3 id="pdf-support" class="docs">2.1. PDF support</h3>
137 PDF support has been added, with features including the automatic
138 generation of PDF outlines, embedding of images in PDF format (via
140 <a href="images.html#pdf-image">PDF_IMAGE</a>
141 macro) and PDF linking (internal and external).
144 <h4 id="mom-pdf" class="docs">2.1.1. Producing PDFs with groff and mom</h4>
147 A manual in PDF format,
148 <span class="book-title">Producing PDFs with groff and mom</span>,
149 has been added to the documentation. The file,
150 <strong>mom-pdf.pdf</strong> can be found in
152 <span class="pre-in-pp">
153 /usr/local/share/doc/groff-<version>/pdf/
157 <span class="pre-in-pp">
158 /usr/share/doc/groff-base/pdf/
162 <span class="pre-in-pp">
163 <a href="http://www.schaffter.ca/mom/momdoc/mom-pdf.pdf">http://www.schaffter.ca/mom/momdoc/mom-pdf.pdf</a>
165 PDF usage, and all associated macros except
166 <a href="#pdf-image">PDF_IMAGE</a>,
167 are fully explained in the manual, which should be considered an
168 integral part of the present documentation. In addition, the mom
169 source file for the manual can be found in
171 <span class="pre-in-pp">
172 /usr/local/share/doc/groff-<version>/examples/mom
176 <span class="pre-in-pp">
177 /usr/share/doc/groff-base/examples/mom/
179 and provides an excellent demonstration of mom usage.
182 <h4 id="pdf-image" class="docs">2.1.2. PDF_IMAGE</h4>
185 A new macro for embedding PDF images has been added,
186 <a href="images.html#pdf-image"><kbd>PDF_IMAGE</kbd></a>.
190 <kbd>PDF_IMAGE</kbd> functions similarly to <kbd>PSPIC</kbd> and
191 accepts the same arguments. Differences in implementation are that
192 PDF_IMAGE requires the image dimensions (the bounding box) to be
193 supplied. Instructions for getting the bounding box are included in
194 the documentation entry for PDF_IMAGE. Two additional options,
195 <kbd>SCALE</kbd> and <kbd>ADJUST</kbd>, allow scaling of the image
196 and optical centering.
199 <h3 id="covers" class="docs">2.2. Covers</h3>
203 <a href="cover.html#cover"><kbd>COVER</kbd></a>
205 <a href="cover.html#doc-cover"><kbd>DOC_COVER</kbd></a>
206 may now be given in any order.
209 <h3 id="headings" class="docs">2.3. Headings</h3>
214 <span class="pre-in-pp">
215 HEAD SUBHEAD SUBSUBHEAD
217 are now deprecated and have been replaced by a single macro
219 <span class="pre-in-pp">
220 <a href="docelement.html#heading"><kbd>HEADING <n></kbd></a>
222 where <kbd><n></kbd> is the heading level. The deprecated
223 macros may still be used, and conform in style to their original
224 defaults; they are, however, wrappers around
225 <kbd>HEADING</kbd> levels 1 - 3.
226 Both the wrappers and <kbd>HEADING</kbd> itself can take a
227 <kbd>NAMED <id></kbd> argument, specifying a PDF link
232 Styling of headings is managed by a single macro
234 <span class="pre-in-pp">
235 <a href="docelement.html#heading"><kbd>HEADING_STYLE <n></kbd></a>
237 where <kbd><n></kbd> conforms to a <kbd>HEADING</kbd> level.
238 The control macros for HEAD, SUBHEAD and SUBSUBHEAD have been
239 removed. Users wishing to style the wrappers must use
240 <kbd>HEADING_STYLE</kbd>.
244 <kbd>PARAHEAD</kbd> is no longer valid. Paragraph heads in
245 2.0 are created by passing the <kbd>PARAHEAD</kbd> argument to
246 <kbd>.HEADING</kbd>. Mom will abort with an informational message
247 whenever she encounters <kbd>.PARAHEAD</kbd>.
250 <h3 id="margin-notes" class="docs">2.4. Margin notes</h3>
253 The macro for setting margin note parameters,
254 <a href="docelement.html#mn-init"><kbd>MN_INIT</kbd></a>,
255 has been re-written such that each parameter now has the form
257 <span class="pre-in-pp">
258 <PARAMETER> <value>
260 This differs from 1.x where parameters were entered without a
261 preceding <kbd><PARAMETER></kbd> flag. Parameters may be
262 entered in any order. Any that are skipped are set to default
263 values. Documents created with 1.x will have to have their
264 <kbd>MN_INIT</kbd> updated accordingly.
267 <h3 id="floats" class="docs">2.5. Floats</h3>
271 <a href="images.html#floats-intro">FLOAT</a>
272 macro has been added, which functions similarly to the <kbd>ms</kbd>
273 macros’ <kbd>.KF/.KE</kbd>, ie the contents of the float are
274 output immediately if there’s room on the page; otherwise,
275 normal text processing continues and the contents are output at the
276 top of the next page. An <kbd>ADJUST</kbd> argument to FLOAT allows
277 for optical centering.
280 <h3 id="table-of-contents" class="docs">2.6. Tables of contents</h3>
283 The default look of the Table of Contents has been overhauled to
284 produce a more typographically pleasing result. All control macros
285 for TOC title and entry styles have been removed, replaced by the
288 <span class="pre-in-pp">
289 <a href="tables-of-contents.html#toc-title-style">TOC_TITLE_STYLE</a>
293 <span class="pre-in-pp">
294 <a href="tables-of-contents.html#toc-title-style">TOC_ENTRY_STYLE <n></a>
296 where <kbd><n></kbd> corresponds to a <kbd>HEADING</kbd>
297 level. Both macros permit setting any or all of the style
298 parameters for TOC titles (ie chapters or major sections/divisions
299 of a collated document) and TOC entries (nested heading levels) at
300 once. Documents created with 1.x that contain TOCs will need to
301 have their TOC style updated if the new defaults are unsatisfactory.
305 Two new TOC control macros have been added,
307 <span class="pre-in-pp">
308 <a href="tables-of-contents.html#space-toc-items">SPACE_TOC_ITEMS</a>
312 <span class="pre-in-pp">
314 href="tables-of-contents.html#auto-relocate-toc">AUTO_RELOCATE_TOC</a>
316 <kbd>SPACE_TOC_ITEMS</kbd> groups TOC entry levels and separates
317 them with a discrete amount of whitespace. This leads to improved
318 legibility, and is highly recommended even though it is not
319 mom’s default. <kbd>AUTO_RELOCATE_TOC</kbd> intelligently
320 repositions the Table of Contents to the top of a document when
321 the mom source file is processed with
322 <a href="pdfmom"><strong>pdfmom</strong></a>.
325 <h2 id="v2.1-changes" class="docs">3. Version 2.1 changes</h2>
328 Version 2.1 adds these features:
330 <ul style="margin-top: -.5em; width: 90%">
331 <li>expansion of cover, docheader, page header, and heading
332 control macros to permit caps, smallcaps, color, and
334 <li>the ability to style every element appearing in docheaders and
335 automatically-generated cover/title pages separately</li>
336 <li>macros to place images on cover/title pages</li>
337 <li>a new macro COVERTEXT that allows adding text (e.g. an
338 Abstract) to automatically-generated cover/title pages or to
339 create cover/title pages entirely by hand</li>
340 <li>separate indent control macros for QUOTES and BLOCKQUOTES</li>
341 <li>pseudo-smallcaps, including a control macro to choose the
342 size, weight, and width of the small caps</li>
343 <li>new <element>_STYLE macros that allow setting
344 parameters for <element> with a single macro using
345 keyword/value pairs</li>
349 The following changes have been made:
352 <ul style="margin-top: -.5em; width: 90%">
353 <li>MISC_AUTOLEAD (including COVER_MISC_AUTOLEAD and
354 DOC_COVER_MISC_AUTOLEAD) has been replaced in favour of MISC_LEAD,
355 which takes an absolute leading value, rather than one derived
356 from the point size</li>
357 <li>COVER_UNDERLINE and DOC_COVER_UNDERLINE have been
358 removed in favour of COVER_DOCTYPE_UNDERLINE and
359 DOC_COVER_DOCTYPE_UNDERLINE</li>
360 <li>DOCTYPE NAMED <string> no longer accepts a color
361 argument; setting the color for <string> is accomplished with
362 DOCTYPE_COLOR <color>; in addition, the string now has a
363 complete set of control macros</li>
364 <li>default underscoring of the DOCTYPE NAMED string has been
365 removed, both in the docheader and on cover/title pages</li>
366 <li>no cover/title page data persists, however formatting for the
367 elements on them does</li>
370 <h2 id="v2.1-changes" class="docs">3. Version 2.2 changes</h2>
373 Version 2.2 adds these features:
375 <ul style="margin-top: -.5em; width: 90%">
376 <li>flex-spacing, an alternative to mom’s default shimming
377 policy; flex-spacing balances vertical whitespace on the page by
378 distributing any excess equally at sensible points so that running
379 text always fills the page to the bottom margin (see
380 <a href="docprocessing.html#vertical-whitespace-management">
381 vertical whitespace management</a>
383 <li>improvements to auto-labelling, such that it is now possible
384 to link symbollically to auto-labelled preprocessor material and
388 <h2 id="pdfmom" class="docs">4. pdfmom</h2>
391 Deri James has provided <strong>pdfmom</strong>, a wrapper around
392 groff that processes mom source files with all the PDF bells and
393 whistles. Its use is highly recommended. Usage is explained in the
395 <a href="http://www.schaffter.ca/mom/pdf/mom-pdf.pdf"><span class="book-title">Producing PDFs with groff and mom</span></a>.
396 A significant convenience of <strong>pdfmom</strong> is that it can,
397 with the <kbd>-Tps</kbd> flag, be used to pass processing over to Keith
398 Marshall’s <strong>pdfroff</strong>. This is useful when
399 processing files that contain PostScript images embedded with
400 <kbd>PSPIC</kbd>. <strong>pdfmom</strong>, without the flag, uses
401 groff’s PDF device (<strong>gropdf</strong>), which only
402 recognizes PDF images that have been embedded with
403 <a href="images.html#pdf-image"><kbd>PDF_IMAGE</kbd></a>.
406 <h2 id="install-font" class="docs">5. install-font.sh</h2>
409 A bash script, <strong>install-font.sh</strong>, has been posted at the
410 <a href="http://www.schaffter.ca/mom/mom-01.html">mom site</a>.
411 There’s nothing mom-specific about the script, and it is not
412 an official part of groff.
416 Installing groff fonts is a multi-step procedure, which, while not
417 difficult, can be a nuisance. <strong>install-font.sh</strong> takes
418 care of all the details, including converting fonts to formats
419 acceptable to <strong>grops</strong> and <strong>gropdf</strong>,
420 creating and installing the groff fonts in the appropriate
421 directories, updating the <strong>download</strong> files, and
422 installing the original fonts in a system-wide directory, if
426 <div class="rule-long"><hr/></div>
428 <!-- Navigation links -->
429 <table style="width: 100%; margin-top: 12px;">
431 <td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td>
432 <td style="width: 20%; text-align: center;"><a href="#top">Top</a></td>
433 <td style="width: 46%; text-align: right;"><a href="intro.html">Next: Introduction to mom</a></td>
439 <div class="bottom-spacer"><br/></div>