From 88f4b7d56b55a0650f3bf07be15a11acbbc13376 Mon Sep 17 00:00:00 2001 From: wlemb Date: Sun, 25 Jan 2004 07:22:59 +0000 Subject: o Added lists and associated macros. Mom now does (nested) lists. o Added German-style lowered double quotes and two styles of guillemets to SMARTQUOTES. o Added macro SIZE, intended to be called inline as \*[SIZE ]. This is to bring mom's inline size change syntax into line with her other inlines. o Added ESC_CHAR as an alias of .ec o Added doc entries for lists. o Updated SMARTQUOTES entry in docs. o Updated reserved words in docs. o Fixed a few more typos in docs. --- contrib/mom/BUGS | 12 + contrib/mom/ChangeLog | 21 ++ contrib/mom/NEWS | 18 ++ contrib/mom/TODO | 13 -- contrib/mom/examples/README.mom | 7 +- contrib/mom/examples/elvis_syntax.new | 1 + contrib/mom/examples/macros.mom | 10 +- contrib/mom/momdoc/docelement.html | 424 +++++++++++++++++++++++++++++++++- contrib/mom/momdoc/docprocessing.html | 4 +- contrib/mom/momdoc/goodies.html | 92 ++++++-- contrib/mom/momdoc/headfootpage.html | 2 +- contrib/mom/momdoc/inlines.html | 71 +++--- contrib/mom/momdoc/intro.html | 2 +- contrib/mom/momdoc/reserved.html | 74 ++++-- contrib/mom/momdoc/toc.html | 26 ++- contrib/mom/momdoc/typemacdoc.html | 2 +- contrib/mom/momdoc/typesetting.html | 61 +++-- contrib/mom/om.tmac | 403 ++++++++++++++++++++++++++++++-- 18 files changed, 1097 insertions(+), 146 deletions(-) diff --git a/contrib/mom/BUGS b/contrib/mom/BUGS index 52f03c5e..9fa7c77a 100644 --- a/contrib/mom/BUGS +++ b/contrib/mom/BUGS @@ -7,10 +7,22 @@ questions and suggestions, or contact me directly at: df191@ncf.ca +If writing me directly, please include the word "groff" or "mom" in +the Subject line or you risk my spam filter nuking your message. +Also, please--no html email. That, too, gets nuked. + --Peter Schaffter ======================================================================== +Version 1.1.6-e +=============== + +The " mark (doublequote), when entered while not in document +processing mode (i.e. just straightforward typesetting), outputs +nothing unless SMARTQUOTES is invoked explicitly. +---Fixed--- + Version 1.1.6-c =============== diff --git a/contrib/mom/ChangeLog b/contrib/mom/ChangeLog index 0d062128..a8c4f4d6 100644 --- a/contrib/mom/ChangeLog +++ b/contrib/mom/ChangeLog @@ -1,3 +1,24 @@ +*Jan 24 2004 + +o Added lists and associated macros. Mom now does (nested) lists. + +o Added German-style lowered double quotes and two styles of + guillemets to SMARTQUOTES. + +o Added macro SIZE, intended to be called inline as \*[SIZE ]. + This is to bring mom's inline size change syntax into line with + her other inlines. + +o Added ESC_CHAR as an alias of .ec + +o Added doc entries for lists. + +o Updated SMARTQUOTES entry in docs. + +o Updated reserved words in docs. + +o Fixed a few more typos in docs. + *Tue Oct 21 2003 o Changed \n[#DRAFT] and \n[#REVISION] to strings \*[$DRAFT] and diff --git a/contrib/mom/NEWS b/contrib/mom/NEWS index 5a7436b6..50cb5b10 100644 --- a/contrib/mom/NEWS +++ b/contrib/mom/NEWS @@ -1,3 +1,21 @@ +Release 1.7 +----------- + +Finally got around to writing "list" macros. See the docs. + +Added German-style lowered double quotes and two styles of +guillemets to SMARTQUOTES. + +Added macro SIZE, intended to be called inline as \*[SIZE ]. +This brings mom's inline size change syntax into line with her other +inlines. \*S[] can still be used for the same thing. + +The file elvis_syntax (for elvis prior to 2.2h) is no longer being +maintained. It was getting messy and long in the tooth. The +official elvis syntax file is elvis_syntax.new, which works for +2.2h of elvis (and higher, one hopes). elvis users are encouraged +to update to 2.2h or higher. + Release 1.1.6-e --------------- diff --git a/contrib/mom/TODO b/contrib/mom/TODO index 7785cd9d..4cff7e23 100644 --- a/contrib/mom/TODO +++ b/contrib/mom/TODO @@ -14,17 +14,4 @@ control macros, or, instead, let user be able to enter absolute values with a unit of measure in addition to current behaviour, which is relative. -LISTS ------ -Possbility of indented, nested lists, html-style. Options for numbered, -alpha-ed, bulleted, dashed. Again, not sure how useful these would be -for mom's target users. As things stand now, it's easy enough to -set up lists with string tabs or hanging indents. - -BIBLIOGRAPHY ------------- -Thinking about macros to *assist* in user-written bibliographies (i.e. -not biblios that get generated automatically at the ends of docs). Style -considerations are a nightmare, though. - ------------------------------------------------------------------------ diff --git a/contrib/mom/examples/README.mom b/contrib/mom/examples/README.mom index fba1e018..2be09dab 100644 --- a/contrib/mom/examples/README.mom +++ b/contrib/mom/examples/README.mom @@ -43,8 +43,8 @@ letter.mom This is just the tutorial example from the momdocs, ready for previewing. -elvis_syntax ------------- +elvis_syntax.new +---------------- For those who use the vi clone, elvis, you can paste this file into your elvis.syn file. Provided your mom documents have the extension @@ -52,5 +52,8 @@ your elvis.syn file. Provided your mom documents have the extension in elvis_syntax aren't exhaustive, but they go a LONG way to making mom files more readable. +The file elvis_syntax (for pre-2.2h versions of elvis) is no longer +being maintained. Users are encouraged to update to elvis 2.2h or +higher, and to use elvis_syntax.new for mom highlighting. I'll be very happy if someone sends me syntax highlighting rules for vim and emacs. :) diff --git a/contrib/mom/examples/elvis_syntax.new b/contrib/mom/examples/elvis_syntax.new index 7da807f1..aaf9d605 100644 --- a/contrib/mom/examples/elvis_syntax.new +++ b/contrib/mom/examples/elvis_syntax.new @@ -45,6 +45,7 @@ font args LETTER LEGAL EXECUTIVE LEDGER TABLOID QUARTO FOLIO font args 10x14 A3 A4 A5 B4 B5 font args SINGLESPACE font args FACTOR +font args DASH BULLET ALPHA DIGIT USER prefix \/ \/. \/? \/! \/, \/; \/: font escapes \/ \/. \/? \/! \/, \/; \/: prefix \, \,. \,? \,! \,, \,; \,: diff --git a/contrib/mom/examples/macros.mom b/contrib/mom/examples/macros.mom index a3976f3f..5db01313 100644 --- a/contrib/mom/examples/macros.mom +++ b/contrib/mom/examples/macros.mom @@ -274,7 +274,7 @@ the wrong. \# \# .NEWPAGE \" Start a new page -.T_MARGIN 1i \" Set top margin to 1i (approx. equivalent to .ALD |1i-1v above +.T_MARGIN 1i \" Set top margin to 1i (approx. equivalent to .ALD |1i-1v above) \# \# .FAM T @@ -285,7 +285,7 @@ the wrong. Example 3: .ALD .25v .UNDERSCORE 3.75p "A \*[BU 2]recipe for enumerated lists using indents" -.SP \" Add an extra line space +.SP .5v \" Add an extra half line space .FAM N \" New Century Schoolbook family .FT R .PT_SIZE 11 @@ -296,6 +296,10 @@ This example demonstrates the use of left and hanging indents for simple enumerated lists. Nested lists are possible, as the example shows; however, the more complex the nesting, the wiser it becomes to use (string) tabs, as seen in Example 4. +.TI 1.5m +\*[BD]Please note: mom\*[PREV] has macros that allow you to set +enumerated lists automatically. These examples merely show hanging +indents and string tabs in use. \# \# .JUSTIFY \" Justify text @@ -374,7 +378,7 @@ list... Example 4: .ALD .25v .UNDERSCORE 3.75p "A \*[BU 2]recipe for nested lists using string tabs" -.SP +.SP .5v .FAM N .FT R .PT_SIZE 11 diff --git a/contrib/mom/momdoc/docelement.html b/contrib/mom/momdoc/docelement.html index 6f20ed12..2413ead4 100644 --- a/contrib/mom/momdoc/docelement.html +++ b/contrib/mom/momdoc/docelement.html @@ -216,6 +216,14 @@ arguments as
  • BLOCKQUOTE
  • Blockquote control +
  • Nested lists +
  • Footnotes
    • FOOTNOTE @@ -816,11 +824,6 @@ the escape in the string for each line, like this: or .HEAD "\[DOWN 3p]First line" "\[DOWN 3p]Next line" - - - - -

      @@ -1168,9 +1171,13 @@ or underlined (PRINTSTYLE TYPEWRITE), indented from the left margin. Obviously, she's thinking "quotes from poetry or song lyrics", but with the -quote control macros you can change her defaults so -QUOTE serves other needs, e.g. entering snippets of -programming code, command line instructions, and so on. +quote control macros +you can change her defaults so QUOTE serves other +needs, e.g. entering verbatim snippets of programming code, command +line instructions, and so on. (See the +tip +below for suggestions about including programming code snippets in +documents.)

      Besides indenting quotes, mom further sets them @@ -1195,7 +1202,49 @@ and BLOCKQUOTE, as does the control macro QUOTE_INDENT. -
      +

      +TIP: +If you want to include snippets of programming code in +mom documents, you may come acropper of the fact +that groff (and mom's) escape character is the +backslash. In order for mom not to interpret +backslashes that occur in code snippets as escapes, you have to +tell mom that the backslash character is +(temporarily) no longer the escape character. The easiest way +to do this is to set the escape character to something else for +the duration of the code snippet. You accomplish this with +ESC_CHAR, like this: +

      +

      +	.ESC_CHAR c
      +
      + +where "c", above, is the alternate escape character +(which should be a character that does not appear in the code). To +set the escape character back to the backslash, simply invoke +.ESC_CHAR by itself (i.e. with no argument). +

      +Because mom, by default, sets the text after +.QUOTE in italic (for PRINTSTYLE +TYPESET) or underlined (for PRINTSTYLE +TYPEWRITE), you'll want to change that behaviour as +well. Therefore, a recipe for setting verbatim code snippets using +QUOTE could be (assuming you want a fixed width +font like Courier): +

      +

      +	\# You only need the first two lines before the first invocation
      +	\# of QUOTE.  They stay in effect for all subsequent invocations.
      +	\#
      +	.QUOTE_FONT       CR    \" Set quote font to Courier roman
      +	.UNDERLINE_QUOTES OFF   \" Don't underline quotes in TYPEWRITE
      +	.QUOTE
      +	.ESC_CHAR ^             \" Change escape character to ^
      +	<code snippet>
      +	.ESC_CHAR               \" Restore escape character to \
      +	.QUOTE OFF
      +
      +
      @@ -1407,6 +1456,363 @@ spacing policy for +

      Nested lists

      + +

      +Lists are points or items of interest or importance that are +separated from +running text +by enumerators. Some typical enumerators are +en-dashes, +bullets, +digits and letters. +

      +Setting lists with mom is easy. First, you +initialize a list with the LIST macro. Then, for +every item in the list, you invoke the macro, ITEM, +followed by the text of the item. When a list is finished, you +exit the list with LIST OFF (or +QUIT, END, X, +etc.) +

      +By default mom starts each list with the enumerator +flush with the left margin of running text that comes before it, +like this: +

      +

      +	My daily schedule needs organizing.  I can't
      +	seem to get everything done I want.
      +	o an hour's worth of exercise
      +	o time to prepare at least one healthy
      +	  meal per day
      +	o reading time
      +	o work on mom
      +	o writing
      +	  - changes from publisher
      +	  - current novel
      +	o a couple of hours at the piano
      +
      + +In other words, mom does not, by default, indent +entire lists. Indenting a list is controlled by the macro, +SHIFT_LIST. +(This is a design decision; there are too many instances where a +default indent is not desirable.) Equally, mom +does not add any extra space above or below lists. +

      +Lists can be nested (as in the example above). In other words, you +can set lists within lists, each with an enumerator (and possibly, +indent) of your choosing. In nested lists, each invocation of +LIST OFF takes you back to the previous depth (or +level) of list, with that list's enumerator and indent intact. The +final LIST OFF exits lists completely and returns +you to the left margin of running text. +

      +Finally, lists can be used in documents created with either the +document processing macros or just the typesetting macros. +
      + + + +


      +

      + + Macro: LIST [ BULLET | DASH | DIGIT | ALPHA | USER ] [ <separator> | <user-defined enumerator> ] [ <off> ] + +

      +Invoked by itself (i.e. with no argument), LIST +initializes a list (with bullets as the default enumerator). +Afterwards, each block of input text preceded by +.ITEM, +on a line by itself, is treated as a list item. +

      +The optional arguments BULLET, +DASH, DIGIT (for arabic +numerals), ALPHA (for lowercase letters) and +USER allow you to say what kind of enumerator you +want for a given list. +

      +If you choose DIGIT or ALPHA, you +may enter the optional argument separator to say +what kind of separator you want after the enumerator. The separator +can be anything you like. The default for DIGIT is +a period (dot), like this: +

      +

      +	1. A list item
      +
      + +The default separator for ALPHA is a right +parenthesis, like this: +

      +

      +	a) A list item
      +
      + +If you want digits with a right-parenthesis separator, you'd do +

      +

      +	.LIST DIGIT )
      +	.ITEM
      +	A list item
      +
      + +which would produce +

      +

      +	1) A list item
      +
      + +BULLET, DASH and +USER do not take a separator. +

      +USER lets you make up your own enumerator. For +example, if you want a list enumerated with =>, +

      +

      +	.LIST USER =>
      +	.ITEM
      +	A list item
      +
      + +will produce + +

      +

      +	=> A list item
      +
      + +If the argument to USER contains spaces, you must +enclose the argument in double quotes. +

      +Any single argument other than BULLET, +DASH, DIGIT, +ALPHA or USER takes you out of the +current list. If you are at the first list-level (or -depth), +mom returns you to the left margin of running text. +Any indents that were in effect prior to setting the list are fully +restored. If you are in a nested list, mom moves +you back one list-level and restores the enumerator, separator and +indent appropriate to that level. +

      +Each invocation of LIST must be matched by a +corresponding LIST OFF in order to fully exit +lists. For example, +

      +

      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +	o List item in level 1
      +	o List item in level 1
      +	  - List item in level 2
      +	  - List item in level 2
      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +
      + +is created like this: +

      +

      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +	.LIST BULLET
      +	.ITEM
      +	List item in level 1
      +	.ITEM
      +	List item in level 1
      +	.LIST DASH
      +	.ITEM
      +	List item in level 2
      +	.ITEM
      +	List item in level 2
      +	.LIST OFF    \" Turn level 2 list off
      +	.LIST OFF    \" Turn level 1 list off
      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +
      + +NOTE: Every time you invoke LIST +to start a list (as opposed to exiting one), you must supply an +enumerator (and optionally, a separator) for the list, unless you +want mom's default enumerator, which is a bullet. +Within nested lists, mom stores the enumerator, +separator and indent for any list you return backwards to +(i.e. with LIST OFF), but does not store any +information for lists you move forward to. +
      + +
      +

      + + Macro: ITEM +

      +After you've initialized a list with +LIST, +precede each item you want in the list with ITEM. +Mom takes care of everything else with respect to +setting the item appropriate to the list you're in. +

      +In document processing, it is legal to have list items that contain +multiple paragraphs. Simply issue a +PP +request for each paragraph following the first item. +I.e., don't do this: +

      +

      +	.ITEM
      +	.PP
      +	Some text...
      +	.PP
      +	A second paragraph of text
      +
      + +but rather +

      +

      +	.ITEM
      +	Some text...
      +	.PP
      +	A second paragraph of text
      +
      +
      + +

      List control macros

      +
        +
      1. Indenting lists (SHIFT_LIST) +
      2. Resetting an initialized list's enumerator (RESET_LIST) +
      3. Padding digit enumerators (PAD_LIST_DIGITS) +
      + +

      1. Indenting lists -- SHIFT_LIST

      +

      +If you want a list to be indented to the right of running text, or +indented to the right of a current list, use the macro +SHIFT_LIST immediately after +LIST. +SHIFT_LIST takes just one argument: the amount by +which you want the list shifted to the right. The argument requires +a +unit of measure, +

      +SHIFT_LIST applies only to the list you +just initialized with LIST. It does not carry +over from one invocation of LIST to the next. +However, the indent remains in effect when you return to a +list level in a nested list. +

      +For example, if you want a 2-level list, with each list indented to +the right by 18 +points, +

      +

      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +	.LIST           \" List 1
      +	.SHIFT_LIST 18p \" Indent 18 points right of running text
      +	.ITEM
      +	List 1 item
      +	.ITEM
      +	List 1 item
      +	.LIST DASH      \" List 2
      +	.SHIFT_LIST 18p \" Indent 18 points right of list 1
      +	.ITEM
      +	List 2 item
      +	.ITEM
      +	List 2 item
      +	.LIST OFF       \" Move back to list 1
      +	.ITEM
      +	List 1 item
      +	.ITEM
      +	List 1 item
      +	.LIST OFF       \" Exit lists
      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +
      + +produces (approximately) +

      +

      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +	    o List 1 item
      +	    o List 1 item
      +	        - List 2 item
      +	        - List 2 item
      +	    o List 1 item
      +	    o List 1 item
      +	Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
      +	sed diam nonumy eirmod tempor invidunt ut labore.
      +
      + +

      2. Resetting an initialized list's enumerator -- RESET_LIST

      +

      +In nested lists, if your choice of list enumerator for a given level +of list is either DIGIT or ALPHA, +you may sometimes want to reset the list's enumerator back to +"1" or "a" when you return, within the nest, to +that list. Consider the following: +

      +

      +	Things to do religiously each and every day:
      +	1. Take care of the dog
      +	   a) walk every day
      +	   b) brush once a week
      +	      - trim around the eyes every fourth brushing
      +	      - don't forget to check nails
      +	2. Feed the cat
      +	   a) soft food on Mon., Wed. and Fri.
      +	   b) dry food on Tues., Thurs. and Sat.
      +	   c) canned tuna on Sunday
      +
      + +Normally, within a nested list, when you return to an alpha- or +digit-enumerated list, the enumerator continues incrementing from +where it left off. That means, in the example above, the normal +state of affairs for the alpha'ed list under "2. Feed the +cat" would be c), d) and e). The solution, in such a case, is +simply to reset the enumerator --before ITEM! -- +with the macro, RESET_LIST. +

      +RESET_LIST does exactly what it says -- resets the +list -- and doesn't take any arguments. +

      +

      3. Padding digit enumerators (PAD_LIST_DIGITS)

      +

      +When your choice of enumerators is DIGIT AND the +number of items in the list exceeds nine (9), you have to make a +design decision: should mom leave room for the +extra numeral in two-numeral digits to the right or the left of +the single-numeral digits? If you want the extra space to the +right, just invoke the macro, PAD_LIST_DIGITS by +itself. This will produce something like +

      +

      +	8.  List item
      +	9.  List item
      +	10. List item
      +
      + +If you want the extra space to the left, invoke +PAD_LIST_DIGITS with the single argument, +LEFT, which will produce +

      +

      +	 8. List item
      +	 9. List item
      +	10. List item
      +
      + +Of course, if the number of items in the list is less than ten +(10), there's no need for PAD_LIST_DIGITS. +
      +
      + + +

      Footnotes

      • Footnote behaviour diff --git a/contrib/mom/momdoc/docprocessing.html b/contrib/mom/momdoc/docprocessing.html index 887f7e24..0e8505cd 100644 --- a/contrib/mom/momdoc/docprocessing.html +++ b/contrib/mom/momdoc/docprocessing.html @@ -1043,7 +1043,7 @@ containing the title, subtitle and author information given to the and page headers with the author and title. (See Default specs for headers -for how mom's outputs each part of the page header.) +for how mom outputs each part of the page header.)

        CHAPTER prints "Chapter #" in place of a docheader @@ -1082,7 +1082,7 @@ except that mom prints the argument to as well as in page headers. (See Default specs for headers -for how mom's outputs each part of the page header.) +for how mom outputs each part of the page header.)

        LETTER tells mom you're writing a letter. See the section diff --git a/contrib/mom/momdoc/goodies.html b/contrib/mom/momdoc/goodies.html index f641aafe..54a33c3a 100644 --- a/contrib/mom/momdoc/goodies.html +++ b/contrib/mom/momdoc/goodies.html @@ -28,7 +28,7 @@ nearly indispensible) routines to simplify typesetting.

      • ALIAS (rename macros)
      • SILENT ("hide" input lines from output)
      • TRAP (suspend/re-invoke traps) -
      • SMARTQUOTES +
      • SMARTQUOTES (convert typewriter doublequotes to proper doublequotes)
      • CAPS (convert to upper case)
      • Underscore/underline @@ -59,12 +59,21 @@ nearly indispensible) routines to simplify typesetting.
      • DROPCAP_GUTTER (change space between drop cap and running text)
    -
  • Superscript +
  • Superscripts +
  • Lists + @@ -213,9 +222,9 @@ in order for one page to finish and another to start.

    Sometimes, traps get sprung when you don't want them, notably when using the -EL +EL and -TN +TN macros. If this happens, surround just the offending macros and input lines with

    @@ -237,14 +246,18 @@ of EL and TN to see


    -

    Smartquotes

    +

    Convert typewriter doublequotes to proper doublequotes


    -Macro: SMARTQUOTES toggle +Macro: SMARTQUOTES [<off>] [ ,, | >> | << ]

    -SMARTQUOTES converts all instances of the -inch-mark, (" -- also called a "doublequote"), -into the appropriate instances of true open- and close-doublequotes. +If you SMARTQUOTES without an argument, +mom converts all instances of the inch-mark, +(" --also called a "doublequote"), into +the appropriate instances of true Anglo-American open-and +close-doublequotes. (See the paragraphs on the meaning of the +optional arguments for how to get SMARTQUOTES to behave correctly +for non-English quoting styles.)

    Typographically, there is a difference between the inch-mark and doublequotes -- a BIG difference. Sadly, typewriters and computer @@ -255,20 +268,67 @@ typeset copy. Failure to turn inches into quotes is the first thing a professional typesetter notices in documents prepared by amateurs. And you don't want to look like an amateur, do you?

    -When preparing documents for typesetting, by all means, use the -inch-mark. Just make sure to turn SMARTQUOTES -on. SMARTQUOTES is a toggle, so invoking it with -no argument turns it on, and invoking it with any argument at all -turns it off. +If you invoke SMARTQUOTES with one of the optional +arguments ,,, >> or +<<, you can use " as "cheap" +open- and close-quotes when inputting text in a language other than +English, and have mom convert them, on output, +into the chosen open- and close-quote style. +

    +,, +opens quotes with "lowered doublequotes" and closes them +with "raised doublequotes", as in this ascii +approximation: +

    +

    +	,,Hilfe !``
    +
    + +>> +opens quotes with guillemets pointing to the right, and closes +them with guillemets pointing to the left, as in this ascii +approximation: +

    +

    +	>>Zurück !<<
    +
    + +<< +opens quotes with guillemets pointing to the left, and closes +them with guillemets pointing to the right, as in this ascii +approximation: +

    +

    +	<<Mais monsieur! Je ne suis pas ce genre de fille!>>
    +
    + +Please note: the arguments to SMARTQUOTES are +literal ASCII characters. ,, is two commas, << is two +less-than signs and >> is two greater-than signs. +

    +Turn SMARTQUOTES off by passing it any argument +not in the argument list (e.g. OFF, +QUIT, X, etc.)

    If you're using the document processing macros with PRINTSTYLE TYPESET, -SMARTQUOTES is on by default; with +SMARTQUOTES is on by default (in the Anglo-American +style); with PRINTSTYLE TYPEWRITE, it's off by default (and should probably stay that way).

    +Finally, if you're fussy about the kerning of quote marks in +relation to the text they surround, or have special quoting needs, +you have to enter quote marks by hand using groff's native +inline escapes +for special characters (see man groff_char for a complete list of +special characters). Entering quote marks this way allows you to +use mom's +inline kerning escapes +to fine-tune the look of quotes. +

    NOTE: SMARTQUOTES does not work on single quotes, which most people input with the apostrophe (found at the right-hand end of the "home row" on a QWERTY keyboard). @@ -566,7 +626,7 @@ rules into the whitespace through the use of string tabs and (Instead of \*[RULE], groff's line drawing function, \l -could be used instead.) +could be used.)

     	.LL 30P
    diff --git a/contrib/mom/momdoc/headfootpage.html b/contrib/mom/momdoc/headfootpage.html
    index 7b42cef6..c101dad4 100644
    --- a/contrib/mom/momdoc/headfootpage.html
    +++ b/contrib/mom/momdoc/headfootpage.html
    @@ -1272,7 +1272,7 @@ required, and decimal fractions are allowed.  Please note that
     (i.e. HEADER_RULE_GAP is NOT added to
     HEADER_GAP when mom calculates
     the space between headers and the start of
    -running text.
    +running text).
     

    By default, the header rule gap is 4 points. diff --git a/contrib/mom/momdoc/inlines.html b/contrib/mom/momdoc/inlines.html index b68cdbbb..ef463703 100644 --- a/contrib/mom/momdoc/inlines.html +++ b/contrib/mom/momdoc/inlines.html @@ -137,35 +137,52 @@ current macro.

    Changing point size

    -Mom's inline escape for changing point -size, sadly, does not observe her normal inline syntax -\*[whatever]. It's the only exception, and there's -no way around it. The escape for changing point size looks like this: +Mom has two inline escapes for changing point +size:

    -	\*S[size]
    +	\*[SIZE <size>]
     
    -where "size" is the new size you want. For example, to -change the point size inline to 12 points, you'd enter +and +

    +

    +	\*[S<size>]
    +
    + +where "size" is the new size you want. You can use +either; they behave exactly the same way. For example, to change +the point size of type inline to 12 points, you could enter either +

    +

    +	\*[SIZE 12]
    +
    + +or

     	\*S[12]
     
    -Notice that the new size does not require a +The advantage of the first form is that it's easy to remember, and +follows mom's usual inline syntax. The advantage +of the second is that it's more concise. +

    +Notice that in both cases, the new size does not require a unit of measure; points -is assumed. However, a unit of measure may be appended to the size, +is assumed. However, a unit of measure may be appended to the size if that's what you wish. Fractional sizes are, of course, allowed.

    -The size given to \*S may be expressed in plus -or minus terms, which can be very useful. In the following -example, the word "mom" will be output 2 points larger -than the point size of the rest of the line. +The size given to \*[SIZE <size>] or +\*S[<size>] may be expressed in plus or minus +terms, which can be very useful. In the following examples, the word +"mom" will be output 2 points larger than the point size +of the rest of the line.

     	While she isn't perfect, \*S[+2]mom\*S[-2] isn't half bad.
    +	While she isn't perfect, \*[SIZE +2]mom\*[SIZE -2] isn't half bad.
     
    NOTE: If you're accustomed to groff's usual way @@ -189,8 +206,8 @@ for more details). kerning through the use of the inline escapes

    -
    \*[BU #]Closes the space between letters (Back Units). -
    \*[FU #]Opens the space between letters (Forward Units). +
    \*[BU #]
    Closes the space between letters (Back Units). +
    \*[FU #]
    Opens the space between letters (Forward Units).

    "#" is the number of -
    \*[BU1]...\*[BU36] +
    \*[BU1]...\*[BU36]
    Move back 1...36 kern units -
    \*[FU1]...\*[FU36] +
    \*[FU1]...\*[FU36]
    Move forward 1...36 kern units
    @@ -247,12 +264,12 @@ line in order to create special typographic effects.

    -
    \*[FWD #<unit>] +
    \*[FWD #<unit>]
    Move forward inline the specified number of units of measure; decimal fractions are allowed. -
    \*[BCK #<unit>] +
    \*[BCK #<unit>]
    Move backward inline the specified number of units of measure; decimal fractions are allowed. @@ -269,8 +286,8 @@ puts 12 points of space between "1." and NOTE: For backward compatibility, the forms

    - +
    \*[BP.25]...\*[BP12.75]Move back .25...12.75 points -
    \*[FP.25]...\*[FP12.75]Move forward .25...12.75 points
    \*[BP.25]...\*[BP12.75]
    Move back .25...12.75 points +
    \*[FP.25]...\*[FP12.75]
    Move forward .25...12.75 points

    also exist (i.e. with no space before the digit and points being @@ -291,11 +308,11 @@ If you need to move portions of type up or down on a line,

    -
    \*[UP #<unit>] +
    \*[UP #<unit>]
    Move up inline the specified number of units of measure -
    \*[DOWN #<unit>] +
    \*[DOWN #<unit>]
    Move down inline the specified number of units of measure
    @@ -313,9 +330,9 @@ moves back down by the same amount. also available:

    -
    \*[ALD.25]...\*[ALD12.75] +
    \*[ALD.25]...\*[ALD12.75]
    Advance lead .25...12.75 points (move downward) -
    \*[RLD.25]...\*[RLD12.75] +
    \*[RLD.25]...\*[RLD12.75]
    Reverse lead .5...12.75 points (move upward)

    @@ -359,7 +376,7 @@ If you wish to accomplish this effect, you have to use macro and string tabs. (See the example provided with -.PAD. +.PAD.

    See groff's Horizontal line drawing function @@ -567,7 +584,7 @@ For a more complete list, consult the section Special Character Names at the end of the Tutorial Examples in cstr54, available here, -or the groff info documentation. +the groff info documentation, or man groff_char.

         CHARACTER                   ESCAPE SEQUENCE
    diff --git a/contrib/mom/momdoc/intro.html b/contrib/mom/momdoc/intro.html
    index b0741b41..91b4c279 100644
    --- a/contrib/mom/momdoc/intro.html
    +++ b/contrib/mom/momdoc/intro.html
    @@ -310,7 +310,7 @@ should be familiar to anyone who has ever read a manpage.  Briefly:
     		which means "or."
     	
  • Arguments that are optional are surrounded by square brackets.
  • <off> in an argument list means that any argument - turns the macro off. + other than those in the argument list turns the macro off.

    Toggle macros

    diff --git a/contrib/mom/momdoc/reserved.html b/contrib/mom/momdoc/reserved.html index accea287..4e88da78 100644 --- a/contrib/mom/momdoc/reserved.html +++ b/contrib/mom/momdoc/reserved.html @@ -139,6 +139,7 @@ DROPCAP_FAMILY Drop cap family DROPCAP_FONT Drop cap font DROPCAP_GUTTER Drop cap gutter DROPCAP_OFF Support only; restores .in if there was one +ESC_CHAR Alias for .ec EW Extra white -- loosen overall line kern (character spacing) LEADER_CHARACTER Sets leader character @@ -164,6 +165,10 @@ TYPESIZE Diverts SIZESPECS routine so it doesn't print +++NUMBER REGISTERS+++ #ALD ALD value +#ARGS_TO_LIST Tells LIST whether LIST was invoked with a legal arg; + controls LIST OFF processing +#ARGS_TO_SQ Tells SMARTQUOTES whether it was invoked with a legal + arg; controls SMARTQUOTES OFF processing #AUTOLEAD_FACTOR Using FACTOR arg to AUTOLEAD? (toggle) #AUTO_LEAD Using autolead? (toggle) #AUTO_LEAD_VALUE Auto leading value @@ -175,9 +180,12 @@ c column mark #CONDENSE Are we in pseudo-condense mode? (toggle) #COND_WIDTH Width of pseudo-condensed type (pointsize x $COND_PERCENT) +#CURRENT_L_LENGTH Current line length at first invocation of LIST; + like #ORIG_L_LENGTH #CURRENT_TAB Current tab number #DC_GUT Width of dropcap gutter #DEGREES # of degrees slant for pseudo-italic +#ENUMERATOR Number register enumerator for depth in lists #EXTEND Are we in pseudo-extend mode? (toggle) #EXT_WIDTH Width of pseudo-extended type (pointsize x $EXT_PERCENT) @@ -207,17 +215,21 @@ c column mark #LAST_TAB Last tab number set in multi-columns #LEAD Leading (alias) #LIGATURES Ligatures on? (toggle) +#LIST_INDENT Left indent of list #L_INDENT Value of left indent #L_LENGTH Line length #L_MARGIN Page offset if set with LMARGIN; if .po used, \n(.o returns page offset #LOOP #LOOP=1 if a while loop executes; otherwise 0. +#NEXT_DEPTH_BACK Next list level back in lists #NEXT_TAB Current tab number + 1 (used in TN) #NEXT_TAB Next tab in an n+1 sequence #OPEN_CLOSE Manipulates character " to print `` or '' +#ORIGINAL_L_LENGTH Used in LIST for IB processing; holds \n(.l p Output line horiz position at end of $PAD_STRING #PAD_COUNT Number of times # was included in arg to PAD +#PAD_LIST_DIGITS Pad list digits to the left? #PAD_SPACE Size of padding space #PAGE_LENGTH Page length (alias) #PAGE_WIDTH Page width @@ -227,13 +239,17 @@ p Output line horiz position at end of #Q_AT_TOP Does a quote start at the top of a new page? (toggle) #QUAD In autoquad mode? (toggle) +#QUIT Tells LIST whether to exit lists completely +#REMOVE Used in LIST OFF cleanup #RESTORE_LEAD Lead value in effect prior to AUTOLEAD #RESTORE_LINE_LENGTH Restores actual line length in RULE #RESTORE_PT_SIZE Stores current point size (in units) prior to underscore #R_INDENT Value of right indent -#RLD RLD value #R_MARGIN Right margin +#RESTORE_PREV_INDENT Tells LIST OFF what kind of indent was active prior to + first invocation of LIST +#RLD RLD value #SILENT Is silent on? (toggle) #SIZE_FOR_PAD Used to ensure that the size in effect prior to PAD is restored at the start of every @@ -247,15 +263,22 @@ p Output line horiz position at end of #ST_OFFSET Offset (from current tab) to add to #ST<#>_OFFSET when calculating string indents set from within tabs #ST<#>_OFFSET Indent of autotab <#> (page offset) +#STORED_L_INDENT Current left indent at first invocation of LIST +#STORED_R_INDENT Current right indent at first invocation of LIST +#STORED_BL_INDENT Current "both, left" indent at first invocation of LIST +#STORED_BR_INDENT Current "both, right" indent at first invocation of LIST +#STORED_HL_INDENT Current hanging indent at first invocation of LIST +#STORED_T_INDENT Current temporary indent at first invocation of LIST t "mark" register set in T_MARGIN; recalled in LS and AUTOLEAD if #T_MARGIN_SET is 1 -#TAB_ACTIVE Are we in a tab? (toggle) -#TAB_NUMBER Tab number -#TAB_OFFSET Tab indent #T_INDENT Value of temporary indent #T_MARGIN Top margin #T_MARGIN_SET Did we set the top margin with T_MARGIN? (toggle) +#TAB_ACTIVE Are we in a tab? (toggle) +#TAB_NUMBER Tab number +#TAB_OFFSET Tab indent +#TOTAL_LISTS Total number of lists in a nest #USER_SET_L_LENGTH Did user invoke LL? (toggle) #USER_SET_TITLE_ITEM Did user invoke TOC_TITLE_ENTRY? u Horiz position of start of underscore @@ -268,6 +291,7 @@ $CURRENT_TAB Current tab number $DC_ADJUST +|- # of points to subtract from dropcap $DC_FAM Drop cap family $DC_FT Drop cap font +$ENUMERATOR String enumerator for depth in lists $EXT_PERCENT Percentage by which to pseudo-extend type $FAMILY Family $FAMILY_FOR_PAD Used to ensure that the family in effect prior @@ -281,6 +305,7 @@ $QUOTE0 `` $QUOTE1 '' $RESTORE_QUAD_VALUE Quad value for use in restoring L, R, C, J (after tabs) +$SEPARATOR Separator for depth in lists $SS_VAR Holds + or - sentence space value $ST<#>_FILL Always QUAD if QUAD passed to ST <#> $ST<#>_QUAD_DIR Quad direction supplied to ST for <#> @@ -400,23 +425,28 @@ PRINTSTYLE Print style (TYPEWRITE or TYPESET) Document tags ------------- -BLOCKQUOTE Block-indented, quoted text -COL_BREAK Breaks and spreads line before invocation; moves to - next column on page or 1st col of next page. An alias - of COL_NEXT. -COL_NEXT Moves to next column on page or 1st col of next page -ENDNOTE Endnote -ENDNOTES Output endnotes -EPIGRAPH Epigraph before 1st para -FINIS Prints --END-- -FOOTNOTE Collects footnotes in text for printing at bottom of page -HEAD Section title (main heads) -LINEBREAK Break between narrative sections -PARAHEAD Paragraph head -PP Paragraph -QUOTE Poetic or line for line quotes -START Prints info collected with doc info macros -SUBHEAD Subheads +BLOCKQUOTE Block-indented, quoted text +COL_BREAK Breaks and spreads line before invocation; moves to + next column on page or 1st col of next page. An alias + of COL_NEXT. +COL_NEXT Moves to next column on page or 1st col of next page +ENDNOTE Endnote +ENDNOTES Output endnotes +EPIGRAPH Epigraph before 1st para +FINIS Prints --END-- +FOOTNOTE Collects footnotes in text for printing at bottom of page +HEAD Section title (main heads) +ITEM Begin a list item +LINEBREAK Break between narrative sections +LIST Initialize a list +PAD_LIST_DIGITS Leave space for two-numeral digit enumerators in a list +PARAHEAD Paragraph head +PP Paragraph +QUOTE Poetic or line for line quotes +RESET_LIST Reset digit or alpha list enumerator +SHIFT_LIST Move a list over to the right +START Prints info collected with doc info macros +SUBHEAD Subheads Headers/footers -------------- @@ -731,6 +761,8 @@ PRINT_PAGE_NUMBER Invoked in HEADER or FOOTER PRINT_USERDEF_HDRFTR Prints user defined, single string recto/verso header/footer REMOVE_INDENT Removes indents set with CHECK_INDENT +QUIT_LISTS Exit lists cleanly and completely +SET_LIST_INDENT Restore indent of a prev. level of list TRAPS Sets hdrftr traps; optionally adjusts #DOC_LEAD to fill page to #B_MARGIN diff --git a/contrib/mom/momdoc/toc.html b/contrib/mom/momdoc/toc.html index 26be1c4e..ba3e73b8 100644 --- a/contrib/mom/momdoc/toc.html +++ b/contrib/mom/momdoc/toc.html @@ -8,8 +8,10 @@

    Table of Contents

    -This link takes you to the Table of Contents itself -

    Table of Contents Navigation

    +This link takes you to the top of the Table of Contents proper +

    +


    +

    Quick Table of Contents Navigation

    INTRODUCTORY STUFF
    -
    -
    +
    -

    The Table of Contents Proper

    +

    The Table of Contents Proper

  • 1. WHAT IS MOM? @@ -142,7 +143,7 @@
  • 4.11 Goodies -- aliases, transparent lines, smartquotes, caps, underscoring/underlining, padding lines, leaders, drop - caps, superscripts + caps, superscripts, (nested) lists @@ -215,13 +216,14 @@
  • 5.4.5 Subheads
  • 5.4.6 Paragraph heads
  • 5.4.7 Linebreaks -- author linebreaks -
  • 5.4.8 Quotes -- line for line poetic quotes +
  • 5.4.8 Quotes -- line for line poetic quotes or unformatted, verbatim text
  • 5.4.9 Blockquotes -- cited material -
  • 5.4.10 Footnotes -
  • 5.4.11 Endnotes -
  • 5.4.12 Blank page -
  • 5.4.13 Table of contents -
  • 5.4.14 Document termination -- FINIS +
  • 5.4.10 Lists -- (nested) lists +
  • 5.4.11 Footnotes +
  • 5.4.12 Endnotes +
  • 5.4.13 Blank page +
  • 5.4.14 Table of contents +
  • 5.4.15 Document termination -- FINIS
  • 5.5 DOCUMENT HEADERS AND FOOTERS diff --git a/contrib/mom/momdoc/typemacdoc.html b/contrib/mom/momdoc/typemacdoc.html index ef23d084..e74ce877 100644 --- a/contrib/mom/momdoc/typemacdoc.html +++ b/contrib/mom/momdoc/typemacdoc.html @@ -35,7 +35,7 @@ with the basic parameters of type style: horizontal and vertical margins, line length, family, font, -point size, +point size, leading, and quad. diff --git a/contrib/mom/momdoc/typesetting.html b/contrib/mom/momdoc/typesetting.html index 56b1c144..184825ca 100644 --- a/contrib/mom/momdoc/typesetting.html +++ b/contrib/mom/momdoc/typesetting.html @@ -1140,16 +1140,17 @@ a line break that trips the trap (hey, I like that -- mom can't recover. She places the line after the EL on the next page.

    -If you need EL functionality on the last line of -a page with a footer trap, turn the trap off with -TRAP, -as in this example: +If you need EL functionality on the last line of a +page that has a footer trap, turn the trap off by surrounding the +line to be EL'd with +TRAP +requests, as in following example.

    -	3.
    -	.TRAP OFF
    -	.EL
    -	.TRAP
    +	.TRAP OFF  \" Turn trap off
    +	3.		   \" Input the first line
    +	.EL        \" Invoke EL...
    +	.TRAP      \" ...and turn trap back on *before* inputting next line
     	\*[FP12]Establish, once and for all, if 42 really is the answer.
     
    @@ -2997,23 +2998,51 @@ sequence (tab n+1) without advancing on the page. See the in the description of the TAB macro for an example of how TN works.

    -NOTE: TN is like +NOTE: You must put text in the +input line +immediately after TN. "Stacking" of +TN's is not allowed. In other words, you cannot +do +

    +

    +	.TAB 1
    +	Some text
    +	.TN
    +	Some more text
    +	.TN
    +	.TN
    +	Yet more text
    +
    + +The above example, assuming tabs numbered from 1 to 4, should be entered +

    +

    +	.TAB 1
    +	Some text
    +	.TN
    +	Some more text
    +	.TAB 4
    +	Yet more text
    +
    +

    +ADDITIONAL NOTE: TN is like EL in that it doesn't work as advertised on the last line before a -footer trap is sprung. If you need to use TN -on the last line of a page with a footer trap, turn the trap off with +footer trap is sprung. If you need to use TN on +the last line of a page that has a footer trap, turn the trap off by +surrounding the line to be TN'd with TRAP, -as in this example: +requests, as in the following example.

     	.TAB_SET 1 0  1P  L
     	.TAB_SET 2 1P 20P L
     	.TAB 1
    -	.TRAP OFF
    -	1.
    -	.TN
    +	.TRAP OFF  \" Turn trap off
    +	1.         \" Input the first line
    +	.TN        \" Invoke TN...
    +	.TRAP      \" ...and turn trap back on *before* inputting next line
     	The first rule of survival is "make and keep good friends."
    -	.TRAP
     
    The above, at the bottom of a page, will look something like this: diff --git a/contrib/mom/om.tmac b/contrib/mom/om.tmac index 4f4f2a81..ff0962a0 100644 --- a/contrib/mom/om.tmac +++ b/contrib/mom/om.tmac @@ -23,8 +23,8 @@ .\" .\" .\" -\# Version 1.1.6-e -\# --------------- +\# Version 1.7 +\# ----------- \# .if (\n[.x]\n[.y] < 118) \ . ab You need GNU troff version 1.18 or higher to run this version of mom! @@ -56,6 +56,7 @@ .ALIAS NEWPAGE bp .ALIAS SPREAD brp .ALIAS STRING ds +.ALIAS ESC_CHAR ec \# \# ALIASES FOR NUMBER REGISTERS \# ---------------------------- @@ -370,6 +371,20 @@ .END \# \# +\# *Arguments: +\# +\# *Function: +\# Sets point size to user supplied value in scaled points. +\# Intended to be called inline with \*[SIZE ] +\# *Notes: +\# Can be used with a unit of measure or not. +\# +.MAC SIZE END +\c +.ps \\$1 +.END +\# +\# \# LEADING \# ------- \# *Argument: @@ -440,7 +455,6 @@ .ds PREV \EfP .ds S \Es \# -\# \# ===================================================================== \# \# +++KERNING+++ @@ -476,14 +490,14 @@ \# of kerning between two letters as expressed in Us remains \# visually similar regardless of changes in point size. \# -\# N.B.--the amount of inline kerning supplied by \*[BU#] or -\# \*[FU#] is added to or subtracted from any kerning that already +\# N.B.--the amount of inline kerning supplied by \*[BU] or +\# \*[FU] is added to or subtracted from any kerning that already \# takes place between two characters when automatic kerning is \# turned on. \# \# In groff v. 1.17.2, it was not possible to pass arguments to macros that \# were executed with inline escapes, nor thence to evaluate conditional -\# expressions. Consequently, each pseudo-escape \[BU#] had to be defined +\# expressions. Consequently, each pseudo-escape \[BU] had to be defined \# separately with ".char". \# \# As of v. 1.18, one can pass arguments to inline strings/macros, @@ -1020,27 +1034,46 @@ \# Turns smartquotes on or off. \# *Notes: \# The " character is read outside the macro when mom is -\# processed. The strings for open/close ($QUOTE#) are then -\# defined in the macro. \N'34' is the ASCII code for ". If -\# incompatibilities arise, find the code for " that applies -\# to your system and plug in that code instead. +\# processed. The strings for open/close ($QUOTE) are then +\# defined in the macro. +\# +\# (Note to myself: ascii code for " is \N'34'.) \# .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])' \# .MAC SMARTQUOTES END +. rr #ARGS_TO_SQ . ie '\\$1'' \{\ . nr #OPEN_CLOSE 0 -. ds $QUOTE0 `` -. ds $QUOTE1 '' -. nr #SMART_QUOTES 1 +. ds $QUOTE0 \\[lq] +. ds $QUOTE1 \\[rq] . \} . el \{\ -. ds $QUOTE0 \\N'34' -. ds $QUOTE1 \\N'34' -. nr #SMART_QUOTES 0 +. if '\\$1',,' \{\ +. nr #ARGS_TO_SQ 1 +. ds $QUOTE0 \\[Bq] +. ds $QUOTE1 \\[lq] +. \} +. if '\\$1'<<' \{\ +. nr #ARGS_TO_SQ 1 +. ds $QUOTE0 \\[Fo]\\ +. ds $QUOTE1 \\ \\[Fc] +. \} +. if '\\$1'>>' \{\ +. nr #ARGS_TO_SQ 1 +. ds $QUOTE0 \\[Fc]\\| +. ds $QUOTE1 \\|\\[Fo] +. \} +. if !r#ARGS_TO_SQ \{\ +. ds $QUOTE0 \\[dq] +. ds $QUOTE1 \\[dq] +. \} . \} .END \# +.ds $QUOTE0 \[dq] +.ds $QUOTE1 \[dq] +\# Strings for foot and inch marks .ds FOOT \(fm .ds INCH \(fm\(fm \# @@ -1424,7 +1457,7 @@ \# *Argument: \# \# *Function: -\# Automagically moves to TAB#+1 on the same line as the last +\# Automagically moves to TAB on the same line as the last \# line of the previous tab. \# *Notes: \# If the tabs being aligned fall too close to the footer @@ -1432,10 +1465,9 @@ \# unless TRAP...TRAP OFF is used. \# .MAC TN END -. br +. EL . nr #NEXT_TAB \\n[#CURRENT_TAB]+1 . TAB\\n[#NEXT_TAB] -. sp -1v .END \# \# @@ -2458,9 +2490,9 @@ \# change the value, simply pass a new value. Values for TI and HI \# are *not* additive. \# -\# HI presupposes that you already have a left or both indent -\# on. HI will never hang a line outside the left margin of a -\# document. In other words, you must have IL or IB on before you +\# HI presupposes that you already have a left or both indent on. +\# HI will never hang a line outside the left margin of a document +\# or column. In other words, you must have IL or IB on before you \# can use HI. \# \# INDENT LEFT @@ -10534,6 +10566,7 @@ y\\R'#DESCENDER \\n[.cdp]' . br . rr #TOC .END +\# \# ==================================================================== \# \# +++COLUMNS+++ @@ -10591,6 +10624,332 @@ y\\R'#DESCENDER \\n[.cdp]' \# \# ==================================================================== \# +\# +++LISTS+++ +\# +\# LIST +\# ---- +\# *Arguments: +\# [ BULLET | DASH | DIGIT | ALPHA | USER ] [ ] [ ] +\# *Function: +\# Stores indent information in effect prior to invocation and +\# initializes a list with the supplied enumerator (and separator). +\# *Notes: +\# Default enumerator is a bullet. +\# +\# Enumerator *must* be supplied for every list that's to the +\# right of another list, every time, unless the default bullet is +\# desired. +\# +\# moves back one list level intuitively, or exits lists +\# completely if the level at which it's invoked is the first. +\# +.MAC LIST END +. if !r#DEPTH \{\ +. nr #STORED_HL_INDENT \\n[#HL_INDENT] +. nr #STORED_T_INDENT \\n[#T_INDENT] +. nr #CURRENT_L_LENGTH \\n(.l +. nr #DEPTH 0 1 +. if \\n[#INDENT_ACTIVE]=1 \{\ +. if \\n[#INDENT_LEFT_ACTIVE]=1 \{\ +. nr #STORED_L_INDENT \\n[#L_INDENT] +. nr #RESTORE_PREV_INDENT 1 +. \} +. if \\n[#INDENT_BOTH_ACTIVE]=1 \{\ +. nr #STORED_BL_INDENT \\n[#BL_INDENT] +. nr #STORED_BR_INDENT \\n[#BR_INDENT] +. IBX +. nr #ORIG_L_LENGTH \\n(.l +. IB +. nr #RESTORE_PREV_INDENT 2 +. \} +. if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\ +. nr #STORED_R_INDENT \\n[#R_INDENT] +. IRX +. nr #ORIG_L_LENGTH \\n(.l +. IR +. nr #RESTORE_PREV_INDENT 3 +. if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \} +. \} +. \} +. \} +. if \\n[#NUM_ARGS]=0 \{\ +. nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET +. ds $ENUMERATOR\\n+[#DEPTH] \(bu +. ds $SEPARATOR +. \} +. if \\n[#NUM_ARGS]>0 \{\ +. rr #ARGS_TO_LIST \" Clear this before processing arg 1. +. if '\\$1'DASH' \{\ +. nr #ARGS_TO_LIST 1 +. ds $ENUMERATOR\\n+[#DEPTH] \(en +. ds $SEPARATOR\\n[#DEPTH] +. \} +. if '\\$1'BULLET' \{\ +. nr #ARGS_TO_LIST 1 +. ds $ENUMERATOR\\n+[#DEPTH] \(bu +. ds $SEPARATOR\\n[#DEPTH] +. \} +. if '\\$1'DIGIT' \{\ +. nr #ARGS_TO_LIST 1 +. nr #ENUMERATOR\\n+[#DEPTH] 0 1 +. ds $ENUMERATOR_TYPE\\n[#DEPTH] register +. ds $SEPARATOR\\n[#DEPTH] . +. if \\n[#NUM_ARGS]=2 \{\ +. ie '\\$2'NONE' \{ .ds $SEPARATOR\\n[#DEPTH]\} +. el \{ .ds $SEPARATOR\\n[#DEPTH] \\$2\} +. \} +. \} +. if '\\$1'ALPHA' \{\ +. nr #ARGS_TO_LIST 1 +. nr #ENUMERATOR\\n+[#DEPTH] 0 1 +. af #ENUMERATOR\\n[#DEPTH] a +. ds $ENUMERATOR_TYPE\\n[#DEPTH] register +. ds $SEPARATOR\\n[#DEPTH] ) +. if \\n[#NUM_ARGS]=2 \{\ +. ie '\\$2'NONE' \{ .ds $SEPARATOR\\n[#DEPTH]\} +. el \{ .ds $SEPARATOR\\n[#DEPTH] \\$2\} +. \} +. \} +. if '\\$1'USER' \{\ +. nr #ARGS_TO_LIST 1 +. ds $ENUMERATOR\\n+[#DEPTH] \\$2 +. ds $SEPARATOR\\n[#DEPTH] +. \} +. if \\n[#NUM_ARGS]=1 \{\ +. if !r#ARGS_TO_LIST \{\ +. ie \\n[#DEPTH]=1 \{\ +. ie \\n[#NEXT_DEPTH_BACK]=0 \{\ +. SET_LIST_INDENT +. if \\n[#QUIT]=1 \{\ +. QUIT_LISTS +. return +. \} +. return +. \} +. el \{\ +. QUIT_LISTS +. return +. \} +. \} +. el \{\ +. SET_LIST_INDENT +. return +. \} +. \} +. \} +. \} +. nr #TOTAL_LISTS \\n[#DEPTH] +. ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\ +. nr #LIST_INDENT\\n[#DEPTH] \\w'm\\*[$SEPARATOR\\n[#DEPTH]]\\ ' +. \} +. el \{\ +. nr #LIST_INDENT\\n[#DEPTH] \\w'\\*[$ENUMERATOR\\n[#DEPTH]]\\0' +. \} +. LL \\n[#CURRENT_L_LENGTH]u +. ie \\n[#DEPTH]=1 \{\ +. ie \\n[#INDENT_ACTIVE]=1 \{\ +. if \\n[#INDENT_LEFT_ACTIVE]=1 \{\ +. nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]] +. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]] +. nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT] +. \} +. if \\n[#INDENT_BOTH_ACTIVE]=1 \{\ +. nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]] +. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]] +. nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT] +. \} +. if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\ +. ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\ +. \" Don't do anything; we already have a left indent +. \} +. el \{\ +. nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]] +. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]] +. \} +. \} +. \} +. el \{\ +. nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]] +. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]] +. \} +. \} +. el \{\ +. nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]] +. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]] +. \} +.END +\# +\# +\# ITEM +\# ---- +\# *Arguments: +\# none +\# *Function: +\# Prints enumerator for a given list depth and prepares mom to +\# receive the text of an item. +\# +.MAC ITEM END +. KERN OFF +. IL +. ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off. +. TRAP OFF +. HI \\n[#HL_INDENT\\n[#DEPTH]]u +. ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\ +. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\ +. ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\ +. ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\ +. PRINT \\0\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]] +. \} +. el \{\ +. PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]] +. \} +. \} +. el \{\ +. PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]] +. \} +. \} +. el \{\ +. PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]] +. \} +. \} +. el \{\ +. PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]] +. \} +. EL +. TRAP +. KERN +.END +\# +\# +\# SHIFT LIST +\# --------- +\# *Arguments: +\# +\# *Function: +\# Adds the value of the arg to the current list's indent. +\# *Notes: +\# Requires a unit of measure. +\# +.MAC SHIFT_LIST END +. nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]+(\\$1) +. nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]] +.END +\# +\# +\# PAD LIST DIGITS +\# --------------- +\# *Arguments: +\# [ LEFT ] +\# *Function: +\# Adds a figure space to a list's hanging and left indent. If +\# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM. +\# +.MAC PAD_LIST_DIGITS END +. if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\ +. nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0' +. nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]] +. nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]' +. if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \} +. \} +.END +\# +\# +\# RESET LIST +\# ---------- +\# *Arguments: +\# none +\# *Function: +\# Resets register enumerators to 1 or a. +\# +.MAC RESET_LIST END +. nr #ENUMERATOR\\n[#DEPTH] 0 1 +.END +\# +\# +\# QUIT LISTS +\# ---------- +\# *Arguments: +\# none +\# *Function: +\# Exits lists cleanly and restores any indents that were in +\# effect prior to LIST. +\# +.MAC QUIT_LISTS END +. IQ CLEAR +. nr #HL_INDENT \\n[#STORED_HL_INDENT] +. nr #T_INDENT \\n[#STORED_T_INDENT] +. rr #STORED_HL_INDENT +. if \\n[#RESTORE_PREV_INDENT]=1 \{\ +. nr #L_INDENT \\n[#STORED_L_INDENT] +. IL +. rr #STORED_L_INDENT +. \} +. if \\n[#RESTORE_PREV_INDENT]=2 \{\ +. nr #BL_INDENT \\n[#STORED_BL_INDENT] +. nr #BR_INDENT \\n[#STORED_BR_INDENT] +. LL \\n[#ORIG_L_LENGTH]u +. IB +. rr #STORED_BL_INDENT +. rr #STORED_BR_INDENT +. \} +. if \\n[#RESTORE_PREV_INDENT]=3 \{\ +. nr #R_INDENT \\n[#STORED_R_INDENT] +. LL \\n[#ORIG_L_LENGTH]u +. IR +. rr #STORED_R_INDENT +. \} +. if \\n[#RESTORE_PREV_INDENT]=4 \{\ +. nr #R_INDENT \\n[#STORED_R_INDENT] +. nr #L_INDENT \\n[#STORED_L_INDENT] +. LL \\n[#ORIG_L_LENGTH]u +. IR +. IL +. rr #STORED_R_INDENT +. rr #STORED_L_INDENT +. \} +.\" Clean up after exiting last depth of list +. nr #REMOVE 0 1 +. while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\ +. rr #LIST_INDENT\\n[#REMOVE] +. rr #ENUMERATOR\\n[#REMOVE] +. rm $ENUMERATOR\\n[#REMOVE] +. rr #SEPARATOR\\n[#REMOVE] +. rm $ENUMERATOR_TYPE\\n[#REMOVE] +. rr #PAD_LIST_DIGITS\\n[#REMOVE] +. \} +. rr #REMOVE +. rr #TOTAL_LISTS +. rr #QUIT +. rr #DEPTH +. rr #NEXT_DEPTH_BACK +. rr #RESTORE_PREV_INDENT +. rr #ORIG_L_LENGTH +. rr #CURRENT_L_LENGTH +.END +\# +\# +\# SET LIST INDENT +\# --------------- +\# *Arguments: +\# none +\# *Function: +\# Restores indent of prev. list in nested lists. Also sets the +\# #QUIT register if an invocation of LIST OFF applies to the first +\# level of list. +\# +.MAC SET_LIST_INDENT END +. nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1 +. if \\n[#NEXT_DEPTH_BACK]=0 \{\ +. nr #QUIT 1 +. return +. \} +. ie \\n[#NEXT_DEPTH_BACK]=1 \{ .nr #L_INDENT \\n[#LIST_INDENT1] \} +. el \{ .nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]] \} +. nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]] +.END +\# +\# ==================================================================== +\# \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++ \# \# COLLATE -- cgit v1.2.1