diff options
author | wlemb <wlemb> | 2003-07-07 20:55:41 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2003-07-07 20:55:41 +0000 |
commit | 4dcc1e10c79aa70ec9ac00daa486bcba9864f53b (patch) | |
tree | c39fdf57f30140c0464fe41a35dfce178290a23d /contrib/mom | |
parent | f011af41ce79eb34a7bba5097f4754caa4ab54ac (diff) | |
download | groff-4dcc1e10c79aa70ec9ac00daa486bcba9864f53b.tar.gz |
Added a SHIM macro that calculates and moves to the next "legal"
baseline during document processing (useful if user starts playing
around with spacing/leading on a page and needs to get the leading
back on track).
Fixed handling of DOCHEADER OFF <distance> so that the first line of
running text falls on a "legal" baseline when <distance> is given.
Other cleanups.
Diffstat (limited to 'contrib/mom')
-rw-r--r-- | contrib/mom/BUGS | 11 | ||||
-rw-r--r-- | contrib/mom/ChangeLog | 29 | ||||
-rw-r--r-- | contrib/mom/NEWS | 11 | ||||
-rw-r--r-- | contrib/mom/examples/elvis_syntax | 2 | ||||
-rw-r--r-- | contrib/mom/momdoc/docelement.html | 19 | ||||
-rw-r--r-- | contrib/mom/momdoc/docprocessing.html | 137 | ||||
-rw-r--r-- | contrib/mom/momdoc/goodies.html | 19 | ||||
-rw-r--r-- | contrib/mom/momdoc/headfootpage.html | 87 | ||||
-rw-r--r-- | contrib/mom/momdoc/inlines.html | 4 | ||||
-rw-r--r-- | contrib/mom/momdoc/reserved.html | 14 | ||||
-rw-r--r-- | contrib/mom/momdoc/toc.html | 3 | ||||
-rw-r--r-- | contrib/mom/momdoc/typesetting.html | 4 | ||||
-rw-r--r-- | contrib/mom/om.tmac | 98 |
13 files changed, 326 insertions, 112 deletions
diff --git a/contrib/mom/BUGS b/contrib/mom/BUGS index 807cef08..c193d867 100644 --- a/contrib/mom/BUGS +++ b/contrib/mom/BUGS @@ -11,6 +11,17 @@ questions and suggestions, or contact me directly at: ======================================================================== +Version 1.1.6-b +=============== + +String tabs not picking up #L_MARGIN when #L_MARGIN not explicitly +set with L_MARGIN, PAPER or PAGE. +---Fixed--- + +Infinite loop when B_MARGIN is set lower than FOOTER_MARGIN during +doc processing. +---Fixed--- + Version 1.1.6-a =============== diff --git a/contrib/mom/ChangeLog b/contrib/mom/ChangeLog index 1f180482..7057f6a1 100644 --- a/contrib/mom/ChangeLog +++ b/contrib/mom/ChangeLog @@ -44,11 +44,15 @@ o Extensive changes to DEFAULTS, START, COLLATE, HEAD, SUBHEAD and o Fixed DOCHEADER OFF (distance), FINIS +----------------------------------------------------------------------- + *Sat Feb 22 2003 o (Re)-fixed handling of post epigraph spacing after #START for TYPEWRITE double-spaced. +------------------------------------------------------------------------ + *Sun Feb 16 2003 o Added James Ramsey's proposed CHAPTER_TITLE macro, along with his @@ -108,6 +112,8 @@ o Changed handling of inline horizontal and vertical movements. The older forms \*[FP#] and \*[BP#] still work (horizontals), as do \*[ALD#] and \*[RLD#] (verticals). +------------------------------------------------------------------------ + *Mon Aug 19 2002 o Fixed ENDNOTES so footnotes output properly when ENDNOTES is called @@ -123,15 +129,6 @@ o Added .nf to top of PAD, with a test beforehand for current fill processing. Updated reserved.html to include number register #FILL_MODE. -*Mon Jul 29 2002 - -o Makefile.sub (FFLAG, TFLAG): Add paths to source directories. - -*Wed Jul 24 2002 - -o Makefile.sub (groff_bin_path): Don't use ' \+' but ' *' for sed. - (GROFF): Set GROFF_COMMAND_PREFIX to empty value. - *Fri Jul 12 2002 o More fixes to underlining. @@ -162,10 +159,6 @@ o Fixed the character translations for UNDERLINE so they work properly o Expanded docprocessing.html entry "Special Note on Chapters". Tidied up html a bit. -*Tue Jun 18 2002 - -o examples/macros.mom: Fix path to penguin.ps. - *Sat Jun 15 2002 o Small fix to PAD to make the use of inlines within the pad string @@ -174,17 +167,17 @@ o Small fix to PAD to make the use of inlines within the pad string o Added \*[RULE] ( = \l'\n(.lu' ) so that full measure rules (either to full line length or within tabs) are easier to set. -*Sat Jun 8 2002 +*Sat Jun 8 2002 o Macro .PS renamed to .PT_SIZE. Alias .TS removed. -o .tr bits in .CAPS rewritten in the form .tr é\['E]. +o .tr bits in .CAPS rewritten in the form .tr é\[`E]. -o General cleanup of docs to reflect changes. +o General cleanup of docs to reflect changes -o Small changes/additions to `elvis_syntax'. +o Small changes/additions to elvis_syn -*Thu Jun 6 2002 +*Thu Jun 6 2002 o In DOCTYPE, in .if '\\$1'LETTER', added .FOOTER_RIGHT_SIZE +0. Without it, the suite page was printing at the default diff --git a/contrib/mom/NEWS b/contrib/mom/NEWS index 3fe3d8c4..2825ba9f 100644 --- a/contrib/mom/NEWS +++ b/contrib/mom/NEWS @@ -1,3 +1,14 @@ +Release 1.1.6-b +--------------- + +Added a SHIM macro that calculates and moves to the next "legal" +baseline during document processing (useful if user starts playing +around with spacing/leading on a page and needs to get the leading +back on track). + +Fixed handling of DOCHEADER OFF <distance> so that the first line of +running text falls on a "legal" baseline when <distance> is given. + Release 1.1.6-a --------------- diff --git a/contrib/mom/examples/elvis_syntax b/contrib/mom/examples/elvis_syntax index 33492723..a366538e 100644 --- a/contrib/mom/examples/elvis_syntax +++ b/contrib/mom/examples/elvis_syntax @@ -97,7 +97,7 @@ keyword .RECTO_VERSO keyword .RESET_FOOTNOTE_NUMBER .RESET_HEAD_NUMBER .RESET_PARAHEAD_NUMBER keyword .RESET_SUBHEAD_NUMBER keyword .REVISION .REVISION_STRING .RIGHT .RLD .R_MARGIN .RW -keyword .SETBOLDER .SETSLANT .SILENT .SLANT_MEANS_SLANT .SMARTQUOTES .SP .SPACE +keyword .SETBOLDER .SETSLANT .SHIM .SILENT .SLANT_MEANS_SLANT .SMARTQUOTES .SP .SPACE keyword .SPREAD .SS .ST .START .STRING .SUBHEAD .SUBHEAD_FAMILY .SUBHEAD_FONT .SUBHEAD_SIZE keyword .SUBTITLE .SUBTITLE_FAMILY .SUBTITLE_FONT .SUBTITLE_SIZE keyword .SWITCH_FOOTERS .SWITCH_HDRFTR .SWITCH_HEADERS diff --git a/contrib/mom/momdoc/docelement.html b/contrib/mom/momdoc/docelement.html index f1fde1fd..6f20ed12 100644 --- a/contrib/mom/momdoc/docelement.html +++ b/contrib/mom/momdoc/docelement.html @@ -343,7 +343,7 @@ and indent appropriate to where you are in your document are taken care of automatically. <p> By default, <strong>mom</strong> does not indent the first paragraph -of a document, nor paragraphs that fall imediately after +of a document, nor paragraphs that fall immediately after <a href="#HEAD_INTRO">heads</a> or <a href="#SUBHEAD_INTRO">subheads</a>. @@ -467,7 +467,7 @@ with the appropriate control macros. <p> <strong>Mom</strong>'s default paragraph font is medium roman. -<a name="PP_LEADING"><h3><u>3.Leading</u></h3></a> +<a name="PP_LEADING"><h3><u>3. Leading</u></h3></a> The paragraph <a href="definitions.html#TERMS_LEADING">leading</a> is set with @@ -489,7 +489,11 @@ EVERY paragraph whose leading you wish to change. <strong>HYPER-IMPORTANT NOTE:</strong> It is extremely unwise to change paragraph leading with <strong>LS</strong>, as it will, in all cases, screw up <strong>mom</strong>'s ability to balance the bottom margin -of pages. +of pages. Should you absolutely need to change paragraph leading +with <strong>LS</strong>, and subsequently want <strong>mom</strong> +to get back on the right leading track, use the +<a href="docprocessing.html#SHIM">SHIM</a> +macro. <p> <strong>Mom</strong>'s default paragraph leading (document leading) is 16 points, adjusted to fill the page. @@ -1233,7 +1237,7 @@ See <pre> .QUOTE_FAMILY default = prevailing document family; default is Times Roman .QUOTE_FONT default = italic -.QUOTE_SIZE default = 0 (i.e. same size as paragraph text) +.QUOTE_SIZE default = +0 (i.e. same size as paragraph text) <a name="QUOTE_INDENT">.QUOTE_INDENT default = paragraph indent x 3 (typeset); x 2 (typewrite)</a> (note that this macro also sets the indents (left and right) for blockquotes) @@ -1323,7 +1327,10 @@ although you can change the point size. There are Very Good Reasons for this. If you can't live with the limitation, change the leading of blockquotes (after invoking the tag) with <a href="typesetting.html#LS">LS</a>, -but know that there will be Bottom Margin Consequences. +but know that there will be Bottom Margin Consequences unless you +use the +<a href="docprocessing.html#SHIM">SHIM</a> +macro after you turn the blockquote off. <br> <!---BLOCKQUOTE---> @@ -1461,7 +1468,7 @@ appropriate marker from the previous page. <p> In the unfortunate happenstance that a deferred footnote is the only footnote on its page (i.e. it's marked in the document body with -a star) and the page it's deferred has its own footnotes, +a star) and the page it's deferred to has its own footnotes, <strong>mom</strong> separates the deferred footnote from the page's proper footnote(s) with a blank line. This avoids the confusion that might result from readers seeing two footnote entries on the same page diff --git a/contrib/mom/momdoc/docprocessing.html b/contrib/mom/momdoc/docprocessing.html index fdc49753..403c6ccf 100644 --- a/contrib/mom/momdoc/docprocessing.html +++ b/contrib/mom/momdoc/docprocessing.html @@ -22,6 +22,8 @@ <a href="#DEFAULTS">Some document defaults</a> <p> <a href="#LEADING_NOTE">* IMPORTANT NOTE on leading/spacing and bottom margins *</a> +<br> + <a href="#SHIM">The SHIM macro</a> <p> <ul> <li><a href="#SETUP"><strong>DOCUMENT SETUP</strong></a> @@ -32,6 +34,7 @@ <li><a href="#REFERENCE_MACROS"><strong>The Reference Macros</strong></a> <ul> <li><a href="#TITLE">TITLE</a> + <li><a href="#DOC_TITLE">DOCTITLE</a> <li><a href="#SUBTITLE">SUBTITLE</a> <li><a href="#AUTHOR">AUTHOR</a> <li><a href="#CHAPTER">CHAPTER</a> @@ -277,11 +280,11 @@ short). In order to ensure even bottom margins, <strong>mom</strong> uses the "base" document <a href="definitions.html#TERMS_LEADING">leading</a> -in effect <em>at the start of each page</em> (i.e. the leading used -in paragraphs) to calculate the spacing of every document element. -Prior to invoking +in effect <em>at the start of running text on each page</em> (i.e. +the leading used in paragraphs) to calculate the spacing of every +document element. Prior to invoking <a href="#START">START</a>, -this is done with the +this is set with the <a href="typesetting.html#MACROS_TYPESETTING">typesetting macro</a> <a href="typesetting.html#LEADING">LS</a>, afterwards with the document @@ -310,7 +313,73 @@ since "v" accepts decimal fractions, you can add/subtract half linespaces and quarter linespaces with "v" as well, <em>provided you compensate for the fractional linespace somewhere else on the page</em>. +<p> +If all this seems like too much too much work, <strong>mom</strong> +provides a special macro to get you out of trouble if you've played +around with leading and/or spacing. The macro is called +<strong>SHIM</strong> (like those little pieces of wood carpenters +use to get their work even, level and snug), and it's described +below. <br> + +<!---SHIM---> + +<hr width="66%" align="left"> +<p> +<a name="SHIM"></a> +Macro: <strong>SHIM</strong> + +<p> +<strong>SHIM</strong> doesn't take any argument. Use it whenever +you've played around with the +<a href="definitions.html#TERMS_LEADING">leading</a> +or spacing on a page and you +need to get <strong>mom</strong>'s document leading back on track. +<p> +For example, say you want to insert a picture into a document with +the special groff macro, <strong>PSPIC</strong> (see the +<strong>grops</strong> man page for useage). +<p> +Pictures aren't usually conveniently sized in multiples of document +leading, which means that when you insert the picture, you disrupt +<strong>mom</strong>'s ordered placement of baselines on the page. +This will certainly result in a bottom margin that doesn't match the +bottom margins of your document's other pages. +<p> +The solution is to insert <strong>SHIM</strong> after the picture, +like this: +<p> +<pre> + <some lines of text> + .PSPIC <full path to picture> + .SHIM + <more lines of text> +</pre> +<strong>SHIM</strong> instructs <strong>mom</strong> to insert as +much or a little space after the picture as is needed to ensure that +the baseline of the next +<a href="definitions.html#TERMS_OUTPUTLINE">output line</a> +falls where <strong>mom</strong> would have put it had you not +disrupted the normal flow of output lines with the picture. +<p> +And say, on previewing the above example, you find that the picture +doesn't centre nicely between the lines of text, you can always do +<p> +<pre> + <some lines of text> + .RLD 3p + .PSPIC <full path to picture> + .SHIM + <more lines of text> +</pre> + +to raise the picture slightly +(<strong>R</strong>everse <strong>L</strong>ea<strong>D</strong> +3 points; see +<a href="typesetting.html#RLD">RLD</a>), +and still have <strong>SHIM</strong> ensure that text underneath +falls exactly where it's supposed to. +<p> <hr> <a name="SETUP"><h2><u>Document setup</u></h2></a> @@ -366,6 +435,7 @@ some reference information. The reference macros are: <p> <ul> <li>TITLE + <li>DOCTITLE <li>SUBTITLE <li>AUTHOR <li>CHAPTER -- the chapter number @@ -571,6 +641,7 @@ document processing macros. <ul> <li><a href="#TITLE">TITLE</a> + <li><a href="#DOC_TITLE">DOCTITLE</a> <li><a href="#SUBTITLE">SUBTITLE</a> <li><a href="#AUTHOR">AUTHOR</a> <li><a href="#CHAPTER">CHAPTER</a> @@ -722,7 +793,7 @@ She also puts the same thing in the middle of If you're not using <strong>DOCTYPE CHAPTER</strong>, the macro serves no purpose and <strong>mom</strong> ignores it. <p> -<a name="CHAPTER_STRING"><strong>CHAPTER_STRING<strong></a> +<a name="CHAPTER_STRING"><strong>CHAPTER_STRING</strong></a> <p> If you're not writing in English, you can ask <strong>mom</strong> to use the word for chapter in your own language by telling @@ -792,7 +863,7 @@ default), <strong>mom</strong> ignores <strong>DRAFT</strong>. "Draft" in the middle part of <a href="definitions.html#TERMS_HEADER">page headers</a>. <p> -<a name="DRAFT_STRING"><strong>DRAFT STRING<strong></a> +<a name="DRAFT_STRING"><strong>DRAFT STRING</strong></a> <p> If you're not writing in English, you can ask <strong>mom</strong> to use the word for draft in your own language by telling @@ -908,10 +979,10 @@ reference macro but supply a backward compatability with pre-1.1.5 versions of</em> <strong>mom</strong><em>, you can also supply a chapter title by ommitting the</em> <strong>CHAPTER</strong> <em>reference macro and -supplying a chapter title with -<a href="#CHAPTER_STRING">CHAPTER_STRING</a>. +supplying a chapter title with</em> +<a href="#CHAPTER_STRING">CHAPTER_STRING</a>.) <p> -The page headers in <strong>DOCTYPE CHAPTER</a> contain the author, +The page headers in <strong>DOCTYPE CHAPTER</strong> contain the author, the title of the book (which you gave with <a href="#TITLE">TITLE</a>), and "Chapter #" (or the chapter title). See @@ -1234,17 +1305,17 @@ When used before <strong>START</strong>, the <a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a> -(below have) the following meanings: +(below) have the following meanings: <p> <pre> L_MARGIN Left margin of pages, including headers/footers R_MARGIN Right margin of pages, including headers/footers T_MARGIN The point at which running text (i.e. not headers/footers or page numbers) starts on each page - B_MARGIN The point at which running text (i.e. not - headers/footers or page numbers) ends on each page + *B_MARGIN The point at which running text (i.e. not + (see note) headers/footers or page numbers) ends on each page - (PAGE If you use PAGE, its first four arguments have the + PAGE If you use PAGE, its final four arguments have the same meaning as L_ R_ T_ and B_MARGIN above.) LL The line length for everything on the page; @@ -1253,12 +1324,13 @@ the PT_SIZE The point size of type in paragraphs; mom uses this calculate automatic point size changes (eg. for heads, footnotes, quotes, headers, etc) - *LS or AUTOLEAD The leading used in paragraphs; all leading and spacing + **LS/AUTOLEAD The leading used in paragraphs; all leading and spacing of running text is calculated from this QUAD Affects paragraphs only ------ -*See <a href="#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a> + *See <a href="headfootpage.html#FOOTER_MARGIN">FOOTER MARGIN AND BOTTOM MARGIN</a> for an important warning +**See <a href="#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a> </pre> Other macros that deal with type style, or refinements thereof @@ -1266,7 +1338,7 @@ Other macros that deal with type style, or refinements thereof It is not recommended that you set up tabs or indents prior to <strong>START</strong>. <p> -If you want to change any of the basic parameters above +If you want to change any of the basic parameters (above) <em>after</em> <strong>START</strong> and have them affect a document globally (as if you'd entered them <em>before</em> <strong>START</strong>), you must use the macros listed in @@ -1373,17 +1445,22 @@ turn it off with have to be <strong>OFF</strong>; it can be anything you like. <p> If you turn the docheader off, <strong>mom</strong>, by default, starts -your document in the same place she would if the docheader were there. -If you'd like her to start at a different vertical position, give -her the distance you'd like as a second argument. +the running text of your document on the same top +<a href="definitions.html#TERMS_BASELINE">baseline</a> +as all subsequent pages. If you'd like her to start at a different +vertical position, give her the distance you'd like as a second +argument. <p> <pre> .DOCHEADER OFF 1.5i </pre> -This starts the document 1.5 inches from the top of the page. -The distance you give is measured from the top edge of the paper -to the +This starts the document 1.5 inches from the top of the page PLUS +whatever spacing adjustment <strong>mom</strong> has to make in +order to ensure that the first baseline of running text falls on a +"legal" baseline (i.e. one that ensures that the bottom +margin of the first page falls where it should). The distance is +measured from the top edge of the paper to the <a href="definitions.html#TERMS_BASELINE">baseline</a> of the first line of type. <p> @@ -1486,10 +1563,10 @@ to place them where you want. <a name="ADJUST_LEADING"><h3><u>2. Adjust the leading</u></h3></a> The -<a href="definitions.html#TERMS_LEADING">leading</a> of -docheaders is the same as running text (except when +<a href="definitions.html#TERMS_LEADING">leading</a> +of docheaders is the same as running text (except when <a href="#DOCTYPE">DOCTYPE</a> -is <strong>CHAPTER</a> <em>and both</em> a chapter number and a +is <strong>CHAPTER</strong> <em>and</em> both a chapter number and a chapter title have been supplied, in which case the default is 4 points more than running text.) <p> @@ -1497,14 +1574,14 @@ If you'd like your docheaders to have a different leading, say, 2 points more than the lead of running text, use: <p> <pre> - .DOCHEADER_LEAD +2p + .DOCHEADER_LEAD +2 </pre> Since the leading of docheaders is calculated from the lead of running text, a + or - sign is required before the argument (how much to add -or subtract from the lead of running text). The +or subtract from the lead of running text). No <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a> -is also required. +is required; points is assumed. <a name="CHANGE_FAMILY"><h3><u>3. Change the family of docheader elements</u></h3></a> The following macros let you change the @@ -1520,7 +1597,9 @@ of each docheader element separately: <a href="#DOCTYPE">DOCTYPE</a> is NAMED) </ul> <p> -Simply pass the appropriate macro the family you want. +Simply pass the appropriate macro the family you want, just as you +would with +<a href="typesetting.html#FAMILY">FAMILY</a>. <a name="CHANGE_FONT"><h3><u>4. Change the font of docheader elements</u></h3></a> The following macros let you change the diff --git a/contrib/mom/momdoc/goodies.html b/contrib/mom/momdoc/goodies.html index 8876966a..f641aafe 100644 --- a/contrib/mom/momdoc/goodies.html +++ b/contrib/mom/momdoc/goodies.html @@ -560,8 +560,13 @@ particularly useful in conjunction with <a href="#STRING_TABS">string tabs</a>. The following uses the Date/Signature example above, but adds rules into the whitespace through the use of string tabs and +<strong>mom</strong>'s +<a href="definitions.html#TERMS_INLINES">inline escape</a> +<a href="inlines.html#INLINE_RULE_MOM">\*[RULE]</a>. +(Instead of <strong>\*[RULE]</strong>, groff's line drawing function, -<a href="#INLINE_LINEDRAWING_GROFF">\l</a>. +<a href="inlines.html#INLINE_LINEDRAWING_GROFF">\l</a> +could be used instead.) <p> <pre> .LL 30P @@ -570,22 +575,16 @@ groff's line drawing function, .ST 1 J .ST 2 J .TAB 1 - \l'\n(.lu' + \*[RULE] .TN - \l'\n(.lu' + \*[RULE] .TQ </pre> If you're not a typesetter, and if you're new to groff, the example probably looks like gibberish. My apologies. However, remember that typesetting is a craft, and without having studied -the craft, it takes a while to grasp its concepts. Also, -although <strong>mom</strong> tries very hard to provide -consistent-looking, comprehensible alternatives to groff's -native -<a href="definitions.html#TERMS_INLINES">inline escapes</a>, -<strong>mom</strong> has not yet found a replacement for -<strong>\l</strong>. +the craft, it takes a while to grasp its concepts. <p> Basically, what the example does is: <br> diff --git a/contrib/mom/momdoc/headfootpage.html b/contrib/mom/momdoc/headfootpage.html index 15d88128..7b42cef6 100644 --- a/contrib/mom/momdoc/headfootpage.html +++ b/contrib/mom/momdoc/headfootpage.html @@ -13,7 +13,7 @@ <a name="TOP"></a> <a name="HEADFOOTPAGE"> - <h2 align="center"><u>DOCUMENT HEADERS, FOOTERS, AND PAGINATION</u></h2> + <h2 align="center"><u>PAGE HEADERS, FOOTERS, AND PAGINATION</u></h2> </a> <ul> @@ -188,7 +188,7 @@ the top and bottom margins of a <strong>mom</strong> document are the vertical start and end positions of <a href="definitions.html#TERMS_RUNNING">running text</a>, not the vertical positions of headers or footers, which, by definition, -appear in the margin <em>above</em> (or below) running text. +appear in the margins <em>above</em> (or below) running text. <p> The vertical placement of headers is controlled by the macro @@ -212,7 +212,10 @@ running text at whatever top margin you gave. <strong>FOOTER_GAP</strong> and <a href="typesetting.html#B_MARGIN">B_MARGIN</a> work similarly, except they determine where running text -<em>ends</em> on the page. +<em>ends</em> on the page. (See +<a href="#FOOTER_MARGIN">FOOTER MARGIN AND BOTTOM MARGIN -- VERY IMPORTANT!</a> +for a warning about possible conflicts between the footer margin +and the bottom margin.) <p> Confused? <strong>Mom</strong> apologizes. It's really quite simple. By default, <strong>mom</strong> sets headers 4-1/2 @@ -426,8 +429,8 @@ you can make the headers come out just about any way you want. Use of the <strong>\*[PAGE#]</strong> escape is permitted in the string argument (see <a href="#PAGE_NUMBER_INCL">Including the page number in header-left, -center or -right</a>), -and <strong>mom</strong> provides a special mechanism whereby -it's possible to "pad" it as well. +and as an added bonus, <strong>mom</strong> provides a special +mechanism whereby it's possible to "pad" the string as well. <br> <!---HDRFTR_RECTOVERSO---> @@ -509,7 +512,9 @@ point in the string where you want an equalized amount of whitespace inserted. (If you're unsure what padding is, see <a href="goodies.html#PAD">Insert space into lines</a>.) Note that if you're padding the string, it doesn't matter what -quad direction you give <strong>HEADER_RECTO</strong>. +quad direction you give <strong>HEADER_RECTO</strong> since +padding, by it's nature, justifies text to the left and right +margins. <p> The situation depicted above is accomplished like this: <p> @@ -522,6 +527,16 @@ Note that <strong>mom</strong> does not interpret the <kbd>#</kbd> in <strong>\*[PAGE#]</strong> as a padding marker (i.e. as a place to insert whitespace). <p> +Also, notice that the argument <strong>LEFT</strong> is used in both +cases. When padding a header, it doesn't matter whether you use +LEFT, CENTER or RIGHT as the argument. +<p> +Furthermore, should you need a user-defined header of +the sort provided by <strong>HEADER_RECTO</strong> and +<strong>HEADER_VERSO</strong> but aren't actually printing +recto/verso, you can use <strong>HEADER_RECTO</strong> to design the +header that appears at the top of every page. +<p> <strong>IMPORTANT:</strong> The <a href="goodies.html#PAD_MARKER">PAD_MARKER</a> macro, which changes the default pad marker (<kbd>#</kbd>) used by @@ -649,7 +664,7 @@ you want <strong>NAMED</strong> "Outline" <p> but when you preview your work, you see that "Outline", in the -centre of the page header, is uncomfortable close to the title, +centre of the page header, is uncomfortably close to the title, which is to the right of it. By invoking <p> <pre> @@ -1052,11 +1067,61 @@ edge of the page to the baseline of type in footers. <p> <strong>Mom</strong>'s default footer margin is 3 <a href="definitions.html#TERMS_PICASPOINTS">picas</a>. + +<a name="FOOTER_MARGIN"></a> <p> -<strong>NOTE:</strong> <strong>Mom</strong> uses -<strong>HEADER_MARGIN</strong> and +<strong>FOOTER MARGIN AND BOTTOM MARGIN -- VERY IMPORTANT!</strong> +<p> +<strong>Mom</strong> requires a footer margin for proper operation, +hence she sets one, even if you don't. (As stated above, her default +footer margin is 3-picas). +<p> +If you set a bottom margin for your document (with +<a href="typesetting.html#B_MARGIN">B_MARGIN</a>, +prior to +<a href="docprocessing.html#START">START</a>) +and the margin's too close to <strong>mom</strong>'s default +footer margin (or a footer margin you set yourself +with <strong>FOOTER_MARGIN</strong>), <strong>mom</strong> will +not print your footers; additionally, she'll give you a warning +on and some advice on standard error. When this happens, you must +reset either <strong>B_MARGIN</strong> or +<strong>FOOTER_MARGIN</strong> so there's an adequate amount of +space for <strong>mom</strong> to print the bottom line of running +text and the footer. +<p> +If you see the warning even when footers and/or bottom-of-page page +numbering are disabled, set a nominal footer margin of 0 prior to +<a href="docprocessing.html#START">START</a>, +as in these examples. +<p> +<strong>Example 1</strong> +<p> +<pre> + <reference macros, etc> + .PAGINATION OFF + .B_MARGIN .25i + .FOOTER_MARGIN O + .START +</pre> + +<strong>Example 2</strong> +<p> +<pre> + <reference macros, etc> + .HEADERS OFF + .PAGENUM_POS TOP RIGHT + .B_MARGIN .25i + .FOOTER_MARGIN O + .START +</pre> + +<h3>A note on header/footer margins and page numbering</h3> +<p> +<strong>Mom</strong> uses HEADER_MARGIN</strong> and <strong>FOOTER_MARGIN</strong> to establish the baseline -position of page numbers in addition to headers and footers. +position of page numbers in addition to the baseline position of +headers and footers. <p> By default, page numbers appear at the bottom of the page, therefore if you want the default position (bottom), but want to change the @@ -1425,7 +1490,7 @@ For example, if you turn both and <a href="definitions.html#TERMS_FOOTER">footers</a> off (with <code>.HEADERS OFF</code> and <code>.FOOTERS -OFF</code)) and you want <strong>mom</strong> to number your +OFF</code>) and you want <strong>mom</strong> to number your pages at the top right position, enter <p> <pre> diff --git a/contrib/mom/momdoc/inlines.html b/contrib/mom/momdoc/inlines.html index 2d8aa82a..b68cdbbb 100644 --- a/contrib/mom/momdoc/inlines.html +++ b/contrib/mom/momdoc/inlines.html @@ -566,8 +566,8 @@ these characters, consult the For a more complete list, consult the section <em>Special Character Names</em> at the end of the <em>Tutorial Examples</em> in <strong>cstr54</strong>, available -<a href="http://www.kohala.com/start/troff/">here</a>. - +<a href="http://www.kohala.com/start/troff/">here</a>, +or the groff <strong>info</strong> documentation. <p> <pre> CHARACTER ESCAPE SEQUENCE diff --git a/contrib/mom/momdoc/reserved.html b/contrib/mom/momdoc/reserved.html index 13714342..39eef9e0 100644 --- a/contrib/mom/momdoc/reserved.html +++ b/contrib/mom/momdoc/reserved.html @@ -620,6 +620,7 @@ RESTORE_PAGINATION Restore pagination after outputting non- paginated endnotes. REVISION_STRING What to print whenever the word "revision" is required +SHIM Advance to next "legal" baseline SINGLESPACE_ENDNOTES Single space TYPEWRITE endnotes SLANT_MEANS_SLANT In TYPEWRITE, render \*[SLANT] as slant SUBHEAD_FAMILY Family to use in subheads @@ -768,6 +769,7 @@ TRAPS Sets hdrftr traps; optionally adjusts #DOC_LEAD #COLUMNS_WERE_ON Stores columnar state prior to outputting endnotes in no-columns mode #COPY_STYLE 1=draft, 2=final +#CURRENT_V_POS \n(.d ; used in SHIM dc "mark" register for document columns #DATE Is there a date (for letters)? 1=yes #DEFER_PAGINATION Tells COLLATE to restore pagination (from @@ -779,8 +781,6 @@ dc "mark" register for document columns #DEPTH_TO_B_MARGIN Page length minus #B_MARGIN #DOCHEADER_ADVANCE Distance from top-of-page to baseline of docheader -#DOCHEADER_LEAD_ADJ +|- value applied to #DOC_LEAD to - in/decrease leading of doc header #DOCHEADER_LEAD Lead of doc header (#DOC_LEAD + #DOCHEADER_LEAD_ADJ) #DOCHEADER_SPACE_ADJ Lead difference between #DEPTH_1 and @@ -928,6 +928,8 @@ dc "mark" register for document columns alone if it's on for running text. #ITALIC_MEANS_ITALIC For TYPEWRITE. 1=yes; 0=no #LEFT_CAP_HEIGHT Cap height of left string in headers/footers +#LEGAL_BASELINE Calculates vert. position of next legal + baseline in SHIM #LETTER_STYLE 1=BUSINESS 2=PERSONAL #LINEBREAK Did we have a linebreak? (toggle) #LINES_PER_PAGE # of lines (at DOC_LEAD) that fit on @@ -1016,7 +1018,11 @@ dc "mark" register for document columns #SH_LEAD_ADJUST #DOC_LEAD/8 (TYPESET) or /2 (TYPEWRITE) (used for subhead spacing) #SH_NUM Subhead number +#SHIM Amount of lead required to advance to + next legal baseline #SINGLE_SPACE Is TYPEWRITE in single space mode? (toggle) +#SKIP_FOOTER If 1, instructs DO_FOOTER to do nothing + if B_MARGIN falls below FOOTER_MARGIN #SLANT_MEANS_SLANT For TYPEWRITE. 1=yes; 0=no #SLANT_WAS_ON Keeps track of SLANT when it needs to go off for a while @@ -1033,7 +1039,7 @@ dc "mark" register for document columns #SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT? (toggle) #TAB_OFFSET# "#" at the end is from $CURRENT_TAB -#TO Is there an addressee date (for letters)? +#TO Is there an addressee (for letters)? 1=yes #TOC_AUTHORS Whether to append author(s) to toc doc title entries (toggle) @@ -1106,6 +1112,8 @@ $DOC_TITLE Overall doc title that gets printed in different title $DOC_TYPE Document type (default, chapter, named, letter) +$DOCHEADER_LEAD_ADJ +|- value applied to #DOC_LEAD to + in/decrease leading of doc header $DOCTYPE_FAM Family to use for DOCTYPE string in doc header $DOCTYPE_FT Font to use for DOCTYPE string in diff --git a/contrib/mom/momdoc/toc.html b/contrib/mom/momdoc/toc.html index a6e1b8ff..26be1c4e 100644 --- a/contrib/mom/momdoc/toc.html +++ b/contrib/mom/momdoc/toc.html @@ -162,7 +162,8 @@ <li><a href="docprocessing.html#INTRO_MACROS_DOCPROCESSING">5.1 Introduction to document processing</a> <li><a href="docprocessing.html#DEFAULTS">5.2 Some document defaults</a> <ul> - <li><a href="docprocessing.html#LEADING_NOTE">IMPORTANT NOTE on leading/spacing and bottom margins</a> + <li><a href="docprocessing.html#LEADING_NOTE">IMPORTANT NOTE on leading/spacing and bottom margins</a> + <li><a href="docprocessing.html#SHIM">The SHIM macro</a> -- to get document leading back on track </ul> <a name="PRELIM"></a> <li><a href="docprocessing.html#SETUP"><strong>5.3 PRELIMINARY DOCUMENT SETUP</strong></a> diff --git a/contrib/mom/momdoc/typesetting.html b/contrib/mom/momdoc/typesetting.html index 8ac345ee..56b1c144 100644 --- a/contrib/mom/momdoc/typesetting.html +++ b/contrib/mom/momdoc/typesetting.html @@ -2550,8 +2550,8 @@ In combination with the macro and the groff inline escape <a href="inlines.html#INLINE_HORIZONTAL_GROFF">\h</a> (move horizontally across the page) or <strong>mom</strong>'s -<a href="inlines.html#INLINE_HORIZONTAL_MOM">\*[FP#]</a> -(Forward Points) inline, string tabs provide +<a href="inlines.html#INLINE_HORIZONTAL_MOM">\*[FWD <distance>]</a> +(move forward) inline, string tabs provide tremendous flexibility in setting up complex tab structures. <a name="STRING_TABS_TUT"><h3><u>Quickie tutorial on string tabs</u></h3></a> diff --git a/contrib/mom/om.tmac b/contrib/mom/om.tmac index f1528746..cd9f1386 100644 --- a/contrib/mom/om.tmac +++ b/contrib/mom/om.tmac @@ -23,7 +23,7 @@ .\" . . -\# Version 1.1.6-a +\# Version 1.1.6-c \# --------------- \# .if (\n[.x]\n[.y] < 118) \ @@ -73,7 +73,8 @@ \# \# MISCELLANEOUS \# ============= -.cflags 4 /\(en +.cflags 4 /\(en \" So slash and en-dashes get broken +.nr #L_MARGIN \n(.o \" Tabs, etc require #L_MARGIN \# \# ==================================================================== \# @@ -105,7 +106,7 @@ . ALD \\n[#DOC_LEAD]u*3u . PRINT \\*[$AUTHOR_1] . \} -.DO_FOOTER +. DO_FOOTER .END \# \# @@ -271,9 +272,9 @@ \# The trap is set in .PAGE. \# .MAC DO_B_MARGIN END -.ev 1 +. ev 1 . bp -.ev +. ev .END \# \# ===================================================================== @@ -1430,7 +1431,8 @@ \# line of the previous tab. \# *Notes: \# If the tabs being aligned fall too close to the footer -\# trap, the line entered after .TN will appear on the next page. +\# trap, the line entered after .TN will appear on the next page, +\# unless TRAP...TRAP OFF is used. \# .MAC TN END . br @@ -3670,6 +3672,13 @@ y\\R'#DESCENDER \\n[.cdp]' . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \} . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \} . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \} +. if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\ +. tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin. +. tm1 " No footers or bottom-of-page page numbers will be printed. +. tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space. +. tm1 " If no footers or bottom-of-page page numbers are required, +. tm1 " place .FOOTER_MARGIN 0 before .START +. \} . if !r#HDRFTR_RULE_GAP \{\ . if \\n[#HEADERS_ON] \{ .HDRFTR_RULE_GAP 4p \} . if \\n[#FOOTERS_ON] \{ .HDRFTR_RULE_GAP 4p \} @@ -3799,10 +3808,10 @@ y\\R'#DESCENDER \\n[.cdp]' . \} \# Defaults for printstyle TYPESET . if \\n[#PRINT_STYLE]=2 \{\ -. if !r#DOCHEADER_LEAD_ADJ \{\ +. if !d$DOCHEADER_LEAD_ADJ \{\ . ie !'\\*[$CHAPTER_TITLE]'' \{\ . ie !'\\*[$CHAPTER_STRING]'' \{\ -. DOCHEADER_LEAD +4p +. DOCHEADER_LEAD +4 . \} . el \{ .DOCHEADER_LEAD +0 \} . \} @@ -4091,7 +4100,7 @@ y\\R'#DESCENDER \\n[.cdp]' . \} . \} . DEFAULTS -\# +\# Collate stuff . ie \\n[#COLLATED_DOC]=1 \{\ \# Collect TITLE for TOC. . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ] @@ -4179,14 +4188,17 @@ y\\R'#DESCENDER \\n[.cdp]' . \} . rr #COLLATE . rr #PAGINATION_STATE -\# +\# End collate stuff . ie \\n[#DOC_HEADER]=0 \{\ . PRINT \& . if \\n[#DOC_TYPE]=4 \{\ . if !'\\n(.z'' \{ .di \} . \} . PP -. ie r#ADVANCE_FROM_TOP \{ .sp |\\n[#ADVANCE_FROM_TOP]u-1v \} +. ie r#ADVANCE_FROM_TOP \{\ +. sp |\\n[#ADVANCE_FROM_TOP]u-1v +. SHIM +. \} . el \{ .sp |\\n[#T_MARGIN]u-1v \} . if \\n[#COLUMNS] \{\ . mk dc @@ -4199,7 +4211,7 @@ y\\R'#DESCENDER \\n[.cdp]' . if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \} . \} . el \{\ -. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u+\\n[#DOCHEADER_LEAD_ADJ]u \} +. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \} . nr #DOCHEADER_LEAD \\n[#LEAD] \# Default . if \\n[#DOC_TYPE]=1 \{\ @@ -4393,8 +4405,8 @@ y\\R'#DESCENDER \\n[.cdp]' . \} . if !\\n[#DOC_TYPE]=4 \{\ . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \} -. nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD] \"Do we need the units? -. ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]u-\\n[#DOCHEADER_SPACE_ADJ]u \} +. nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD] +. ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \} . el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \} . if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \} . if \\n[#COLUMNS] \{\ @@ -4455,13 +4467,13 @@ y\\R'#DESCENDER \\n[.cdp]' \# *Arguments: \# <+|- amount by which to in/decrease leading of doc header> \# *Function: -\# Stores user supplied lead in/decrease in register #DOCHEADER_LEAD_ADJ. +\# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ. \# *Notes: \# A unit of measure must be supplied. Decimal fractions OK. \# Default is +0, i.e. same as DOC_LEAD. \# .MAC DOCHEADER_LEAD END -. nr #DOCHEADER_LEAD_ADJ (\\$1) +. ds $DOCHEADER_LEAD_ADJ \\$1 .END \# \# @@ -4843,6 +4855,27 @@ y\\R'#DESCENDER \\n[.cdp]' .END \# \# +\# SHIM +\# ---- +\# *Argument: +\# None +\# *Function: +\# Advances to the next "legal" baseline. +\# *Notes: +\# If a user plays around with spacing in a doc (say, with ALD), +\# it isn't easy to get mom back on track so she can achieve +\# perfectly flush bottom margins. Any time SHIM is used, it +\# ensures that the next output line falls on a legal baseline. +\# +.MAC SHIM END +. nr #CURRENT_V_POS \\n(.d +. nr #LEGAL_BASELINE \\n[#T_MARGIN] \\n[#DOC_LEAD] +. while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{ . \} +. nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS] +. ALD \\n[#SHIM]u +.END +\# +\# \# DOCUMENT QUAD \# ------------- \# *Arguments: @@ -5864,7 +5897,9 @@ y\\R'#DESCENDER \\n[.cdp]' \# *Notes: \# For use when users don't want 3-part headers/footers, but rather \# want to design their own headers/footers and need different -\# headers/footers on recto and verso pages. +\# headers/footers on recto and verso pages. Using just +\# HEADER_RECTO, even when recto/verso is not on, allows users to +\# design their own headers/footers for doc pages. \# .MAC HDRFTR_RECTO END . nr #USERDEF_HDRFTR 1 @@ -6508,7 +6543,12 @@ y\\R'#DESCENDER \\n[.cdp]' \# Resets CAPS and UNDERLINE if they were on. \# .MAC DO_FOOTER END -. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v +. ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\ +. nr #SKIP_FOOTER 1 +. \} +. el \{\ +. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v +. \} . ev FOOTER . po \\n[#DOC_L_MARGIN]u . ll \\n[#DOC_L_LENGTH]u @@ -6531,13 +6571,16 @@ y\\R'#DESCENDER \\n[.cdp]' . UNDERLINE OFF . \} . ie \\n[#FOOTERS_ON] \{\ -. PRINT_HDRFTR +. if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \} . \} . el \{\ . if \\n[#PAGINATE] \{\ -. if \\n[#PAGE_NUM_V_POS]=2 \{ .PRINT_PAGE_NUMBER \} +. if \\n[#PAGE_NUM_V_POS]=2 \{\ +. if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \} +. \} . \} . \} +. rr #SKIP_FOOTER . if \\n[#CAPS_WAS_ON] \{\ . CAPS . rr #CAPS_WAS_ON @@ -9920,7 +9963,6 @@ y\\R'#DESCENDER \\n[.cdp]' \# \# +++TABLE OF CONTENTS+++ \# -\# \# Strings to allocate space for leaders and entry page numbers \# .ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X] @@ -9985,7 +10027,7 @@ y\\R'#DESCENDER \\n[.cdp]' \# measure required. \# \# No unit of measure required (points assumed). Default is 11.5 -\# for TYPEWRITE. +\# for TYPESET. \# .MAC TOC_PT_SIZE END . nr #TOC_PS (p;\\$1) @@ -10062,7 +10104,7 @@ y\\R'#DESCENDER \\n[.cdp]' . el \{ .rr #TOC_RV_SWITCH \} .END \# -\# - for TOC "doc" header (i.e. "Contents") +\# - for TOC "doc header" (i.e. "Contents") \# \# TOC HEADER FAMILY \# ----------------- @@ -10124,7 +10166,7 @@ y\\R'#DESCENDER \\n[.cdp]' \# TOC HEADER STRING \# ----------------- \# *Argument: -\# <string for "doc" header of first toc page> +\# <string for "doc header" of first toc page> \# *Function: \# Creates or modifies string $TOC_HEADER_STRING \# *Notes: @@ -10134,7 +10176,7 @@ y\\R'#DESCENDER \\n[.cdp]' . ds $TOC_HEADER_STRING \\$1 .END \# -\# - for TOC entries page number numbers +\# - for TOC entries page number numerals \# \# TOC ENTRIES PAGE NUMBER FAMILY \# ------------------------------ @@ -10184,7 +10226,7 @@ y\\R'#DESCENDER \\n[.cdp]' \# \# All these control macros behave the same way, setting the family, \# font, point size and indent from the left margin of the different -\# kinds of entries what can appear in the toc. The way they +\# kinds of entries that can appear in the toc. The way they \# operate is identical to all other _FAMILY, _FONT and _SIZE \# control macros. _INDENT takes an absolute value. \# TOC_APPENDS_AUTHORS is unique in this section. @@ -10733,8 +10775,6 @@ y\\R'#DESCENDER \\n[.cdp]' .END \# \# -\# -\# \# ==================================================================== \# \# +++DOCUMENT PROCESSING ALIASES+++ @@ -10856,7 +10896,7 @@ y\\R'#DESCENDER \\n[.cdp]' .ALIAS SWITCH_HEADERS SWITCH_HDRFTR .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR \# -\# SUPPORT ALIASES +\# Support aliases \# .ALIAS COL_BREAK COL_NEXT .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE |