Debian Codegraph @

contrib/mom/momdoc/version-2.html

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 This file is part of groff, the GNU roff type-setting system.
4
5 Copyright (C) 2004-2020 Free Software Foundation, Inc.
6 Written by Peter Schaffter ([email protected]).
7
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
12 Texts.
13
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.
16 -->
17
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">
20
21 <head>
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" />
25 </head>
26
27 <body style="background-color: #f5faff;">
28
29 <!-- ==================================================================== -->
30
31 <div id="top" class="page">
32
33 <!-- Navigation links -->
34 <table style="width: 100%;">
35 <tr>
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>
38 </tr>
39 </table>
40
41 <h1 class="docs">Version 2.0 notes</h1>
42
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>
52 </ul></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>
58 </ul></li>
59 <li><a href="#v2.1-changes">Version 2.1 changes</a></li>
60 <li><a href="#v2.2-changes">Version 2.2 changes</a></li>
61 <li><a href="#v2.5-changes">Version 2.5 changes</a></li>
62 <li><a href="#pdfmom">The <strong>pdfmom</strong> wrapper around groff</a></li>
63 <li><a href="#install-font">The <strong>install-font.sh</strong> script</a></li>
64 </ol>
65 </div>
66
67 <div class="rule-medium"><hr/></div>
68
69 <h2 id="prefatory" class="docs">1. Prefatory comments</h2>
70
71 <p>
72 Version 2.0 comes about as a result of Deri James&#8217;
73 contribution of <strong>gropdf</strong> to <strong>groff</strong>,
74 and his subsequent work integrating the device with
75 <strong>mom</strong>.
76 </p>
77
78 <p>
79 Whereas the 1.x releases were oriented toward PostScript output,
80 2.0 focuses on PDF output, a bias reflected throughout this
81 documentation. Users are strongly encouraged to process their files
82 with
83 <a href="#pdfmom"><strong>pdfmom</strong></a>,
84 a wrapper around <strong>groff&nbsp;-Tpdf</strong>, in order to take
85 full advantage of all PDF has to offer.
86 </p>
87
88 <p>
89 While portions of mom have been rewritten, and new features
90 introduced, 2.0 is backwardly compatible with 1.x releases. Changes
91 are either transparent, or accompanied by notifications on stderr.
92 </p>
93
94 <p>
95 The implementation of nested heads has been completely rethought,
96 as has the manner of styling of them. There are no limits on
97 how deep the nesting can go. The 1.x macros <kbd>HEAD</kbd>,
98 <kbd>SUBHEAD</kbd>, and <kbd>SUBSUBHEAD</kbd> may still be used, but
99 must be re-designed with the new <kbd>HEADING_STYLE</kbd> macro
100 if their 1.x defaults are not desired.
101 </p>
102
103 <p>
104 In conjunction with the changes to nested heads, Table of Contents
105 generation has also been rethought. Greater flexibility in the
106 inclusion of toc entry numbering been added. Like nested heads,
107 there&#8217;s a new macro <kbd>TOC_ENTRY_STYLE</kbd> that permits
108 styling of each level in the toc hierarchy separately. The default
109 overall layout has also been significantly improved, achieving a
110 level of typographical elegance formerly lacking. Best of all, the
111 Table of Contents can now be repositioned to the correct spot at the
112 top of a document from within the mom source file.
113 </p>
114
115 <p>
116 When mom files are processed with <strong>pdfmom</strong>, a PDF
117 outline for the Contents panel of PDF viewers is automatically
118 generated. In addition, entries in the Table of Contents
119 are clickable links when a document is viewed at the screen.
120 <strong>pdfmom</strong> also permits setting a document&#8217;s
121 papersize within the source file without the corresponding need for
122 <kbd>-P-p&lt;papersize&gt;</kbd> on the command line.
123 </p>
124
125 <h3 id="install-font" class="docs">The install-font.sh script</h3>
126
127 <p>
128 Lastly, while not strictly part of mom, a bash script,
129 <strong>install-font.sh</strong>, has been posted at the
130 <a href="https://www.schaffter.ca/mom/">mom site</a>.
131 The script significantly eases the installation of new
132 groff families and fonts, with conversion to .pfa
133 and .t42 being performed by <strong>fontforge</strong>.
134 </p>
135
136 <h2 id="differences" class="docs">2. Differences between v2.0 and v1.x</h2>
137
138 <h3 id="pdf-support" class="docs">2.1. PDF support</h3>
139
140 <p>
141 PDF support has been added, with features including the automatic
142 generation of PDF outlines, embedding of images in PDF format (via
143 the
144 <a href="images.html#pdf-image">PDF_IMAGE</a>
145 macro) and PDF linking (internal and external).
146 </p>
147
148 <h4 id="mom-pdf" class="docs">2.1.1. Producing PDFs with groff and mom</h4>
149
150 <p>
151 A manual in PDF format,
152 <span class="book-title">Producing PDFs with groff and mom</span>,
153 has been added to the documentation. The file,
154 <strong>mom-pdf.pdf</strong> can be found in
155 <br/>
156 <span class="pre-in-pp">
157 /usr/local/share/doc/groff-&lt;version&gt;/pdf/
158 </span>
159 or
160 <br/>
161 <span class="pre-in-pp">
162 /usr/share/doc/groff-base/pdf/
163 </span>
164 or at
165 <br/>
166 <span class="pre-in-pp">
167 <a href="http://www.schaffter.ca/mom/momdoc/mom-pdf.pdf">http://www.schaffter.ca/mom/momdoc/mom-pdf.pdf</a>
168 </span>
169 PDF usage, and all associated macros except
170 <a href="#pdf-image">PDF_IMAGE</a>,
171 are fully explained in the manual, which should be considered an
172 integral part of the present documentation. In addition, the mom
173 source file for the manual can be found in
174 <br/>
175 <span class="pre-in-pp">
176 /usr/local/share/doc/groff-&lt;version&gt;/examples/mom
177 </span>
178 or
179 <br/>
180 <span class="pre-in-pp">
181 /usr/share/doc/groff-base/examples/mom/
182 </span>
183 and provides an excellent demonstration of mom usage.
184 </p>
185
186 <h4 id="pdf-image" class="docs">2.1.2. PDF_IMAGE</h4>
187
188 <p>
189 A new macro for embedding PDF images has been added,
190 <a href="images.html#pdf-image">PDF_IMAGE</a>.
191 </p>
192
193 <p>
194 PDF_IMAGE functions similarly to PSPIC and accepts the same
195 arguments. Differences in implementation are that PDF_IMAGE
196 requires the image dimensions (the bounding box) to be supplied.
197 Instructions for getting the bounding box are included in the
198 documentation entry for PDF_IMAGE. Two additional options,
199 <kbd>SCALE</kbd> and <kbd>ADJUST</kbd>, allow scaling of the image
200 and optical centering.
201 </p>
202
203 <h3 id="covers" class="docs">2.2. Covers</h3>
204
205 <p>
206 Arguments to
207 <a href="cover.html#cover">COVER</a>
208 and
209 <a href="cover.html#doc-cover">DOC_COVER</a>
210 may now be given in any order.
211 </p>
212
213 <h3 id="headings" class="docs">2.3. Headings</h3>
214
215 <p>
216 The 1.x macros HEAD, SUBHEAD, SUBSUBHEAD, are now deprecated and
217 have been replaced by the single macro
218 <a href="docelement.html#heading">HEADING <kbd>&lt;n&gt;</kbd></a>,
219 where <kbd>&lt;n&gt;</kbd> is the heading level. The deprecated
220 macros may still be used, and conform in style to their original
221 defaults; they are, however, wrappers around HEADING levels 1
222 &#8211; 3. Both the wrappers and HEADING itself can take a
223 <kbd>NAMED&nbsp;&lt;id&gt;</kbd> argument, specifying a PDF link
224 destination.
225 </p>
226
227 <p>
228 Styling of headings is managed by the single macro <a
229 href="docelement.html#heading">HEADING_STYLE &lt;n&gt;</a> where
230 <kbd>&lt;n&gt;</kbd> conforms to a heading level. The control
231 macros for HEAD, SUBHEAD and SUBSUBHEAD have been removed. Users
232 wishing to style the wrappers must use HEADING_STYLE.
233 </p>
234
235 <p>
236 PARAHEAD is no longer valid. Paragraph heads in 2.0 are created
237 by passing the <kbd>PARAHEAD</kbd> argument to HEADING. Mom
238 will abort with an informational message whenever she encounters
239 <kbd>.PARAHEAD</kbd>.
240 </p>
241
242 <h3 id="margin-notes" class="docs">2.4. Margin notes</h3>
243
244 <p>
245 The macro for setting margin note parameters,
246 <a href="docelement.html#mn-init">MN_INIT</a>,
247 has been re-written such that each parameter now has the form
248 <kbd>&lt;PARAMETER&gt; &lt;value&gt;</kbd>. This differs
249 from 1.x where parameters were entered without a preceding
250 <kbd>&lt;PARAMETER&gt;</kbd> flag. Parameters may be entered in any
251 order. Any that are skipped are set to default values. Documents
252 created with 1.x will have to have their <kbd>MN_INIT</kbd> updated
253 accordingly.
254 </p>
255
256 <h3 id="floats" class="docs">2.5. Floats</h3>
257
258 <p>
259 A
260 <a href="images.html#floats-intro">FLOAT</a>
261 macro has been added, which functions similarly to the <kbd>ms</kbd>
262 macros&#8217; <kbd>.KF/.KE</kbd>, i.e., the contents of the float are
263 output immediately if there&#8217;s room on the page, otherwise
264 normal text processing continues and the contents are output at the
265 top of the next page. An <kbd>ADJUST</kbd> argument to FLOAT allows
266 for optical centering.
267 </p>
268
269 <h3 id="table-of-contents" class="docs">2.6. Tables of contents</h3>
270
271 <p>
272 The default look of the Table of Contents has been overhauled to
273 produce a more typographically pleasing result. All control macros
274 for TOC title and entry styles have been removed, replaced by
275 <a href="tables-of-contents.html#toc-title-style">TOC_TITLE_STYLE</a>
276 and
277 <a href="tables-of-contents.html#toc-title-style">TOC_ENTRY_STYLE <kbd>&lt;n&gt;</kbd></a>
278 where <kbd>&lt;n&gt;</kbd> corresponds to a heading level. Both
279 macros permit setting any or all of the style parameters for TOC
280 titles (i.e. chapters or major sections/divisions of a collated
281 document) and TOC entries (nested heading levels) at once.
282 Documents created with 1.x that contain TOCs will need to have their
283 TOC style updated if the new defaults are unsatisfactory.
284 </p>
285
286 <p>
287 Two new TOC control macros have been added,
288 <a href="tables-of-contents.html#space-toc-items">SPACE_TOC_ITEMS</a>
289 and
290 <a href="tables-of-contents.html#auto-relocate-toc">AUTO_RELOCATE_TOC</a>.
291 SPACE_TOC_ITEMS groups TOC entry levels and separates them with a
292 discrete amount of whitespace. This leads to improved legibility,
293 and is highly recommended even though it is not mom&#8217;s
294 default. AUTO_RELOCATE_TOC intelligently repositions the Table
295 of Contents to the top of a document when the mom source file is
296 processed with
297 <a href="pdfmom">pdfmom</a>.
298 </p>
299
300 <h2 id="v2.1-changes" class="docs">3. Version 2.1 changes</h2>
301 <p> Version 2.1 adds these features: </p> <ul style="margin-top: -.5em; width: 90%">
302 <li>expansion of cover, docheader, page header, and heading
303 control macros to permit caps, smallcaps, color, and
304 underscoring</li>
305 <li>the ability to style every element appearing in docheaders and
306 automatically-generated cover/title pages separately</li>
307 <li>macros to place images on cover/title pages</li>
308 <li>a new macro COVERTEXT that allows adding text (e.g. an
309 Abstract) to automatically-generated cover/title pages or to
310 create cover/title pages entirely by hand</li>
311 <li>separate indent control macros for QUOTES and BLOCKQUOTES</li>
312 <li>pseudo-smallcaps, including a control macro to choose the
313 size, weight, and width of the small caps</li>
314 <li>new &lt;element&gt;_STYLE macros that allow setting
315 parameters for &lt;element&gt; with a single macro using
316 keyword/value pairs</li>
317 </ul>
318
319 <p>
320 The following changes have been made:
321 </p>
322
323 <ul style="margin-top: -.5em; width: 90%">
324 <li>MISC_AUTOLEAD (including COVER_MISC_AUTOLEAD and
325 DOC_COVER_MISC_AUTOLEAD) has been replaced in favour of MISC_LEAD,
326 which takes an absolute leading value rather than one derived
327 from the point size.</li>
328 <li>COVER_UNDERLINE and DOC_COVER_UNDERLINE have been
329 removed in favour of COVER_DOCTYPE_UNDERLINE and
330 DOC_COVER_DOCTYPE_UNDERLINE.</li>
331 <li>DOCTYPE NAMED <kbd>&lt;string&gt;</kbd> no longer accepts a
332 <kbd>color</kbd> argument; setting the colour for
333 <kbd>&lt;string&gt;</kbd> is accomplished with DOCTYPE_COLOR
334 <kbd>&lt;color&gt;</kbd>. In addition, the string now has a
335 complete set of control macros.</li>
336 <li>Default underscoring of the DOCTYPE NAMED string has been
337 removed, both in the docheader and on cover/title pages.</li>
338 <li>No cover/title page data persists, however formatting for the
339 elements on them does.</li>
340 </ul>
341
342 <h2 id="v2.2-changes" class="docs">4. Version 2.2 changes</h2>
343
344 <p>
345 Version 2.2 adds these features:
346 </p>
347 <ul style="margin-top: -.5em; width: 90%">
348 <li>flex-spacing, an alternative to mom&#8217;s default shimming
349 policy; flex-spacing balances vertical whitespace on the page by
350 distributing any excess equally at sensible points so that running
351 text always fills the page to the bottom margin (see
352 <a href="docprocessing.html#vertical-whitespace-management">
353 vertical whitespace management</a>)
354 </li>
355 <li>improvements to auto-labelling, such that it is now possible
356 to link symbolically to auto-labelled preprocessor material and
357 PDF images (note that you must be running groff 1.22.4 or higher
358 for this feature)
359 </li>
360 </ul>
361
362 <h2 id="v2.5-changes" class="docs">5. Version 2.5 changes</h2>
363
364 <p>
365 Version 2.5 adds shaded backgrounds and frames that span pages
366 appropriately when necessary, and a macro to set page or slide
367 background colour.
368 </p>
369
370 <h2 id="v2.6-changes" class="docs">6. Version 2.6 changes</h2>
371
372 <p>
373 Version 2.6 improves Table of Contents handling so that entries may
374 span multiple lines. PDF outline page numbers now map correctly to
375 printed page numbers.
376 </p>
377
378 <h2 id="pdfmom" class="docs">6. pdfmom</h2>
379
380 <p>
381 Deri James has provided <strong>pdfmom</strong>, a wrapper around
382 groff that processes mom source files with all the PDF bells and
383 whistles. Its use is highly recommended. Usage is explained in the
384 manual,
385 <a href="http://www.schaffter.ca/mom/pdf/mom-pdf.pdf">
386 <span class="book-title">Producing PDFs with groff and mom</span>
387 </a>.
388 A significant convenience of pdfmom is that it can, with the
389 <kbd>-Tps</kbd> flag, be used to pass processing over to Keith
390 Marshall&#8217;s <strong>pdfroff</strong>. This is useful when
391 processing files that contain PostScript images embedded with
392 <a href="images.html#pspic">PSPIC</a>.
393 pdfmom, without the flag, uses groff&#8217;s PDF device
394 (<strong>gropdf</strong>), which only recognizes PDF images that
395 have been embedded with
396 <a href="images.html#pdf-image">PDF_IMAGE</a>.
397 </p>
398
399 <h2 id="install-font" class="docs">7. install-font.sh</h2>
400
401 <p>
402 A bash script, <strong>install-font.sh</strong>, has been posted at the
403 <a href="http://www.schaffter.ca/mom/mom-01.html">mom site</a>.
404 There&#8217;s nothing mom-specific about the script, and it is not
405 an official part of groff.
406 </p>
407
408 <p>
409 Installing groff fonts is a multi-step procedure, which, while not
410 difficult, can be a nuisance. install-font.sh takes
411 care of all the details, including converting fonts to formats
412 acceptable to <strong>grops</strong> and <strong>gropdf</strong>,
413 creating and installing the groff fonts in the appropriate
414 directories, updating the download files, and installing the
415 original fonts in a system-wide directory, if desired.
416 </p>
417
418 <div class="rule-long"><hr/></div>
419
420 <!-- Navigation links -->
421 <table style="width: 100%; margin-top: 12px;">
422 <tr>
423 <td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td>
424 <td style="width: 20%; text-align: center;"><a href="#top">Top</a></td>
425 <td style="width: 46%; text-align: right;"><a href="intro.html">Next: Introduction to mom</a></td>
426 </tr>
427 </table>
428
429 </div>
430
431 <div class="bottom-spacer"><br/></div>
432
433 </body>
434 </html>