DOCUMENT PROCESSING WITH MOM
Introduction to document processing
Some document defaults
* IMPORTANT NOTE on leading/spacing and bottom margins *
The SHIM macro
In addition to the tags themselves, mom has an extensive array of macros that control how they look and behave.
Setting up a mom doc is a simple, four-part procedure. You begin by entering information about the document itself (title, subtitle, author, etc.). Next, you tell mom what kind of document you're creating (e.g. chapter, letter, abstract, etc...) and what kind of output you want (typeset, typewritten, draft-style, etc). Thirdly, you make as many or as few changes to mom's default behaviour as you wish. Lastly, you invoke the START macro. Voilà! You're ready to write.
I fear the following may not be adequately covered in the documentation. Just in case, here they are.
Another way to check up on document processing defaults is to have a look at the macro file (om.tmac). Each macro is preceded by a description that (generally) says what its default is (if it has one).
In order to ensure even bottom margins, mom uses the "base" document leading in effect at the start of running text on each page (i.e. the leading used in paragraphs) to calculate the spacing of every document element. Prior to invoking START, this is set with the typesetting macro LS, afterwards with the document control macro DOC_LEAD.
Because mom relies so heavily on the base document leading, any change to the leading or spacing on a page will almost certainly have undesirable consequences on that page's bottom margin unless the change is fully compensated for elsewhere on the page.
In other words, if you add a few points of space somewhere on a page, you must subtract the same number of points somewhere else on that same page, and vice versa.
If it's a question of adding or subtracting full line spaces between or within document elements, you can do so by using the "v" unit of measure with whatever spacing macro you choose -- ALD, RLD, SPACE -- and mom won't object. "v" means "the current leading", so she isn't confused by it. And since "v" accepts decimal fractions, you can add/subtract half linespaces and quarter linespaces with "v" as well, provided you compensate for the fractional linespace somewhere else on the page.
If all this seems like too much work, mom provides a special macro to get you out of trouble if you've played around with leading and/or spacing. The macro is called SHIM (like those little pieces of wood carpenters use to get their work even, level and snug), and it's described below.
SHIM doesn't take any argument. Use it whenever you've played around with the leading or spacing on a page and you need to get mom's document leading back on track.
For example, say you want to insert a picture into a document with the special groff macro, PSPIC (see the groff_tmac man page for usage).
Pictures aren't usually conveniently sized in multiples of document leading, which means that when you insert the picture, you disrupt mom'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.
The solution is to insert SHIM after the picture, like this:
<some lines of text> .PSPIC <full path to picture> .SHIM <more lines of text>SHIM instructs mom to insert as much or a little space after the picture as is needed to ensure that the baseline of the next output line falls where mom would have put it had you not disrupted the normal flow of output lines with the picture.
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
<some lines of text> .RLD 3p .PSPIC <full path to picture> .SHIM <more lines of text>to raise the picture slightly (Reverse LeaD 3 points; see RLD), and still have SHIM ensure that text underneath falls exactly where it's supposed to.
Tutorial -- Setting up a mom document
There are four "parts" to setting up a mom
doc (three, actually, with one optional). Before we proceed, though,
be reassured that something as simple as
.TITLE "By the Shores of Lake Attica" .AUTHOR "Rosemary Winspeare" .PRINTSTYLE TYPESET .STARTproduces a beautifully typeset 8.5x11 document, with a docheader at the top of page 1, page headers with the title and author on subsequent pages, and page numbers at the bottom of each page. In the course of the document, heads, subheads, citations, quotes, epigraphs, and so on, all come out looking neat, trim, and professional.
For the purposes of this tutorial, we're going to set up a short story -- My Pulitzer Winner by Joe Blow. Thankfully, we don't have to look at story itself, just the setup. Joe wants the document
Joe Blow has no taste in typography. His draft won't look pretty, but this is, after all, a tutorial; we're after examples, not beauty.
You can use as many or as few as you wish, although at a minimum, you'll probably fill in TITLE (unless the document's a letter) and AUTHOR. Order doesn't matter. You can separate the arguments from the macros by any number of spaces. The following are what you'd need to start Joe Blow's story.
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39
Mom has defaults for DOCTYPE and COPYSTYLE; if they're what you want, you don't need to include them here. However, PRINTSTYLE has no default and MUST be present in every formatted document. If you omit it, mom won't process the document AND she'll complain (both to stderr and as a single printed sheet with a warning). Moms -- they can be so annoying sometimes. <sigh>
Adding to what we already have, the next bit of setup for Joe Blow's story looks like this:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .DOCTYPE DEFAULT \"Superfluous; mom uses DOCTYPE DEFAULT by default .PRINTSTYLE TYPESET .COPYSTYLE DRAFTNotice the use of the comment line ( \# ), a handy way to keep groups of macros visually separated for easy reading in a text editor.
Joe Blow wants his story printed in Helvetica, 12 on 14, rag right, with page footers instead of page headers and a single asterisk for the linebreak character. None of these requirements conforms to mom's defaults for the chosen PRINTSTYLE (TYPESET), so we change them here. The setup for Joe Blow's story now looks like this:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .DOCTYPE DEFAULT .PRINTSTYLE TYPESET .COPYSTYLE DRAFT \# .FAMILY H .PT_SIZE 12 .LS 14 .QUAD LEFT \"i.e. rag right .FOOTERS .LINEBREAK_CHAR *
Here's the complete setup for My Pulitzer Winner:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .DOCTYPE DEFAULT .PRINTSTYLE TYPESET .COPYSTYLE DRAFT \# .FAMILY H .PT_SIZE 12 .LS 14 .QUAD LEFT \"i.e. rag right .FOOTERS .LINEBREAK_CHAR * \# .STARTAs pointed out earlier, Joe Blow is no typographer. Given that all he needs is a printed draft of his work, a simpler setup would have been:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .PRINTSTYLE TYPEWRITE .COPYSTYLE DRAFT \# .START.PRINTSTYLE TYPEWRITE, above, means that Joe's work will come out "typewritten, double-spaced", making the blue-pencilling he (or someone else) is sure to do much easier (which is why many publishers and agents still insist on typewritten, double-spaced copy).
When J. Blow stops re-writing and decides to print off a final, typeset copy of his work for the world to see, he need only make two changes to the (simplified) setup:
.TITLE "My Pulitzer Winner" .AUTHOR "Joe Blow" .DRAFT 7 .REVISION 39 \# .PRINTSTYLE TYPESET \"first change .COPYSTYLE FINAL \"second change \# .STARTIn the above, .DRAFT 7, .REVISION 39, and .COPYSTYLE FINAL are actually superfluous. The draft and revision numbers aren't used when COPYSTYLE is FINAL, and COPYSTYLE FINAL is mom's default unless you tell her otherwise. BUT... to judge from the number of drafts already, J. Blow may very well decide his "final" version still isn't up to snuff. Hence, he might as well leave in the superfluous macros. That way, when draft 7, rev. 62 becomes draft 8, rev. 1, he'll be ready to tackle his Pulitzer winner again.
*Argument must be enclosed in double-quotes
The title string can be caps or caps/lower-case; it's up to you. In PRINTSTYLE TYPESET, the title will appear in the docheader exactly as you typed it. However, mom converts the title to all caps in page headers unless you turn that feature off (see HEADER_<POSITION>_CAPS). In PRINTSTYLE TYPEWRITE, the title always gets converted to caps.
NOTE: If your DOCTYPE is CHAPTER, TITLE should be the title of the opus, not "CHAPTER whatever".
*Argument must be enclosed in double-quotes
NOTE: This macro should be used only if your DOCTYPE is DEFAULT (which is mom's default).
When you're creating a single document, say, an essay or a short story, you have no need of this macro. TITLE takes care of all your title needs.
However if you're collating a bunch of documents together, say, to print out a report containing many articles with different titles, or a book of short stories, you need DOCTITLE.
DOCTITLE tells mom the title of the complete document (as opposed to the title of each article or entitled section).
The doctitle string can be caps or caps/lower-case; it's up to you. In PRINTSTYLE TYPESET, by default, the doctitle appears in the rightmost position of page headers, all in caps unless you turn that feature off (see HEADER_<POSITION>_CAPS). In PRINTSTYLE TYPEWRITE, the doctitle always gets converted to caps.
NOTE: If your DOCTYPE is CHAPTER, you don't need DOCTITLE. TITLE takes care of everything.
*Argument must be enclosed in double-quotes
The subtitle string can be caps or caps/lower-case. Since a document's subtitle appears only in the docheader, and the title is most likely in caps, I recommend caps/lower case.
*Multiple arguments must all be enclosed in double-quotes
Each author string can hold as many names as you like, e.g.
.AUTHOR "Joe Blow" or .AUTHOR "Joe Blow, Jane Doe" "John Hancock"Mom prints each string that's enclosed in double-quotes on a separate line in the docheader, however only the first string appears in page headers. If you want mom to put something else in the author part of page headers (say, just the last names of a document's two authors), redefine the appropriate part of the header (see header/footer control).
The strings can be caps or caps/lower-case. I recommend caps/lower case.
The chapter number can be in any form you like -- a digit, a roman numeral, a word. If you choose DOCTYPE CHAPTER, mom prints whatever argument you pass CHAPTER beside the word "Chapter" as a single line docheader. She also puts the same thing in the middle of page headers.
Please note that if your argument to CHAPTER runs to more than one word, you must enclose the argument in double-quotes.
If you're not using DOCTYPE CHAPTER, the macro serves no purpose and mom ignores it.
If you're not writing in English, you can ask mom to use the word for "chapter" in your own language by telling her what it is with the CHAPTER_STRING macro, like this:
.CHAPTER_STRING "Chapître"You can also use CHAPTER_STRING if you want "CHAPTER" instead of "Chapter" in the doc- and page-headers.
*Argument must be enclosed in double-quotes
If, either in addition to or instead of "Chapter #" appearing at the top of chapters, you want your chapter to have a title, use CHAPTER_TITLE, with your title enclosed in double-quotes, like this:
.CHAPTER_TITLE "The DMCA Nazis"If you've used CHAPTER to give the chapter a number, both "Chapter #" and the chapter title will appear at the top of the chapter, like this:
Chapter 1 The DMCA NazisIn such a case, by default, only the chapter's title will appear in the page headers, not "Chapter #".
If you omit CHAPTER when setting up your reference macros, only the title will appear, both at the top of page one and in subsequent page headers.
The style of the chapter title can be altered by control macros, e.g. CHAPTER_TITLE_FAMILY, CHAPTER_TITLE_FONT, etc. The default family, font and point size are Times Roman, Bold Italic, 4 points larger than running text.
DRAFT only gets used with COPYSTYLE DRAFT. If the COPYSTYLE is FINAL (the default), mom ignores DRAFT. DRAFT accepts both alphabetic and numeric arguments, hence it's possible to do either
.DRAFT 2 or .DRAFT TwoMom prints the argument to .DRAFT (i.e. the draft number) beside the word "Draft" in the middle part of page headers.
A small word of caution: If your argument to .DRAFT is more than one word long, you must enclose the argument in double-quotes.
You may, if you wish, invoke .DRAFT without an argument, in which case, no draft number will be printed beside "Draft" in headers or footers.
If you're not writing in English, you can ask mom to use the word for "draft" in your own language by telling her what it is with the DRAFT_STRING macro, like this:
.DRAFT_STRING "Jet"Equally, DRAFT_STRING can be used to roll your own solution to something other than the word "Draft." For example, you might want "Trial run alpha-three" to appear in the headers of a draft version. You'd accomplish this by doing
.DRAFT alpha-three .DRAFT_STRING "Trial run.DRAFT without an argument, above, ensures that only the DRAFT_STRING gets printed.
NOTE: If you define both a blank .DRAFT and a blank .DRAFT_STRING, mom skips the draft field in headers entirely. If this is what you want, this is also the only way to do it. Simply leaving out .DRAFT and .DRAFT_STRING will result in mom using her default, which is to print "Draft 1".
REVISION only gets used with COPYSTYLE DRAFT. If the COPYSTYLE is FINAL (the default), mom ignores the REVISION macro. REVISION accepts both alphabetic and numeric arguments, hence it's possible to do either
.REVISION 2 or .REVISION TwoMom prints the revision number beside the shortform "Rev." in the middle part of page headers.
A small word of caution: If your argument to .REVISION is more than one word long, you must enclose the argument in double-quotes.
You may, if you wish, invoke .REVISION without an argument, in which case, no revision number will be printed beside "Rev." in headers or footers.
If you're not writing in English, you can ask mom to use the word for "revision," or a shortform thereof, in your own language by telling her what it is with the REVISION_STRING macro, like this:
.REVISION_STRING "Rév."Additionally, you may sometimes want to make use of mom's COPYSTYLE DRAFT but not actually require any draft information. For example, you might like mom to indicate only the revision number of your document. The way to do that is to define an empty .DRAFT and .DRAFT_STRING in addition to .REVISION, like this:
.DRAFT .DRAFT_STRING .REVISION 2
Equally, if you want to roll your own solution to what revision information appears in headers, you could do something like this:
.DRAFT .DRAFT_STRING .REVISION "two-twenty-two" .REVISION_STRING "Revision"
The above, naturally, has no draft information. If you want to roll your own .DRAFT and/or .DRAFT_STRING as well, simply supply arguments to either or both.
*Argument must be enclosed in double-quotes
The argument passed to COPYRIGHT is only used on cover or doc cover pages, and then only if the argument COPYRIGHT is passed to COVER or DOC_COVER. Do not include the copyright symbol in the argument passed to COPYRIGHT; mom puts it in for you.
*Multliple arguments must all be enclosed in double-quotes
The argument(s) passed to MISC are only used on cover or doc cover pages, and then only if the argument MISC is passed to COVER or DOC_COVER. MISC can contain any information you like. Each argument appears on a separate line at the bottom of the cover or doc cover page.
For example, if you're submitting an essay where the prof has requested that you include the course number, his name and the date, you could do
.MISC "Music History 101" "Professor Hasbeen" "Dec. 24, 2006"and the information would appear on the essay's cover page.
*Argument must be enclosed in double-quotes
The argument passed to COVERTITLE or DOC_COVERTITLE is only used on cover or doc cover pages, and then only if the argument COVERTITLE is passed to COVER or DOC_COVER.
The only time you require a COVERTITLE or DOC_COVERTITLEis when none of the required first arguments to COVER or DOC_COVER fits your needs for the title you want to appear on cover (or doc cover) pages.
The arguments DEFAULT, CHAPTER and NAMED tell mom what to put in the docheader and page headers. LETTER tells her that you want to write a letter.
Mom's default DOCTYPE is DEFAULT. If that's what you want, you don't have to give a DOCTYPE command.
DEFAULT prints a docheader containing the title, subtitle and author information given to the reference macros, and page headers with the author and title. (See Default specs for headers for how mom outputs each part of the page header.)
CHAPTER prints "Chapter #" in place of a docheader (# is what you gave to the reference macro CHAPTER). If you give the chapter a title with CHAPTER TITLE, mom prints "Chapter #" and the title underneath. If you omit the CHAPTER reference macro but supply a CHAPTER_TITLE, mom prints only the chapter title. (*For backward compatibility with pre-1.1.5 versions of mom, you can also supply a chapter title by omitting the CHAPTER reference macro and supplying a chapter title with CHAPTER_STRING.)
The page headers in DOCTYPE CHAPTER contain the author, the title of the book (which you gave with TITLE), and "Chapter #" (or the chapter title). See Default Specs for Headers for mom's default type parameters for each part of the page header.
NAMED takes an additional argument: a name for this particular kind of document (e.g. outline, synopsis, abstract, memorandum), enclosed in double-quotes. NAMED is identical to DEFAULT except that mom prints the argument to NAMED beneath the docheader, as well as in page headers. (See Default specs for headers for how mom outputs each part of the page header.)
Additionally, if you wish the name of this particular kind of document to be coloured, you can pass DOCTYPE NAMED a third (optional) argument: the name of a colour pre-defined (or "initialized") with NEWCOLOR or XCOLOR. For example, if you have a doctype named "Warning", and you'd like "Warning" to be in red, assuming you've pre-defined (or "initialized") the color, red, this is what the DOCTYPE entry would look like:
.DOCTYPE NAME "Warning" red
LETTER tells mom you're writing a letter. See the section Writing Letters for instructions on using mom to format letters.
*Required for document processing.
*Must come before any changes to default document style
PRINTSTYLE tells mom whether to typeset a document, or to print it out "typewritten, doubled-spaced".
THIS MACRO MAY NOT BE OMITTED. In order for document processing to take place, mom requires a PRINTSTYLE. If you don't give one, mom will warn you on stderr and print a single page with a nasty message.
Furthermore, PRINTSTYLE must come before any changes to mom's default typestyle parameters. (This applies primarily to, but is by no means restricted to, PRINTSTYLE TYPESET.) PRINTSTYLE sets up complete "templates" that include default papersize, margins, family, fonts, point sizes, and so on. Therefore, changes to any aspect of document style must come afterwards.
TYPESET, as the argument implies, typesets documents (by default in Times Roman; see TYPESET defaults). You have full access to all the typesetting macros as well as the style control macros of document processing.
As mentioned above, PRINTSTYLE TYPESET must come before any changes to mom's default typographic settings. For example,
.PAPER A4 .LS 14 .PRINTSTYLE TYPESETwill not changes mom's default paper size to A4, nor her default document leading 14 points, whereas
.PRINTSTYLE TYPESET .PAPER A4 .LS 14will.
With TYPEWRITE, mom does her best to reproduce the look and feel of typewritten, double-spaced copy (see TYPEWRITE defaults). Control macros and typesetting macros that alter family, font, point size, and leading are (mostly) ignored. An important exception is HEADER_SIZE (and, by extension, FOOTER_SIZE), which allows you to reduce the point size of headers/footers should they become too crowded. Most of mom's inlines affecting the appearance of type are also ignored (\*S is an exception; there may be a few others).
In short, TYPEWRITE never produces effects other than those available on a typewriter. Don't be fooled by how brainless this sounds; mom is remarkably sophisticated when it comes to conveying the typographic sense of a document within the confines of TYPEWRITE.
The primary uses of TYPEWRITE are: outputting hard copy drafts of your work (for editing), and producing documents for submission to publishers and agents who (wisely) insist on typewritten, double-spaced copy. To get a nicely typeset version of work that's in the submission phase of its life (say, to show fellow writers for critiquing), simply change TYPEWRITE to TYPESET and print out a copy.
If, for some reason, you would prefer the output of TYPEWRITE single-spaced, pass PRINTSTYLE TYPEWRITE the optional argument, SINGLESPACE.
If you absolutely must have a leading other than typewriter double- or singlespaced, the only way to get it is with the DOC_LEAD macro, and then ONLY if DOC_LEAD is set before you invoke the START macro.
Family = Times Roman Point size = 12.5 Paragraph leading = 16 points, adjusted Fill mode = justified Hyphenation = enabled max. lines = 2 margin = 36 points interword adjustment = 1 point Kerning = enabled Ligatures = enabled Smartquotes = enabled Word space = groff default Sentence space = 0
Family = Courier Italics = underlined Point size = 12 Paragraph leading = 24 points, adjusted; 12 points for SINGLESPACE Fill mode = left Hyphenation = disabled Kerning = disabled Ligatures = disabled Smartquotes = disabled Word space = groff default Sentence space = groff default Columns = ignored
In PRINTSTYLE TYPEWRITE, mom, by default, underlines anything that looks like italics. This includes the \*[SLANT] inline escape for pseudo-italics.
If you'd prefer that mom were less bloody-minded about pretending to be a typewriter (i.e. you'd like italics and pseudo-italics to come out as italics), use the control macros .ITALIC_MEANS_ITALIC and .SLANT_MEANS_SLANT. Neither requires an argument.
Although it's unlikely, should you wish to reverse the sense of these macros in the midst of a document, .UNDERLINE_ITALIC and .UNDERLINE_SLANT restore underlining of italics and pseudo-italics.
Additionally, by default, mom underlines quotes (but not blockquotes) in PRINTSTYLE TYPEWRITE. If you don't like this behaviour, turn it off with
.UNDERLINE_QUOTES OFFTo turn underlining of quotes back on, use UNDERLINE_QUOTES without an argument.
While most of the control macros have no effect on PRINTSTYLE TYPEWRITE, there is an important exception: HEADER_SIZE (and by extension, FOOTER_SIZE). This is particularly useful for reducing the point size of headers/footers should they become crowded (quite likely to happen if the title of your document is long and your COPYSTYLE is DRAFT).
Mom's default COPYSTYLE is FINAL, so you don't have to use this macro unless you want to.
COPYSTYLE DRAFT exhibits the following behaviour:
IMPORTANT: If you define your own centre part for page headers with HEADER_CENTER, no draft and/or revision number will appear there. If you want draft and revision information in this circumstance, use DRAFT_WITH_PAGENUMBER.
COPYSTYLE FINAL differs from DRAFT in that:
NOTE: The centre part of page headers can get crowded, especially with DOCTYPE CHAPTER and DOCTYPE NAMED, when the COPYSTYLE is DRAFT. Three mechanisms are available to overcome this problem. One is to reduce the overall size of headers (with HEADER_SIZE). Another, which only works with PRINTSTYLE TYPESET, is to reduce the size of the header's centre part only (with HEADER_CENTER_SIZE). And finally, you can elect to have the draft/revision information attached to page numbers instead of having it appear in the centre of page headers (see DRAFT_WITH_PAGENUMBER).
In the third (optional) part of setting up a document (see Tutorial -- setting up a mom document), you can use the typesetting macros to change mom's document-wide defaults for margins, line length, family, base point size, leading, and justification style.
Two additional style concerns have to be addressed here (i.e. in macros before START): changes to the docheader, and whether you want you want the document's nominal leading adjusted to fill pages fully to the bottom margin.
From time to time (or maybe frequently), you'll want the overall look of a document to differ from mom's defaults. Perhaps you'd like her to use a different family, or a different overall leading, or have different left and/or right page margins.
To accomplish such alterations, use the appropriate typesetting macros (listed below) after PRINTSTYLE and before START.
More than one user has, quite understandably, not fully grasped the significance of the preceding sentence. The part they've missed is "after PRINTSTYLE".
Changes to any aspect of the default look and/or formatting of a mom document must come after PRINTSTYLE. For example, it might seem natural to set up page margins at the very top of a document with
.L_MARGIN 1i .R_MARGIN 1.5iHowever, when you invoke .PRINTSTYLE, those margins will be overridden. The correct place to set margins--and all other changes to the look of a document--is after PRINTSTYLE.
NOTE: Don't use the macros listed in Changing document-wide typesetting parameters after START prior to START; they are exclusively for use afterwards.
When used before START, the typesetting macros (below) have the following meanings:
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 (see note) headers/footers or page numbers) ends on each page 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; equivalent to setting the right margin with R_MARGIN FAMILY The family of all type in the document PT_SIZE The point size of type in paragraphs; mom uses this to calculate automatic point size changes (e.g. for heads, footnotes, quotes, headers, etc) LS/AUTOLEAD** The leading used in paragraphs; all leading and spacing of running text is calculated from this QUAD/JUSTIFY Affects paragraphs only LEFT No effect*** RIGHT No effect*** CENTER No effect*** ------ *See FOOTER MARGIN AND BOTTOM MARGIN for an important warning **See DOC_LEAD_ADJUST ***See Special noteOther macros that deal with type style, or refinements thereof (KERN, LIGATURES, HY, WS, SS, etc.), behave normally. It is not recommended that you set up tabs or indents prior to START.
If you want to change any of the basic parameters (above) after START and have them affect a document globally (as if you'd entered them before START), you must use the macros listed in Changing document-wide style parameters after START.
All mom's document element tags (PP, HEAD, BLOCKQUOTE, FOOTNOTE, etc.) except QUOTE set a fill mode as soon as they're invoked. If you wish to turn fill mode off for the duration of any tag (with .LEFT, .RIGHT or .CENTER) you must do so immediately after invoking the tag. Furthermore, the change affects only the current invocation of the tag. Subsequent invocations of the same tag for which you want the same change require that you invoke LEFT, RIGHT or CENTER immediately after every invocation of the tag.
Colour
Although it doesn't really matter where you define/initialize
colours for use in document processing (see
NEWCOLOR
and
XCOLOR
in the section
Coloured text),
I recommend doing so before you begin document processing with
START.
The macro, COLOR, and the inline escape, \[<colorname>], can be used at any time during document processing for occasional colour effects. However, consistent and reliable colourizing of various document elements (the docheader, heads, linebreaks, footnotes, pagenumbers, and so on) must be managed through the use of the document element control macros.
PLEASE NOTE: If you plan to have mom
generate a
table of contents,
do NOT embed colour
inline escapes
(\[<colorname>])
in the
string arguments
given to any of the
reference macros,
nor in the string arguments given to
.HEAD,
.SUBHEAD
or
.PARAHEAD.
Use, rather, the
control macros
mom provides to automatically colourize these
elements.
DOC_LEAD_ADJUST is a special macro to adjust document leading so that bottom margins fall precisely where you expect.
If you invoke DOC_LEAD_ADJUST, mom takes the number of lines that fit on the page at your requested leading, then incrementally adds machine units to the leading until the maximum number of lines at the new leading matches the bottom margin. In most instances, the difference between the requested lead and the adjusted lead is unnoticeable, and since in almost all cases adjusted leading is what you want, it's mom's default.
Should you NOT want adjusted document leading, you MUST turn it off manually, like this:
.DOC_LEAD_ADJUST OFFIf you set the document leading prior to START with LS or AUTOLEAD, DOC_LEAD_ADJUST OFF must come afterwards, like this:
.LS 12 .DOC_LEAD_ADJUST OFFIn this scenario, the maximum number of lines that fit on a page at a leading of 12 points determine where mom ends a page. The effect will be that last lines usually fall (slightly) short of the "official" bottom margin.
In PRINTSTYLE TYPEWRITE, the leading is always adjusted and can't be turned off.
NOTE: DOC_LEAD_ADJUST, if used, must be invoked after LS or AUTOLEAD and before START
ADDITIONAL NOTE: Even if you disable DOC_LEAD_ADJUST, mom will still adjust the leading of endnotes pages and toc pages. See ENDNOTE_LEAD and TOC_LEAD for an explanation of how to disable this default behaviour.
By default, mom prints a docheader on the first page of any document (see below for a description of the docheader). If you don't want a docheader, turn it off with
.DOCHEADER OFFDOCHEADER is a toggle macro, so the argument doesn't have to be OFF; it can be anything you like.
If you turn the docheader off, mom, by default, starts the running text of your document on the same top baseline 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.
.DOCHEADER OFF 1.5iThis starts the document 1.5 inches from the top of the page PLUS whatever spacing adjustment mom 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 baseline of the first line of type.
TIP: Since no document processing happens until you invoke START -- including anything to do with docheaders -- you can typeset your own docheader prior to START (if you don't like the way mom does things) and use DOCHEADER OFF with its optional distance argument to ensure that the body of your document starts where you want. You can even insert a PostScript file (with .PSPIC; see the groff_tmac man page for usage).
How to change the look of docheaders: docheader control macros
With PRINTSTYLE TYPEWRITE, the look of docheaders is carved in stone. In PRINTSTYLE TYPESET, however, you can make a lot of changes. Macros that alter docheaders MUST come before START.
A typeset docheader has the following characteristics. Note that title, subtitle, author, and document type are what you supply with the reference macros. Any you leave out will not appear; mom will compensate:
TITLE bold, 3.5 points larger than running text (not necessarily caps) Subtitle medium, same size as running text by medium italic, same size as running text Author(s) medium italic, same size as running text (Document type) bold italic, underscored, 3 points larger than running textIf the DOCTYPE is CHAPTER,
Chapter # bold, 4 points larger than running text Chapter Title bold italic, 4 points larger than running text
The family is the prevailing family of the whole document.
NOTE: If your DOCTYPE is CHAPTER and you have both "Chapter #" and a "Chapter Title" (as above), you may find the leading a bit cramped (owing to mom's default docheader leading). If this is the case, you can adjust the leading either with DOCHEADER_LEAD or by including the inline escape, \*[DOWN], in the argument you pass to CHAPTER_TITLE, like this:
.CHAPTER_TITLE "\*[DOWN 2p]Why Not Patent Calculus?"
1. Change the starting position
By default, a docheader starts on the same baseline as running text. If you'd like it to start somewhere else, use the macro .DOCHEADER_ADVANCE and give it the distance you want (measured from the top edge of the paper to the first baseline of the docheader), like this:
.DOCHEADER_ADVANCE 4PA unit of measure is required.
NOTE: If HEADERS are OFF, mom's normal top margin for running text (7.5 picas) changes to 6 picas (visually approx. 1 inch). Since the first baseline of the docheader falls on the same baseline as the first line of running text (on pages after page 1), you might find the docheaders a bit high when headers are off. Use DOCHEADER_ADVANCE to place them where you want.
2. Change the family of the entire docheader
By default, mom sets the docheader in the same family used for running text. If you'd prefer to have your docheaders set in a different family, invoke DOCHEADER_FAMILY with the family you want. The argument for DOCHEADER_FAMILY is the same as for FAMILY.
For example, mom's default family for running text is Times Roman. If you'd like to keep that default, but have the docheaders set entirely in Helvetica,
.DOCHEADER_FAMILY His how you'd do it.
Please note that if you use DOCHEADER_FAMILY,
you can still alter the family of individual parts of the docheader
with the macros listed
here.
3. Adjust the leading
The leading of docheaders is the same as running text (except when DOCTYPE is CHAPTER and both a chapter number and a chapter title have been supplied, in which case the default is 4 points more than running text.)
If you'd like your docheaders to have a different leading, say, 2 points more than the lead of running text, use:
.DOCHEADER_LEAD +2Since 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). No unit of measure is required; points is assumed.
4. Change the family of docheader elements
The following macros let you change the family of each docheader element separately:
Simply pass the appropriate macro the family you want, just as you would with FAMILY.
5. Change the font of docheader elements
The following macros let you change the font of each docheader element separately:
Simply pass the appropriate macro the font you want. R, B, I and BI have the same meaning as they do for FT.
6. Change the colour of the docheader elements individually
The following macros let you change the color of each docheader element separately. You must pre-define (or "initialize") the color with NEWCOLOR or XCOLOR.
It is not recommended that you embed colour (with the inline escape, \*[<colorname>]) in the strings passed to TITLE, CHAPTER_TITLE, SUBTITLE, AUTHOR or the name you give DOCTYPE NAMED. The strings passed to these macros are used to generate page headers and footers. An embedded colour will cause the string to be colourized any time it appears in headers or footers. (If you want headers or footers colourized, or parts thereof, use the header/footer control macros.)
If you want to colourize the entire docheader, use the macro
The following macros let you adjust the point size of each docheader element separately.
Mom calculates the point size of docheader elements from the point size of paragraphs in running text, so you must prepend a + or - sign to the argument. Points is assumed as the unit of measure, so there's no need to append a unit to the argument. Fractional point sizes are allowed.
Simply pass the appropriate macro the size adjustment you want.
8. Change the attribution string ("by")
If you're not writing in English, you can change what mom prints where "by" appears in docheaders. For example,
.ATTRIBUTE_STRING "par"changes "by" to "par". If you don't want an attribution string at all, simply pass ATTRIBUTE_STRING an empty argument, like this:
.ATTRIBUTE_STRING ""Mom will deposit a blank line where the attribution string normally appears.
NOTE: The type specs for the attribution line in docheaders are the same as for the author line. Although it's highly unlikely you'll want the attribution line in a different family, font, or point size, you can do so by using inline escapes in the argument to ATTRIBUTE_STRING. For example,
.ATTRIBUTE_STRING "\f[HBI]\*[SIZE -2p] by \*[SIZE +2p]\*[PREV]"would set "by" in Helvetica bold italic, 2 points smaller than normal.
Setting documents in columns is easy with mom. (Of course she'd say that, but it's true!) All you have to do is is say how many columns you want and how much space you want between them (the gutters). That's it. Mom takes care of everything else, from soup to nuts.
SOME WORDS OF ADVICE:
If you want your type to achieve a pleasing justification or rag in columns, reduce the point size of type (and probably the leading as well). Mom's default document point size is 12.5, which works well across her default 39 pica full page line length, but with even just two columns on a page, the default point size is awkward to work with.
Furthermore, you'll absolutely need to reduce the indents for epigraphs, quotes, and blockquotes (and probably the paragraph first-line indent as well).
COLUMNS takes two arguments: the number of columns you want on document pages, and the width of the gutter between them. For example, to set up a page with two columns separated by an 18 point gutter, you'd do
.COLUMNS 2 18pNothing to it, really. However, as noted above, COLUMNS should always be the last document setup macro prior to START.
NOTE: Mom ignores columns completely when the PRINTSTYLE is TYPEWRITE. The notion of typewriter-style output in columns is just too ghastly for her to bear.
.COL_NEXT breaks the line just before it, quads it left (assuming the type is justified or quad left), and moves over to the top of the next column. If the column happens to be the last (rightmost) one on the page, mom starts a new page at the "column 1" position. This is the macro to use when you want to start a new column after the end of a paragraph.
.COL_BREAK is almost the same, except that instead of breaking and quadding the line preceding it, she breaks and spreads it (see SPREAD). Use this macro whenever you need to start a new column in the middle of a paragraph.
If you need COL_BREAK in the middle of a blockquote or (god help us) an epigraph, you must do the following in order for COL_BREAK to work:
.SPREAD \!.COL_BREAK
START collects the information you gave mom in the setup section at the top of your file (see Tutorial -- setting up a mom document), merges it with her defaults, sets up headers and page numbering, and prepares mom to process your document using the document element tags. No document processing takes place until you invoke START.
Macro: START
*Required for document processing.
START takes no arguments. It simply instructs mom to begin document processing. If you don't want document processing (i.e. you only want the typesetting macros), don't use START.
At a barest minimum before START, you must enter a PRINTSTYLE command.
*Requires a unit of measure
*Requires a unit of measure
*Requires a unit of measure
*Does not require a unit of measure; points is assumed
*Does not require a unit of measure; points is assumed
IMPORTANT: Do not use DOC_LEAD in the middle of a page! It should always and only be invoked immediately prior to a new page, like this:
.DOC_LEAD <new value> .NEWPAGENOTE: Even if you don't pass DOC_LEAD the optional argument ADJUST, mom will still adjust the leading of endnotes pages and toc pages. See ENDNOTE_LEAD and TOC_LEAD for an explanation of how to disable this default behaviour.